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

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

            return(game);
        }
        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"));
        }