public async Task <IActionResult> Create([Bind("Id,Name,published")] ShoppingList shoppingList) { if (ModelState.IsValid) { await _shoppingListService.Create(shoppingList); return(RedirectToAction(nameof(Index))); } return(View(shoppingList)); }
public ShoppingListModel Create() { var shoppingList = _shoppingListService.Create(); return(new ShoppingListModel(shoppingList, _userService.Get(_userContext.UserId))); }