Created
September 21, 2020 01:16
-
-
Save scattered-code/57d35178f5570a42036710e8996547d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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