public async Task <IActionResult> Index() { if (!await _sessionService.IsAuthentificateAsync()) { return(RedirectToAction("Login", "Library")); } return(View(_bookService.GetAll(_sessionService.GetCurrentLibraryId()))); }
public async Task<IActionResult> Update() { if (! await _sessionService.IsAuthentificateAsync()) { return RedirectToAction("Login"); } return View(_db.Libraries.FirstOrDefault(x => x.Id == _sessionService.GetCurrentLibraryId())); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> private LibraryUser GetUserById(int id) { return(_db.LibraryUsers.FirstOrDefault(x => x.LibraryId == _sessionService.GetCurrentLibraryId() && x.Id == id)); }