Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        public ShoppingListModel Create()
        {
            var shoppingList = _shoppingListService.Create();

            return(new ShoppingListModel(shoppingList, _userService.Get(_userContext.UserId)));
        }