2 overrides of Metadata
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\ModelBinderFactory.cs (1)
242
public override ModelMetadata
Metadata
{ get; }
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\TestModelBinderProviderContext.cs (1)
59
public override ModelMetadata
Metadata
{ get; }
60 references to Metadata
Microsoft.AspNetCore.Mvc.Core (31)
ModelBinding\Binders\ArrayModelBinderProvider.cs (3)
22
if (context.
Metadata
.ModelType.IsArray)
24
var elementType = context.
Metadata
.ElementMetadata!.ModelType;
26
var elementBinder = context.CreateBinder(context.
Metadata
.ElementMetadata);
ModelBinding\Binders\ByteArrayModelBinderProvider.cs (1)
21
if (context.
Metadata
.ModelType == typeof(byte[]))
ModelBinding\Binders\CancellationTokenModelBinderProvider.cs (1)
22
if (context.
Metadata
.ModelType == typeof(CancellationToken))
ModelBinding\Binders\CollectionModelBinderProvider.cs (1)
23
var modelType = context.
Metadata
.ModelType;
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (4)
21
var metadata = context.
Metadata
;
29
for (var i = 0; i < context.
Metadata
.Properties.Count; i++)
31
var property = context.
Metadata
.Properties[i];
43
var boundConstructor = context.
Metadata
.BoundConstructor;
ModelBinding\Binders\ComplexTypeModelBinderProvider.cs (4)
22
if (context.
Metadata
.IsComplexType && !context.
Metadata
.IsCollectionType)
25
for (var i = 0; i < context.
Metadata
.Properties.Count; i++)
27
var property = context.
Metadata
.Properties[i];
ModelBinding\Binders\DateTimeModelBinderProvider.cs (1)
24
var modelType = context.
Metadata
.UnderlyingOrModelType;
ModelBinding\Binders\DictionaryModelBinderProvider.cs (1)
23
var modelType = context.
Metadata
.ModelType;
ModelBinding\Binders\EnumTypeModelBinderProvider.cs (2)
30
if (context.
Metadata
.IsEnum)
35
context.
Metadata
.UnderlyingOrModelType,
ModelBinding\Binders\FloatingPointTypeModelBinderProvider.cs (1)
27
var modelType = context.
Metadata
.UnderlyingOrModelType;
ModelBinding\Binders\FormCollectionModelBinderProvider.cs (1)
23
var modelType = context.
Metadata
.ModelType;
ModelBinding\Binders\FormFileModelBinderProvider.cs (1)
24
var modelType = context.
Metadata
.ModelType;
ModelBinding\Binders\HeaderModelBinderProvider.cs (1)
28
var modelMetadata = context.
Metadata
;
ModelBinding\Binders\KeyValuePairModelBinderProvider.cs (1)
21
var modelType = context.
Metadata
.ModelType;
ModelBinding\Binders\ServicesModelBinderProvider.cs (4)
29
var isRequired = context.
Metadata
.IsRequired ||
30
(context.
Metadata
.Identity.ParameterInfo?.HasDefaultValue != true &&
31
!context.
Metadata
.ModelType.IsValueType &&
32
context.
Metadata
.NullabilityState == NullabilityState.Unknown);
ModelBinding\Binders\SimpleTypeModelBinderProvider.cs (2)
21
if (context.
Metadata
.IsConvertibleType)
24
return new SimpleTypeModelBinder(context.
Metadata
.ModelType, loggerFactory);
ModelBinding\Binders\TryParseModelBinderProvider.cs (2)
19
if (context.
Metadata
.IsParseableType)
22
return new TryParseModelBinder(context.
Metadata
.ModelType, loggerFactory);
Microsoft.AspNetCore.Mvc.Core.Test (27)
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (1)
646
if (context.
Metadata
== _modelMetadata)
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (2)
1584
if (context.
Metadata
.IsComplexType)
1587
foreach (var property in context.
Metadata
.Properties)
ModelBinding\ModelBinderFactoryTest.cs (24)
72
if (c.
Metadata
.ModelType == typeof(Widget))
74
Assert.NotNull(c.CreateBinder(c.
Metadata
.Properties[nameof(Widget.Id)]));
112
if (c.
Metadata
.ModelType == typeof(WidgetId))
147
if (c.
Metadata
.ModelType == typeof(Widget))
149
Assert.NotNull(c.CreateBinder(c.
Metadata
.Properties[nameof(Widget.Id)]));
152
else if (c.
Metadata
.ModelType == typeof(WidgetId))
189
Assert.Equal(typeof(Employee), c.
Metadata
.ModelType);
190
var binder = c.CreateBinder(c.
Metadata
.Properties[nameof(Employee.Manager)]);
226
Assert.Equal(typeof(Employee), c.
Metadata
.ModelType);
257
Assert.Equal(typeof(Employee), c.
Metadata
.ModelType);
358
Assert.Equal(typeof(Employee), context.
Metadata
.ModelType);
401
if (c.
Metadata
.ModelType == typeof(Widget))
403
var binder = c.CreateBinder(c.
Metadata
.Properties[nameof(Widget.Id)]);
421
Assert.Equal(typeof(WidgetId), c.
Metadata
.ModelType);
462
if (c.
Metadata
.ModelType == typeof(Widget))
464
var binder = c.CreateBinder(c.
Metadata
.Properties[nameof(Widget.Id)]);
483
Assert.Equal(typeof(WidgetId), c.
Metadata
.ModelType);
526
if (c.
Metadata
.ModelType == typeof(Widget))
528
inner = c.CreateBinder(c.
Metadata
.Properties[nameof(Widget.Id)]);
537
Assert.Equal(typeof(WidgetId), c.
Metadata
.ModelType);
589
if (c.
Metadata
.ModelType == typeof(Widget))
591
inner = c.CreateBinder(c.
Metadata
.Properties[nameof(Widget.Id)]);
600
Assert.Equal(typeof(WidgetId), c.
Metadata
.ModelType);
601
innerInner = c.CreateBinder(c.
Metadata
);
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
ActionParametersIntegrationTest.cs (1)
1086
foreach (var property in context.
Metadata
.Properties)
ExcludeBindingMetadataProviderIntegrationTest.cs (1)
135
if (context.
Metadata
.ModelType == typeof(Type))