Esempio n. 1
0
        public async Task <ViewResult> GetAllSongs(bool isSuccess, int?songId)

        {
            //var userId = _userManager.GetUserId(this.HttpContext.User);
            var datas = await _songRepository.GetAllSongs();

            ViewBag.IsSuccess = TempData["Alert"];
            ViewBag.SongId    = TempData["SongID"];
            //isSuccess = false;
            TempData["Alert"]  = false;
            TempData["SongID"] = 0;

            foreach (var data in datas)
            {
                data.CalculateTime = _songRepository.CalculateTime(data.CreatedOn.GetValueOrDefault());
            }

            return(View(datas));
            //return RedirectToAction(datas, new { isSuccess = true, songId = datas.Count() });
        }