예제 #1
0
        public async Task <IActionResult> Lend(int bookId)
        {
            var result = await _interactor.GetAsync(bookId);

            if (!result.Success)
            {
                return(NotFound());
            }

            var model = new LendingViewModel
            {
                BookId   = bookId,
                BookName = result.Entity.Author + ", " + result.Entity.Name,
                Lenders  = await GetLendersDropdown(),
                From     = DateTime.Now,
                To       = DateTime.Now.AddDays(14)
            };

            return(View("Lend", model));
        }