public int GetWonMatchesCount(BDDModel.Team team) { return (from p in mDC.MatchParticipations where p.TeamID == team.TeamID && p.Goals > p.Match.MatchParticipations.Single(o => o != p).Goals select p).Count(); }
public int GetTotalMatchesCount(BDDModel.Team team) { return (from p in mDC.MatchParticipations where p.TeamID == team.TeamID select p).Count(); }
public int GetTotalGoalsScored(BDDModel.Team team) { return (from p in mDC.MatchParticipations where p.TeamID == team.TeamID select p.Goals).ToArray().Sum(); }
public int GetTotalGoalsReceived(BDDModel.Team team) { return (from p in mDC.MatchParticipations where p.TeamID == team.TeamID select p.Match.MatchParticipations.Single(o => o != p).Goals).ToArray().Sum(); }
public string GetFacebookUserName(BDDModel.Team team) { return team.Player.Name + " " + team.Player.Surname; }
private TransferModel.TeamDetails RefreshTeamDetailsInner(BDDModel.Team theTeam) { var ret = new TransferModel.TeamDetails(); // Para el calculo de los averages, cogemos sólo los titulares var myAlignedPlayers = (from sp in theTeam.SoccerPlayers where sp.FieldPosition < 100 select sp); ret.AverageWeight = (int)Math.Ceiling(myAlignedPlayers.Average(sp => sp.Weight)); ret.AverageSliding = (int)Math.Ceiling(myAlignedPlayers.Average(sp => sp.Sliding)); ret.AveragePower = (int)Math.Ceiling(myAlignedPlayers.Average(sp => sp.Power)); ret.Fitness = theTeam.Fitness; ret.SpecialSkillsIDs = (from s in theTeam.SpecialTrainings where s.IsCompleted select s.SpecialTrainingDefinitionID).ToList(); return ret; }