public ActionResult <IEnumerable <Albums> > Get() { string page = Request.Query["page"]; string perPage = Request.Query["perpage"]; string genre = Request.Query["genre"]; int _page; int _perPage; IQueryable <Albums> albumQuery = _repo.Fetch(); if (Int32.TryParse(page, out _page) && Int32.TryParse(perPage, out _perPage)) { if (!String.IsNullOrEmpty(genre)) { return(_repo.GetGenrePage(genre, _page, _perPage).ToList()); } else { return(_repo.GetPage(_page, _perPage).ToList()); } } else { if (!String.IsNullOrEmpty(genre)) { return(_repo.GetGenre(genre).ToList()); } else { return(_repo.GetAll().OrderBy(x => x.Name).ToList()); } } }
public List <Album> GetAll() { return(_repository.GetAll()); }
public IEnumerable <Albums> GetAlbums() { return(_context.GetAll()); }