/// <summary> /// Finds Tournament by given criteria /// </summary> /// <param name="criteria"> The criteria. </param> /// <returns> The <see cref="Player"/>. </returns> public List <Player> Execute(TeamPlayersCriteria criteria) { return(_unitOfWork.Context.Players .Where(p => p.TeamId == criteria.TeamId) .Select(GetPlayerMapping()) .ToList()); }
/// <summary> /// Finds Players by given criteria /// </summary> /// <param name="criteria"> The criteria. </param> /// <returns> The <see cref="Player"/>. </returns> public ICollection <Player> Execute(TeamPlayersCriteria criteria) { var players = _unitOfWork.Context.Players .Where(p => p.TeamId == criteria.TeamId) .ToList(); return(players.Select(p => GetPlayerMapping(p)).ToList()); }