public LeagueViewModel(League league, bool isManager, bool userIsInLeague, bool userIsFollowingLeague)
 {
     LeagueID              = league.LeagueID;
     LeagueName            = league.LeagueName;
     LeagueManager         = new PlayerViewModel(league, league.LeagueManager, false);
     IsManager             = isManager;
     Archived              = league.Archived;
     Years                 = league.Years;
     ActiveYear            = Years.Max();
     PublicLeague          = league.PublicLeague;
     TestLeague            = league.TestLeague;
     UserIsInLeague        = userIsInLeague;
     UserIsFollowingLeague = userIsFollowingLeague;
     NumberOfFollowers     = league.NumberOfFollowers;
 }
        public LeagueViewModel(League league, bool isManager, IEnumerable <FantasyCriticUserRemovable> players, Maybe <LeagueInvite> outstandingInvite, FantasyCriticUser currentUser,
                               bool neverStarted, bool userIsInLeague, bool userIsFollowingLeague)
        {
            LeagueID      = league.LeagueID;
            LeagueName    = league.LeagueName;
            LeagueManager = new PlayerViewModel(league, league.LeagueManager, false);
            IsManager     = isManager;
            Years         = league.Years;
            ActiveYear    = Years.Max();

            if (outstandingInvite.HasValue)
            {
                OutstandingInvite = LeagueInviteViewModel.CreateWithDisplayName(outstandingInvite.Value, currentUser);
            }

            Players               = players.Select(x => new PlayerViewModel(league, x.User, x.Removable)).ToList();
            NeverStarted          = neverStarted;
            PublicLeague          = league.PublicLeague;
            TestLeague            = league.TestLeague;
            UserIsInLeague        = userIsInLeague;
            UserIsFollowingLeague = userIsFollowingLeague;
            NumberOfFollowers     = league.NumberOfFollowers;
        }
 public PlayerWithPublisherViewModel(LeagueYear leagueYear, FantasyCriticUser user, bool removable)
 {
     User = new PlayerViewModel(leagueYear.League, user, removable);
 }
Exemple #4
0
 public PlayerWithPublisherViewModel(LeagueYear leagueYear, FantasyCriticUser user, Publisher publisher, IClock clock)
 {
     User      = new PlayerViewModel(leagueYear.League, user);
     Publisher = new PublisherViewModel(publisher, clock);
 }
Exemple #5
0
 public PlayerWithPublisherViewModel(LeagueYear leagueYear, FantasyCriticUser user)
 {
     User = new PlayerViewModel(leagueYear.League, user);
 }