示例#1
0
        public async Task <ActionResult <Game> > DeleteGame(Guid id)
        {
            var game = await _gamesService.DeleteGameAsync(id);

            if (game == null)
            {
                return(NotFound());
            }

            return(game);
        }
示例#2
0
        public async Task <IActionResult> OnPost(Guid id)
        {
            if (id == null)
            {
                return(BadRequest());
            }

            var game = await _gameService.GetGameByIdAsync(id);

            await _gameService.DeleteGameAsync(id);

            await _storageService.DeleteBlob(game.PhotoUrl);

            return(RedirectToPage("./Games"));
        }