I'd want to use in cshtml description of property/field from Description
attribute
Is it possible to do it as easily as with DisplayName
by using @Html.DisplayNameFor(x => ...)
or I have to "extract it"
public class Test
{
[Description("Test description")]
public bool Name { get; set; }
}
I've been trying with something like that, but without any success
var desc = typeof(Test)
.GetCustomAttributes(false)
.ToDictionary(a => a.GetType().Name, a => a);
or
typeof(Test).Attributes
typeof(Test).GetCustomAttributesData();