public async Task <BookList> Create(CreateBookList input) { BookList newBookList = BookList.Create(input.Title, input.CreatorUserId); await _context.BookLists.AddAsync(newBookList); await _context.SaveChangesAsync(); return(newBookList); }
public async Task <ActionResult> Create(CreateBookList model) { if (ModelState.IsValid) { model.CreatorUserId = User.FindFirst(ClaimTypes.NameIdentifier).Value; var newItem = await _bookListService.Create(model); return(RedirectToAction("Index", "BookList")); } return(View()); }