1 instantiation of ComplexObjectModelBinder
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (1)
35
return new
ComplexObjectModelBinder
(propertyBinders, parameterBinders, logger);
102 references to ComplexObjectModelBinder
Microsoft.AspNetCore.Mvc.Abstractions.Test (7)
ModelBinding\BindingInfoTest.cs (7)
102
new ModelBinderAttribute { BinderType = typeof(
ComplexObjectModelBinder
), Name = "Test" },
119
Assert.Same(typeof(
ComplexObjectModelBinder
), bindingInfo.BinderType);
149
new ModelBinderAttribute(typeof(
ComplexObjectModelBinder
)),
168
Assert.Same(typeof(
ComplexObjectModelBinder
), bindingInfo.BinderType);
182
metadata.BinderType = typeof(
ComplexObjectModelBinder
);
191
Assert.Same(typeof(
ComplexObjectModelBinder
), bindingInfo.BinderType);
226
new ModelBinderAttribute(typeof(
ComplexObjectModelBinder
)),
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (1)
25
var logger = loggerFactory.CreateLogger(typeof(
ComplexObjectModelBinder
));
Microsoft.AspNetCore.Mvc.Core.Test (89)
ApplicationModels\DefaultApplicationModelProviderTest.cs (2)
1286
[ModelBinder(typeof(
ComplexObjectModelBinder
))]
1323
Assert.Same(typeof(
ComplexObjectModelBinder
), bindingInfo.BinderType);
ApplicationModels\InferParameterBindingInfoConventionTest.cs (1)
1192
public IActionResult Action([ModelBinder(typeof(
ComplexObjectModelBinder
))] Car car) => null;
ModelBinding\Binders\ComplexObjectModelBinderProviderTest.cs (2)
52
Assert.IsType<
ComplexObjectModelBinder
>(result);
79
Assert.IsType<
ComplexObjectModelBinder
>(result);
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (83)
21
private readonly ILogger<
ComplexObjectModelBinder
> _logger = NullLogger<
ComplexObjectModelBinder
>.Instance;
24
[InlineData(true,
ComplexObjectModelBinder
.ValueProviderDataAvailable)]
25
[InlineData(false,
ComplexObjectModelBinder
.NoDataAvailable)]
31
var
binder = CreateBinder(bindingContext.ModelMetadata);
48
var
binder = CreateBinder(bindingContext.ModelMetadata);
54
Assert.Equal(
ComplexObjectModelBinder
.NoDataAvailable, canCreate);
63
var
binder = CreateBinder(bindingContext.ModelMetadata);
69
Assert.Equal(
ComplexObjectModelBinder
.ValueProviderDataAvailable, canCreate);
73
[InlineData(
ComplexObjectModelBinder
.ValueProviderDataAvailable)]
74
[InlineData(
ComplexObjectModelBinder
.GreedyPropertiesMayHaveData)]
78
bindingContext.IsTopLevelObject = expectedCanCreate ==
ComplexObjectModelBinder
.ValueProviderDataAvailable;
80
var
binder = CreateBinder(bindingContext.ModelMetadata);
90
[InlineData(
ComplexObjectModelBinder
.ValueProviderDataAvailable)]
91
[InlineData(
ComplexObjectModelBinder
.NoDataAvailable)]
98
.Returns(valueAvailable ==
ComplexObjectModelBinder
.ValueProviderDataAvailable);
107
var
binder = CreateBinder(bindingContext.ModelMetadata);
124
var
binder = CreateBinder(bindingContext.ModelMetadata);
130
Assert.Equal(
ComplexObjectModelBinder
.NoDataAvailable, canCreate);
140
var
binder = CreateBinder(bindingContext.ModelMetadata);
146
Assert.Equal(
ComplexObjectModelBinder
.ValueProviderDataAvailable, canCreate);
150
[InlineData(typeof(TypeWithNoBinderMetadata),
ComplexObjectModelBinder
.NoDataAvailable)]
151
[InlineData(typeof(TypeWithNoBinderMetadata),
ComplexObjectModelBinder
.ValueProviderDataAvailable)]
159
.Returns(valueProviderProvidesValue ==
ComplexObjectModelBinder
.ValueProviderDataAvailable);
166
var
binder = CreateBinder(bindingContext.ModelMetadata);
176
[InlineData(typeof(TypeWithAtLeastOnePropertyMarkedUsingValueBinderMetadata),
ComplexObjectModelBinder
.GreedyPropertiesMayHaveData)]
177
[InlineData(typeof(TypeWithAtLeastOnePropertyMarkedUsingValueBinderMetadata),
ComplexObjectModelBinder
.ValueProviderDataAvailable)]
178
[InlineData(typeof(TypeWithUnmarkedAndBinderMetadataMarkedProperties),
ComplexObjectModelBinder
.GreedyPropertiesMayHaveData)]
179
[InlineData(typeof(TypeWithUnmarkedAndBinderMetadataMarkedProperties),
ComplexObjectModelBinder
.ValueProviderDataAvailable)]
187
.Returns(expectedCanCreate ==
ComplexObjectModelBinder
.ValueProviderDataAvailable);
194
var
binder = CreateBinder(bindingContext.ModelMetadata);
204
[InlineData(typeof(TypeWithAtLeastOnePropertyMarkedUsingValueBinderMetadata),
ComplexObjectModelBinder
.GreedyPropertiesMayHaveData)]
205
[InlineData(typeof(TypeWithAtLeastOnePropertyMarkedUsingValueBinderMetadata),
ComplexObjectModelBinder
.ValueProviderDataAvailable)]
218
.Returns(expectedCanCreate ==
ComplexObjectModelBinder
.ValueProviderDataAvailable);
229
var
binder = CreateBinder(bindingContext.ModelMetadata);
239
[InlineData(typeof(TypeWithUnmarkedAndBinderMetadataMarkedProperties), false,
ComplexObjectModelBinder
.GreedyPropertiesMayHaveData)]
240
[InlineData(typeof(TypeWithUnmarkedAndBinderMetadataMarkedProperties), true,
ComplexObjectModelBinder
.ValueProviderDataAvailable)]
241
[InlineData(typeof(TypeWithNoBinderMetadata), false,
ComplexObjectModelBinder
.NoDataAvailable)]
242
[InlineData(typeof(TypeWithNoBinderMetadata), true,
ComplexObjectModelBinder
.ValueProviderDataAvailable)]
263
var
binder = CreateBinder(bindingContext.ModelMetadata);
304
var
binder = new ComplexObjectModelBinder(
348
var
binder = new ComplexObjectModelBinder(
392
var
binder = new ComplexObjectModelBinder(
423
var canUpdate =
ComplexObjectModelBinder
.CanUpdateReadOnlyProperty(metadata.ModelType);
445
var
binder = new ComplexObjectModelBinder(
476
var
binder = CreateBinder(bindingContext.ModelMetadata);
479
var result =
ComplexObjectModelBinder
.CanBindItem(bindingContext, metadata);
503
var
binder = CreateBinder(bindingContext.ModelMetadata);
506
var result =
ComplexObjectModelBinder
.CanBindItem(bindingContext, metadata);
528
var
binder = CreateBinder(bindingContext.ModelMetadata);
531
var result =
ComplexObjectModelBinder
.CanBindItem(bindingContext, metadata);
555
var
binder = CreateBinder(bindingContext.ModelMetadata);
558
var result =
ComplexObjectModelBinder
.CanBindItem(bindingContext, metadata);
581
var
binder = CreateBinder(bindingContext.ModelMetadata);
584
var result =
ComplexObjectModelBinder
.CanBindItem(bindingContext, metadata);
606
var
binder = CreateBinder(bindingContext.ModelMetadata, options =>
671
var
binder = CreateBinder(bindingContext.ModelMetadata, options =>
710
var
binder = CreateBinder(bindingContext.ModelMetadata, options =>
742
var
binder = CreateBinder(bindingContext.ModelMetadata, options =>
765
var
binder = CreateBinder(bindingContext.ModelMetadata, options =>
790
var
binder = CreateBinder(bindingContext.ModelMetadata, options =>
815
var
binder = CreateBinder(bindingContext.ModelMetadata, options =>
842
var
binder = CreateBinder(bindingContext.ModelMetadata, options =>
872
var
binder = CreateBinder(bindingContext.ModelMetadata);
875
ComplexObjectModelBinder
.SetProperty(bindingContext, "foo", propertyMetadata, result);
896
var
binder = CreateBinder(bindingContext.ModelMetadata);
899
ComplexObjectModelBinder
.SetProperty(bindingContext, "foo", propertyMetadata, result);
920
var
binder = CreateBinder(bindingContext.ModelMetadata);
923
ComplexObjectModelBinder
.SetProperty(bindingContext, "foo", propertyMetadata, result);
942
var
binder = CreateBinder(bindingContext.ModelMetadata);
945
ComplexObjectModelBinder
.SetProperty(bindingContext, "foo", propertyMetadata, result);
984
var
binder = CreateBinder(bindingContext.ModelMetadata);
987
ComplexObjectModelBinder
.SetProperty(bindingContext, propertyName, propertyMetadata, result);
1008
var
binder = CreateBinder(bindingContext.ModelMetadata);
1011
ComplexObjectModelBinder
.SetProperty(bindingContext, propertyMetadata.PropertyName, propertyMetadata, result);
1027
var
binder = CreateBinder(bindingContext.ModelMetadata);
1030
ComplexObjectModelBinder
.SetProperty(bindingContext, "foo", propertyMetadata, result);
1051
var
binder = CreateBinder(bindingContext.ModelMetadata);
1054
ComplexObjectModelBinder
.SetProperty(bindingContext, "foo", propertyMetadata, result);
1072
var
binder = CreateBinder(bindingContext.ModelMetadata);
1075
ComplexObjectModelBinder
.SetProperty(bindingContext, "foo.NameNoAttribute", propertyMetadata, result);
1084
private static
ComplexObjectModelBinder
CreateBinder(ModelMetadata metadata, Action<MvcOptions> configureOptions = null)
1093
return (
ComplexObjectModelBinder
)factory.CreateBinder(new ModelBinderFactoryContext()
ModelBinding\Binders\DictionaryModelBinderTest.cs (1)
352
NullLogger<
ComplexObjectModelBinder
>.Instance),
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (4)
ModelMetadataProviderTest.cs (4)
628
new TestBinderTypeProvider() { BinderType = typeof(
ComplexObjectModelBinder
) }
637
Assert.Same(typeof(
ComplexObjectModelBinder
), metadata.BinderType);
646
new TestBinderTypeProvider() { BinderType = typeof(
ComplexObjectModelBinder
) },
656
Assert.Same(typeof(
ComplexObjectModelBinder
), metadata.BinderType);
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
ComplexObjectIntegrationTest.cs (1)
10
protected override Type ExpectedModelBinderType => typeof(
ComplexObjectModelBinder
);