public static ICollection<string> GetGroups(ICollection<Asset> urls) { List<string> groups = new List<string>(); foreach (Asset url in urls) { if (!String.IsNullOrEmpty(url.Group) && !groups.Contains(url.Group)) groups.Add(url.Group); } return groups; }