6 types derived from ModelMetadata
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcModelMetadata.cs (1)
11internal sealed class GrpcModelMetadata : ModelMetadata
Microsoft.AspNetCore.Mvc.Abstractions.Test (1)
ModelBinding\ModelMetadataTest.cs (1)
444private class TestModelMetadata : ModelMetadata
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointModelMetadata.cs (1)
11internal sealed class EndpointModelMetadata : ModelMetadata
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Metadata\DefaultModelMetadata.cs (1)
16public class DefaultModelMetadata : ModelMetadata
Microsoft.AspNetCore.Mvc.Core.Test (2)
Controllers\ControllerBinderDelegateProviderTest.cs (1)
1453public abstract class FakeModelMetadata : ModelMetadata
ModelBinding\ParameterBinderTest.cs (1)
842public abstract class FakeModelMetadata : ModelMetadata
1228 references to ModelMetadata
HtmlGenerationWebSite (2)
Components\CheckViewData - LackModel.cs (1)
14var metadata = ViewData.ModelMetadata;
Components\CheckViewData.cs (1)
13var metadata = ViewData.ModelMetadata;
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcModelMetadata.cs (1)
28public override ModelMetadata ElementMetadata { get; }
Microsoft.AspNetCore.Mvc.Abstractions (134)
ApiExplorer\ApiParameterDescription.cs (1)
17public ModelMetadata ModelMetadata { get; set; } = default!;
ApiExplorer\ApiResponseType.cs (2)
19/// Gets or sets <see cref="ModelBinding.ModelMetadata"/> for the <see cref="Type"/> or null. 24public ModelMetadata? ModelMetadata { get; set; }
Formatters\InputFormatterContext.cs (6)
26/// The <see cref="ModelMetadata"/> of the model to deserialize. 35ModelMetadata metadata, 52/// The <see cref="ModelMetadata"/> of the model to deserialize. 64ModelMetadata metadata, 108/// Gets the requested <see cref="ModelMetadata"/> of the request body deserialization. 110public ModelMetadata Metadata { get; }
ModelBinding\BindingInfo.cs (9)
102/// This overload does not account for <see cref="BindingInfo"/> specified via <see cref="ModelMetadata"/>. Consider using 103/// <see cref="GetBindingInfo(IEnumerable{object}, ModelMetadata)"/> overload, or <see cref="TryApplyBindingInfo(ModelMetadata)"/> 199/// <param name="modelMetadata">The <see cref="ModelMetadata"/>.</param> 201public static BindingInfo? GetBindingInfo(IEnumerable<object> attributes, ModelMetadata modelMetadata) 225/// <param name="modelMetadata">The <see cref="ModelMetadata"/>.</param> 228public bool TryApplyBindingInfo(ModelMetadata modelMetadata) 280public Func<ModelMetadata, bool> PropertyFilter => CreatePropertyFilter(); 282private Func<ModelMetadata, bool> CreatePropertyFilter()
ModelBinding\EnumGroupAndName.cs (1)
7/// An abstraction used when grouping enum values for <see cref="ModelMetadata.EnumGroupedDisplayNamesAndValues"/>.
ModelBinding\IModelMetadataProvider.cs (5)
7/// A provider that can supply instances of <see cref="ModelMetadata"/>. 18/// <returns>A <see cref="ModelMetadata"/> instance describing the <see cref="Type"/>.</returns> 19ModelMetadata GetMetadataForType(Type modelType); 25/// <returns>A set of <see cref="ModelMetadata"/> instances describing properties of the <see cref="Type"/>.</returns> 26IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType);
ModelBinding\IPropertyFilterProvider.cs (1)
19Func<ModelMetadata, bool> PropertyFilter { get; }
ModelBinding\Metadata\ModelMetadataIdentity.cs (1)
9/// A key type which identifies a <see cref="ModelMetadata"/>.
ModelBinding\Metadata\ModelMetadataKind.cs (5)
7/// Enumeration for the kinds of <see cref="ModelMetadata"/> 12/// Used for <see cref="ModelMetadata"/> for a <see cref="System.Type"/>. 17/// Used for <see cref="ModelMetadata"/> for a property. 22/// Used for <see cref="ModelMetadata"/> for a parameter. 27/// <see cref="ModelMetadata"/> for a constructor.
ModelBinding\ModelBinderProviderContext.cs (6)
14/// <param name="metadata">The <see cref="ModelMetadata"/> for the model.</param> 16public abstract IModelBinder CreateBinder(ModelMetadata metadata); 22/// <param name="metadata">The <see cref="ModelMetadata"/> for the model.</param> 26public virtual IModelBinder CreateBinder(ModelMetadata metadata, BindingInfo bindingInfo) 37/// Gets the <see cref="ModelMetadata"/>. 39public abstract ModelMetadata Metadata { get; }
ModelBinding\ModelBindingContext.cs (5)
61public abstract ModelMetadata ModelMetadata { get; set; } 96public abstract Func<ModelMetadata, bool>? PropertyFilter { get; set; } 129/// <see cref="ModelBinding.ModelMetadata"/> to assign to the <see cref="ModelMetadata"/> property. 136/// <see cref="EnterNestedScope(ModelMetadata, string, string, object)"/> is called. 139ModelMetadata modelMetadata,
ModelBinding\ModelMetadata.cs (36)
23public abstract class ModelMetadata : IEquatable<ModelMetadata?>, IModelMetadataProvider 26/// The default value of <see cref="ModelMetadata.Order"/>. 45private IReadOnlyList<ModelMetadata>? _boundProperties; 46private IReadOnlyDictionary<ModelMetadata, ModelMetadata>? _parameterMapping; 47private IReadOnlyDictionary<ModelMetadata, ModelMetadata>? _boundConstructorPropertyMapping; 52/// Creates a new <see cref="ModelMetadata"/>. 75public virtual ModelMetadata? ContainerMetadata 120/// Gets the collection of <see cref="ModelMetadata"/> instances for the model's properties. 124internal IReadOnlyList<ModelMetadata> BoundProperties 141var boundProperties = new List<ModelMetadata>(); 143foreach (var metadata in Properties) 163internal IReadOnlyDictionary<ModelMetadata, ModelMetadata> BoundConstructorParameterMapping 178internal IReadOnlyDictionary<ModelMetadata, ModelMetadata> BoundConstructorPropertyMapping 190/// Gets <see cref="ModelMetadata"/> instance for a constructor of a record type that is used during binding and validation. 192public virtual ModelMetadata? BoundConstructor { get; } 195/// Gets the collection of <see cref="ModelMetadata"/> instances for parameters on a <see cref="BoundConstructor"/>. 198public virtual IReadOnlyList<ModelMetadata>? BoundConstructorParameters { get; } 251/// Gets the <see cref="ModelMetadata"/> for elements of <see cref="ModelType"/> if that <see cref="Type"/> 255/// <see cref="ModelMetadata"/> for <c>T</c> if <see cref="ModelType"/> implements 256/// <see cref="IEnumerable{T}"/>. <see cref="ModelMetadata"/> for <c>object</c> if <see cref="ModelType"/> 260public abstract ModelMetadata? ElementMetadata { get; } 422/// validated. If <c>null</c>, properties with this <see cref="ModelMetadata"/> are validated. 667var parameterMapping = new Dictionary<ModelMetadata, ModelMetadata>(); 668var propertyMapping = new Dictionary<ModelMetadata, ModelMetadata>(); 670foreach (var parameter in boundParameters) 672var property = Properties.FirstOrDefault(p => 712public bool Equals(ModelMetadata? other) 732return Equals(obj as ModelMetadata); 814public virtual ModelMetadata GetMetadataForType(Type modelType) 820public virtual IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType)
ModelBinding\ModelMetadataProvider.cs (13)
9/// A provider that can supply instances of <see cref="ModelMetadata"/>. 17/// <returns>A set of <see cref="ModelMetadata"/> instances describing properties of the <see cref="Type"/>.</returns> 18public abstract IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType); 24/// <returns>A <see cref="ModelMetadata"/> instance describing the <see cref="Type"/>.</returns> 25public abstract ModelMetadata GetMetadataForType(Type modelType); 31/// <returns>A <see cref="ModelMetadata"/> instance describing the <paramref name="parameter"/>.</returns> 32public abstract ModelMetadata GetMetadataForParameter(ParameterInfo parameter); 39/// <returns>A <see cref="ModelMetadata"/> instance describing the <paramref name="parameter"/>.</returns> 40public virtual ModelMetadata GetMetadataForParameter(ParameterInfo parameter, Type modelType) 50/// <returns>A <see cref="ModelMetadata"/> instance describing the <paramref name="propertyInfo"/>.</returns> 51public virtual ModelMetadata GetMetadataForProperty(PropertyInfo propertyInfo, Type modelType) 61/// <returns>A <see cref="ModelMetadata"/> instance describing the <paramref name="constructor"/>.</returns> 62public virtual ModelMetadata GetMetadataForConstructor(ConstructorInfo constructor, Type modelType)
ModelBinding\ModelPropertyCollection.cs (7)
10/// A read-only collection of <see cref="ModelMetadata"/> objects which represent model properties. 12public class ModelPropertyCollection : ReadOnlyCollection<ModelMetadata> 18public ModelPropertyCollection(IEnumerable<ModelMetadata> properties) 24/// Gets a <see cref="ModelMetadata"/> instance for the property corresponding to <paramref name="propertyName"/>. 30/// The <see cref="ModelMetadata"/> instance for the property specified by <paramref name="propertyName"/>, or 33public ModelMetadata? this[string propertyName] 41var property = Items[i];
ModelBinding\ModelStateDictionary.cs (9)
97/// <see cref="AddModelError(string, Exception, ModelMetadata)"/> or 98/// <see cref="TryAddModelError(string, Exception, ModelMetadata)"/>. 197/// when <see cref="ModelMetadata"/> is not available or the exact <paramref name="exception"/> 199/// Where <see cref="ModelMetadata"/> is available, use <see cref="AddModelError(string, Exception, ModelMetadata)"/> instead. 238/// <param name="metadata">The <see cref="ModelMetadata"/> associated with the model.</param> 239public void AddModelError(string key, Exception exception, ModelMetadata metadata) 257/// <param name="metadata">The <see cref="ModelMetadata"/> associated with the model.</param> 262public bool TryAddModelError(string key, Exception exception, ModelMetadata metadata)
ModelBinding\Validation\ClientModelValidationContext.cs (2)
15/// <param name="metadata">The <see cref="ModelMetadata"/> for validation.</param> 20ModelMetadata metadata,
ModelBinding\Validation\ClientValidatorProviderContext.cs (5)
14/// <param name="modelMetadata">The <see cref="ModelBinding.ModelMetadata"/> for the model being validated. 17public ClientValidatorProviderContext(ModelMetadata modelMetadata, IList<ClientValidatorItem> items) 24/// Gets the <see cref="ModelBinding.ModelMetadata"/>. 26public ModelMetadata ModelMetadata { get; } 32/// This property provides convenience access to <see cref="ModelMetadata.ValidatorMetadata"/>.
ModelBinding\Validation\IValidationStrategy.cs (2)
15/// <param name="metadata">The <see cref="ModelMetadata"/> associated with <paramref name="model"/>.</param> 19IEnumerator<ValidationEntry> GetChildren(ModelMetadata metadata, string key, object model);
ModelBinding\Validation\ModelValidationContext.cs (2)
15/// <param name="modelMetadata">The <see cref="ModelMetadata"/> for validation.</param> 21ModelMetadata modelMetadata,
ModelBinding\Validation\ModelValidationContextBase.cs (3)
19ModelMetadata modelMetadata, 37/// Gets the <see cref="ModelBinding.ModelMetadata"/>. 39public ModelMetadata ModelMetadata { get; }
ModelBinding\Validation\ModelValidatorProviderContext.cs (5)
14/// <param name="modelMetadata">The <see cref="ModelBinding.ModelMetadata"/>.</param> 16public ModelValidatorProviderContext(ModelMetadata modelMetadata, IList<ValidatorItem> items) 23/// Gets the <see cref="ModelBinding.ModelMetadata"/>. 25public ModelMetadata ModelMetadata { get; set; } 31/// This property provides convenience access to <see cref="ModelMetadata.ValidatorMetadata"/>.
ModelBinding\Validation\ValidationEntry.cs (6)
17/// <param name="metadata">The <see cref="ModelMetadata"/> associated with <paramref name="model"/>.</param> 20public ValidationEntry(ModelMetadata metadata, string key, object? model) 34/// <param name="metadata">The <see cref="ModelMetadata"/> associated with the <see cref="Model"/>.</param> 37public ValidationEntry(ModelMetadata metadata, string key, Func<object?> modelAccessor) 55/// The <see cref="ModelMetadata"/> associated with <see cref="Model"/>. 57public ModelMetadata Metadata { get; }
ModelBinding\Validation\ValidationStateEntry.cs (2)
18/// Gets or sets the <see cref="ModelMetadata"/> associated with the entry. 20public ModelMetadata Metadata { get; set; } = default!;
Microsoft.AspNetCore.Mvc.Abstractions.Test (30)
ModelBinding\BindingInfoTest.cs (10)
112var modelMetadata = provider.GetMetadataForType(modelType); 133var modelMetadata = provider.GetMetadataForType(modelType); 161var modelMetadata = provider.GetMetadataForType(modelType); 184var modelMetadata = provider.GetMetadataForType(modelType); 210var modelMetadata = provider.GetMetadataForType(modelType); 237var modelMetadata = provider.GetMetadataForType(modelType); 259var modelMetadata = provider.GetMetadataForType(modelType); 281var modelMetadata = provider.GetMetadataForType(modelType); 302var modelMetadata = provider.GetMetadataForType(modelType); 324var modelMetadata = provider.GetMetadataForType(modelType);
ModelBinding\ModelMetadataTest.cs (3)
548public override ModelMetadata ElementMetadata 764public override ModelMetadata BoundConstructor => throw new NotImplementedException(); 768public override IReadOnlyList<ModelMetadata> BoundConstructorParameters => throw new NotImplementedException();
ModelBinding\ModelStateDictionaryTest.cs (17)
327var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 757var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 816var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 860var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 890var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 918var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 980var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 1004var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 1032var metadata = provider.GetMetadataForParameter(parameter); 1058var metadata = provider.GetMetadataForType(typeof(int)); 1094var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 1119var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 1148var metadata = provider.GetMetadataForParameter(parameter); 1175var metadata = provider.GetMetadataForType(typeof(int)); 1194var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 1248var metadata = provider.GetMetadataForType(typeof(int)); 1268var metadata = provider.GetMetadataForType(typeof(int));
Microsoft.AspNetCore.Mvc.ApiExplorer (10)
DefaultApiDescriptionProvider.cs (8)
171ModelMetadata metadata; 201var modelMetadata = context.MetadataProvider.GetMetadataForProperty( 514public ModelMetadata ModelMetadata { get; } 525ModelMetadata metadata, 580var modelMetadata = bindingContext.ModelMetadata; 631var propertyMetadata = metadataProperties[i]; 669private static Type GetModelType(ModelMetadata metadata) 694public PropertyKey(ModelMetadata metadata, BindingSource? source)
EndpointModelMetadata.cs (2)
28public override ModelMetadata? ElementMetadata { get; } 44public override ModelPropertyCollection Properties { get; } = new(Enumerable.Empty<ModelMetadata>());
Microsoft.AspNetCore.Mvc.Core (294)
ApiBehaviorOptions.cs (2)
43/// Parameters that are complex (<see cref="ModelMetadata.IsComplexType"/>) and are registered in the DI Container (<see cref="IServiceCollection"/>) are assumed to be bound from the services <see cref="BindingSource.Services"/>, unless this 45/// Parameters that are complex (<see cref="ModelMetadata.IsComplexType"/>) are assumed to be bound from the body (<see cref="BindingSource.Body"/>).
ApplicationModels\DefaultApplicationModelProvider.cs (2)
219var modelMetadata = _modelMetadataProvider.GetMetadataForProperty(declaringType, propertyInfo.Name); 443var modelMetadata = modelMetadataProviderBase.GetMetadataForParameter(parameterInfo);
ApplicationModels\InferParameterBindingInfoConvention.cs (5)
20/// <item>A complex type parameter (<see cref="ModelMetadata.IsComplexType"/>), registered in the DI container, is assigned <see cref="BindingSource.Services"/>.</item> 21/// <item>A complex type parameter (<see cref="ModelMetadata.IsComplexType"/>), not registered in the DI container, is assigned <see cref="BindingSource.Body"/>.</item> 116if (IsComplexTypeParameter(parameter, out var metadata)) 172private bool IsComplexTypeParameter(ParameterModel parameter, out ModelMetadata metadata) 189var metadata = modelMetadataProvider.GetMetadataForParameter(parameter.ParameterInfo);
BindAttribute.cs (4)
16private static readonly Func<ModelMetadata, bool> _default = (m) => true; 18private Func<ModelMetadata, bool>? _propertyFilter; 52public Func<ModelMetadata, bool> PropertyFilter 66bool PropertyFilter(ModelMetadata modelMetadata)
ControllerBase.cs (3)
2644Func<ModelMetadata, bool> propertyFilter) 2718Func<ModelMetadata, bool> propertyFilter) 2788Func<ModelMetadata, bool> propertyFilter)
Controllers\ControllerBinderDelegateProvider.cs (6)
66var modelMetadata = bindingInfo.ModelMetadata; 92var modelMetadata = bindingInfo.ModelMetadata; 132ModelMetadata metadata; 178var metadata = modelMetadataProvider.GetMetadataForProperty(controllerType, property.Name); 194public BinderItem(IModelBinder modelBinder, ModelMetadata modelMetadata) 202public ModelMetadata ModelMetadata { get; }
ModelBinding\Binders\ArrayModelBinder.cs (2)
39/// <see cref="ModelMetadata.IsBindingRequired"/> is <see langword="true"/> for a top-level model, the binder 64/// <see cref="ModelMetadata.IsBindingRequired"/> is <see langword="true"/> for a top-level model, the binder
ModelBinding\Binders\CollectionModelBinder.cs (7)
49/// <see cref="ModelMetadata.IsBindingRequired"/> is <see langword="true"/> for a top-level model, the binder 74/// <see cref="ModelMetadata.IsBindingRequired"/> is <see langword="true"/> for a top-level model, the binder 206/// <see cref="ModelMetadata.IsBindingRequired" />. 213/// <see cref="ModelMetadata.IsBindingRequired" /> failure for collections. Add the error here. 217var modelMetadata = bindingContext.ModelMetadata; 269var elementMetadata = bindingContext.ModelMetadata.ElementMetadata!; 342var elementMetadata = bindingContext.ModelMetadata.ElementMetadata!;
ModelBinding\Binders\ComplexObjectModelBinder.cs (19)
33private readonly IDictionary<ModelMetadata, IModelBinder> _propertyBinders; 39IDictionary<ModelMetadata, IModelBinder> propertyBinders, 74var modelMetadata = bindingContext.ModelMetadata; 75var boundConstructor = modelMetadata.BoundConstructor; 158internal static bool CreateModel(ModelBindingContext bindingContext, ModelMetadata boundConstructor, object[] values) 193var metadata = bindingContext.ModelMetadata; 225IReadOnlyList<ModelMetadata> parameters, 239var parameter = parameters[i]; 294var parameter = parameters[i]; 322IReadOnlyList<ModelMetadata> boundProperties) 335var property = boundProperties[i]; 386var property = boundProperties[i]; 406internal static bool CanBindItem(ModelBindingContext bindingContext, ModelMetadata propertyMetadata) 435ModelMetadata property, 480ModelMetadata parameter, 544var modelMetadata = bindingContext.ModelMetadata; 580var propertyMetadata = bindingContext.ModelMetadata.Properties[i]; 616var parameterMetadata = parameters[i]; 687ModelMetadata propertyMetadata,
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (4)
21var metadata = context.Metadata; 28var propertyBinders = new Dictionary<ModelMetadata, IModelBinder>(); 31var property = context.Metadata.Properties[i]; 43var boundConstructor = context.Metadata.BoundConstructor;
ModelBinding\Binders\ComplexTypeModelBinder.cs (15)
34private readonly IDictionary<ModelMetadata, IModelBinder> _propertyBinders; 46IDictionary<ModelMetadata, IModelBinder> propertyBinders, 61/// <see cref="ModelMetadata.IsBindingRequired"/> is <see langword="true"/> for a top-level model, the binder 66IDictionary<ModelMetadata, IModelBinder> propertyBinders, 105var modelMetadata = bindingContext.ModelMetadata; 111var property = modelMetadata.Properties[i]; 161var property = modelMetadata.Properties[i]; 228/// <param name="propertyMetadata">The <see cref="ModelMetadata"/> for the model property.</param> 230protected virtual bool CanBindProperty(ModelBindingContext bindingContext, ModelMetadata propertyMetadata) 258ModelMetadata property, 381var propertyMetadata = bindingContext.ModelMetadata.Properties[i]; 423internal static bool CanUpdatePropertyInternal(ModelMetadata propertyMetadata) 482var metadata = bindingContext.ModelMetadata; 516/// <param name="propertyMetadata">The <see cref="ModelMetadata"/> for the property to set.</param> 521ModelMetadata propertyMetadata,
ModelBinding\Binders\ComplexTypeModelBinderProvider.cs (2)
24var propertyBinders = new Dictionary<ModelMetadata, IModelBinder>(); 27var property = context.Metadata.Properties[i];
ModelBinding\Binders\DateTimeModelBinder.cs (1)
53var metadata = bindingContext.ModelMetadata;
ModelBinding\Binders\DecimalModelBinder.cs (1)
55var metadata = bindingContext.ModelMetadata;
ModelBinding\Binders\DictionaryModelBinder.cs (6)
44/// <see cref="ModelMetadata.IsBindingRequired"/> is <see langword="true"/> for a top-level model, the binder 52/// <see cref="ModelMetadata.IsBindingRequired"/>. 78/// <see cref="ModelMetadata.IsBindingRequired"/> is <see langword="true"/> for a top-level model, the binder 89/// <see cref="ModelMetadata.IsBindingRequired"/>. 158var elementMetadata = bindingContext.ModelMetadata.ElementMetadata!; 159var valueMetadata = elementMetadata.Properties[nameof(KeyValuePair<TKey, TValue>.Value)]!;
ModelBinding\Binders\DoubleModelBinder.cs (1)
55var metadata = bindingContext.ModelMetadata;
ModelBinding\Binders\FloatModelBinder.cs (1)
55var metadata = bindingContext.ModelMetadata;
ModelBinding\Binders\HeaderModelBinderProvider.cs (3)
28var modelMetadata = context.Metadata; 59private static bool IsSimpleType(ModelMetadata modelMetadata) 61var metadata = modelMetadata.ElementMetadata ?? modelMetadata;
ModelBinding\Binders\KeyValuePairModelBinder.cs (1)
96var propertyModelMetadata = bindingContext.ModelMetadata.Properties[propertyName]!;
ModelBinding\Binders\KeyValuePairModelBinderProvider.cs (2)
27var keyMetadata = context.MetadataProvider.GetMetadataForType(typeArguments[0]); 30var valueMetadata = context.MetadataProvider.GetMetadataForType(typeArguments[1]);
ModelBinding\Binders\TryParseModelBinder.cs (1)
110var tryParseMethodExpession = ModelMetadata.FindTryParseMethod(modelType)
ModelBinding\DefaultModelBindingContext.cs (6)
59public override ModelMetadata ModelMetadata 137public override Func<ModelMetadata, bool>? PropertyFilter 200ModelMetadata metadata, 246ModelMetadata modelMetadata, 327public ModelMetadata ModelMetadata; 331public Func<ModelMetadata, bool>? PropertyFilter;
ModelBinding\DefaultPropertyFilterProvider.cs (3)
19private static readonly Func<ModelMetadata, bool> _default = (m) => true; 33public virtual Func<ModelMetadata, bool> PropertyFilter 47private static Func<ModelMetadata, bool> GetPropertyFilterFromExpression(
ModelBinding\Metadata\BindingMetadata.cs (10)
13/// Binding metadata details for a <see cref="ModelMetadata"/>. 22/// See <see cref="ModelMetadata.BindingSource"/>. 28/// See <see cref="ModelMetadata.BinderModelName"/>. 34/// model. See <see cref="ModelMetadata.BinderType"/>. 61/// See <see cref="ModelMetadata.IsBindingAllowed"/>. 68/// See <see cref="ModelMetadata.IsBindingRequired"/>. 75/// <see cref="ModelMetadata.IsReadOnly"/> will be computed based on the accessibility 76/// of the property accessor and model <see cref="Type"/>. See <see cref="ModelMetadata.IsReadOnly"/>. 82/// <see cref="ModelMetadata.ModelBindingMessageProvider"/>. 98/// See <see cref="ModelMetadata.PropertyFilterProvider"/>.
ModelBinding\Metadata\BindingMetadataProviderContext.cs (2)
16/// <param name="key">The <see cref="ModelMetadataIdentity"/> for the <see cref="ModelMetadata"/>.</param> 17/// <param name="attributes">The attributes for the <see cref="ModelMetadata"/>.</param>
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (2)
177public Func<ModelMetadata, bool> PropertyFilter => CreatePropertyFilter(); 179private Func<ModelMetadata, bool> CreatePropertyFilter()
ModelBinding\Metadata\DefaultMetadataDetails.cs (6)
50/// Gets or sets the <see cref="ModelMetadata"/> entries for the model properties. 52public ModelMetadata[]? Properties { get; set; } 55/// Gets or sets the <see cref="ModelMetadata"/> entries for constructor parameters. 57public ModelMetadata[]? BoundConstructorParameters { get; set; } 80/// Gets or sets the <see cref="ModelMetadata"/> of the container type. 82public ModelMetadata? ContainerMetadata { get; set; }
ModelBinding\Metadata\DefaultModelMetadata.cs (13)
14/// A default <see cref="ModelMetadata"/> implementation. 27private ModelMetadata? _elementMetadata; 28private ModelMetadata? _constructorMetadata; 82public override ModelMetadata? ContainerMetadata => _details.ContainerMetadata; 216public override ModelMetadata? ElementMetadata 376public override ModelMetadata? BoundConstructor 396public override IReadOnlyList<ModelMetadata>? BoundConstructorParameters => _details.BoundConstructorParameters; 462internal static bool CalculateHasValidators(HashSet<DefaultModelMetadata> visited, ModelMetadata metadata) 511var parameters = defaultModelMetadata.BoundConstructor?.BoundConstructorParameters ?? Array.Empty<ModelMetadata>(); 512foreach (var parameter in parameters) 520foreach (var property in defaultModelMetadata.BoundProperties) 559public override ModelMetadata GetMetadataForType(Type modelType) 565public override IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType)
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (15)
72public override IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType) 85var properties = new ModelMetadata[propertyDetails.Length]; 99public override ModelMetadata GetMetadataForParameter(ParameterInfo parameter) 103public override ModelMetadata GetMetadataForParameter(ParameterInfo parameter, Type modelType) 114public override ModelMetadata GetMetadataForType(Type modelType) 124public override ModelMetadata GetMetadataForProperty(PropertyInfo propertyInfo, Type modelType) 135public override ModelMetadata GetMetadataForConstructor(ConstructorInfo constructorInfo, Type modelType) 211var metadata = CreateModelMetadata(details); 235var parameterMetadata = new ModelMetadata[parameters.Length]; 306/// Creates a new <see cref="ModelMetadata"/> from a <see cref="DefaultMetadataDetails"/>. 309/// <returns>A new <see cref="ModelMetadata"/> instance.</returns> 312/// <see cref="DefaultModelMetadata"/> .Override this method to create a <see cref="ModelMetadata"/> 315protected virtual ModelMetadata CreateModelMetadata(DefaultMetadataDetails entry) 418public ModelMetadataCacheEntry(ModelMetadata metadata, DefaultMetadataDetails details) 424public ModelMetadata Metadata { get; }
ModelBinding\Metadata\DisplayMetadata.cs (29)
9/// Display metadata details for a <see cref="ModelMetadata"/>. 18/// Gets a set of additional values. See <see cref="ModelMetadata.AdditionalValues"/> 25/// <see cref="ModelMetadata.ConvertEmptyStringToNull"/> 31/// See <see cref="ModelMetadata.DataTypeName"/> 37/// model description. See <see cref="ModelMetadata.Description"/>. 43/// See <see cref="ModelMetadata.DisplayFormatString"/> 62/// <see cref="ModelMetadata.DisplayFormatString"/>. 83/// display name of the model. See <see cref="ModelMetadata.DisplayName"/>. 89/// See <see cref="ModelMetadata.EditFormatString"/> 115/// <see cref="ModelMetadata.EditFormatString"/>. 142/// <see cref="ModelMetadata.UnderlyingOrModelType"/>. See 143/// <see cref="ModelMetadata.EnumGroupedDisplayNamesAndValues"/>. 149/// <see cref="ModelMetadata.UnderlyingOrModelType"/>. See <see cref="ModelMetadata.EnumNamesAndValues"/>. 156/// See <see cref="ModelMetadata.HasNonDefaultEditFormat"/> 162/// See <see cref="ModelMetadata.HideSurroundingHtml"/> 168/// See <see cref="ModelMetadata.HtmlEncode"/> 173/// Gets a value indicating whether <see cref="ModelMetadata.UnderlyingOrModelType"/> is for an 174/// <see cref="System.Enum"/>. See <see cref="ModelMetadata.IsEnum"/>. 180/// Gets a value indicating whether <see cref="ModelMetadata.UnderlyingOrModelType"/> is for an 182/// <see cref="ModelMetadata.IsFlagsEnum"/>. 189/// See <see cref="ModelMetadata.NullDisplayText"/> 208/// See <see cref="ModelMetadata.NullDisplayText"/>. 229/// See <see cref="ModelMetadata.Order"/> 235/// model's placeholder text. See <see cref="ModelMetadata.Placeholder"/>. 241/// See <see cref="ModelMetadata.ShowForDisplay"/> 247/// See <see cref="ModelMetadata.ShowForEdit"/> 253/// See <see cref="ModelMetadata.SimpleDisplayProperty"/> 259/// See <see cref="ModelMetadata.TemplateHint"/>
ModelBinding\Metadata\DisplayMetadataProviderContext.cs (2)
16/// <param name="key">The <see cref="ModelMetadataIdentity"/> for the <see cref="ModelMetadata"/>.</param> 17/// <param name="attributes">The attributes for the <see cref="ModelMetadata"/>.</param>
ModelBinding\Metadata\ExcludeBindingMetadataProvider.cs (2)
9/// An <see cref="IBindingMetadataProvider"/> which configures <see cref="ModelMetadata.IsBindingAllowed"/> to 21/// <see cref="ModelMetadata.IsBindingAllowed"/> set to <c>false</c>.
ModelBinding\Metadata\ValidationMetadata.cs (7)
11/// Validation metadata details for a <see cref="ModelMetadata"/>. 18/// <see cref="ModelMetadata.IsRequired"/> will be computed based on the model <see cref="System.Type"/>. 19/// See <see cref="ModelMetadata.IsRequired"/>. 25/// should be validated. See <see cref="ModelMetadata.PropertyValidationFilter"/>. 31/// then <see cref="ModelMetadata.ValidateChildren"/> will be <c>true</c> if either of 32/// <see cref="ModelMetadata.IsComplexType"/> or <see cref="ModelMetadata.IsEnumerableType"/> is <c>true</c>;
ModelBinding\Metadata\ValidationMetadataProviderContext.cs (2)
16/// <param name="key">The <see cref="ModelMetadataIdentity"/> for the <see cref="ModelMetadata"/>.</param> 17/// <param name="attributes">The attributes for the <see cref="ModelMetadata"/>.</param>
ModelBinding\ModelBinderFactory.cs (9)
174private void AddToCache(ModelMetadata metadata, object? cacheToken, IModelBinder binder) 187private bool TryGetCachedBinder(ModelMetadata metadata, object? cacheToken, [NotNullWhen(true)] out IModelBinder? binder) 229ModelMetadata metadata, 242public override ModelMetadata Metadata { get; } 250public override IModelBinder CreateBinder(ModelMetadata metadata) 258public override IModelBinder CreateBinder(ModelMetadata metadata, BindingInfo bindingInfo) 266var token = metadata; 282private readonly ModelMetadata _metadata; 285public Key(ModelMetadata metadata, object? token)
ModelBinding\ModelBinderFactoryContext.cs (2)
19/// Gets or sets the <see cref="ModelMetadata"/>. 21public ModelMetadata Metadata { get; set; } = default!;
ModelBinding\ModelBindingHelper.cs (11)
131Func<ModelMetadata, bool> propertyFilter) 212Func<ModelMetadata, bool> propertyFilter) 232var modelMetadata = metadataProvider.GetMetadataForType(modelType); 327public static Expression<Func<ModelMetadata, bool>> GetPropertyFilterExpression<TModel>( 346return Expression.Lambda<Func<ModelMetadata, bool>>(orWrapperExpression, firstExpression.Parameters); 349private static Expression<Func<ModelMetadata, bool>> GetPredicateExpression<TModel>( 358/// Clears <see cref="ModelStateDictionary"/> entries for <see cref="ModelMetadata"/>. 378/// Clears <see cref="ModelStateDictionary"/> entries for <see cref="ModelMetadata"/>. 380/// <param name="modelMetadata">The <see cref="ModelMetadata"/>.</param> 384ModelMetadata modelMetadata, 417var property = modelMetadata.Properties[i];
ModelBinding\ModelMetadataProviderExtensions.cs (6)
16/// Gets a <see cref="ModelMetadata"/> for property identified by the provided 19/// <param name="provider">The <see cref="ModelMetadata"/>.</param> 22/// <returns>A <see cref="ModelMetadata"/> for the property.</returns> 23public static ModelMetadata GetMetadataForProperty( 32var containerMetadata = provider.GetMetadataForType(containerType); 34var propertyMetadata = containerMetadata.Properties[propertyName];
ModelBinding\ObjectModelValidator.cs (7)
51var metadata = model == null ? null : _modelMetadataProvider.GetMetadataForType(model.GetType()); 58/// <see cref="ModelMetadata.IsRequired"/> is <see langword="true"/>, will add one or more 66/// <param name="metadata">The <see cref="ModelMetadata"/>.</param> 72ModelMetadata metadata) 78/// <see cref="ModelMetadata.IsRequired"/> is <see langword="true"/>, will add one or more 86/// <param name="metadata">The <see cref="ModelMetadata"/>.</param> 93ModelMetadata metadata,
ModelBinding\ParameterBinder.cs (6)
61/// <param name="metadata">The <see cref="ModelMetadata"/>.</param> 69ModelMetadata metadata, 80/// <param name="metadata">The <see cref="ModelMetadata"/>.</param> 89ModelMetadata metadata, 175ModelMetadata metadata, 235ref ModelMetadata metadata)
ModelBinding\ParameterBinder.Log.cs (5)
18ModelMetadata modelMetadata) 64ModelMetadata modelMetadata) 110ModelMetadata modelMetadata) 157ModelMetadata modelMetadata) 207ModelMetadata modelMetadata)
ModelBinding\PropertyValueSetter.cs (1)
16ModelMetadata metadata,
ModelBinding\SuppressChildValidationMetadataProvider.cs (3)
12/// An <see cref="IValidationMetadataProvider"/> which configures <see cref="ModelMetadata.ValidateChildren"/> to 22/// <see cref="ModelMetadata.ValidateChildren"/> set to <c>false</c>. 36/// <see cref="ModelMetadata.ValidateChildren"/> set to <c>false</c>.
ModelBinding\Validation\ClientValidatorCache.cs (6)
17private readonly ConcurrentDictionary<ModelMetadata, CacheEntry> _cacheEntries = new ConcurrentDictionary<ModelMetadata, CacheEntry>(); 22/// <param name="metadata">The <see cref="ModelMetadata"/> being validated.</param> 25public IReadOnlyList<IClientModelValidator> GetValidators(ModelMetadata metadata, IClientModelValidatorProvider validatorProvider) 76private static IReadOnlyList<IClientModelValidator> GetValidatorsFromEntry(CacheEntry entry, ModelMetadata metadata, IClientModelValidatorProvider validationProvider) 104private static void ExecuteProvider(IClientModelValidatorProvider validatorProvider, ModelMetadata metadata, List<ClientValidatorItem> items)
ModelBinding\Validation\DefaultCollectionValidationStrategy.cs (5)
37/// <see cref="ModelMetadata.ElementMetadata"/>. The indices of the elements in the collection are used to 57ModelMetadata metadata, 65public IEnumerator GetEnumeratorForElementType(ModelMetadata metadata, object model) 92private readonly ModelMetadata _metadata; 99ModelMetadata metadata,
ModelBinding\Validation\DefaultComplexObjectValidationStrategy.cs (9)
27ModelMetadata metadata, 39private readonly ModelMetadata _modelMetadata; 40private readonly IReadOnlyList<ModelMetadata> _parameters; 41private readonly IReadOnlyList<ModelMetadata> _properties; 47ModelMetadata modelMetadata, 57_parameters = Array.Empty<ModelMetadata>(); 86var parameter = _parameters[_index]; 107var property = _properties[_index - _parameters.Count]; 134private static object? GetModel(object container, ModelMetadata property)
ModelBinding\Validation\DefaultModelValidatorProvider.cs (1)
13/// instances in <see cref="ModelBinding.ModelMetadata.ValidatorMetadata"/>.
ModelBinding\Validation\ExplicitIndexCollectionValidationStrategy.cs (4)
27/// <see cref="ModelMetadata.ElementMetadata"/>. The keys captured during model binding are mapped to the elements 50ModelMetadata metadata, 61private readonly ModelMetadata _metadata; 68ModelMetadata metadata,
ModelBinding\Validation\IMetadataBasedModelValidatorProvider.cs (3)
12/// exclusively using values in <see cref="ModelMetadata.ValidatorMetadata"/> or the model type. 15/// <see cref="ModelMetadata"/> instance can incur any validation. The value for <see cref="ModelMetadata.HasValidators"/>
ModelBinding\Validation\ShortFormDictionaryValidationStrategy.cs (6)
32private readonly ModelMetadata _valueMetadata; 41/// The <see cref="ModelMetadata"/> associated with <typeparamref name="TValue"/>. 45ModelMetadata valueMetadata) 58ModelMetadata metadata, 68private readonly ModelMetadata _metadata; 75ModelMetadata metadata,
ModelBinding\Validation\ValidationVisitor.cs (13)
100protected ModelMetadata? Metadata { get; set; } 114/// When not <see langword="null"/>, <see cref="Visit(ModelMetadata, string, object)"/> will throw if 140/// <param name="metadata">The <see cref="ModelMetadata"/> associated with the model.</param> 144public bool Validate(ModelMetadata metadata, string key, object model) 152/// <param name="metadata">The <see cref="ModelMetadata"/> associated with the model.</param> 157public virtual bool Validate(ModelMetadata? metadata, string? key, object? model, bool alwaysValidateAtTopLevel) 163/// <param name="metadata">The <see cref="ModelMetadata"/> associated with the model.</param> 169public virtual bool Validate(ModelMetadata? metadata, string? key, object? model, bool alwaysValidateAtTopLevel, object? container) 269protected virtual bool Visit(ModelMetadata metadata, string? key, object? model) 292private bool VisitImplementation(ref ModelMetadata metadata, ref string? key, object? model) 436var metadata = entry.Metadata; 497private readonly ModelMetadata _metadata; 513ModelMetadata metadata,
ModelBinding\Validation\ValidatorCache.cs (4)
16private readonly ConcurrentDictionary<ModelMetadata, CacheEntry> _cacheEntries = new(); 24public IReadOnlyList<IModelValidator> GetValidators(ModelMetadata metadata, IModelValidatorProvider validatorProvider) 66private static IReadOnlyList<IModelValidator> GetValidatorsFromEntry(CacheEntry entry, ModelMetadata metadata, IModelValidatorProvider validationProvider) 94private static void ExecuteProvider(IModelValidatorProvider validatorProvider, ModelMetadata metadata, List<ValidatorItem> items)
MvcCoreLoggerExtensions.cs (3)
120var modelMetadata = bindingContext.ModelMetadata; 175var modelMetadata = bindingContext.ModelMetadata; 215var modelMetadata = bindingContext.ModelMetadata;
MvcOptions.cs (3)
169/// <see cref="ModelMetadata.ModelBindingMessageProvider"/> property of all <see cref="ModelMetadata"/> 176/// create <see cref="ModelMetadata"/> instances.
Microsoft.AspNetCore.Mvc.Core.Test (256)
ApplicationModels\InferParameterBindingInfoConventionTest.cs (2)
1138public static Func<ModelMetadata, bool> PropertyFilterStatic => (c) => true; 1142public Func<ModelMetadata, bool> PropertyFilter => PropertyFilterStatic;
BindAttributeTest.cs (1)
30context.ModelMetadata = new Mock<ModelMetadata>(identity).Object;
ControllerBaseTest.cs (4)
2721Func<ModelMetadata, bool> propertyFilter = (m) => 2754Func<ModelMetadata, bool> propertyFilter = (m) => 2865var modelMetadata = context.ModelMetadata.Properties[propertyName]; 2903Func<ModelMetadata, bool> propertyFilter = (m) =>
Controllers\ControllerBinderDelegateProviderTest.cs (2)
1148It.IsAny<ModelMetadata>(), 1151.Returns((ActionContext context, IModelBinder modelBinder, IValueProvider valueProvider, ParameterDescriptor descriptor, ModelMetadata metadata, object v, object c) =>
Formatters\InputFormatterTest.cs (9)
38var metadata = provider.GetMetadataForType(typeof(void)); 72var metadata = provider.GetMetadataForType(typeof(void)); 103var metadata = provider.GetMetadataForType(typeof(void)); 137var metadata = provider.GetMetadataForType(typeof(void)); 168var metadata = provider.GetMetadataForType(typeof(void)); 205var metadata = provider.GetMetadataForType(typeof(void)); 235var metadata = provider.GetMetadataForType(typeof(void)); 273var metadata = provider.GetMetadataForType(typeof(void)); 302var metadata = provider.GetMetadataForType(typeof(void));
Formatters\JsonInputFormatterTestBase.cs (1)
655var metadata = provider.GetMetadataForType(modelType);
ModelBinding\Binders\ArrayModelBinderProviderTest.cs (1)
81var modelMetadata = metadataProvider.GetMetadataForProperty(
ModelBinding\Binders\CollectionModelBinderTest.cs (1)
484var metadata = metadataProvider.GetMetadataForProperty(
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (48)
43var modelMetadata = GetMetadataForProperty(typeof(Document), nameof(Document.SubDocument)); 100var modelMetadata = GetMetadataForProperty(typeof(SimpleContainer), nameof(SimpleContainer.Simple)); 285var metadata = metadataProvider.GetMetadataForParameter(parameter); 298var binders = new Dictionary<ModelMetadata, IModelBinder>(); 299foreach (var property in metadataProvider.GetMetadataForProperties(typeof(Person))) 337var metadata = metadataProvider.GetMetadataForParameter(parameter); 349new Dictionary<ModelMetadata, IModelBinder>(), 381var metadata = metadataProvider.GetMetadataForParameter(parameter); 393new Dictionary<ModelMetadata, IModelBinder>(), 420var metadata = metadataProvider.GetMetadataForProperty(typeof(CollectionContainer), propertyName); 463var metadata = GetMetadataForProperty(typeof(PersonWithBindExclusion), property); 490var metadata = GetMetadataForProperty(typeof(PersonWithBindExclusion), property); 518var metadata = GetMetadataForProperty(typeof(PersonWithBindExclusion), property); 545var metadata = GetMetadataForProperty(typeof(TypeWithIncludedPropertiesUsingBindAttribute), property); 571var metadata = GetMetadataForProperty(typeof(ModelWithMixedBindingBehaviors), property); 601var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithBindRequired.Age)); 629private readonly ModelMetadata _modelMetadata; 632public TestModelBinderProvider(ModelMetadata modelMetadata, ModelBindingResult result) 668var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithDataMemberIsRequired.Age)); 707var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithBindRequired.Age)); 739var property = GetMetadataForProperty(model.GetType(), nameof(BindingOptionalProperty.ValueTypeRequired)); 762var property = GetMetadataForProperty(model.GetType(), nameof(NullableValueTypeProperty.NullableValueType)); 783var containerMetadata = GetMetadataForType(model.GetType()); 787var property = GetMetadataForProperty(model.GetType(), nameof(Person.ValueTypeRequired)); 808var containerMetadata = GetMetadataForType(model.GetType()); 812var property = GetMetadataForProperty(model.GetType(), nameof(Person.ValueTypeRequired)); 838var containerMetadata = GetMetadataForType(model.GetType()); 844var firstNameProperty = containerMetadata.Properties[nameof(model.FirstName)]; 847var lastNameProperty = containerMetadata.Properties[nameof(model.LastName)]; 868var metadata = GetMetadataForType(typeof(Person)); 869var propertyMetadata = metadata.Properties[nameof(model.PropertyWithDefaultValue)]; 890var metadata = GetMetadataForType(typeof(Person)); 891var propertyMetadata = metadata.Properties[nameof(model.PropertyWithInitializedValue)]; 914var metadata = GetMetadataForType(typeof(Person)); 915var propertyMetadata = metadata.Properties[nameof(model.PropertyWithInitializedValueAndDefault)]; 938var metadata = GetMetadataForType(typeof(Person)); 939var propertyMetadata = metadata.Properties[nameof(model.NonUpdateableProperty)]; 981var propertyMetadata = bindingContext.ModelMetadata.Properties[propertyName]; 1002var modelMetadata = GetMetadataForType(model.GetType()); 1003var propertyMetadata = GetMetadataForProperty(model.GetType(), nameof(CollectionContainer.ReadOnlyList)); 1024var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.DateOfBirth)]; 1048var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.DateOfDeath)]; 1069var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.NameNoAttribute)]; 1084private static ComplexObjectModelBinder CreateBinder(ModelMetadata metadata, Action<MvcOptions> configureOptions = null) 1106private static DefaultModelBindingContext CreateContext(ModelMetadata metadata, object model = null) 1122private static ModelMetadata GetMetadataForType(Type type) 1127private static ModelMetadata GetMetadataForProperty(Type type, string propertyName) 1363public Func<ModelMetadata, bool> PropertyFilter
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (65)
42var modelMetadata = GetMetadataForProperty(typeof(Document), nameof(Document.SubDocument)); 99var modelMetadata = GetMetadataForProperty(typeof(SimpleContainer), nameof(SimpleContainer.Simple)); 298var metadata = metadataProvider.GetMetadataForParameter(parameter); 319.Setup(o => o.CanBindPropertyPublic(bindingContext, It.IsAny<ModelMetadata>())) 345var metadata = metadataProvider.GetMetadataForParameter(parameter); 358var binders = new Dictionary<ModelMetadata, IModelBinder>(); 359foreach (var property in metadataProvider.GetMetadataForProperties(typeof(Person))) 397var metadata = metadataProvider.GetMetadataForParameter(parameter); 409new Dictionary<ModelMetadata, IModelBinder>(), 441var metadata = metadataProvider.GetMetadataForParameter(parameter); 453new Dictionary<ModelMetadata, IModelBinder>(), 480var propertyMetadata = GetMetadataForProperty(typeof(MyModelTestingCanUpdateProperty), propertyName); 500var metadata = metadataProvider.GetMetadataForProperty(typeof(CollectionContainer), propertyName); 556var metadata = GetMetadataForType(typeof(ClassWithNoParameterlessConstructor)); 644var metadata = GetMetadataForProperty(typeof(PersonWithBindExclusion), property); 671var metadata = GetMetadataForProperty(typeof(PersonWithBindExclusion), property); 699var metadata = GetMetadataForProperty(typeof(PersonWithBindExclusion), property); 726var metadata = GetMetadataForProperty(typeof(TypeWithIncludedPropertiesUsingBindAttribute), property); 752var metadata = GetMetadataForProperty(typeof(ModelWithMixedBindingBehaviors), property); 782var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithBindRequired.Age)); 820var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithDataMemberIsRequired.Age)); 856var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithBindRequired.Age)); 885var property = GetMetadataForProperty(model.GetType(), nameof(BindingOptionalProperty.ValueTypeRequired)); 905var property = GetMetadataForProperty(model.GetType(), nameof(NullableValueTypeProperty.NullableValueType)); 921var containerMetadata = GetMetadataForType(model.GetType()); 927var property = GetMetadataForProperty(model.GetType(), nameof(Person.ValueTypeRequired)); 943var containerMetadata = GetMetadataForType(model.GetType()); 949var property = GetMetadataForProperty(model.GetType(), nameof(Person.ValueTypeRequired)); 970var containerMetadata = GetMetadataForType(model.GetType()); 976foreach (var property in containerMetadata.Properties) 981var firstNameProperty = containerMetadata.Properties[nameof(model.FirstName)]; 984var lastNameProperty = containerMetadata.Properties[nameof(model.LastName)]; 1003var property = GetMetadataForProperty(model.GetType(), nameof(ModelWithPropertyInitializedInConstructor.NameContainer)); 1004var nestedProperty = GetMetadataForProperty(typeof(ClassWithNoParameterlessConstructor), nameof(ClassWithNoParameterlessConstructor.Name)); 1030var metadata = GetMetadataForType(typeof(Person)); 1031var propertyMetadata = metadata.Properties[nameof(model.PropertyWithDefaultValue)]; 1052var metadata = GetMetadataForType(typeof(Person)); 1053var propertyMetadata = metadata.Properties[nameof(model.PropertyWithInitializedValue)]; 1076var metadata = GetMetadataForType(typeof(Person)); 1077var propertyMetadata = metadata.Properties[nameof(model.PropertyWithInitializedValueAndDefault)]; 1100var metadata = GetMetadataForType(typeof(Person)); 1101var propertyMetadata = metadata.Properties[nameof(model.NonUpdateableProperty)]; 1143var propertyMetadata = bindingContext.ModelMetadata.Properties[propertyName]; 1164var modelMetadata = GetMetadataForType(model.GetType()); 1165var propertyMetadata = GetMetadataForProperty(model.GetType(), nameof(CollectionContainer.ReadOnlyList)); 1186var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.DateOfBirth)]; 1210var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.DateOfDeath)]; 1231var propertyMetadata = bindingContext.ModelMetadata.Properties[nameof(model.NameNoAttribute)]; 1246private static TestableComplexTypeModelBinder CreateBinder(ModelMetadata metadata) 1270private static DefaultModelBindingContext CreateContext(ModelMetadata metadata, object model = null) 1286private static ModelMetadata GetMetadataForType(Type type) 1291private static ModelMetadata GetMetadataForProperty(Type type, string propertyName) 1538public Func<ModelMetadata, bool> PropertyFilter 1586var propertyBinders = new Dictionary<ModelMetadata, IModelBinder>(); 1587foreach (var property in context.Metadata.Properties) 1603: this(new Dictionary<ModelMetadata, IModelBinder>()) 1608: this(new Dictionary<ModelMetadata, IModelBinder>(), allowValidatingTopLevelNodes) 1612public TestableComplexTypeModelBinder(IDictionary<ModelMetadata, IModelBinder> propertyBinders) 1618IDictionary<ModelMetadata, IModelBinder> propertyBinders, 1624public Dictionary<ModelMetadata, ModelBindingResult> Results { get; } = new Dictionary<ModelMetadata, ModelBindingResult>(); 1648ModelMetadata propertyMetadata) 1662ModelMetadata propertyMetadata) 1680ModelMetadata propertyMetadata, 1689ModelMetadata propertyMetadata,
ModelBinding\Binders\DictionaryModelBinderTest.cs (3)
342var valueMetadata = metadataProvider.GetMetadataForType(typeof(ModelWithProperties)); 346new ComplexObjectModelBinder(new Dictionary<ModelMetadata, IModelBinder>() 672var metadata = metadataProvider.GetMetadataForProperty(
ModelBinding\Binders\FormFileModelBinderTest.cs (5)
86var metadata = new EmptyModelMetadataProvider().GetMetadataForProperty( 128var metadata = new EmptyModelMetadataProvider().GetMetadataForProperty( 438var metadata = metadataProvider.GetMetadataForProperty( 448var metadata = metadataProvider.GetMetadataForType(modelType); 454ModelMetadata metadata,
ModelBinding\Binders\HeaderModelBinderTests.cs (4)
329ModelMetadata metadata, 375var metadata = bindingContext.ModelMetadata; 389private static ModelMetadata GetMetadataForType(Type modelType) 396private static ModelMetadata GetMetadataForReadOnlyArray()
ModelBinding\Binders\ServicesModelBinderTest.cs (1)
37var modelMetadata = metadataProvider.GetMetadataForType(modelType);
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (4)
158public static TheoryData<ModelMetadata> IntegerModelMetadataDataSet 166return new TheoryData<ModelMetadata> 177public async Task BindModel_EmptyValueProviderResult_ReturnsFailedAndLogsSuccessfully(ModelMetadata metadata) 262public async Task BindModel_ValidValueProviderResult_ReturnsModelAndLogsSuccessfully(ModelMetadata metadata)
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (4)
107public static TheoryData<ModelMetadata> IntegerModelMetadataDataSet 115return new TheoryData<ModelMetadata> 126public async Task BindModel_EmptyValueProviderResult_ReturnsFailedAndLogsSuccessfully(ModelMetadata metadata) 189public async Task BindModel_ValidValueProviderResult_ReturnsModelAndLogsSuccessfully(ModelMetadata metadata)
ModelBinding\DefaultModelBindingContextTest.cs (3)
37var newModelMetadata = metadataProvider.GetMetadataForType(typeof(object)); 102var propertyMetadata = metadataProvider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 131var propertyMetadata = metadataProvider.GetMetadataForProperty(typeof(string), nameof(string.Length));
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (20)
18var metadata = provider.GetMetadataForType(typeof(ModelType)); 52var metadata1 = provider.GetMetadataForType(typeof(object)); 53var metadata2 = provider.GetMetadataForType(typeof(object)); 158var metadata = provider.GetMetadataForProperties(typeof(ModelType)).First(); 178var propertyMetadata = Assert.Single(metadata); 192foreach (var property in metadata) 209var metadata = provider.GetMetadataForParameter(parameters[0]); 228var metadata = provider.GetMetadataForParameter(parameters[1]); 257var metadata1 = provider.GetMetadataForParameter(parameter); 258var metadata2 = provider.GetMetadataForParameter(parameter); 274var metadata = provider.GetMetadataForParameter(parameter, typeof(DerivedModelType)); 325var metadata1 = provider.GetMetadataForParameter(parameter, typeof(DerivedModelType)); 326var metadata2 = provider.GetMetadataForParameter(parameter, typeof(DerivedModelType)); 342var metadata1 = provider.GetMetadataForParameter(parameter, typeof(DerivedModelType)); 343var metadata2 = provider.GetMetadataForParameter(parameter, typeof(object)); 358var metadata = provider.GetMetadataForProperty(property, typeof(DerivedModelType)); 408var metadata1 = provider.GetMetadataForProperty(property, typeof(DerivedModelType)); 409var metadata2 = provider.GetMetadataForProperty(property, typeof(DerivedModelType)); 424var metadata1 = provider.GetMetadataForProperty(property, typeof(DerivedModelType)); 425var metadata2 = provider.GetMetadataForProperty(property, typeof(object));
ModelBinding\Metadata\DefaultModelMetadataTest.cs (6)
66Assert.Equal(10000, ModelMetadata.DefaultOrder); 67Assert.Equal(ModelMetadata.DefaultOrder, metadata.Order); 242var elementMetadata = metadata.ElementMetadata; 269var elementMetadata = metadata.ElementMetadata; 960var metadata2 = metadata1.GetMetadataForType(typeof(string)); 1076var propertyMetadata = new Mock<ModelMetadata>(propertyIdentity);
ModelBinding\ModelBindingHelperTest.cs (12)
134Func<ModelMetadata, bool> propertyFilter = (m) => true; 183Func<ModelMetadata, bool> propertyFilter = (m) => 463Func<ModelMetadata, bool> propertyFilter = (m) => true; 513Func<ModelMetadata, bool> propertyFilter = (m) => 612Func<ModelMetadata, bool> propertyFilter = (m) => true; 641var modelMetadata = metadataProvider.GetMetadataForType(typeof(Product)); 673var modelMetadata = metadataProvider.GetMetadataForType(typeof(string)); 697var modelMetadata = metadataProvider.GetMetadataForType(typeof(List<Product>)); 742var modelMetadata = metadataProvider.GetMetadataForType(typeof(Product)); 1510var modelMetadata = metadataProvider.GetMetadataForProperty( 1524var metadata = metadataProvider.GetMetadataForType(modelType); 1529private static DefaultModelBindingContext GetBindingContext(ModelMetadata metadata)
ModelBinding\ParameterBinderTest.cs (12)
123public static TheoryData<RequiredAttribute, ParameterDescriptor, ModelMetadata> EnforcesTopLevelRequiredDataSet 174return new TheoryData<RequiredAttribute, ParameterDescriptor, ModelMetadata> 189ModelMetadata metadata) 331var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameter); 386var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameter); 441var modelMetadata = modelMetadataProvider.GetMetadataForProperty(property.DeclaringType, property.Name); 495var modelMetadata = modelMetadataProvider.GetMetadataForProperty(property.DeclaringType, property.Name); 542var modelMetadata = modelMetadataProvider.GetMetadataForType(typeof(IJsonPatchDocument)); 604var modelMetadata = modelMetadataProvider.GetMetadataForType(typeof(IJsonPatchDocument)); 672var modelMetadata = modelMetadataProvider.GetMetadataForType(typeof(string)); 741ModelMetadata modelMetadata, 786ModelMetadata modelMetadata,
ModelBinding\TestModelBinderProviderContext.cs (7)
19private readonly List<Func<ModelMetadata, IModelBinder>> _binderCreators = 20new List<Func<ModelMetadata, IModelBinder>>(); 59public override ModelMetadata Metadata { get; } 67public override IModelBinder CreateBinder(ModelMetadata metadata) 81public override IModelBinder CreateBinder(ModelMetadata metadata, BindingInfo bindingInfo) 87public void OnCreatingBinder(Func<ModelMetadata, IModelBinder> binderCreator) 92public void OnCreatingBinder(ModelMetadata metadata, Func<IModelBinder> binderCreator)
ModelBinding\UnsupportedContentTypeFilterTest.cs (2)
28var modelMetadata = new EmptyModelMetadataProvider() 111var modelMetadata = new EmptyModelMetadataProvider()
ModelBinding\Validation\ClientValidatorCacheTest.cs (7)
16var metadata = new TestModelMetadataProvider().GetMetadataForProperty(typeof(TypeWithProperty), "Property1"); 43var metadata = new TestModelMetadataProvider().GetMetadataForProperty(typeof(TypeWithProperty), "Property1"); 71var metadata = modelMetadataProvider.GetMetadataForType(typeof(TestRecordType)); 72var property = metadata.Properties[nameof(TestRecordType.Property1)]; 73var parameter = metadata.BoundConstructor.BoundConstructorParameters.First(f => f.Name == nameof(TestRecordType.Property1)); 92var metadata = modelMetadataProvider.GetMetadataForType(typeof(TestRecordTypeWithProperty)); 93var property = metadata.Properties[nameof(TestRecordTypeWithProperty.Property2)];
ModelBinding\Validation\CompositeModelValidatorProviderTest.cs (1)
35var modelMetadata = new EmptyModelMetadataProvider().GetMetadataForType(typeof(string));
ModelBinding\Validation\DefaultCollectionValidationStrategyTest.cs (3)
16var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(List<int>)); 56var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(List<int>)); 91var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(TwiceEnumerable));
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (7)
23var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(Person)); 63var metadata = TestModelMetadataProvider.CreateDefaultProvider(new List<IMetadataDetailsProvider> { new TestValidationModelNameProvider() }).GetMetadataForType(typeof(Person)); 97var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(Person)); 131var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(LazyPerson)); 232private readonly Func<ModelMetadata, bool> _shouldExclude; 234public ExcludePropertiesDefaultModelMetadataProvider(ICompositeMetadataDetailsProvider detailsProvider, Func<ModelMetadata, bool> shouldExclude) : base(detailsProvider) 239public override IEnumerable<ModelMetadata> GetMetadataForProperties(Type modelType)
ModelBinding\Validation\DefaultModelValidatorProviderTest.cs (7)
19var metadata = metadataProvider.GetMetadataForType(typeof(ValidatableObject)); 39var metadata = metadataProvider.GetMetadataForType(typeof(ModelValidatorAttributeOnClass)); 59var metadata = metadataProvider.GetMetadataForProperty( 81var metadata = metadataProvider.GetMetadataForProperty( 104var metadata = metadataProvider.GetMetadataForProperty( 126var metadata = metadataProvider.GetMetadataForProperty( 170private static IList<ValidatorItem> GetValidatorItems(ModelMetadata metadata)
ModelBinding\Validation\ExplicitIndexCollectionValidationStrategyTest.cs (5)
16var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(List<int>)); 56var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(List<int>)); 91var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(TwiceEnumerable)); 126var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(List<int>)); 156var metadata = TestModelMetadataProvider.CreateDefaultProvider().GetMetadataForType(typeof(List<int>));
ModelBinding\Validation\ShortFormDictionaryValidationStrategyTest.cs (6)
20var metadata = metadataProvider.GetMetadataForType(typeof(List<int>)); 21var valueMetadata = metadataProvider.GetMetadataForType(typeof(string)); 68var metadata = metadataProvider.GetMetadataForType(typeof(List<int>)); 69var valueMetadata = metadataProvider.GetMetadataForType(typeof(string)); 108var metadata = metadataProvider.GetMetadataForType(typeof(List<int>)); 109var valueMetadata = metadataProvider.GetMetadataForType(typeof(string));
ModelBinding\Validation\ValidatorCacheTest.cs (2)
16var metadata = new TestModelMetadataProvider().GetMetadataForProperty(typeof(TypeWithProperty), "Property1"); 43var metadata = new TestModelMetadataProvider().GetMetadataForProperty(typeof(TypeWithProperty), "Property1");
ValidationProblemDetailsTest.cs (1)
56var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
Microsoft.AspNetCore.Mvc.DataAnnotations (6)
CompareAttributeAdapter.cs (1)
88var otherProperty = validationContext.MetadataProvider.GetMetadataForProperty(
DataAnnotationsModelValidator.cs (1)
70var metadata = validationContext.ModelMetadata;
DefaultClientModelValidatorProvider.cs (1)
13/// <see cref="IClientModelValidator"/> instances in <see cref="ModelBinding.ModelMetadata.ValidatorMetadata"/>.
NumericClientModelValidator.cs (1)
32private static string GetErrorMessage(ModelMetadata modelMetadata)
ValidationAttributeAdapterOfTAttribute.cs (2)
61/// <param name="modelMetadata">The <see cref="ModelMetadata"/> associated with the model annotated with 65protected virtual string GetErrorMessage(ModelMetadata modelMetadata, params object[] arguments)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (127)
CompareAttributeAdapterTest.cs (6)
21var metadata = metadataProvider.GetMetadataForProperty(typeof(PropertyDisplayNameModel), "MyProperty"); 56var metadata = metadataProvider.GetMetadataForProperty(typeof(PropertyDisplayNameModel), "MyProperty"); 99var metadata = metadataProvider.GetMetadataForProperty(typeof(PropertyNameModel), "MyProperty"); 133var metadata = metadataProvider.GetMetadataForProperty(typeof(PropertyNameModel), "MyProperty"); 172var metadata = metadataProvider.GetMetadataForProperty(typeof(PropertyNameModel), "MyProperty"); 211var metadata = metadataProvider.GetMetadataForProperty(typeof(PropertyNameModel), "MyProperty");
DataAnnotationsClientModelValidatorProviderTest.cs (6)
24var metadata = _metadataProvider.GetMetadataForProperty( 47var metadata = _metadataProvider.GetMetadataForProperty( 78var metadata = _metadataProvider.GetMetadataForProperty( 100var metadata = _metadataProvider.GetMetadataForProperty( 123var metadata = _metadataProvider.GetMetadataForType(typeof(DummyClassWithDummyValidationAttribute)); 135private IList<ClientValidatorItem> GetValidatorItems(ModelMetadata metadata)
DataAnnotationsModelValidatorProviderTest.cs (5)
25var metadata = _metadataProvider.GetMetadataForType(mockValidatable.GetType()); 44var metadata = _metadataProvider.GetMetadataForProperty( 67var metadata = _metadataProvider.GetMetadataForType(typeof(DummyClassWithDummyValidationAttribute)); 99var metadata = _metadataProvider.GetMetadataForType(mockValidatable.Object.GetType()); 160private IList<ValidatorItem> GetValidatorItems(ModelMetadata metadata)
DataAnnotationsModelValidatorTest.cs (11)
35public static TheoryData<ModelMetadata, object, object, string> Validate_SetsMemberName_AsExpectedData 46return new TheoryData<ModelMetadata, object, object, string> 89ModelMetadata metadata, 127var metadata = _metadataProvider.GetMetadataForType(typeof(string)); 156var metadata = _metadataProvider.GetMetadataForProperty(typeof(string), "Length"); 187var metadata = _metadataProvider.GetMetadataForType(typeof(string)); 217var metadata = _metadataProvider.GetMetadataForProperty(typeof(string), "Length"); 242var metadata = _metadataProvider.GetMetadataForProperty(typeof(string), "Length"); 334var metadata = _metadataProvider.GetMetadataForProperty(typeof(string), nameof(string.Length)); 365var metadata = _metadataProvider.GetMetadataForType(typeof(string)); 523var metadata = _metadataProvider.GetMetadataForType(typeof(SampleModel));
DataTypeClientModelValidatorProviderTest.cs (4)
24var metadata = _metadataProvider.GetMetadataForType(modelType); 41var metadata = _metadataProvider.GetMetadataForType(typeof(float)); 72var metadata = _metadataProvider.GetMetadataForType(modelType); 83private IList<ClientValidatorItem> GetValidatorItems(ModelMetadata metadata)
DefaultModelClientValidatorProviderTest.cs (10)
20var metadata = metadataProvider.GetMetadataForType(typeof(ValidatableObject)); 40var metadata = metadataProvider.GetMetadataForType(typeof(ModelValidatorAttributeOnClass)); 61var metadata = metadataProvider.GetMetadataForProperty( 83var metadata = metadataProvider.GetMetadataForProperty( 107var metadata = metadataProvider.GetMetadataForProperty( 130var metadata = metadataProvider.GetMetadataForProperty( 151var metadata = metadataProvider.GetMetadataForProperty( 174var metadata = metadataProvider.GetMetadataForProperty( 190private IList<ClientValidatorItem> GetClientValidatorItems(ModelMetadata metadata) 195private IList<ValidatorItem> GetValidatorItems(ModelMetadata metadata)
FileExtensionsAttributeAdapterTest.cs (4)
23var metadata = provider.GetMetadataForProperty(typeof(Profile), nameof(Profile.PhotoFileName)); 74var metadata = provider.GetMetadataForProperty(typeof(Profile), nameof(Profile.PhotoFileName)); 104var metadata = provider.GetMetadataForProperty(typeof(Profile), nameof(Profile.PhotoFileName)); 138var metadata = provider.GetMetadataForProperty(typeof(Profile), "PhotoFileName");
MaxLengthAttributeAdapterTest.cs (5)
21var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 55var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 84var metadata = provider.GetMetadataForProperty(typeof(string), propertyName); 111var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 144var metadata = provider.GetMetadataForProperty(typeof(string), "Length");
MinLengthAttributeAdapterTest.cs (4)
21var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 55var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 83var metadata = provider.GetMetadataForProperty(typeof(string), propertyName); 111var metadata = provider.GetMetadataForProperty(typeof(string), propertyName);
ModelMetadataProviderTest.cs (51)
29var metadata = provider.GetMetadataForType(type); 35foreach (var property in metadata.Properties) 54var metadata = provider.GetMetadataForType(type); 91var metadata = provider.GetMetadataForType(modelType: typeof(ClassWithHiddenProperties)); 92var property = metadata.Properties["DirectlyHidden"]; 106var metadata = provider.GetMetadataForType(typeof(ClassWithHiddenProperties)); 107var property = metadata.Properties["OfHiddenType"]; 121var metadata = provider.GetMetadataForType(typeof(ClassWithHiddenProperties)); 122var property = metadata.Properties["DirectlyHidden"]; 136var metadata = provider.GetMetadataForType(typeof(ClassWithHiddenProperties)); 137var property = metadata.Properties["OfHiddenType"]; 153var propertyMetadata = provider.GetMetadataForProperty(typeof(Person), nameof(Person.Parent)); 166var propertyMetadata = provider.GetMetadataForProperty(typeof(Person), nameof(Person.GrandParent)); 172public static TheoryData<object, Func<ModelMetadata, string>> ExpectedAttributeDataStrings 176return new TheoryData<object, Func<ModelMetadata, string>> 224public void AttributesOverrideMetadataStrings(object attribute, Func<ModelMetadata, string> accessor) 230var metadata = provider.GetMetadataForType(typeof(string)); 246var metadata = provider.GetMetadataForType(typeof(string)); 255public static TheoryData<Attribute, Func<ModelMetadata, bool>, bool> ExpectedAttributeDataBooleans 259return new TheoryData<Attribute, Func<ModelMetadata, bool>, bool> 342Func<ModelMetadata, bool> accessor, 348var metadata = provider.GetMetadataForProperty(typeof(CoolUser), nameof(CoolUser.Name)); 364new DisplayAttribute(), ModelMetadata.DefaultOrder 399var metadata = provider.GetMetadataForType(typeof(string)); 415var metadata = provider.GetMetadataForType(typeof(string)); 431var metadata = provider.GetMetadataForType(typeof(string)); 451var metadata = provider.GetMetadataForType(typeof(string)); 477var metadata = provider.GetMetadataForType(typeof(string)); 499var metadata = provider.GetMetadataForType(typeof(string)); 516var metadata = provider.GetMetadataForType(typeof(string)); 534var metadata = provider.GetMetadataForType(typeof(string)); 552var metadata = provider.GetMetadataForType(typeof(string)); 575var metadata = provider.GetMetadataForType(typeof(string)); 593var metadata = provider.GetMetadataForType(typeof(string)); 615var metadata = provider.GetMetadataForType(typeof(string)); 634var metadata = provider.GetMetadataForType(typeof(string)); 653var metadata = provider.GetMetadataForType(typeof(string)); 670var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 687var metadata = provider.GetMetadataForProperty(typeof(Person), nameof(Person.Parent)); 700var metadata = provider.GetMetadataForProperty( 715var metadata = metadataProvider.GetMetadataForProperty( 730var metadata = metadataProvider.GetMetadataForProperty( 745var metadata = metadataProvider.GetMetadataForProperty( 760var metadata = metadataProvider.GetMetadataForProperty( 776var metadata = metadataProvider.GetMetadataForProperty( 794var metadata = metadataProvider.GetMetadataForType(type); 806var metadata = metadataProvider.GetMetadataForType(type); 822var metadata = metadataProvider.GetMetadataForProperty(type, propertyName); 838var metadata = metadataProvider.GetMetadataForProperty(type, propertyName); 854var metadata = metadataProvider.GetMetadataForProperty(type, propertyName); 870var metadata = metadataProvider.GetMetadataForProperty(type, propertyName);
NumericClientModelValidatorTest.cs (5)
19var metadata = provider.GetMetadataForProperty(typeof(TypeWithNumericProperty), "Id"); 51var metadata = provider.GetMetadataForProperty( 86var metadata = provider.GetMetadataForParameter(parameter); 112var metadata = provider.GetMetadataForType(typeof(int)); 134var metadata = provider.GetMetadataForProperty(typeof(TypeWithNumericProperty), "Id");
RangeAttributeAdapterTest.cs (3)
20var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 50var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 86var metadata = provider.GetMetadataForProperty(typeof(string), "Length");
RequiredAttributeAdapterTest.cs (3)
21var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 56var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 81var metadata = provider.GetMetadataForProperty(typeof(string), "Length");
StringLengthAttributeAdapterTest.cs (5)
21var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 56var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 83var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 111var metadata = provider.GetMetadataForProperty(typeof(string), "Length"); 137var metadata = provider.GetMetadataForProperty(typeof(string), "Length");
ValidatableObjectAdapterTest.cs (4)
17public static TheoryData<ModelMetadata, string, string> Validate_PassesExpectedNamesData 23return new TheoryData<ModelMetadata, string, string> 113ModelMetadata metadata, 153var metadata = _metadataProvider.GetMetadataForProperty(
ValidationAttributeAdapterOfTAttributeTest.cs (1)
20var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(string), "Length");
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (8)
XmlDataContractSerializerInputFormatterTest.cs (4)
76var metadata = provider.GetMetadataForType(typeof(string)); 514var metadata = provider.GetMetadataForType(typeof(TestLevelOne)); 578var metadata = provider.GetMetadataForType(typeof(TestLevelOne)); 725var metadata = provider.GetMetadataForType(modelType);
XmlSerializerInputFormatterTest.cs (4)
255var metadata = provider.GetMetadataForType(typeof(string)); 535var metadata = provider.GetMetadataForType(typeof(TestLevelOne)); 599var metadata = provider.GetMetadataForType(typeof(TestLevelOne)); 661var metadata = provider.GetMetadataForType(modelType);
Microsoft.AspNetCore.Mvc.IntegrationTests (190)
ActionParametersIntegrationTest.cs (9)
649var modelMetadata = modelMetadataProvider 682var modelMetadata = modelMetadataProvider 727var modelMetadata = modelMetadataProvider 780var modelMetadata = modelMetadataProvider 822var modelMetadata = modelMetadataProvider 867var modelMetadata = modelMetadataProvider 1069public CustomComplexTypeModelBinder(IDictionary<ModelMetadata, IModelBinder> propertyBinders) 1085var propertyBinders = new Dictionary<ModelMetadata, IModelBinder>(); 1086foreach (var property in context.Metadata.Properties)
ArrayModelBinderIntegrationTest.cs (1)
394var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType);
BindPropertyIntegrationTest.cs (4)
121var modelMetadata = modelMetadataProvider 161var modelMetadata = modelMetadataProvider 219var modelMetadata = modelMetadataProvider 280var modelMetadata = modelMetadataProvider
CollectionModelBinderIntegrationTest.cs (6)
991var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1020var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1077var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1115var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1143var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 1192var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType);
ComplexRecordIntegrationTest.cs (80)
49var metadata = GetMetadata(testContext, parameter); 99var metadata = GetMetadata(testContext, parameter); 151var metadata = GetMetadata(testContext, parameter); 205var metadata = GetMetadata(testContext, parameter); 254var metadata = GetMetadata(testContext, parameter); 303var metadata = GetMetadata(testContext, parameter); 351var metadata = GetMetadata(testContext, parameter); 403var metadata = GetMetadata(testContext, parameter); 455var metadata = GetMetadata(testContext, parameter); 508var metadata = GetMetadata(testContext, parameter); 561var metadata = GetMetadata(testContext, parameter); 615var metadata = GetMetadata(testContext, parameter); 665var metadata = GetMetadata(testContext, parameter); 722var metadata = GetMetadata(testContext, parameter); 776var metadata = GetMetadata(testContext, parameter); 831var metadata = GetMetadata(testContext, parameter); 886var metadata = GetMetadata(testContext, parameter); 933var metadata = GetMetadata(testContext, parameter); 979var metadata = GetMetadata(testContext, parameter); 1034var metadata = GetMetadata(testContext, parameter); 1089var metadata = GetMetadata(testContext, parameter); 1136var metadata = GetMetadata(testContext, parameter); 1182var metadata = GetMetadata(testContext, parameter); 1237var metadata = GetMetadata(testContext, parameter); 1292var metadata = GetMetadata(testContext, parameter); 1339var metadata = GetMetadata(testContext, parameter); 1398var metadata = GetMetadata(testContext, parameter); 1505var metadata = GetMetadata(testContext, parameter); 1612var metadata = GetMetadata(testContext, parameter); 1716var metadata = GetMetadata(testContext, parameter); 1771var metadata = GetMetadata(testContext, parameter); 1835var metadata = GetMetadata(testContext, parameter); 1921var metadata = GetMetadata(testContext, parameter); 1967var metadata = GetMetadata(testContext, parameter); 2023var metadata = GetMetadata(testContext, parameter); 2075var metadata = GetMetadata(testContext, parameter); 2129var metadata = GetMetadata(testContext, parameter); 2187var metadata = GetMetadata(testContext, parameter); 2243var metadata = GetMetadata(testContext, parameter); 2295var metadata = GetMetadata(testContext, parameter); 2343var metadata = GetMetadata(testContext, parameter); 2391var metadata = GetMetadata(testContext, parameter); 2443var metadata = GetMetadata(testContext, parameter); 2490var metadata = GetMetadata(testContext, parameter); 2540var metadata = GetMetadata(testContext, parameter); 2594var metadata = GetMetadata(testContext, parameter); 2653var metadata = GetMetadata(testContext, parameter); 2702var metadata = GetMetadata(testContext, parameter); 2758var metadata = GetMetadata(testContext, parameter); 2812var metadata = GetMetadata(testContext, parameter); 2870var metadata = GetMetadata(testContext, parameter); 2916var metadata = GetMetadata(testContext, parameter); 2985var metadata = GetMetadata(testContext, parameter); 3057var metadata = GetMetadata(testContext, parameter); 3121var metadata = GetMetadata(testContext, parameter); 3173var metadata = GetMetadata(testContext, parameter); 3248var metadata = GetMetadata(testContext, parameter); 3319var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3348var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3389var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3423var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3455var metadata = GetMetadata(testContext, parameter); 3497var metadata = GetMetadata(testContext, parameter); 3540var metadata = GetMetadata(testContext, parameter); 3583var metadata = GetMetadata(testContext, parameter); 3634var metadata = GetMetadata(testContext, parameter); 3680var metadata = GetMetadata(testContext, parameter); 3732var metadata = GetMetadata(testContext, parameter); 3775var metadata = GetMetadata(testContext, parameter); 3820var metadata = GetMetadata(testContext, parameter); 3863var metadata = GetMetadata(testContext, parameter); 3907var metadata = GetMetadata(testContext, parameter); 3952var metadata = GetMetadata(testContext, parameter); 3996var metadata = GetMetadata(testContext, parameter); 4037var metadata = GetMetadata(testContext, parameter); 4080var metadata = GetMetadata(testContext, parameter); 4125var metadata = GetMetadata(testContext, parameter); 4170var metadata = GetMetadata(testContext, parameter); 4241private ModelMetadata GetMetadata(ModelBindingTestContext context, ParameterDescriptor parameter) 4249ModelMetadata metadata)
ComplexTypeIntegrationTestBase.cs (65)
39var metadata = GetMetadata(testContext, parameter); 86var metadata = GetMetadata(testContext, parameter); 136var metadata = GetMetadata(testContext, parameter); 188var metadata = GetMetadata(testContext, parameter); 237var metadata = GetMetadata(testContext, parameter); 286var metadata = GetMetadata(testContext, parameter); 344var metadata = GetMetadata(testContext, parameter); 396var metadata = GetMetadata(testContext, parameter); 448var metadata = GetMetadata(testContext, parameter); 511var metadata = GetMetadata(testContext, parameter); 564var metadata = GetMetadata(testContext, parameter); 618var metadata = GetMetadata(testContext, parameter); 668var metadata = GetMetadata(testContext, parameter); 725var metadata = GetMetadata(testContext, parameter); 784var metadata = GetMetadata(testContext, parameter); 839var metadata = GetMetadata(testContext, parameter); 894var metadata = GetMetadata(testContext, parameter); 941var metadata = GetMetadata(testContext, parameter); 992var metadata = GetMetadata(testContext, parameter); 1047var metadata = GetMetadata(testContext, parameter); 1102var metadata = GetMetadata(testContext, parameter); 1149var metadata = GetMetadata(testContext, parameter); 1200var metadata = GetMetadata(testContext, parameter); 1255var metadata = GetMetadata(testContext, parameter); 1310var metadata = GetMetadata(testContext, parameter); 1357var metadata = GetMetadata(testContext, parameter); 1434var metadata = GetMetadata(testContext, parameter); 1541var metadata = GetMetadata(testContext, parameter); 1648var metadata = GetMetadata(testContext, parameter); 1757var metadata = GetMetadata(testContext, parameter); 1812var metadata = GetMetadata(testContext, parameter); 1867var metadata = GetMetadata(testContext, parameter); 1916var metadata = GetMetadata(testContext, parameter); 1975var metadata = GetMetadata(testContext, parameter); 2068var metadata = GetMetadata(testContext, parameter); 2121var metadata = GetMetadata(testContext, parameter); 2176var metadata = GetMetadata(testContext, parameter); 2237var metadata = GetMetadata(testContext, parameter); 2291var metadata = GetMetadata(testContext, parameter); 2349var metadata = GetMetadata(testContext, parameter); 2409var metadata = GetMetadata(testContext, parameter); 2461var metadata = GetMetadata(testContext, parameter); 2509var metadata = GetMetadata(testContext, parameter); 2561var metadata = GetMetadata(testContext, parameter); 2613var metadata = GetMetadata(testContext, parameter); 2660var metadata = GetMetadata(testContext, parameter); 2713var metadata = GetMetadata(testContext, parameter); 2767var metadata = GetMetadata(testContext, parameter); 2832var metadata = GetMetadata(testContext, parameter); 2881var metadata = GetMetadata(testContext, parameter); 2949var metadata = GetMetadata(testContext, parameter); 3003var metadata = GetMetadata(testContext, parameter); 3063var metadata = GetMetadata(testContext, parameter); 3120var metadata = GetMetadata(testContext, parameter); 3193var metadata = GetMetadata(testContext, parameter); 3272var metadata = GetMetadata(testContext, parameter); 3343var metadata = GetMetadata(testContext, parameter); 3395var metadata = GetMetadata(testContext, parameter); 3477var metadata = GetMetadata(testContext, parameter); 3554var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3593var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3640var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3692var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType); 3740private ModelMetadata GetMetadata(ModelBindingTestContext context, ParameterDescriptor parameter) 3748ModelMetadata metadata)
DictionaryModelBinderIntegrationTest.cs (1)
1220var metadata = testContext.MetadataProvider.GetMetadataForType(parameter.ParameterType);
NullableReferenceTypeIntegrationTest.cs (1)
169var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo);
ParameterBinderExtensions.cs (2)
41ModelMetadata metadata; 60ModelMetadata modelMetadata)
ValidationIntegrationTests.cs (10)
1547var otherProperty = parentEntry.Metadata.Properties[_otherProperty]; 2025var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo); 2077var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo); 2147var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo); 2313var modelMetadata = modelMetadataProvider.GetMetadataForProperty(propertyInfo, propertyInfo.PropertyType); 2367var modelMetadata = modelMetadataProvider.GetMetadataForProperty(propertyInfo, propertyInfo.PropertyType); 2471var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo); 2517var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo); 2599public List<ModelMetadata> Visited = new(); 2601protected override bool Visit(ModelMetadata metadata, string key, object model)
ValidationWithRecordIntegrationTests.cs (11)
1357var otherProperty = parentEntry.Metadata.Properties[_otherProperty]; 1816var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo); 1868var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo); 1938var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo); 2104var modelMetadata = modelMetadataProvider.GetMetadataForProperty(propertyInfo, propertyInfo.PropertyType); 2155var modelMetadata = modelMetadataProvider.GetMetadataForProperty(propertyInfo, propertyInfo.PropertyType); 2257var modelMetadata = modelMetadataProvider.GetMetadataForParameter(parameterInfo); 2307var modelMetadata = modelMetadataProvider.GetMetadataForType(modelType); 2346var modelMetadata = modelMetadataProvider.GetMetadataForType(modelType); 2387var modelMetadata = modelMetadataProvider.GetMetadataForType(modelType); 2424var modelMetadata = modelMetadataProvider.GetMetadataForType(modelType);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (4)
NewtonsoftJsonInputFormatter.cs (4)
307var metadata = GetPathMetadata(context.Metadata, path); 364private static ModelMetadata GetPathMetadata(ModelMetadata metadata, string path) 400var propertyMetadata = metadata.Properties[propertyName];
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (3)
NewtonsoftJsonPatchInputFormatterTest.cs (2)
188var metadata = provider.GetMetadataForType(modelType); 244var metadata = provider.GetMetadataForType(modelType);
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (1)
655var metadata = provider.GetMetadataForType(modelType);
Microsoft.AspNetCore.Mvc.RazorPages (14)
ApplicationModels\DefaultPageApplicationModelPartsProvider.cs (2)
84var modelMetadata = modelMetadataProviderBase.GetMetadataForParameter(parameter); 112var propertyMetadata = _modelMetadataProvider.GetMetadataForProperty(property.DeclaringType!, property.Name);
Infrastructure\PageBinderFactory.cs (6)
33var metadata = modelMetadataProvider.GetMetadataForProperty(handlerType, property.Name); 58var modelMetadata = bindingInfo.ModelMetadata; 99ModelMetadata metadata; 139var modelMetadata = bindingInfo.ModelMetadata; 165public BinderItem(IModelBinder modelBinder, ModelMetadata modelMetadata) 171public ModelMetadata ModelMetadata { get; }
PageBase.cs (3)
1391Func<ModelMetadata, bool> propertyFilter) 1463Func<ModelMetadata, bool> propertyFilter) 1531Func<ModelMetadata, bool> propertyFilter)
PageModel.cs (3)
296Func<ModelMetadata, bool> propertyFilter) 368Func<ModelMetadata, bool> propertyFilter) 436Func<ModelMetadata, bool> propertyFilter)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\PageBinderFactoryTest.cs (1)
826ModelMetadata metadata,
Microsoft.AspNetCore.Mvc.TagHelpers (2)
InputTagHelper.cs (2)
180var metadata = For.Metadata; 280/// <see cref="ModelMetadata.ModelType"/> base class, used to determine this method's return value.</param>
Microsoft.AspNetCore.Mvc.TagHelpers.Test (12)
InputTagHelperTest.cs (2)
2400var containerMetadata = metadataProvider.GetMetadataForType(containerType); 2403var propertyMetadata = metadataProvider.GetMetadataForProperty(containerType, propertyName);
LabelTagHelperTest.cs (2)
168var containerMetadata = metadataProvider.GetMetadataForType(containerType); 171var propertyMetadata = metadataProvider.GetMetadataForProperty(containerType, "Text");
SelectTagHelperTest.cs (6)
190var containerMetadata = metadataProvider.GetMetadataForType(containerType); 193var propertyMetadata = metadataProvider.GetMetadataForProperty(containerType, "Text"); 280var containerMetadata = metadataProvider.GetMetadataForType(containerType); 283var propertyMetadata = metadataProvider.GetMetadataForProperty(containerType, "Text"); 460var containerMetadata = metadataProvider.GetMetadataForType(containerType); 463var propertyMetadata = metadataProvider.GetMetadataForProperty(containerType, "Text");
TextAreaTagHelperTest.cs (2)
99var containerMetadata = metadataProvider.GetMetadataForType(containerType); 102var propertyMetadata = metadataProvider.GetMetadataForProperty(containerType, "Text");
Microsoft.AspNetCore.Mvc.ViewFeatures (99)
DefaultDisplayTemplates.cs (3)
88var elementMetadata = htmlHelper.ViewData.ModelMetadata.ElementMetadata; 114var itemMetadata = elementMetadata; 215var propertyMetadata = propertyExplorer.Metadata;
DefaultEditorTemplates.cs (4)
70var elementMetadata = htmlHelper.ViewData.ModelMetadata.ElementMetadata; 96var itemMetadata = elementMetadata; 257var propertyMetadata = propertyExplorer.Metadata; 421var metadata = htmlHelper.ViewData.ModelMetadata;
DefaultHtmlGenerator.cs (1)
956var metadata = modelExplorer.Metadata;
ExpressionMetadataProvider.cs (5)
95ModelMetadata metadata = null; 176var containerMetadata = metadataProvider.GetMetadataForType(viewDataInfo.Container.GetType()); 177var propertyMetadata = containerMetadata.Properties[viewDataInfo.PropertyInfo.Name]; 185var valueMetadata = metadataProvider.GetMetadataForType(viewDataInfo.Value.GetType()); 191var stringMetadata = metadataProvider.GetMetadataForType(typeof(string));
HtmlHelper.cs (5)
369var metadata = MetadataProvider.GetMetadataForType(type); 387var metadata = MetadataProvider.GetMetadataForType(enumType); 1359/// <param name="metadata"><see cref="ModelMetadata"/> to generate a select list for.</param> 1365/// Thrown if <paramref name="metadata"/>'s <see cref="ModelMetadata.ModelType"/> is not an <see cref="Enum"/> 1368protected virtual IEnumerable<SelectListItem> GetEnumSelectList(ModelMetadata metadata)
ModelExplorer.cs (28)
11/// Associates a model object with it's corresponding <see cref="ModelMetadata"/>. 26/// <param name="metadata">The <see cref="ModelMetadata"/>.</param> 30ModelMetadata metadata, 46/// <param name="metadata">The <see cref="ModelMetadata"/>.</param> 51ModelMetadata metadata, 69/// <param name="metadata">The <see cref="ModelMetadata"/>.</param> 74ModelMetadata metadata, 104/// instances, then use <see cref="ModelMetadata.ContainerType"/> to validate this assumption. 110/// Gets the <see cref="ModelMetadata"/>. 112public ModelMetadata Metadata { get; } 170/// Includes a <see cref="ModelExplorer"/> for each property of the <see cref="ModelMetadata"/> 181var metadata = GetMetadataForRuntimeType(); 188var propertyMetadata = properties[i]; 264var metadata = GetMetadataForRuntimeType(); 266var propertyMetadata = metadata.Properties[name]; 289var metadata = GetMetadataForRuntimeType(); 291var propertyMetadata = metadata.Properties[name]; 320var metadata = _metadataProvider.GetMetadataForType(modelType); 327/// <param name="metadata">The <see cref="ModelMetadata"/> associated with the model.</param> 333/// <see cref="GetExplorerForExpression(ModelMetadata, object)"/> 341public ModelExplorer GetExplorerForExpression(ModelMetadata metadata, object model) 369var metadata = _metadataProvider.GetMetadataForType(modelType); 376/// <param name="metadata">The <see cref="ModelMetadata"/> associated with the model.</param> 382/// <see cref="GetExplorerForExpression(ModelMetadata, Func{object, object})"/> 390public ModelExplorer GetExplorerForExpression(ModelMetadata metadata, Func<object, object> modelAccessor) 397private ModelMetadata GetMetadataForRuntimeType() 401var metadata = Metadata; 411ModelMetadata propertyMetadata,
ModelExpression.cs (1)
39public ModelMetadata Metadata => ModelExplorer.Metadata;
ModelMetadataProviderExtensions.cs (1)
31var modelMetadata = provider.GetMetadataForType(modelType);
ModelStateDictionaryExtensions.cs (5)
45/// when <see cref="ModelMetadata"/> is not available or the exact <paramref name="exception"/> 73/// <param name="metadata">The <see cref="ModelMetadata"/> associated with the model.</param> 78ModelMetadata metadata) 124var modelMetadata = new EmptyModelMetadataProvider().GetMetadataForType(typeof(TModel)); 127var property = modelMetadata.Properties[i];
Rendering\HtmlHelperDisplayExtensions.cs (16)
16/// using the <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 48/// <see cref="ModelBinding.ModelMetadata"/>. 92/// <see cref="ModelBinding.ModelMetadata"/>. 128/// <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 174/// <paramref name="expression"/>'s<see cref="ModelBinding.ModelMetadata"/>. 214/// using the <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 248/// <see cref="ModelBinding.ModelMetadata"/>. 288/// <see cref="ModelBinding.ModelMetadata"/>. 324/// <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 366/// <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 406/// model's <see cref="ModelBinding.ModelMetadata"/>. 433/// template is found using the model's <see cref="ModelBinding.ModelMetadata"/>. 465/// <paramref name="templateName"/> or the model's <see cref="ModelBinding.ModelMetadata"/>. 494/// <see cref="ModelBinding.ModelMetadata"/>. 531/// <see cref="ModelBinding.ModelMetadata"/>. 567/// <see cref="ModelBinding.ModelMetadata"/>.
Rendering\HtmlHelperEditorExtensions.cs (16)
16/// using the <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 48/// <see cref="ModelBinding.ModelMetadata"/>. 92/// <see cref="ModelBinding.ModelMetadata"/>. 125/// <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 171/// <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 211/// using the <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 241/// <see cref="ModelBinding.ModelMetadata"/>. 281/// <see cref="ModelBinding.ModelMetadata"/>. 313/// <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 355/// <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>. 391/// model's <see cref="ModelBinding.ModelMetadata"/>. 418/// template is found using the model's <see cref="ModelBinding.ModelMetadata"/>. 450/// <paramref name="templateName"/> or the model's <see cref="ModelBinding.ModelMetadata"/>. 479/// <see cref="ModelBinding.ModelMetadata"/>. 516/// <see cref="ModelBinding.ModelMetadata"/>. 552/// <see cref="ModelBinding.ModelMetadata"/>.
Rendering\IHtmlHelper.cs (3)
197/// <paramref name="expression"/>'s <see cref="ModelMetadata"/>. 247/// If the expression result is <c>null</c>, returns <see cref="ModelMetadata.NullDisplayText"/>. 289/// <paramref name="expression"/>'s <see cref="ModelMetadata"/>.
Rendering\IHtmlHelperOfT.cs (3)
49/// <paramref name="expression"/>’s <see cref="Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata.TemplateHint"/>. 109/// <see cref="ModelBinding.ModelMetadata.NullDisplayText"/>. 151/// <paramref name="expression"/>'s <see cref="ModelBinding.ModelMetadata"/>.
TemplateBuilder.cs (1)
22private readonly ModelMetadata _metadata;
TemplateRenderer.cs (2)
147var metadata = _viewData.ModelMetadata; 169public static IEnumerable<string> GetTypeNames(ModelMetadata modelMetadata, Type fieldType)
ValidationHelpers.cs (3)
59var metadata = viewData.ModelMetadata; 84ModelMetadata metadata, 98var propertyMetadata = metadata.Properties[i];
ViewDataDictionary.cs (2)
278/// Gets the <see cref="ModelBinding.ModelMetadata"/> for an expression, the <see cref="Model"/> (if 285public ModelMetadata ModelMetadata
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (35)
DefaultHtmlGeneratorTest.cs (9)
199var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(ModelWithMaxLengthMetadata), expression); 223var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(ModelWithMaxLengthMetadata), expression); 247var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(ModelWithMaxLengthMetadata), expression); 269var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(ModelWithMaxLengthMetadata), nameof(ModelWithMaxLengthMetadata.FieldWithBothAttributes)); 291var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(ModelWithMaxLengthMetadata), nameof(ModelWithMaxLengthMetadata.FieldWithoutAttributes)); 314var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(ModelWithMaxLengthMetadata), expression); 367var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(Model), expression); 397var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(Model), expression); 422var modelMetadata = metadataProvider.GetMetadataForProperty(typeof(ModelWithMaxLengthMetadata), expression);
ModelStateDictionaryExtensionsTest.cs (4)
102var metadata = provider.GetMetadataForProperty(typeof(TestModel), nameof(TestModel.Text)); 140var metadata = provider.GetMetadataForProperty(typeof(ChildModel), nameof(ChildModel.Text)); 178var metadata = provider.GetMetadataForProperty(typeof(ChildModel), nameof(ChildModel.Value)); 218var metadata = provider.GetMetadataForProperty(typeof(string), nameof(string.Length));
PageRemoteAttributeTest.cs (1)
172var metadata = metadataProvider.GetMetadataForProperty(
RemoteAttributeBaseTest.cs (1)
494var metadata = metadataProvider.GetMetadataForProperty(
RemoteAttributeTest.cs (2)
375var metadata = metadataProvider.GetMetadataForProperty( 422var metadata = metadataProvider.GetMetadataForProperty(
Rendering\DefaultTemplatesUtilities.cs (1)
336var metadata = modelExplorer.Metadata;
Rendering\HtmlHelperNameExtensionsTest.cs (2)
163var metadata = new Mock<ModelMetadata>( 192var metadata = new Mock<ModelMetadata>(
Rendering\HtmlHelperSelectTest.cs (6)
1313var metadata = metadataProvider.GetMetadataForType(typeof(EnumWithFields)); 1329var metadata = metadataProvider.GetMetadataForType(typeof(EnumWithFields)); 1389var metadata = metadataProvider.GetMetadataForType(typeof(EnumWithFields)); 1494var metadata = metadataProvider.GetMetadataForType(type); 1583public ModelMetadata Metadata { get; private set; } 1589protected override IEnumerable<SelectListItem> GetEnumSelectList(ModelMetadata metadata)
Rendering\HtmlHelperValidationSummaryTest.cs (2)
671var metadata = provider.GetMetadataForProperty(typeof(ValidationModel), nameof(ValidationModel.Property3)); 690var metadata = provider.GetMetadataForProperty(typeof(OrderedModel), nameof(OrderedModel.Property3));
TemplateRendererTest.cs (1)
50var metadata = metadataProvider.GetMetadataForType(fieldType);
ViewDataDictionaryTest.cs (6)
283var sourceMetadata = source.ModelMetadata; 327var originalMetadata = viewData.ModelMetadata; 349var metadata = metadataProvider.GetMetadataForType(originalMetadataType); 374var metadata = metadataProvider.GetMetadataForType(typeof(bool?)); 419var originalMetadata = viewData.ModelMetadata; 446var originalMetadata = viewData.ModelMetadata;