public async Task <BookList> Update(UpdateBookList input) { var updateBookList = await Get(input.Id); updateBookList.Title = input.Title; _context.BookLists.Update(updateBookList); await _context.SaveChangesAsync(); return(updateBookList); }
public async Task <ActionResult> Update(int id) { var model = await _bookListService.Get(id); UpdateBookList updateModel = new UpdateBookList { Id = model.Id, CreatorUserId = model.CreatorUserId, Title = model.Title }; return(View(updateModel)); }
public async Task <ActionResult> Update(UpdateBookList model) { if (ModelState.IsValid) { var updatedBookList = await _bookListService.Update(model); UpdateBookList updateModel = new UpdateBookList { Id = updatedBookList.Id, CreatorUserId = updatedBookList.CreatorUserId, Title = updatedBookList.Title }; return(View(updateModel)); } return(View(model)); }