コード例 #1
0
 public DatabaseMigrationWorker(IUnitOfWorkFactory unitOfWorkFactory, IServiceScopeFactory serviceScopeFactory, IDataSeedService dataSeedService, IHostApplicationLifetime hostApplicationLifetime)
 {
     _unitOfWorkFactory       = unitOfWorkFactory;
     _serviceScopeFactory     = serviceScopeFactory;
     _dataSeedService         = dataSeedService;
     _hostApplicationLifetime = hostApplicationLifetime;
 }
コード例 #2
0
ファイル: Driver.cs プロジェクト: jjkst/CricketScoreSheetPro
 private IDataSeedService <Team> SetTeamService()
 {
     if (teamService == null)
     {
         teamService = new DataSeedService <Team>(Client);
     }
     return(teamService);
 }
コード例 #3
0
ファイル: Driver.cs プロジェクト: jjkst/CricketScoreSheetPro
 private IDataSeedService <Tournament> SetTournamentService()
 {
     if (tournamentService == null)
     {
         tournamentService = new DataSeedService <Tournament>(Client);
     }
     return(tournamentService);
 }
コード例 #4
0
ファイル: Driver.cs プロジェクト: jjkst/CricketScoreSheetPro
 private IDataSeedService <Umpire> UmpireService()
 {
     if (umpireService == null)
     {
         umpireService = new DataSeedService <Umpire>(Client);
     }
     return(umpireService);
 }
コード例 #5
0
ファイル: Driver.cs プロジェクト: jjkst/CricketScoreSheetPro
 private IDataSeedService <Location> LocationService()
 {
     if (locationService == null)
     {
         locationService = new DataSeedService <Location>(Client);
     }
     return(locationService);
 }
コード例 #6
0
ファイル: Driver.cs プロジェクト: jjkst/CricketScoreSheetPro
 public TournamentViewModel TournamentViewModel(string tournamentId)
 {
     tournamentService = tournamentService ?? SetTournamentService();
     if (tournamentViewModel == null || tournamentViewModel.Tournament.Id != tournamentId)
     {
         tournamentViewModel = new TournamentViewModel(tournamentService, tournamentId);
     }
     return(tournamentViewModel);
 }
コード例 #7
0
 public MainPageViewModel(INavigationService navigationService,
                          IDataSeedService dataSeedService)
 {
     _navigationService             = navigationService;
     _dataSeedService               = dataSeedService;
     DeleteCommand                  = new DelegateCommand(_Delete, _CanDelete);
     IncreaseGradeCommand           = new DelegateCommand(_IncreaseGrade);
     AddAssignmentNavigationCommand = new DelegateCommand(_AddAssignmentNavigation);
 }
コード例 #8
0
ファイル: Driver.cs プロジェクト: jjkst/CricketScoreSheetPro
 public TeamViewModel TeamViewModel(string teamId)
 {
     teamService = teamService ?? SetTeamService();
     if (teamViewModel == null || teamViewModel.Team.Id != teamId)
     {
         teamViewModel = new TeamViewModel(teamService, teamId);
     }
     return(teamViewModel);
 }
コード例 #9
0
 public NewGameViewModel(IClient client, IDataSeedService <Match> matchService, IDataSeedService <Team> teamService,
                         IDataSeedService <Location> locationService, IDataSeedService <Umpire> umpireService, bool isTournament = false)
 {
     this._client          = client;
     this._matchService    = matchService;
     this._teamService     = teamService;
     this._locationService = locationService;
     this._umpireService   = umpireService;
     this._isTournament    = isTournament;
 }
コード例 #10
0
ファイル: Driver.cs プロジェクト: jjkst/CricketScoreSheetPro
 public NewGameViewModel NewGameViewModel()
 {
     teamService     = teamService ?? SetTeamService();
     locationService = locationService ?? LocationService();
     umpireService   = umpireService ?? UmpireService();
     if (newgameViewModel == null)
     {
         newgameViewModel = new NewGameViewModel(Client, matchService, teamService, locationService, umpireService);
     }
     return(newgameViewModel);
 }
コード例 #11
0
        public List <Team> ImportedTeams(IDataSeedService <Tournament> tournamentService)
        {
            var access        = _accessService.GetList().FirstOrDefault(a => a.DocumentType == nameof(Tournament));
            var importedTeams = new List <Team>();

            foreach (var t in access.Documents)
            {
                var importedtournament = tournamentService.GetItem(t.Id);
                importedTeams.AddRange(importedtournament.Teams);
            }
            return(importedTeams);
        }
