using System.Collections.Generic; using System.Linq; using DR.FV2016.Web.Models; namespace DR.FV2016.Web.Helpers { public class SearchableHelper { public static void EnsureUrn(FvViewBase p, string urn) { if (p.MetaTags == null) p.MetaTags = new List>(); //Only add urn if none exists if (!p.MetaTags.Any(x => x.Any(z => z.Key == "name" && z.Value == "urn"))) { p.MetaTags = p.MetaTags.Concat(new List> { new Dictionary { {"name", "urn"}, {"content", urn } } }).ToList(); } } } }