using System.Collections.Generic; using System.Linq; using System.Web.Mvc; namespace DR.FV2016.Web.Helpers { public static class MetaTagHelper { public static MvcHtmlString GetMetaTagHelper(this Dictionary dictionary) { var metaTag = new TagBuilder("meta"); if (dictionary.ContainsValue("copyright")) { return new MvcHtmlString(""); } if (dictionary.ContainsValue("site")) { foreach (var attribute in dictionary.Where(attribute => attribute.Key == "content")) { return new MvcHtmlString(""); } } foreach (var attribute in dictionary) { metaTag.Attributes.Add(attribute.Key, attribute.Value); } return new MvcHtmlString(metaTag.ToString(TagRenderMode.SelfClosing)); } } }