Show / Hide Table of Contents

    Class DisableModelBindingAttribute

    Provides a generic way to disable Microsoft.AspNetCore.Mvc.ModelBinding.IValueProviderFactory implementations used for model binding.

    Inheritance
    System.Object
    System.Attribute
    DisableModelBindingAttribute
    Implements
    Microsoft.AspNetCore.Mvc.Filters.IAsyncResourceFilter
    Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
    Inherited Members
    System.Attribute.Equals(System.Object)
    System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Module)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.GetHashCode()
    System.Attribute.IsDefaultAttribute()
    System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
    System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
    System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.Module, System.Type)
    System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.Match(System.Object)
    System.Attribute.TypeId
    Namespace: Cuemon.AspNetCore.Mvc.Filters.ModelBinding
    Assembly: Cuemon.AspNetCore.Mvc.dll
    Syntax
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
    public class DisableModelBindingAttribute : Attribute, IAsyncResourceFilter, IFilterMetadata
    Remarks

    This attribute was inspired by this source on GitHub: https://github.com/aspnet/Entropy/blob/rel/1.1.1/samples/Mvc.FileUpload/Filters/DisableFormValueModelBindingAttribute.cs.

    Constructors

    | Improve this Doc

    DisableModelBindingAttribute(Type)

    Initializes a new instance of the DisableModelBindingAttribute class.

    Declaration
    public DisableModelBindingAttribute(Type valueProviderFactoryType)
    Parameters
    Type Name Description
    System.Type valueProviderFactoryType

    The type that needs to be disabled on class or method level.

    Exceptions
    Type Condition
    System.ArgumentNullException

    valueProviderFactoryType cannot be null.

    System.NotSupportedException

    Only a type that implements the Microsoft.AspNetCore.Mvc.ModelBinding.IValueProviderFactory interface is supported.

    Properties

    | Improve this Doc

    ValueProviderFactoryType

    Gets the type that needs to be disabled on class or method level.

    Declaration
    public Type ValueProviderFactoryType { get; }
    Property Value
    Type Description
    System.Type

    The type that needs to be disabled on class or method level.

    Methods

    | Improve this Doc

    OnResourceExecutionAsync(ResourceExecutingContext, ResourceExecutionDelegate)

    Called asynchronously before the rest of the pipeline.

    Declaration
    public Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Mvc.Filters.ResourceExecutingContext context

    The Microsoft.AspNetCore.Mvc.Filters.ResourceExecutingContext.

    Microsoft.AspNetCore.Mvc.Filters.ResourceExecutionDelegate next

    The Microsoft.AspNetCore.Mvc.Filters.ResourceExecutionDelegate. Invoked to execute the next resource filter or the remainder of the pipeline.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task which will complete when the remainder of the pipeline completes.

    Implements

    Microsoft.AspNetCore.Mvc.Filters.IAsyncResourceFilter
    Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata

    Extension Methods

    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, DateTime, Action<TimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, DateTime>, Action<TimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Byte[], Action<ContentBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, Byte[]>, Action<ContentBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, DateTime, Byte[], Action<ContentTimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, DateTime>, Func<T, Byte[]>, Action<ContentTimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, DateTime, Func<T, Byte[]>, Action<ContentTimeBasedOptions>)
    CacheableObjectResultExtensions.ToCacheableObjectResult<T>(T, Func<T, DateTime>, Byte[], Action<ContentTimeBasedOptions>)

    See Also

    System.Attribute
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • DisableModelBindingAttribute(Type)
    • Properties
      • ValueProviderFactoryType
    • Methods
      • OnResourceExecutionAsync(ResourceExecutingContext, ResourceExecutionDelegate)
    • Implements
    • Extension Methods
    • See Also
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX