public static HtmlTag Label <TModel>(this IHtmlHelper <TModel> helper, Expression <Func <TModel, object> > expression) { var options = helper.ViewContext.HttpContext.RequestServices.GetService <HtmlConventionOptions>(); var tag = new TagGenerator(options.Conventions.Select(x => (HtmlConvention)helper.ViewContext.HttpContext.RequestServices.GetService(x)).ToList()); return(tag.GenerateLabelFor(helper.ViewContext, expression)); }
public static HtmlTag Label <TModel>(this HtmlHelper <TModel> helper, Expression <Func <TModel, object> > expression) { var tag = new TagGenerator(HtmlConventionFactory.HtmlConventions); return(tag.GenerateLabelFor(helper.ViewContext, expression)); }