Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
using Microsoft.AspNetCore.Mvc.Filters;
namespace Web.Infrastructure
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public sealed class DisableFormValueModelBindingAttribute : Attribute, IResourceFilter
{
public void OnResourceExecuting(ResourceExecutingContext context)
{
context.ValueProviderFactories.Clear();
}
public void OnResourceExecuted(ResourceExecutedContext context)
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment