private void ValidatePlayer(int playerId)
{
var playerToDelete = _dataContext.GetQueryable<Player>()
.Include(p => p.PlayerGameResults)
.FirstOrDefault(p => p.Id == playerId);
if (playerToDelete == null)
{
throw new ArgumentException("Player not exists", nameof(playerId));
}
if (playerToDelete.PlayerGameResults.Any())
{
throw new Exception("You can not delete players with any played game");
}
}