Int32 用の追加のエディター テンプレートを作成したいと考えています。その中で、すべての属性(カスタム/デフォルトデータ注釈)を取得し、それらを使用していくつかの作業を行いたい:
@model Int32
@{
string propertyName = ViewData.ModelMetadata.PropertyName;
var attributes = ViewData.ModelMetadata.GetSomeHowAllTheAttributesOfTheProperty;
SomeWorkWithAttribute(attributes);
}
<input type="text" name="@propertyName" value="@ViewData.ModelMetadata.DisplayFormatString" class="form-control"/>
では、EditorTemplate でプロパティのすべての属性を取得する方法について質問します。
事前にThx