public async Task <Player> GetPlayerById(int id, string userId) { var team = await _repository.GetById(id); if (team == null) { return(null); } return(team.ApplicationUserId == userId ? team : null); }