3 types derived from ModelBinderAttribute
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinderOfTAttribute.cs (1)
14
public class ModelBinderAttribute<TBinder> :
ModelBinderAttribute
where TBinder : IModelBinder
Microsoft.AspNetCore.Mvc.Core.Test (2)
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (1)
892
private class BindingSourceModelBinderAttribute :
ModelBinderAttribute
ModelBinding\Metadata\ModelBinderAttributeTest.cs (1)
68
private 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)
11
public IActionResult ModelBound([
ModelBinder
(typeof(PolymorphicBinder))] BaseModel person)
Microsoft.AspNetCore.Mvc.Abstractions.Test (3)
ModelBinding\BindingInfoTest.cs (3)
102
new
ModelBinderAttribute
{ BinderType = typeof(ComplexObjectModelBinder), Name = "Test" },
149
new
ModelBinderAttribute
(typeof(ComplexObjectModelBinder)),
226
new
ModelBinderAttribute
(typeof(ComplexObjectModelBinder)),
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (3)
DefaultApiDescriptionProviderTest.cs (3)
2457
private void AcceptsProduct_Default([
ModelBinder
] Product product)
2490
private 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)
1010
public IActionResult ModelBinderAttribute([
ModelBinder
(Name = "top")] int value) => null;
1070
public IActionResult ModelBinderAttributeWithExplicitModelName([
ModelBinder
(Name = "top")] int value) => null;
1073
public IActionResult ModelBinderType([
ModelBinder
(typeof(TestModelBinder))] string name) => null;
1076
public IActionResult ModelBinderTypeWithExplicitModelName([
ModelBinder
(typeof(TestModelBinder), Name = "foo")] string name) => null;
1192
public IActionResult Action([
ModelBinder
(typeof(ComplexObjectModelBinder))] Car car) => null;
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (11)
17
new
ModelBinderAttribute
() { BinderType = typeof(HeaderModelBinder) },
18
new
ModelBinderAttribute
() { BinderType = typeof(ArrayModelBinder<string>) },
40
new
ModelBinderAttribute
(),
41
new
ModelBinderAttribute
() { BinderType = typeof(HeaderModelBinder) },
42
new
ModelBinderAttribute
() { BinderType = typeof(ArrayModelBinder<string>) },
64
new
ModelBinderAttribute
() { Name = "Product" },
65
new
ModelBinderAttribute
() { Name = "Order" },
87
new
ModelBinderAttribute
(),
88
new
ModelBinderAttribute
() { Name = "Product" },
89
new
ModelBinderAttribute
() { Name = "Order" },
134
new
ModelBinderAttribute
(),
ModelBinding\Metadata\ModelAttributesTest.cs (1)
332
[
ModelBinder
(Name = "Custom")]
ModelBinding\Metadata\ModelBinderAttributeTest.cs (3)
14
var attribute = new
ModelBinderAttribute
();
27
var attribute = new
ModelBinderAttribute
43
var attribute = new
ModelBinderAttribute
(typeof(ByteArrayModelBinder));
Microsoft.AspNetCore.Mvc.IntegrationTests (21)
ComplexRecordIntegrationTest.cs (9)
2629
[
ModelBinder
(Name = "HomeAddress")]
3021
private record TestInnerModel([
ModelBinder
(BinderType = typeof(NumberModelBinder))] decimal Rate);
3298
private record LoopyModel([
ModelBinder
(typeof(SuccessfulModelBinder))] bool IsBound, LoopyModel SelfReference);
3329
private record TwoDeepModel([
ModelBinder
(typeof(SuccessfulModelBinder))] bool IsBound);
3331
private record ThreeDeepModel([
ModelBinder
(typeof(SuccessfulModelBinder))] bool IsBound, TwoDeepModel Inner);
3366
private record FourDeepModel([
ModelBinder
(typeof(SuccessfulModelBinder))] bool IsBound, ThreeDeepModel Inner);
3399
private record LoopyModel1([
ModelBinder
(typeof(SuccessfulModelBinder))] bool IsBound, LoopyModel2 Inner);
3401
private record LoopyModel2([
ModelBinder
(typeof(SuccessfulModelBinder))] bool IsBound, LoopyModel3 Inner);
3403
private 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
]
927
public 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)
210
private 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)
256
attribute => Assert.IsType<
ModelBinderAttribute
>(attribute),
262
attribute => Assert.IsType<
ModelBinderAttribute
>(attribute),
280
attribute => Assert.IsType<
ModelBinderAttribute
>(attribute),
286
attribute => Assert.IsType<
ModelBinderAttribute
>(attribute),
ModelBinding\Metadata\ModelBinderAttributeTest.cs (3)
14
var
attribute = new ModelBinderAttribute();
27
var
attribute = new ModelBinderAttribute
43
var
attribute = new ModelBinderAttribute(typeof(ByteArrayModelBinder));