ModelPropertyCollection Class

A read-only collection of Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata objects which represent model properties.

Namespace
Microsoft.AspNetCore.Mvc.ModelBinding
Assemblies
  • Microsoft.AspNetCore.Mvc.Abstractions

Inheritance Hierarchy

Syntax

public class ModelPropertyCollection : ReadOnlyCollection<ModelMetadata>, IList<ModelMetadata>, ICollection<ModelMetadata>, IList, ICollection, IReadOnlyList<ModelMetadata>, IReadOnlyCollection<ModelMetadata>, IEnumerable<ModelMetadata>, IEnumerable
class Microsoft.AspNetCore.Mvc.ModelBinding.ModelPropertyCollection

Constructors

ModelPropertyCollection(System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata>)

Creates a new Microsoft.AspNetCore.Mvc.ModelBinding.ModelPropertyCollection.

Arguments:properties (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata>) – The properties.
public ModelPropertyCollection(IEnumerable<ModelMetadata> properties)

Properties

Microsoft.AspNetCore.Mvc.ModelBinding.ModelPropertyCollection.Item[System.String]

Gets a Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata instance for the property corresponding to <em>propertyName</em>.

Arguments:propertyName (System.String) – The property name. Property names are compared using System.StringComparison.Ordinal.
Return type:Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata
Returns:The Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata instance for the property specified by <em>propertyName</em>, or <code>null</code> if no match can be found.
public ModelMetadata this[string propertyName] { get; }