Esempio n. 1
0
        public async Task <ActionResult> SaveGame(BoardgameViewModel boardgameViewModel, string redirectUrl)
        {
            if (!ModelState.IsValid)
            {
                return(View(boardgameViewModel));
            }

            var boardgame = await _boardService.GetGameAsync(boardgameViewModel.Id);

            if (boardgame != null)
            {
                boardgame.ProductName = boardgameViewModel.Name;
                boardgame.Description = boardgameViewModel.Description;
                boardgame.ProductName = boardgameViewModel.ProductName;
                boardgame.Coast       = boardgameViewModel.Coast;
                boardgame.Count       = boardgameViewModel.Count;
                await _boardService.UpdategameAsync(boardgame);
            }

            return(RedirectToLocal(redirectUrl));
        }
Esempio n. 2
0
 public async Task <Boardgame> UpdategameAsync(Boardgame boardgame)
 {
     return(await _boardgameRepositiry.UpdategameAsync(boardgame));
 }