Exemplo n.º 1
0
        public IList <T> Search <T>(PlaylistSearchModel model)
        {
            var playlists = this.context.Playlists
                            .Where(p => p.DeletedOn == null);

            if (model.Name != null)
            {
                playlists = playlists.Where(p => p.Name == model.Name);
            }

            return(playlists.To <T>().ToList());
        }
Exemplo n.º 2
0
        public IList <T> SearchOwn <T>(PlaylistSearchModel model, string userId)
        {
            var playlists = this.context.Playlists
                            .Where(p => p.DeletedOn == null &&
                                   p.UserId == userId);

            if (model.Name != null)
            {
                playlists = playlists.Where(p => p.Name == model.Name);
            }

            return(playlists.To <T>().ToList());
        }
 public ActionResult <IEnumerable <PlaylistViewModel> > SearchOwn(PlaylistSearchModel model)
 => this.Ok(this.playlistService.SearchOwn <PlaylistViewModel>(model, this.userManager.GetUserId(this.User)));
 public ActionResult <IEnumerable <PlaylistViewModel> > Search(PlaylistSearchModel model)
 => this.Ok(this.playlistService.Search <PlaylistViewModel>(model));