ModelMetadata.ElementMetadata Property

Definition

Gets the ModelMetadata for elements of ModelType if that Type implements IEnumerable.

C#
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata ElementMetadata { get; }
C#
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata? ElementMetadata { get; }

Property Value

ModelMetadata for T if ModelType implements IEnumerable<T>. ModelMetadata for object if ModelType implements IEnumerable but not IEnumerable<T>. null otherwise i.e. when IsEnumerableType is false.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0