5 instantiations of ModelMetadataIdentity
Microsoft.AspNetCore.Mvc.Abstractions (5)
ModelBinding\Metadata\ModelMetadataIdentity.cs (5)
36
return new
ModelMetadataIdentity
(modelType);
56
return new
ModelMetadataIdentity
(modelType, name, containerType);
75
return new
ModelMetadataIdentity
(modelType, propertyInfo.Name, containerType, fieldInfo: propertyInfo);
98
return new
ModelMetadataIdentity
(modelType, parameter.Name, fieldInfo: parameter);
113
return new
ModelMetadataIdentity
(modelType, constructor.Name, constructorInfo: constructor);
488 references to ModelMetadataIdentity
Microsoft.AspNetCore.Grpc.Swagger (12)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (11)
83
ModelMetadata = new GrpcModelMetadata(
ModelMetadataIdentity
.ForType(responseType)),
89
ModelMetadata = new GrpcModelMetadata(
ModelMetadataIdentity
.ForType(typeof(Google.Rpc.Status))),
111
var
identity = propertyInfo != null
112
?
ModelMetadataIdentity
.ForProperty(propertyInfo, MessageDescriptorHelpers.ResolveFieldType(field), field.ContainingType.ClrType)
113
:
ModelMetadataIdentity
.ForType(MessageDescriptorHelpers.ResolveFieldType(field));
128
var
identity = bodyDescriptor.PropertyInfo != null
129
?
ModelMetadataIdentity
.ForProperty(bodyDescriptor.PropertyInfo, bodyDescriptor.PropertyInfo.PropertyType, bodyDescriptor.PropertyInfo.DeclaringType!)
130
:
ModelMetadataIdentity
.ForType(bodyDescriptor.Descriptor.ClrType);
153
var
identity = propertyInfo != null
154
?
ModelMetadataIdentity
.ForProperty(propertyInfo, MessageDescriptorHelpers.ResolveFieldType(field), field.ContainingType.ClrType)
155
:
ModelMetadataIdentity
.ForType(MessageDescriptorHelpers.ResolveFieldType(field));
Internal\GrpcModelMetadata.cs (1)
13
public GrpcModelMetadata(
ModelMetadataIdentity
identity) : base(identity)
Microsoft.AspNetCore.Mvc.Abstractions (24)
ModelBinding\Metadata\ModelMetadataIdentity.cs (21)
11
public readonly struct ModelMetadataIdentity : IEquatable<
ModelMetadataIdentity
>
28
/// Creates a <see cref="
ModelMetadataIdentity
"/> for the provided model <see cref="Type"/>.
31
/// <returns>A <see cref="
ModelMetadataIdentity
"/>.</returns>
32
public static
ModelMetadataIdentity
ForType(Type modelType)
40
/// Creates a <see cref="
ModelMetadataIdentity
"/> for the provided property.
45
/// <returns>A <see cref="
ModelMetadataIdentity
"/>.</returns>
47
public static
ModelMetadataIdentity
ForProperty(
60
/// Creates a <see cref="
ModelMetadataIdentity
"/> for the provided property.
65
/// <returns>A <see cref="
ModelMetadataIdentity
"/>.</returns>
66
public static
ModelMetadataIdentity
ForProperty(
79
/// Creates a <see cref="
ModelMetadataIdentity
"/> for the provided parameter.
82
/// <returns>A <see cref="
ModelMetadataIdentity
"/>.</returns>
83
public static
ModelMetadataIdentity
ForParameter(ParameterInfo parameter)
87
/// Creates a <see cref="
ModelMetadataIdentity
"/> for the provided parameter with the specified
92
/// <returns>A <see cref="
ModelMetadataIdentity
"/>.</returns>
93
public static
ModelMetadataIdentity
ForParameter(ParameterInfo parameter, Type modelType)
102
/// Creates a <see cref="
ModelMetadataIdentity
"/> for the provided parameter with the specified
107
/// <returns>A <see cref="
ModelMetadataIdentity
"/>.</returns>
108
public static
ModelMetadataIdentity
ForConstructor(ConstructorInfo constructor, Type modelType)
180
public bool Equals(
ModelMetadataIdentity
other)
194
var other = obj as
ModelMetadataIdentity
?;
ModelBinding\ModelMetadata.cs (3)
54
/// <param name="identity">The <see cref="
ModelMetadataIdentity
"/>.</param>
55
protected ModelMetadata(
ModelMetadataIdentity
identity)
112
protected internal
ModelMetadataIdentity
Identity { get; }
Microsoft.AspNetCore.Mvc.Abstractions.Test (3)
ModelBinding\ModelMetadataTest.cs (3)
449
: base(
ModelMetadataIdentity
.ForType(modelType))
454
: base(
ModelMetadataIdentity
.ForParameter(parameter))
459
: base(
ModelMetadataIdentity
.ForProperty(propertyInfo, modelType, containerType))
Microsoft.AspNetCore.Mvc.ApiExplorer (4)
EndpointMetadataApiDescriptionProvider.cs (3)
437
new(
ModelMetadataIdentity
.ForType(type));
445
return new(
ModelMetadataIdentity
.ForProperty(propertyInfo, type, propertyInfo.DeclaringType));
447
return new(
ModelMetadataIdentity
.ForParameter(parameterInfo, type));
EndpointModelMetadata.cs (1)
13
public EndpointModelMetadata(
ModelMetadataIdentity
identity) : base(identity)
Microsoft.AspNetCore.Mvc.Core (40)
ModelBinding\Metadata\BindingMetadataProviderContext.cs (4)
16
/// <param name="key">The <see cref="
ModelMetadataIdentity
"/> for the <see cref="ModelMetadata"/>.</param>
19
ModelMetadataIdentity
key,
39
/// Gets the <see cref="
ModelMetadataIdentity
"/>.
41
public
ModelMetadataIdentity
Key { get; }
ModelBinding\Metadata\DefaultMetadataDetails.cs (4)
19
/// <param name="key">The <see cref="
ModelMetadataIdentity
"/>.</param>
21
public DefaultMetadataDetails(
ModelMetadataIdentity
key, ModelAttributes attributes)
45
/// Gets or sets the <see cref="
ModelMetadataIdentity
"/>.
47
public
ModelMetadataIdentity
Key { get; }
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (24)
20
private readonly ConcurrentDictionary<
ModelMetadataIdentity
, ModelMetadataCacheEntry> _modelMetadataCache = new();
21
private readonly Func<
ModelMetadataIdentity
, ModelMetadataCacheEntry> _cacheEntryFactory;
82
var
key =
ModelMetadataIdentity
.ForType(modelType);
161
var
key =
ModelMetadataIdentity
.ForType(modelType);
172
ModelMetadataIdentity
.ForParameter(parameter, modelType),
179
ModelMetadataIdentity
.ForProperty(property, modelType, property.DeclaringType!),
186
ModelMetadataIdentity
.ForConstructor(constructor, modelType),
190
private ModelMetadataCacheEntry CreateCacheEntry(
ModelMetadataIdentity
key)
215
private static DefaultMetadataDetails CreateSinglePropertyDetails(
ModelMetadataIdentity
propertyKey)
231
private DefaultMetadataDetails CreateConstructorDetails(
ModelMetadataIdentity
constructorKey)
241
var parameterDetails = CreateParameterDetails(
ModelMetadataIdentity
.ForParameter(parameter));
300
var
key =
ModelMetadataIdentity
.ForType(typeof(object));
325
/// The <see cref="
ModelMetadataIdentity
"/> identifying the model <see cref="Type"/>.
333
protected virtual DefaultMetadataDetails[] CreatePropertyDetails(
ModelMetadataIdentity
key)
342
var
propertyKey =
ModelMetadataIdentity
.ForProperty(
355
ModelMetadataIdentity
propertyKey,
387
/// The <see cref="
ModelMetadataIdentity
"/> identifying the model <see cref="Type"/>.
395
protected virtual DefaultMetadataDetails CreateTypeDetails(
ModelMetadataIdentity
key)
406
/// The <see cref="
ModelMetadataIdentity
"/> identifying the parameter <see cref="Type"/>.
409
protected virtual DefaultMetadataDetails CreateParameterDetails(
ModelMetadataIdentity
key)
ModelBinding\Metadata\DisplayMetadataProviderContext.cs (4)
16
/// <param name="key">The <see cref="
ModelMetadataIdentity
"/> for the <see cref="ModelMetadata"/>.</param>
19
ModelMetadataIdentity
key,
43
/// Gets the <see cref="
ModelMetadataIdentity
"/>.
45
public
ModelMetadataIdentity
Key { get; }
ModelBinding\Metadata\ValidationMetadataProviderContext.cs (4)
16
/// <param name="key">The <see cref="
ModelMetadataIdentity
"/> for the <see cref="ModelMetadata"/>.</param>
19
ModelMetadataIdentity
key,
39
/// Gets the <see cref="
ModelMetadataIdentity
"/>.
41
public
ModelMetadataIdentity
Key { get; }
Microsoft.AspNetCore.Mvc.Core.Test (269)
BindAttributeTest.cs (2)
28
var
identity =
ModelMetadataIdentity
.ForProperty(typeof(int), property, typeof(string));
Controllers\ControllerBinderDelegateProviderTest.cs (1)
1456
: base(
ModelMetadataIdentity
.ForType(typeof(string)))
ModelBinding\Metadata\BindingSourceMetadataProviderTests.cs (2)
14
var
key =
ModelMetadataIdentity
.ForType(typeof(Test));
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (28)
22
ModelMetadataIdentity
.ForType(typeof(string)),
46
ModelMetadataIdentity
.ForType(typeof(string)),
69
ModelMetadataIdentity
.ForType(typeof(string)),
93
ModelMetadataIdentity
.ForType(typeof(string)),
116
ModelMetadataIdentity
.ForType(typeof(string)),
140
ModelMetadataIdentity
.ForType(typeof(string)),
162
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
185
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
208
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
231
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
254
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
277
ModelMetadataIdentity
.ForParameter(ParameterInfos.SampleParameterInfo),
300
ModelMetadataIdentity
.ForParameter(ParameterInfos.SampleParameterInfo),
323
ModelMetadataIdentity
.ForParameter(ParameterInfos.SampleParameterInfo),
346
ModelMetadataIdentity
.ForParameter(ParameterInfos.SampleParameterInfo),
369
ModelMetadataIdentity
.ForParameter(ParameterInfos.SampleParameterInfo),
393
ModelMetadataIdentity
.ForParameter(ParameterInfos.SampleParameterInfo),
421
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
439
ModelMetadataIdentity
.ForProperty(typeof(BindRequiredOnClass).GetProperty(nameof(BindRequiredOnClass.Property)), typeof(int), typeof(BindRequiredOnClass)),
457
ModelMetadataIdentity
.ForProperty(typeof(BindNeverOnClass).GetProperty(nameof(BindNeverOnClass.Property)), typeof(int), typeof(BindNeverOnClass)),
475
ModelMetadataIdentity
.ForProperty(typeof(BindNeverOnClass).GetProperty(nameof(BindNeverOnClass.Property)), typeof(int), typeof(BindNeverOnClass)),
498
ModelMetadataIdentity
.ForProperty(typeof(BindNeverOnClass).GetProperty(nameof(BindNeverOnClass.Property)), typeof(int), typeof(BindNeverOnClass)),
521
ModelMetadataIdentity
.ForProperty(typeof(BindNeverOnClass).GetProperty(nameof(BindNeverOnClass.Property)), typeof(int), typeof(BindNeverOnClass)),
544
ModelMetadataIdentity
.ForProperty(typeof(InheritedBindNeverOnClass).GetProperty(nameof(InheritedBindNeverOnClass.Property)), typeof(int), typeof(InheritedBindNeverOnClass)),
567
ModelMetadataIdentity
.ForProperty(typeof(BindRequiredOnClass).GetProperty(nameof(BindRequiredOnClass.Property)), typeof(int), typeof(BindRequiredOnClass)),
586
ModelMetadataIdentity
.ForProperty(typeof(BindRequiredOverridesInheritedBindNever).GetProperty(nameof(BindRequiredOverridesInheritedBindNever.Property)), typeof(int), typeof(BindRequiredOverridesInheritedBindNever)),
611
ModelMetadataIdentity
.ForType(typeof(string)),
642
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string)),
ModelBinding\Metadata\DefaultModelMetadataTest.cs (195)
23
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
83
var
key =
ModelMetadataIdentity
.ForType(typeof(Exception));
102
var
key =
ModelMetadataIdentity
.ForProperty(typeof(Exception).GetProperty(nameof(Exception.Message)), typeof(string), typeof(Exception));
121
var
key =
ModelMetadataIdentity
.ForProperty(
158
var
key =
ModelMetadataIdentity
.ForProperty(
195
var
key =
ModelMetadataIdentity
.ForProperty(
236
var
key =
ModelMetadataIdentity
.ForType(modelType);
263
var
key =
ModelMetadataIdentity
.ForType(modelType);
297
var
key =
ModelMetadataIdentity
.ForType(modelType);
324
var
key =
ModelMetadataIdentity
.ForType(modelType);
357
var
key =
ModelMetadataIdentity
.ForType(modelType);
380
var
key =
ModelMetadataIdentity
.ForType(modelType);
401
var
key =
ModelMetadataIdentity
.ForType(modelType.MakeByRefType());
423
var
key =
ModelMetadataIdentity
.ForType(modelType);
444
var
key =
ModelMetadataIdentity
.ForType(modelType);
472
ModelMetadataIdentity
.ForProperty(prop1, typeof(int), typeof(string)),
478
ModelMetadataIdentity
.ForProperty(prop2, typeof(int), typeof(string)),
486
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
549
ModelMetadataIdentity
.ForProperty(typeof(int), originalName, typeof(string)),
558
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
651
ModelMetadataIdentity
.ForProperty(typeof(int), kvp.Key, typeof(string)),
670
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
690
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
711
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
732
var
key =
ModelMetadataIdentity
.ForType(typeof(int[]));
757
var
key =
ModelMetadataIdentity
.ForType(typeof(TypeWithProperties));
776
var
key =
ModelMetadataIdentity
.ForType(typeof(TypeWithProperties));
795
var
key =
ModelMetadataIdentity
.ForType(typeof(TypeWithProperties));
819
var
key =
ModelMetadataIdentity
.ForType(modelType);
846
var
key =
ModelMetadataIdentity
.ForType(modelType);
878
var
key =
ModelMetadataIdentity
.ForType(typeof(int));
903
var
key =
ModelMetadataIdentity
.ForType(typeof(int));
928
var
key =
ModelMetadataIdentity
.ForType(typeof(XmlDocument));
951
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
971
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
993
var
modelIdentity =
ModelMetadataIdentity
.ForParameter(parameter);
1011
var
modelIdentity =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, GetType());
1027
var
modelIdentity =
ModelMetadataIdentity
.ForType(typeof(string));
1041
var
modelIdentity =
ModelMetadataIdentity
.ForType(typeof(string));
1055
var
modelIdentity =
ModelMetadataIdentity
.ForType(typeof(string));
1070
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1075
var
propertyIdentity =
ModelMetadataIdentity
.ForProperty(property, typeof(int), typeof(TypeWithProperties));
1095
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1099
var
property1Identity =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(TypeWithProperties.PublicGetPublicSetProperty)), typeof(int), modelType);
1102
var
property2Identity =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(TypeWithProperties.PublicGetProtectedSetProperty)), typeof(int), modelType);
1122
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1126
var
propertyIdentity =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(TypeWithProperties.PublicGetPublicSetProperty)), typeof(int), modelType);
1146
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1150
var
property1Identity =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(TypeWithProperties.PublicGetPublicSetProperty)), typeof(int), modelType);
1153
var
property2Identity =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(TypeWithProperties.PublicGetProtectedSetProperty)), typeof(int), modelType);
1173
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1177
var
employeeId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Id)), typeof(int), modelType);
1179
var
employeeUnit =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Unit)), typeof(BusinessUnit), modelType);
1181
var
employeeManager =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Manager)), typeof(Employee), modelType);
1183
var
employeeEmployees =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Employees)), typeof(List<Employee>), modelType);
1187
var
unitHead =
ModelMetadataIdentity
.ForProperty(unitModel.GetProperty(nameof(BusinessUnit.Head)), typeof(Employee), unitModel);
1189
var
unitId =
ModelMetadataIdentity
.ForProperty(unitModel.GetProperty(nameof(BusinessUnit.Id)), typeof(int), unitModel);
1214
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1218
var
employeeId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Id)), typeof(int), modelType);
1220
var
employeeUnit =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Unit)), typeof(BusinessUnit), modelType);
1222
var
employeeManager =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Manager)), typeof(Employee), modelType);
1224
var
employeeEmployees =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Employees)), typeof(List<Employee>), modelType);
1228
var
unitHead =
ModelMetadataIdentity
.ForProperty(unitModel.GetProperty(nameof(BusinessUnit.Head)), typeof(Employee), unitModel);
1230
var
unitId =
ModelMetadataIdentity
.ForProperty(unitModel.GetProperty(nameof(BusinessUnit.Id)), typeof(int), unitModel);
1257
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1261
var
employeeId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Id)), typeof(int), modelType);
1263
var
employeeEmployees =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Employees)), typeof(List<Employee>), modelType);
1286
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1290
var
employeeId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Id)), typeof(int), modelType);
1292
var
employeeUnit =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Unit)), typeof(BusinessUnit), modelType);
1294
var
employeeManager =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Manager)), typeof(Employee), modelType);
1296
var
employeeEmployeesId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(Employee.Employees)), typeof(List<Employee>), modelType);
1300
var
unitHead =
ModelMetadataIdentity
.ForProperty(unitModel.GetProperty(nameof(BusinessUnit.Head)), typeof(Employee), unitModel);
1302
var
unitId =
ModelMetadataIdentity
.ForProperty(unitModel.GetProperty(nameof(BusinessUnit.Id)), typeof(int), unitModel);
1333
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1338
var
propertyId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordType.Property)), typeof(int), modelType);
1341
var
parameterId =
ModelMetadataIdentity
.ForParameter(parameter);
1346
ModelMetadataIdentity
.ForConstructor(constructor, modelType), metadataProvider.Object, hasValidators: null);
1377
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1382
var
propertyId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordType.Property)), typeof(int), modelType);
1385
var
parameterId =
ModelMetadataIdentity
.ForParameter(parameter);
1389
var constructorMetadata = CreateModelMetadata(
ModelMetadataIdentity
.ForConstructor(constructor, modelType), metadataProvider.Object, hasValidators: null);
1422
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1427
var
propertyId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordTypeWithProperty.Property)), typeof(int), modelType);
1431
var
property2Id =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordTypeWithProperty.Property2)), typeof(int), modelType);
1435
var
parameterId =
ModelMetadataIdentity
.ForParameter(parameter);
1439
ModelMetadataIdentity
.ForConstructor(constructor, modelType), metadataProvider.Object, hasValidators: null);
1467
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1472
var
propertyId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordTypeWithProperty.Property)), typeof(int), modelType);
1476
var
property2Id =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordTypeWithProperty.Property2)), typeof(int), modelType);
1480
var
parameterId =
ModelMetadataIdentity
.ForParameter(parameter);
1484
ModelMetadataIdentity
.ForConstructor(constructor, modelType), metadataProvider.Object, hasValidators: null);
1512
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1517
var
propertyId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordTypeWithProperty.Property)), typeof(int), modelType);
1521
var
property2Id =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordTypeWithProperty.Property2)), typeof(int), modelType);
1525
var
parameterId =
ModelMetadataIdentity
.ForParameter(parameter);
1529
ModelMetadataIdentity
.ForConstructor(constructor, modelType), metadataProvider.Object, hasValidators: null);
1557
var
modelIdentity =
ModelMetadataIdentity
.ForType(modelType);
1562
var
propertyId =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordTypeWithProperty.Property)), typeof(int), modelType);
1565
var
property2Id =
ModelMetadataIdentity
.ForProperty(modelType.GetProperty(nameof(SimpleRecordTypeWithProperty.Property2)), typeof(int), modelType);
1568
var
parameterId =
ModelMetadataIdentity
.ForParameter(parameter);
1572
ModelMetadataIdentity
.ForConstructor(constructor, modelType), metadataProvider.Object, hasValidators: null);
1594
ModelMetadataIdentity
modelIdentity,
ModelBinding\Metadata\DefaultValidationMetadataProviderTest.cs (16)
17
var
key =
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
37
var
key =
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
54
var
key =
ModelMetadataIdentity
.ForType(typeof(ValidateNeverClass));
70
var
key =
ModelMetadataIdentity
.ForProperty(
92
var
key =
ModelMetadataIdentity
.ForProperty(
116
var
key =
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
135
var
key =
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
154
var
key =
ModelMetadataIdentity
.ForProperty(typeof(string).GetProperty(nameof(string.Length)), typeof(int), typeof(string));
ModelBinding\Metadata\ExcludeBindingMetadataProviderTest.cs (4)
16
var
key =
ModelMetadataIdentity
.ForProperty(
40
var
key =
ModelMetadataIdentity
.ForProperty(
ModelBinding\Metadata\HasValidatorsValidationMetadataProviderTest.cs (10)
22
var
key =
ModelMetadataIdentity
.ForType(typeof(object));
40
var
key =
ModelMetadataIdentity
.ForType(typeof(object));
68
var
key =
ModelMetadataIdentity
.ForType(typeof(object));
92
var
key =
ModelMetadataIdentity
.ForType(typeof(object));
115
var
key =
ModelMetadataIdentity
.ForType(typeof(object));
ModelBinding\Metadata\SystemTextJsonValidationMetadataProviderTest.cs (8)
17
var
key =
ModelMetadataIdentity
.ForProperty(typeof(SampleTestClass).GetProperty(nameof(SampleTestClass.NoAttributesProperty)), typeof(int), typeof(SampleTestClass));
35
var
key =
ModelMetadataIdentity
.ForProperty(typeof(SampleTestClass).GetProperty(propertyName), typeof(int), typeof(SampleTestClass));
52
var
key =
ModelMetadataIdentity
.ForType(typeof(SampleTestClass));
70
var
key =
ModelMetadataIdentity
.ForProperty(typeof(SampleTestClass).GetProperty(propertyName), typeof(int), typeof(SampleTestClass));
ModelBinding\ParameterBinderTest.cs (1)
845
: base(
ModelMetadataIdentity
.ForType(typeof(string)))
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (2)
171
var
key =
ModelMetadataIdentity
.ForType(typeof(PersonRecord));
Microsoft.AspNetCore.Mvc.Core.TestCommon (8)
TestModelMetadataProvider.cs (8)
106
var
key =
ModelMetadataIdentity
.ForType(type);
123
var
key =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, containerType);
132
var
key =
ModelMetadataIdentity
.ForParameter(parameter);
191
private readonly
ModelMetadataIdentity
_key;
193
public MetadataBuilder(
ModelMetadataIdentity
key)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (118)
DataAnnotationsMetadataProviderTest.cs (106)
93
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
114
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
137
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
156
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
175
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
198
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
221
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
244
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
279
var
key =
ModelMetadataIdentity
.ForType(typeof(TestEnum));
317
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
354
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
384
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
419
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
454
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
483
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
518
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
547
var
key =
ModelMetadataIdentity
.ForType(typeof(string));
592
var
key =
ModelMetadataIdentity
.ForType(typeof(DataAnnotationsMetadataProviderTest));
636
var
key =
ModelMetadataIdentity
.ForType(type);
670
var
key =
ModelMetadataIdentity
.ForType(type);
802
var
key =
ModelMetadataIdentity
.ForType(type);
831
var
key =
ModelMetadataIdentity
.ForType(type);
980
var
key =
ModelMetadataIdentity
.ForType(type);
1008
var
key =
ModelMetadataIdentity
.ForType(typeof(EnumWithDisplayOrder));
1112
var
key =
ModelMetadataIdentity
.ForProperty(property, typeof(int), typeof(string));
1133
var
key =
ModelMetadataIdentity
.ForProperty(property, typeof(int), typeof(string));
1153
var
key =
ModelMetadataIdentity
.ForProperty(
1178
var
key =
ModelMetadataIdentity
.ForProperty(
1207
var
key =
ModelMetadataIdentity
.ForProperty(
1232
var
key =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, modelType);
1251
var
key =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, modelType);
1270
var
key =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, modelType);
1291
var
key =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, modelType);
1311
var
key =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, modelType);
1330
var
key =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, modelType);
1349
var
key =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, modelType);
1368
var
key =
ModelMetadataIdentity
.ForProperty(property, property.PropertyType, modelType);
1389
var
key =
ModelMetadataIdentity
.ForParameter(parameter);
1410
var
key =
ModelMetadataIdentity
.ForParameter(parameter);
1430
var
key =
ModelMetadataIdentity
.ForProperty(property.PropertyType, property.Name, modelType);
1456
var
key =
ModelMetadataIdentity
.ForProperty(property, typeof(int), typeof(string));
1484
var
key =
ModelMetadataIdentity
.ForProperty(property, typeof(int), typeof(string));
1506
var
key =
ModelMetadataIdentity
.ForProperty(property, typeof(int), typeof(string));
1526
var
key =
ModelMetadataIdentity
.ForProperty(property, typeof(int), typeof(string));
1546
var
key =
ModelMetadataIdentity
.ForProperty(property, typeof(int), typeof(string));
1567
var
key =
ModelMetadataIdentity
.ForProperty(property, typeof(int), typeof(string));
1585
var
key =
ModelMetadataIdentity
.ForProperty(property, type, type);
1601
var
key =
ModelMetadataIdentity
.ForProperty(property, type, type);
1618
var
key =
ModelMetadataIdentity
.ForProperty(property, type, type);
1637
var
key =
ModelMetadataIdentity
.ForProperty(property, type, type);
1654
var
key =
ModelMetadataIdentity
.ForParameter(parameter);
1671
var
key =
ModelMetadataIdentity
.ForParameter(parameter);
1686
var
key =
ModelMetadataIdentity
.ForType(typeof(EnumWithLocalizedDisplayNames));
DataMemberRequiredBindingMetadataProviderTest.cs (10)
23
var
key =
ModelMetadataIdentity
.ForProperty(
49
var
key =
ModelMetadataIdentity
.ForProperty(
77
var
key =
ModelMetadataIdentity
.ForType(typeof(ClassWithDataMemberIsRequiredTrue));
97
var
key =
ModelMetadataIdentity
.ForProperty(
125
var
key =
ModelMetadataIdentity
.ForProperty(
ModelMetadataProviderTest.cs (2)
1059
protected override DefaultMetadataDetails CreateTypeDetails(
ModelMetadataIdentity
key)
1075
protected override DefaultMetadataDetails[] CreatePropertyDetails(
ModelMetadataIdentity
key)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (6)
NewtonsoftJsonValidationMetadataProviderTest.cs (6)
19
var
key =
ModelMetadataIdentity
.ForProperty(typeof(SampleTestClass).GetProperty(nameof(SampleTestClass.NoAttributesProperty)), typeof(int), typeof(SampleTestClass));
37
var
key =
ModelMetadataIdentity
.ForProperty(typeof(SampleTestClass).GetProperty(propertyName), typeof(int), typeof(SampleTestClass));
56
var
key =
ModelMetadataIdentity
.ForProperty(typeof(SampleTestClass).GetProperty(propertyName), typeof(int), typeof(SampleTestClass));
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (4)
FormatWeekHelperTest.cs (2)
24
var
key =
ModelMetadataIdentity
.ForType(typeof(DateTime));
Rendering\HtmlHelperNameExtensionsTest.cs (2)
165
ModelMetadataIdentity
.ForType(typeof(DefaultTemplatesUtilities.ObjectTemplateModel)));
194
ModelMetadataIdentity
.ForType(typeof(DefaultTemplatesUtilities.ObjectTemplateModel)));