public IActionResult Create(Guid id) { var patrons = _library.GetAllPatrons(UserId()); var patronList = patrons.Select(x => new { x.Id, x.FullName }).ToList(); var selectList = new SelectList(patronList, "Id", "FullName"); var book = _library.GetBook(id, UserId()); var loanViewModel = new LoanViewModel() { BookId = id, PatronList = selectList, Title = $"{book.Title} ({book.Author})" }; return(View(loanViewModel)); }
public IActionResult Details(Guid id) { var book = _library.GetBook(id); return(View(book)); }