ModelPropertyCollection Class

Summary

A read-only list of [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata](Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata.yml) objects which represent model properties.

Syntax

public class ModelPropertyCollection : IReadOnlyList<ModelMetadata>, IReadOnlyCollection<ModelMetadata>, IEnumerable<ModelMetadata>, IEnumerable

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.ModelBinding.ModelPropertyCollection

Constructors

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

Creates a new [Microsoft.AspNet.Mvc.ModelBinding.ModelPropertyCollection](Microsoft.AspNet.Mvc.ModelBinding.ModelPropertyCollection.yml).

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

Properties

Count()
Return type:System.Int32
public int Count { get; }
Microsoft.AspNet.Mvc.ModelBinding.ModelPropertyCollection.Item[System.Int32]
Return type:Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata
public ModelMetadata this[int index] { get; }
Microsoft.AspNet.Mvc.ModelBinding.ModelPropertyCollection.Item[System.String]

Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata](Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata.yml) instance for the property corresponding to <paramref name=”propertyName” />.

Return type:Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata
Returns:The [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata](Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata.yml) instance for the property specified by <paramref name=”propertyName” />, or null if no match can be found.
public ModelMetadata this[string propertyName] { get; }

Methods

Microsoft.AspNet.Mvc.ModelBinding.ModelPropertyCollection.GetEnumerator()
Return type:System.Collections.Generic.IEnumerator{Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata}
public IEnumerator<ModelMetadata> GetEnumerator()
Microsoft.AspNet.Mvc.ModelBinding.ModelPropertyCollection.System.Collections.IEnumerable.GetEnumerator()
Return type:System.Collections.IEnumerator
IEnumerator IEnumerable.GetEnumerator()