BindPropertyAttribute 類別

定義

屬性,可以指定要用於系結相關聯屬性的模型名稱或型 IModelBinder 別。

C#
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public class BindPropertyAttribute : Attribute, Microsoft.AspNetCore.Mvc.ModelBinding.IBinderTypeProviderMetadata, Microsoft.AspNetCore.Mvc.ModelBinding.IModelNameProvider, Microsoft.AspNetCore.Mvc.ModelBinding.IRequestPredicateProvider
繼承
BindPropertyAttribute
屬性
實作

備註

類似於 ModelBinderAttribute。 不同于該屬性, BindPropertyAttribute 僅適用于屬性,並新增 IRequestPredicateProvider 實作,預設表示屬性不應系結至 HTTP GET 要求, (另 SupportsGet 請參閱) 。

建構函式

BindPropertyAttribute()

屬性,可以指定要用於系結相關聯屬性的模型名稱或型 IModelBinder 別。

屬性

BinderType

Type 實作其中一個 IModelBinder

BindingSource

取得 BindingSource

Name

模型名稱。

SupportsGet

取得或設定關聯屬性應該系結在 HTTP GET 要求中的指示。 如果 true 為 ,則屬性應該系結于所有要求中。 否則,屬性不應該系結在 HTTP GET 要求中。

明確介面實作

IRequestPredicateProvider.RequestPredicate

屬性,可以指定要用於系結相關聯屬性的模型名稱或型 IModelBinder 別。

適用於

產品 版本
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0