コード例 #1
0
        public ActionResult Index(string sort, string search)
        {
            ViewBag.Title = "Album list";
            var model = _albumsService.GetAlbums(sort, search);

            return(View(model));
        }
コード例 #2
0
 public async Task <List <Album> > Get(int userId)
 {
     if (userId == 0)
     {
         return(await _albumsService.GetAlbums());
     }
     else
     {
         return(await _albumsService.GetAlbumsByUserId(userId));
     }
 }
コード例 #3
0
        public async Task <JsonResult> GetAlbums()
        {
            List <Album> albums = await albumsService.GetAlbums();

            return(Json(albums, JsonRequestBehavior.AllowGet));
        }
コード例 #4
0
        public async Task <IActionResult> Index()
        {
            var albums = await _albumsService.GetAlbums();

            return(View(albums));
        }