public async Task OnGetAsync() { if (FilterCriteria == null || FilterCriteria == "") { SortedEvents = await eventCatalogue.GetAllItems(); } else { foreach (Event evt in await eventCatalogue.GetAllItems()) { bool add = false; if (evt.Name.ToLower().Contains(FilterCriteria.ToLower())) { add = true; } else if (evt.Theme.ToLower().Contains(FilterCriteria.ToLower())) { add = true; } if (evt.RoomNr != RoomNr) { add = false; } if (add) { SortedEvents.Add(evt); } } } SortedEvents.Sort(Comparer <Event> .Create((x, y) => x.Name.CompareTo(y.Name))); }
public IndexModel(ICatalogue <Room> rooms, ICatalogue <IUser> users, ICatalogue <Event> events) { Rooms = (RoomCatalogue)rooms; Users = (UserCatalogue)users; Events = events.GetAllItems().Result; }
public async Task OnGetAsync() { listRoom = await RoomCatalogue.GetAllItems(); //listPart = await userCatalogue.GetAllItems(); }