public async Task <IActionResult> Index() { if (User.IsInRole("Admin")) { return(View(await _bookListService.GetAll())); } string userId = User.FindFirst(ClaimTypes.NameIdentifier).Value; return(View(await _bookListService.GetAllByOwner(userId))); }
public ActionResult Index() { service.Load(); return(View(service.GetAll())); }