Fix message
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 34s
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 34s
This commit is contained in:
@@ -42,12 +42,9 @@ public class GameService(GameIdeasContext context, IMapper mapper)
|
||||
.Include(g => g.GameDevelopers).ThenInclude(p => p.Developer)
|
||||
.FirstOrDefaultAsync(g => g.Id == gameId);
|
||||
|
||||
if (game == null)
|
||||
{
|
||||
throw new NotFoundException($"[{typeof(Game).Name}] with ID {gameId} has not been found in context");
|
||||
}
|
||||
|
||||
return mapper.Map<GameDto>(game);
|
||||
return game == null
|
||||
? throw new NotFoundException($"[{typeof(Game).Name}] with ID {gameId} has not been found in context")
|
||||
: mapper.Map<GameDto>(game);
|
||||
}
|
||||
|
||||
public async Task<GameDto> CreateGame(GameDto gameDto)
|
||||
|
||||
Reference in New Issue
Block a user