Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

BindPropertyAttribute Class

Definition

Namespace:
Microsoft.AspNetCore.Mvc
Assembly:
Microsoft.AspNetCore.Mvc.Core.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Mvc.Core v2.0.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.1.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
BindPropertyAttribute.cs
Source:
BindPropertyAttribute.cs
Source:
BindPropertyAttribute.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

An attribute that can specify a model name or type of IModelBinder to use for binding the associated property.

public ref class BindPropertyAttribute : Attribute, Microsoft::AspNetCore::Mvc::ModelBinding::IBinderTypeProviderMetadata, Microsoft::AspNetCore::Mvc::ModelBinding::IModelNameProvider, Microsoft::AspNetCore::Mvc::ModelBinding::IRequestPredicateProvider
[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
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type BindPropertyAttribute = class
 inherit Attribute
 interface IModelNameProvider
 interface IBinderTypeProviderMetadata
 interface IBindingSourceMetadata
 interface IRequestPredicateProvider
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type BindPropertyAttribute = class
 inherit Attribute
 interface IBinderTypeProviderMetadata
 interface IBindingSourceMetadata
 interface IModelNameProvider
 interface IRequestPredicateProvider
Public Class BindPropertyAttribute
Inherits Attribute
Implements IBinderTypeProviderMetadata, IModelNameProvider, IRequestPredicateProvider
Inheritance
BindPropertyAttribute
Attributes
Implements

Remarks

Similar to ModelBinderAttribute. Unlike that attribute, BindPropertyAttribute applies only to properties and adds an IRequestPredicateProvider implementation that by default indicates the property should not be bound for HTTP GET requests (see also SupportsGet).

Constructors

Name Description
BindPropertyAttribute()

Properties

Name Description
BinderType

A Type which implements either IModelBinder.

BindingSource

Gets the BindingSource.

Name

Model name.

SupportsGet

Gets or sets an indication the associated property should be bound in HTTP GET requests. If true, the property should be bound in all requests. Otherwise, the property should not be bound in HTTP GET requests.

Explicit Interface Implementations

Name Description
IRequestPredicateProvider.RequestPredicate

Applies to


Feedback

Was this page helpful?