3 types derived from ModelBinderAttribute
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinderOfTAttribute.cs (1)
14public class ModelBinderAttribute<TBinder> : ModelBinderAttribute where TBinder : IModelBinder
Microsoft.AspNetCore.Mvc.Core.Test (2)
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (1)
892private class BindingSourceModelBinderAttribute : ModelBinderAttribute
ModelBinding\Metadata\ModelBinderAttributeTest.cs (1)
68private class FromQueryModelBinderAttribute : ModelBinderAttribute
64 instantiations of ModelBinderAttribute
BasicWebSite (3)
Controllers\BindPropertiesController.cs (1)
19[ModelBinder(typeof(CustomBoundModelBinder))]
Controllers\ContactApiController.cs (2)
74[ModelBinder(typeof(TestModelBinder))] string foo) 81[ModelBinder(typeof(TestModelBinder), Name = "bar")] string foo)
FormatterWebSite (1)
Controllers\PolymorphicBindingController.cs (1)
11public IActionResult ModelBound([ModelBinder(typeof(PolymorphicBinder))] BaseModel person)
Microsoft.AspNetCore.Mvc.Abstractions.Test (3)
ModelBinding\BindingInfoTest.cs (3)
102new ModelBinderAttribute { BinderType = typeof(ComplexObjectModelBinder), Name = "Test" }, 149new ModelBinderAttribute(typeof(ComplexObjectModelBinder)), 226new ModelBinderAttribute(typeof(ComplexObjectModelBinder)),
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (3)
DefaultApiDescriptionProviderTest.cs (3)
2457private void AcceptsProduct_Default([ModelBinder] Product product) 2490private void AcceptsManager([ModelBinder] Manager dto) 2598[ModelBinder]
Microsoft.AspNetCore.Mvc.Core.Test (21)
ApplicationModels\DefaultApplicationModelProviderTest.cs (1)
1286[ModelBinder(typeof(ComplexObjectModelBinder))]
ApplicationModels\InferParameterBindingInfoConventionTest.cs (5)
1010public IActionResult ModelBinderAttribute([ModelBinder(Name = "top")] int value) => null; 1070public IActionResult ModelBinderAttributeWithExplicitModelName([ModelBinder(Name = "top")] int value) => null; 1073public IActionResult ModelBinderType([ModelBinder(typeof(TestModelBinder))] string name) => null; 1076public IActionResult ModelBinderTypeWithExplicitModelName([ModelBinder(typeof(TestModelBinder), Name = "foo")] string name) => null; 1192public IActionResult Action([ModelBinder(typeof(ComplexObjectModelBinder))] Car car) => null;
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (11)
17new ModelBinderAttribute() { BinderType = typeof(HeaderModelBinder) }, 18new ModelBinderAttribute() { BinderType = typeof(ArrayModelBinder<string>) }, 40new ModelBinderAttribute(), 41new ModelBinderAttribute() { BinderType = typeof(HeaderModelBinder) }, 42new ModelBinderAttribute() { BinderType = typeof(ArrayModelBinder<string>) }, 64new ModelBinderAttribute() { Name = "Product" }, 65new ModelBinderAttribute() { Name = "Order" }, 87new ModelBinderAttribute(), 88new ModelBinderAttribute() { Name = "Product" }, 89new ModelBinderAttribute() { Name = "Order" }, 134new ModelBinderAttribute(),
ModelBinding\Metadata\ModelAttributesTest.cs (1)
332[ModelBinder(Name = "Custom")]
ModelBinding\Metadata\ModelBinderAttributeTest.cs (3)
14var attribute = new ModelBinderAttribute(); 27var attribute = new ModelBinderAttribute 43var attribute = new ModelBinderAttribute(typeof(ByteArrayModelBinder));
Microsoft.AspNetCore.Mvc.IntegrationTests (21)
ComplexRecordIntegrationTest.cs (9)
2629[ModelBinder(Name = "HomeAddress")] 3021private record TestInnerModel([ModelBinder(BinderType = typeof(NumberModelBinder))] decimal Rate); 3298private record LoopyModel([ModelBinder(typeof(SuccessfulModelBinder))] bool IsBound, LoopyModel SelfReference); 3329private record TwoDeepModel([ModelBinder(typeof(SuccessfulModelBinder))] bool IsBound); 3331private record ThreeDeepModel([ModelBinder(typeof(SuccessfulModelBinder))] bool IsBound, TwoDeepModel Inner); 3366private record FourDeepModel([ModelBinder(typeof(SuccessfulModelBinder))] bool IsBound, ThreeDeepModel Inner); 3399private record LoopyModel1([ModelBinder(typeof(SuccessfulModelBinder))] bool IsBound, LoopyModel2 Inner); 3401private record LoopyModel2([ModelBinder(typeof(SuccessfulModelBinder))] bool IsBound, LoopyModel3 Inner); 3403private record LoopyModel3([ModelBinder(typeof(SuccessfulModelBinder))] bool IsBound, LoopyModel1 Inner);
ComplexTypeIntegrationTestBase.cs (9)
2805[ModelBinder(Name = "HomeAddress")] 3234[ModelBinder(BinderType = typeof(NumberModelBinder))] 3529[ModelBinder(typeof(SuccessfulModelBinder))] 3566[ModelBinder(typeof(SuccessfulModelBinder))] 3572[ModelBinder(typeof(SuccessfulModelBinder))] 3613[ModelBinder(typeof(SuccessfulModelBinder))] 3652[ModelBinder(typeof(SuccessfulModelBinder))] 3660[ModelBinder(typeof(SuccessfulModelBinder))] 3668[ModelBinder(typeof(SuccessfulModelBinder))]
FormFileModelBindingIntegrationTest.cs (2)
467[ModelBinder(Name = "files")] 551[ModelBinder(Name = "files")]
Models\SuccessfulModel.cs (1)
8[ModelBinder(typeof(SuccessfulModelBinder))]
Microsoft.AspNetCore.Mvc.RazorPages.Test (6)
ApplicationModels\DefaultPageApplicationModelProviderTest.cs (5)
598[ModelBinder] 608[ModelBinder] 649[ModelBinder] 661[ModelBinder] 927public void OnPost(string name, [ModelBinder(Name = "personId")] int id) { }
Infrastructure\PageBinderFactoryTest.cs (1)
934[ModelBinder]
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Parameters.cs (1)
210private void ActionWithCustomBinder([ModelBinder(BinderType = typeof(CustomBinder))] Todo model) { }
MvcSandbox (1)
Controllers\HomeController.cs (1)
10[ModelBinder]
RazorPagesWebSite (4)
Pages\PropertyBinding\PageModelWithPropertyAndArgumentBinding.cs (1)
11[ModelBinder]
Pages\PropertyBinding\PageModelWithPropertyBinding.cs (1)
11[ModelBinder]
Pages\PropertyBinding\PolymorphicBinding.cs (1)
11[ModelBinder(typeof(PolymorphicModelBinder))]
Pages\TryValidateModelPageModel.cs (1)
11[ModelBinder]
12 references to ModelBinderAttribute
Microsoft.AspNetCore.Mvc.Core (5)
BindPropertyAttribute.cs (1)
15/// Similar to <see cref="ModelBinderAttribute"/>. Unlike that attribute, <see cref="BindPropertyAttribute"/>
ModelBinderAttribute.cs (2)
33/// Initializes a new instance of <see cref="ModelBinderAttribute"/>. 40/// Initializes a new instance of <see cref="ModelBinderAttribute"/>.
ModelBinderOfTAttribute.cs (2)
11/// This is a derived generic variant of the <see cref="ModelBinderAttribute"/>. 17/// Initializes a new instance of <see cref="ModelBinderAttribute"/>.
Microsoft.AspNetCore.Mvc.Core.Test (7)
ModelBinding\Metadata\ModelAttributesTest.cs (4)
256attribute => Assert.IsType<ModelBinderAttribute>(attribute), 262attribute => Assert.IsType<ModelBinderAttribute>(attribute), 280attribute => Assert.IsType<ModelBinderAttribute>(attribute), 286attribute => Assert.IsType<ModelBinderAttribute>(attribute),
ModelBinding\Metadata\ModelBinderAttributeTest.cs (3)
14var attribute = new ModelBinderAttribute(); 27var attribute = new ModelBinderAttribute 43var attribute = new ModelBinderAttribute(typeof(ByteArrayModelBinder));