Extract Display name and description Attribute from within a HTML helper
问题 I am building a custom HTML.LabelFor helper that looks like this : public static MvcHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> self, Expression<Func<TModel, TValue>> expression, Boolean showToolTip) { var metadata = ModelMetadata.FromLambdaExpression(expression, self.ViewData); ... } To be able to get the proper name for the property I am using the following code : metadata.DisplayName And on the property of the ModelView class I got : [DisplayName("Titel")] The problem is