public IList <IShow> GetAllShows() { var shows = _repo.FindAll().AsCached("Shows", new CachedQueryOptions() { OnInvalidated = (sender, args) => { // This code here is invoked when the query result is invalidated // Always check the args parameter to understand the type of invalidation that occured if (SqlNotificationSource.Data == args.NotificationEventArgs.Source && SqlNotificationType.Change == args.NotificationEventArgs.Type) { // This is a data change notificaiton, the result set has changed } } }); return(shows.ToList()); }
public IDictionary <IShow, IListenedShow> GetBothShowsByYear(int year, Guid userId) { var shows = _showRepo.FindAll().Where(x => x.ShowDate.Value.Year == year); var listened = GetAllShows().Where(x => x.UserId == userId && x.ShowDate.Year == year); var result = (from show in shows join listen in listened on show.Id equals listen.ShowId into temp from t in temp.DefaultIfEmpty() select new { Show = show, ListenedShow = t }); var dict = new Dictionary <IShow, IListenedShow>(); foreach (var r in result) { dict.Add(r.Show, r.ListenedShow); } return(dict); }
public IQueryable <IShow> GetAllShows() { return(_repo.FindAll()); }
public Show[] GetAll() { return(showRepository.FindAll().ToArray()); }
public List <Show> GetAll() { List <Show> all = showRepo.FindAll(); return(all); }
public List <Show> getAllShows() { return(_showRepository.FindAll()); }
public void AllShows() { List <Show> shows = showRepository.FindAll(); Assert.IsTrue(shows.Count == 4); }