public static SeasonParticipantViewModel Create(SeasonLeagueUser participant, ICdnService cdnService) { var user = participant.LeagueUser.User; var profilePic = cdnService.GetUserProfilePicUrl(user.Id, user.ProfilePicKey, ClimbImageRules.ProfilePic); return(new SeasonParticipantViewModel(participant, profilePic)); }
public static Set Create(ApplicationDbContext dbContext, SeasonLeagueUser player1, SeasonLeagueUser player2, int leagueID) { var set = DbContextUtility.AddNew <Set>(dbContext, s => { s.LeagueID = leagueID; s.SeasonID = player1.Season.ID; s.Player1ID = player1.LeagueUserID; s.Player2ID = player2.LeagueUserID; s.SeasonPlayer1 = player1; s.SeasonPlayer2 = player2; s.Player1 = player1.LeagueUser; s.Player2 = player2.LeagueUser; }); return(set); }
public (int winnerPointDelta, int loserPointDelta) CalculatePointDeltas(SeasonLeagueUser winner, SeasonLeagueUser loser) { return(2, 1); }
private SeasonParticipantViewModel(SeasonLeagueUser participant, string profilePic) { Participant = participant; ProfilePic = profilePic; }