public static void AddLinkPart(this IPageAssetsBuilder builder, string rel, string href, string type = null, string media = null, string sizes = null, string hreflang = null) { var attrs = new RouteValueDictionary(); if (type.HasValue()) attrs["type"] = type; if (media.HasValue()) attrs["media"] = media; if (sizes.HasValue()) attrs["sizes"] = sizes; if (hreflang.HasValue()) attrs["hreflang"] = hreflang; builder.AddLinkPart(rel, href, attrs); }
public static void AddLinkPart(this IPageAssetsBuilder builder, string rel, string href, object htmlAttributes) { var attrs = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes); builder.AddLinkPart(rel, href, attrs); }