I’ve putted a Description attribute on my property,but the Description property on the ModelMetada is null anyway.
[Description("sss")]
public int Id { get; set; }
BTW Is I've putted corect?
EDIT
I’ve had a look at the MVC source. It doesn’t seem to be a bug. The decsription attribute is just never used. There is a property in the Metadata class but this property is never set or called. The CreateMetadata method has no code to work with the decription attribute.The solution would be to override the create method and also edit the templates.
While trying to find how to get this working I came across a blog post that said neither Description nor Watermark are usable with the present incarnation of the DataAnnotations framework.
I came up with a workaround that looks roughly like this:
(Disclaimer: this code is edited from my compiling version to remove it from a metadata provider built through composition so it may not compile directly without some touchups.)
Then in your Global.asax in Application_Start or wherever you register your model metadata providers: