Exemplo n.º 1
0
        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 Index()
        {
            var patrons = _library.GetAllPatrons();

            return(View(patrons));
        }