/// <summary> /// Visar detaljer om vald medlem /// </summary> /// <param name="id"></param> /// <returns></returns> public IActionResult Details(int?id) { if (id == null) { return(NotFound()); } var vm = new MemberDetailsVM(); vm.Member = _membersService.GetDetails(id); vm.Books = _membersService.GetAllMembersLoans(vm.Member.Loans); vm.Loans = _loanService.GetAllLoansForMember(id).ToList(); ViewBag.Debt = _loanService.LoanOverdue(vm.Loans); vm.TotalDebt = _loanService.GetTotalDebt(vm.Loans); return(View(vm)); }