public DatabaseMigrationWorker(IUnitOfWorkFactory unitOfWorkFactory, IServiceScopeFactory serviceScopeFactory, IDataSeedService dataSeedService, IHostApplicationLifetime hostApplicationLifetime) { _unitOfWorkFactory = unitOfWorkFactory; _serviceScopeFactory = serviceScopeFactory; _dataSeedService = dataSeedService; _hostApplicationLifetime = hostApplicationLifetime; }
private IDataSeedService <Team> SetTeamService() { if (teamService == null) { teamService = new DataSeedService <Team>(Client); } return(teamService); }
private IDataSeedService <Tournament> SetTournamentService() { if (tournamentService == null) { tournamentService = new DataSeedService <Tournament>(Client); } return(tournamentService); }
private IDataSeedService <Umpire> UmpireService() { if (umpireService == null) { umpireService = new DataSeedService <Umpire>(Client); } return(umpireService); }
private IDataSeedService <Location> LocationService() { if (locationService == null) { locationService = new DataSeedService <Location>(Client); } return(locationService); }
public TournamentViewModel TournamentViewModel(string tournamentId) { tournamentService = tournamentService ?? SetTournamentService(); if (tournamentViewModel == null || tournamentViewModel.Tournament.Id != tournamentId) { tournamentViewModel = new TournamentViewModel(tournamentService, tournamentId); } return(tournamentViewModel); }
public MainPageViewModel(INavigationService navigationService, IDataSeedService dataSeedService) { _navigationService = navigationService; _dataSeedService = dataSeedService; DeleteCommand = new DelegateCommand(_Delete, _CanDelete); IncreaseGradeCommand = new DelegateCommand(_IncreaseGrade); AddAssignmentNavigationCommand = new DelegateCommand(_AddAssignmentNavigation); }
public TeamViewModel TeamViewModel(string teamId) { teamService = teamService ?? SetTeamService(); if (teamViewModel == null || teamViewModel.Team.Id != teamId) { teamViewModel = new TeamViewModel(teamService, teamId); } return(teamViewModel); }
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; }
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); }
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); }
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; }
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(); }
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") }); }
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"); }
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."); }
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"); }
public List <Tournament> Tournaments(IDataSeedService <Tournament> tournamentService) { this._tournamentService = tournamentService; return(_tournamentService.GetList().ToList()); }
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."); }
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"); }
public TeamListViewModel TeamListViewModel() { teamService = teamService ?? SetTeamService(); teamtListViewModel = teamtListViewModel ?? new TeamListViewModel(teamService, accessService); return(teamtListViewModel); }
public TournamentListViewModel TournamentListViewModel() { tournamentService = tournamentService ?? SetTournamentService(); tournamentListViewModel = tournamentListViewModel ?? new TournamentListViewModel(tournamentService, accessService); return(tournamentListViewModel); }