public static ICollection <SelectListItem> GetBusinesses(int selectedId) { return(Businesses.Where(x => x.DeletedKey == null).Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.ToDisplay(), Selected = selectedId == x.Id, }).ToArray()); }
public void PruneByCount(long minCountAllowed) { if (minCountAllowed < 0) { throw new ArgumentOutOfRangeException("minCountAllowed", "Only non-negative values allowed"); } IEnumerable <T> removedItems = _store .Where(kvp => kvp.Value < minCountAllowed) .Select(kvp => kvp.Key) .ToList(); foreach (var item in removedItems) { _store.RemoveAllCopies(item); } _containsUnrepresentedNoiseEvents = true; }
public static IList <SelectListItem> DeleteableToSelectListItems <T>(IBag <T> list, Func <T, string> toText, IEnumerable <int> selectedIds) where T : class, IIdentifiable, IDeleteable { return(ToSelectListItems(list.Where(x => x.DeletedKey == null), toText, selectedIds)); }
public static IList <ReferenceItem> DeleteableToReferenceItems <T>(IBag <T> list, Func <T, string> toText) where T : class, IIdentifiable, IDeleteable { return(ToReferenceItems(list.Where(x => x.DeletedKey == null), toText)); }