私の質問はとても簡単です。
オブジェクト内のすべてのプロパティ値に対して実行したいと思います。例えば:
public class Product
{
public int ProductId {get;set;}
public string Name {get;set;}
public string Content {get;set;}
}
var obj = new Product();
var props = obj.GetType().GetProperties();
foreach(var prop in props)
{
@Html.LabelFor( ....... ) // Need to run for active property.
// such as @Html.LabelFor( x => prop )
}
どうすればやりたいことができますか?このようにまたは他の方法で、