コード例 #12
0
 public SetupController(ISetupProvider setupProvider,
                        IUserSecurityStampStore <ApplicationUser> userSecurityStampStore,
                        IPasswordHasher <ApplicationUser> passwordHasher, IUserManager <ApplicationUser> userManager,
                        IDataSeedService dataSeedService, ILoginManager <ApplicationUser> loginManager)
 {
     _setupProvider          = setupProvider;
     _userSecurityStampStore = userSecurityStampStore;
     _passwordHasher         = passwordHasher;
     _userManager            = userManager;
     _loginManager           = loginManager;
     _dataSeedService        = dataSeedService;
 }
コード例 #13
0
        public BatsmanStatisticsViewModel(IDataSeedService <PlayerInning> playerInningService, string filter)
        {
            _playerInningService = playerInningService ?? throw new ArgumentNullException($"playerService is null, cannot get match.");

            IExpression condition = Expression.Property("type").EqualTo(Expression.String("PlayerInning"));

            if (filter == "only tournament matches")
            {
                condition.Add(Expression.Property("tournamentId").IsNot(Expression.String(string.Empty)));
            }

            List <PlayerInning> playerinnings = _playerInningService.GetFilteredList(condition).ToList();

            BatsmanStatistics = playerinnings.GroupBy(pi => pi.PlayerId).Select(p => new PlayerStatistics(p.ToList())).ToList();
        }
コード例 #14
0
 public BatsmanStatisticsPageTest()
 {
     Client = new TestClient();
     PlayerInningService = new DataSeedService <PlayerInning>(Client);
     var homeplayerinningId = PlayerInningService.Create(new PlayerInning
     {
         PlayerName = "PlayerName",
     }, new KeyValuePair <string, string>[]
     {
         new KeyValuePair <string, string>("matchId", "MatchId"),
         new KeyValuePair <string, string>("tournamentId", "TournamentId"),
         new KeyValuePair <string, string>("teamId", "TeamId"),
         new KeyValuePair <string, string>("playerId", "TeamId:PlayerName")
     });
 }
コード例 #15
0
 public TournamentViewModel(IDataSeedService <Tournament> tournamentService, string tournamentId)
 {
     _tournamentService = tournamentService ?? throw new ArgumentNullException($"TournamentService is null, cannot get tournaments.");
     Tournament         = _tournamentService.GetItem(tournamentId) ?? throw new ArgumentNullException($"Tournament Id is not exist");
 }
コード例 #16
0
 public TeamListViewModel(IDataSeedService <Team> teamService, IDataSeedService <Access> accessService)
 {
     _teamService   = teamService ?? throw new ArgumentNullException($"TeamService is null, cannot get teams.");
     _accessService = accessService ?? throw new ArgumentNullException($"AccessService is null, cannot get tournaments.");
 }
コード例 #17
0
 public MatchViewModel(IDataSeedService <Match> matchService, string matchId)
 {
     _matchService = matchService ?? throw new ArgumentNullException($"matchService is null, cannot get match.");
     Match         = _matchService.GetItem(matchId) ?? throw new ArgumentNullException($"Match Id is not exist");
 }
コード例 #18
0
 public List <Tournament> Tournaments(IDataSeedService <Tournament> tournamentService)
 {
     this._tournamentService = tournamentService;
     return(_tournamentService.GetList().ToList());
 }
コード例 #19
0
 public MatchListViewModel(IDataSeedService <Match> matchService, IDataSeedService <Access> accessService)
 {
     _matchService  = matchService ?? throw new ArgumentNullException($"MatchService is null, cannot get tournaments.");
     _accessService = accessService ?? throw new ArgumentNullException($"AccessService is null, cannot get tournaments.");
 }
コード例 #20
0
 public TeamViewModel(IDataSeedService <Team> teamService, string teamId)
 {
     _teamService = teamService ?? throw new ArgumentNullException($"TeamService is null, cannot get teams.");
     Team         = _teamService.GetItem(teamId) ?? throw new ArgumentNullException($"Team Id is not exist");
 }
コード例 #21
0
ファイル: Driver.cs プロジェクト: jjkst/CricketScoreSheetPro
 public TeamListViewModel TeamListViewModel()
 {
     teamService        = teamService ?? SetTeamService();
     teamtListViewModel = teamtListViewModel ?? new TeamListViewModel(teamService, accessService);
     return(teamtListViewModel);
 }
コード例 #22
0
ファイル: Driver.cs プロジェクト: jjkst/CricketScoreSheetPro
 public TournamentListViewModel TournamentListViewModel()
 {
     tournamentService       = tournamentService ?? SetTournamentService();
     tournamentListViewModel = tournamentListViewModel ?? new TournamentListViewModel(tournamentService, accessService);
     return(tournamentListViewModel);
 }