Beispiel #1
0
 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());
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
 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));
 }
Beispiel #4
0
 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));
 }