MVC Html Helper: modelmetadata from string expression
问题 I am trying to build an html helper that would have access to modelmetadata. I need both versions of helper to work: from string expression and from lambda expression: Example: public static MvcHtmlString MyLabel(this HtmlHelper html, string htmlFieldName) { return LabelHelper(html, htmlFieldName); } public static MvcHtmlString MyLabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression) { return LabelHelper(html, ExpressionHelper.GetExpressionText