public ActionResult Index(string sort, string search) { ViewBag.Title = "Album list"; var model = _albumsService.GetAlbums(sort, search); return(View(model)); }
public async Task <List <Album> > Get(int userId) { if (userId == 0) { return(await _albumsService.GetAlbums()); } else { return(await _albumsService.GetAlbumsByUserId(userId)); } }
public async Task <JsonResult> GetAlbums() { List <Album> albums = await albumsService.GetAlbums(); return(Json(albums, JsonRequestBehavior.AllowGet)); }
public async Task <IActionResult> Index() { var albums = await _albumsService.GetAlbums(); return(View(albums)); }