private void ListView_MemberSportsSelection(object sender, SelectionChangedEventArgs e) { var item = (sender as ListView).SelectedItem as Sport; if (item != null) { Sports.Add(item); MemberSports.Remove(item); Clubs.Clear(); foreach (Sport memberSport in MemberSports) { foreach (Club clubMemberSport in memberSport.Clubs) { Clubs.Add(clubMemberSport); } } var memClubs = new List <Club>(); foreach (Club c in MemberClubs) { memClubs.Add(c); } foreach (Club c in memClubs) { foreach (Club club in item.Clubs) { if (club.Id == c.Id) { MemberClubs.Remove(c); } } } } }
async Task ExecuteLoadSearchResultsCommand(string term) { IsBusy = true; try { var results = await SportnetStore.GetSearchResults(term); Clubs.Clear(); Persons.Clear(); Competitions.Clear(); Unions.Clear(); foreach (var item in results) { switch (item.Type) { case "person": Persons.Add(item); break; case "club": Clubs.Add(item); break; case "competition": Competitions.Add(item); break; case "union": Unions.Add(item); break; default: break; } } IsLoaded = true; } catch (Exception ex) { Debug.WriteLine(ex); var log = new ErrorLog() { ExceptionType = ex.GetType().ToString(), Status = ErrorLog.LogStatus.Unread, Message = ex.Message, ObjectId = term, Action = "Searching", Datetime = DateTime.Now, }; await LogError(log); } finally { IsBusy = false; } }
private void ListView_MemberClubsSelection(object sender, SelectionChangedEventArgs e) { var item = (sender as ListView).SelectedItem as Club; if (item != null) { Clubs.Add(item); MemberClubs.Remove(item); } }
public void ClearDb() { Players.RemoveRange(Players); ManagerProfiles.RemoveRange(ManagerProfiles); Clubs.RemoveRange(Clubs); Clubs.Add(new Club() { Id = 1, Name = "Free Agent", HomeColor = "#00FFFFFF", AwayColor = "#00FFFFFF", ThirdColor = "#00FFFFFF", IsDefault = true }); SaveChanges(); }
public void Add(Club aClub) { if (GetByRegNum((uint)aClub.Number) != null) { throw new Exception("Invalid club record. Club with the registration number already exists:"); } else { Clubs.Add(aClub); } }
public void Add(Club club) { if (Clubs.Contains(club)) { throw (new Exception("Club already exist!")); } else { Clubs.Add(club); } }
public void HandleLine(string line) { var registration = new RegistrationModel(line); Registrations.Add(registration); var club = Clubs.FirstOrDefault(club => club.Name == registration.Club); if (club == null) { club = new Club(registration.Club); Clubs.Add(club); } club.Add(registration); }
//private void FormClubs_Load(object sender, EventArgs e) //{ // foreach (var item in Clubs) // { // lsbClubs.Items.Add(item.Name); // } // foreach (var item in Swimmers) // { // lsbFreeRegistrants.Items.Add(item.Name); // } //} private void btnAddClub_Click(object sender, EventArgs e) { if ((txtClubPhone.Text.Length == 10 && (long.TryParse(txtClubPhone.Text, out long phone)))) { Club aClub = new Club(txtClubName.Text, new Address(txtClubStreet.Text, txtClubCity.Text, txtClubProvince.Text, txtClubPostal.Text), phone); txtClubName.Text = String.Empty; txtClubStreet.Text = String.Empty; txtClubCity.Text = String.Empty; txtClubProvince.Text = String.Empty; txtClubPostal.Text = String.Empty; txtClubPhone.Text = String.Empty; Clubs.Add(aClub); lblClubAddText.Text = "Club" + txtClubName.Text + " was added successfully"; formMain.Clubs = Clubs; lsbClubs.Items.Add(aClub.Name); }
private async Task ViewLoaded() { if (!_viewModelLoaded) { Clubs.Clear(); List <ClubSummary> clubList = await _stravaService.GetClubsAsync(); if (clubList != null && clubList.Any()) { foreach (ClubSummary clubSummary in clubList) { Clubs.Add(clubSummary); } } _viewModelLoaded = true; } }
void LoadClubs(SqliteConnection conn) { bool shouldClose = false; // Is the database already open? if (conn.State != ConnectionState.Open) { shouldClose = true; conn.Open(); } // Execute query using (var command = conn.CreateCommand()) { try { // Create new command command.CommandText = "SELECT DISTINCT ID FROM [Club]"; using (var reader = command.ExecuteReader()) { while (reader.Read()) { var club = new ClubModel(); var id = (string)reader["ID"]; club.Load(conn, id); //AddPersoon(persoon); Clubs.Add(club); } } } catch (Exception Exception) { Debug.WriteLine(Exception.Message); } } if (shouldClose) { conn.Close(); } }
//methods public void Add(Club aClub) { try { for (int i = 0; i < Number; i++) { if (Clubs[i] == aClub) { throw new Exception($"Error: Club {aClub.Name} already exists in clubs-list"); } } Clubs.Add(aClub); Number++; } catch (IndexOutOfRangeException) { Console.WriteLine("Error: Clubs list is full!"); } }
private void ListView_ItemSelection(object sender, SelectionChangedEventArgs e) { var item = (sender as ListView).SelectedItem as Member; if (item != null) { Member = item as Member; MemberClubs = new ObservableCollection <Club>(); MemberSports = new ObservableCollection <Sport>(); Clubs.Clear(); Sports.Clear(); foreach (Sport s in AllSports) { Sports.Add(s); } foreach (Club club in Member.Clubs) { MemberClubs.Add(club); } foreach (Sport sport in Member.Sports) { MemberSports.Add(sport); foreach (Club c in sport.Clubs) { Clubs.Add(c); } } foreach (Club club in MemberClubs) { var filteredClub = Clubs.FirstOrDefault(c => c.Id == club.Id); Clubs.Remove(filteredClub); } foreach (Sport sport in MemberSports) { var filteredSport = AllSports.FirstOrDefault(s => s.Id == sport.Id); Sports.Remove(filteredSport); } } }
/// <summary> /// Add points to the named club /// </summary> /// <param name="clubName">name of club</param> /// <param name="points">Team Trophy points to add</param> public void AddNewClubPoints( string clubName, ITeamTrophyEvent points) { IClubSeasonDetails clubDetails = Clubs.Find(club => club.Name.CompareTo(clubName) == 0); if (clubDetails != null) { clubDetails.AddNewEvent(points); } else { ClubSeasonDetails newClubDetails = new ClubSeasonDetails(clubName); newClubDetails.AddNewEvent(points); Clubs.Add(newClubDetails); } this.ClubsChangedEvent?.Invoke(this, new EventArgs()); }
//Adding new Club to the list private void btnAdd_Click(object sender, EventArgs e) { sog.AddAssign(); if (string.IsNullOrEmpty(txtName.Text)) { MessageBox.Show("Please Enter your Name", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (txtCity.Text == "") { txtCity.Text = "N/A"; } long phoneNo = 0; try { phoneNo = long.Parse(txtPhNo.Text); } catch { MessageBox.Show("Please Check your Phone number", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { Club newClub = new Club(txtName.Text, new Address(txtStreet.Text, txtCity.Text, txtPro.Text, txtPostCode.Text), phoneNo); Clubs.Add(newClub); home = new Home(); home.Clubs = Clubs; lbClubs.Items.Add(newClub.Name); //Displaying Message MessageBox.Show($"Club {newClub.Name} Added Sucessfully", "SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information); DefaultValues(); } catch { } }
private void UpdateClubs(object sender, NotifyCollectionChangedEventArgs e) { string savedFilter = SelectedClub; var clubs = (from fighter in Fighters select fighter.Club).Distinct(); Clubs.Clear(); Clubs.Add("*"); foreach (string club in clubs) { Clubs.Add(club); } if (Clubs.Contains(savedFilter)) { SelectedClub = savedFilter; } else { SelectedClub = "*"; } }
private void ListView_SportInSportsSelection(object sender, SelectionChangedEventArgs e) { var item = (sender as ListView).SelectedItem as Sport; if (item != null) { Sports.Remove(item); MemberSports.Add(item); Clubs.Clear(); foreach (Sport s in MemberSports) { foreach (Club c in s.Clubs) { Clubs.Add(c); } } foreach (Club club in MemberClubs) { var filteredClub = Clubs.FirstOrDefault(c => c.Id == club.Id); Clubs.Remove(filteredClub); } } }
public void Add(Club club) { Clubs.Add(club); numberOfClubs++; }
public bool AddClub(ClubModel _club) { Clubs.Add(_club); return(true); }
public void InsertClub(Club club) { Clubs.Add(club); SaveChanges(); }
/*Add Method to add club*/ public void Add(Club newClub) { Clubs.Add(newClub); Number++; }
public void Load(string fileName, string delimeter) { char deli = Convert.ToChar(delimeter); string record; FileStream fileIn = null; StreamReader reader = null; try { fileIn = new FileStream(fileName, FileMode.Open, FileAccess.Read); reader = new StreamReader(fileIn); record = reader.ReadLine(); while (record != null) { try { string[] fields = record.Split(deli); if (fields[0] != "" && fields[6].Length == 10) { int clubNumber = Convert.ToInt32(fields[0]); long phoneNumber = Convert.ToInt64(fields[6]); Club result = new Club(clubNumber, fields[1], new Address(fields[2], fields[3], fields[4], fields[5]), phoneNumber); if (GetByRegNum(clubNumber) == null) { Clubs.Add(result); } else { throw new Exception($"Invalid club record. Club with the registration number already exists:\n {record}"); } } else if (fields[0] == "") { throw new Exception($"Invalid club record. Club number is not valid:\n {record}"); } else if (fields[6].Length != 10) { throw new Exception($"Invalid club record. Phone number wrong format:\n {record}"); } } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { record = reader.ReadLine(); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { if (reader != null) { reader.Close(); } if (fileIn != null) { fileIn.Close(); } } }
private void GenerateSeedData() { var oversHelper = new OversHelper(); var playerIdentityFinder = new PlayerIdentityFinder(); var playerInMatchStatisticsBuilder = new PlayerInMatchStatisticsBuilder(playerIdentityFinder, oversHelper); var seedDataGenerator = new SeedDataGenerator(oversHelper, new BowlingFiguresCalculator(oversHelper), playerIdentityFinder, new TeamFakerFactory(), new MatchLocationFakerFactory(), new SchoolFakerFactory()); using (var connection = ConnectionFactory.CreateDatabaseConnection()) { connection.Open(); var repo = new SqlServerIntegrationTestsRepository(connection, playerInMatchStatisticsBuilder); repo.CreateUmbracoBaseRecords(); var members = seedDataGenerator.CreateMembers(); foreach (var member in members) { repo.CreateMember(member); } ClubWithMinimalDetails = seedDataGenerator.CreateClubWithMinimalDetails(); repo.CreateClub(ClubWithMinimalDetails); Clubs.Add(ClubWithMinimalDetails); ClubWithOneTeam = seedDataGenerator.CreateClubWithMinimalDetails(); repo.CreateClub(ClubWithOneTeam); Clubs.Add(ClubWithOneTeam); var onlyTeamInClub = seedDataGenerator.CreateTeamWithMinimalDetails("Only team in the club"); ClubWithOneTeam.Teams.Add(onlyTeamInClub); onlyTeamInClub.Club = ClubWithOneTeam; repo.CreateTeam(onlyTeamInClub); Teams.Add(onlyTeamInClub); ClubWithTeamsAndMatchLocation = seedDataGenerator.CreateClubWithTeams(); MatchLocationForClub = seedDataGenerator.CreateMatchLocationWithMinimalDetails(); MatchLocationForClub.PrimaryAddressableObjectName = "Club PAON"; MatchLocationForClub.SecondaryAddressableObjectName = "Club SAON"; MatchLocationForClub.Locality = "Club locality"; MatchLocationForClub.Town = "Club town"; MatchLocationForClub.AdministrativeArea = "Club area"; var teamWithMatchLocation = ClubWithTeamsAndMatchLocation.Teams.First(x => !x.UntilYear.HasValue); teamWithMatchLocation.MatchLocations.Add(MatchLocationForClub); MatchLocationForClub.Teams.Add(teamWithMatchLocation); repo.CreateClub(ClubWithTeamsAndMatchLocation); Clubs.Add(ClubWithTeamsAndMatchLocation); foreach (var team in ClubWithTeamsAndMatchLocation.Teams) { repo.CreateTeam(team); foreach (var matchLocation in team.MatchLocations) { repo.CreateMatchLocation(matchLocation); repo.AddTeamToMatchLocation(team, matchLocation); MatchLocations.Add(matchLocation); } } Teams.AddRange(ClubWithTeamsAndMatchLocation.Teams); TeamWithMinimalDetails = seedDataGenerator.CreateTeamWithMinimalDetails("Team minimal"); repo.CreateTeam(TeamWithMinimalDetails); Teams.Add(TeamWithMinimalDetails); TeamWithFullDetails = seedDataGenerator.CreateTeamWithFullDetails("Team with full details"); repo.CreateTeam(TeamWithFullDetails); Teams.Add(TeamWithFullDetails); foreach (var matchLocation in TeamWithFullDetails.MatchLocations) { repo.CreateMatchLocation(matchLocation); foreach (var team in matchLocation.Teams) { if (team.TeamId != TeamWithFullDetails.TeamId) { repo.CreateTeam(team); Teams.Add(team); } repo.AddTeamToMatchLocation(team, matchLocation); } MatchLocations.Add(matchLocation); } repo.CreateCompetition(TeamWithFullDetails.Seasons[0].Season.Competition); Competitions.Add(TeamWithFullDetails.Seasons[0].Season.Competition); foreach (var season in TeamWithFullDetails.Seasons) { repo.CreateSeason(season.Season, season.Season.Competition.CompetitionId.Value); repo.AddTeamToSeason(season); Seasons.Add(season.Season); } MatchInThePastWithMinimalDetails = seedDataGenerator.CreateMatchInThePastWithMinimalDetails(); repo.CreateMatch(MatchInThePastWithMinimalDetails); Matches.Add(MatchInThePastWithMinimalDetails); MatchListings.Add(MatchInThePastWithMinimalDetails.ToMatchListing()); MatchInTheFutureWithMinimalDetails = seedDataGenerator.CreateMatchInThePastWithMinimalDetails(); MatchInTheFutureWithMinimalDetails.StartTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTimeOffset.UtcNow.AccurateToTheMinute().AddMonths(1), UkTimeZone()); repo.CreateMatch(MatchInTheFutureWithMinimalDetails); Matches.Add(MatchInTheFutureWithMinimalDetails); MatchListings.Add(MatchInTheFutureWithMinimalDetails.ToMatchListing()); MatchInThePastWithFullDetails = seedDataGenerator.CreateMatchInThePastWithFullDetails(members); repo.CreateMatchLocation(MatchInThePastWithFullDetails.MatchLocation); var playersForMatchInThePastWithFullDetails = playerIdentityFinder.PlayerIdentitiesInMatch(MatchInThePastWithFullDetails); MatchInThePastWithFullDetails.Teams[0].Team.UntilYear = 2020; foreach (var team in MatchInThePastWithFullDetails.Teams) { repo.CreateTeam(team.Team); } foreach (var player in playersForMatchInThePastWithFullDetails) { repo.CreatePlayer(player.Player); repo.CreatePlayerIdentity(player); } repo.CreateCompetition(MatchInThePastWithFullDetails.Season.Competition); repo.CreateSeason(MatchInThePastWithFullDetails.Season, MatchInThePastWithFullDetails.Season.Competition.CompetitionId.Value); repo.CreateMatch(MatchInThePastWithFullDetails); Teams.AddRange(MatchInThePastWithFullDetails.Teams.Select(x => x.Team)); Competitions.Add(MatchInThePastWithFullDetails.Season.Competition); Seasons.Add(MatchInThePastWithFullDetails.Season); MatchLocations.Add(MatchInThePastWithFullDetails.MatchLocation); Matches.Add(MatchInThePastWithFullDetails); MatchListings.Add(MatchInThePastWithFullDetails.ToMatchListing()); PlayerIdentities.AddRange(playerIdentityFinder.PlayerIdentitiesInMatch(MatchInThePastWithFullDetails)); MatchInThePastWithFullDetails.History.AddRange(new[] { new AuditRecord { Action = AuditAction.Create, ActorName = nameof(SqlServerDataSourceFixture), AuditDate = DateTimeOffset.UtcNow.AccurateToTheMinute().AddMonths(-1), EntityUri = MatchInThePastWithFullDetails.EntityUri }, new AuditRecord { Action = AuditAction.Update, ActorName = nameof(SqlServerDataSourceFixture), AuditDate = DateTimeOffset.UtcNow.AccurateToTheMinute(), EntityUri = MatchInThePastWithFullDetails.EntityUri } }); foreach (var audit in MatchInThePastWithFullDetails.History) { repo.CreateAudit(audit); } TournamentInThePastWithMinimalDetails = seedDataGenerator.CreateTournamentInThePastWithMinimalDetails(); repo.CreateTournament(TournamentInThePastWithMinimalDetails); Tournaments.Add(TournamentInThePastWithMinimalDetails); MatchListings.Add(TournamentInThePastWithMinimalDetails.ToMatchListing()); TournamentInTheFutureWithMinimalDetails = seedDataGenerator.CreateTournamentInThePastWithMinimalDetails(); TournamentInTheFutureWithMinimalDetails.StartTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTimeOffset.UtcNow.AccurateToTheMinute().AddMonths(1), UkTimeZone()); repo.CreateTournament(TournamentInTheFutureWithMinimalDetails); Tournaments.Add(TournamentInTheFutureWithMinimalDetails); MatchListings.Add(TournamentInTheFutureWithMinimalDetails.ToMatchListing()); TournamentInThePastWithFullDetails = seedDataGenerator.CreateTournamentInThePastWithFullDetails(members); Teams.AddRange(TournamentInThePastWithFullDetails.Teams.Select(x => x.Team)); MatchInThePastWithFullDetails.Teams[0].Team.UntilYear = 2020; foreach (var team in TournamentInThePastWithFullDetails.Teams) { repo.CreateTeam(team.Team); } MatchLocations.Add(TournamentInThePastWithFullDetails.TournamentLocation); repo.CreateMatchLocation(TournamentInThePastWithFullDetails.TournamentLocation); repo.CreateTournament(TournamentInThePastWithFullDetails); foreach (var team in TournamentInThePastWithFullDetails.Teams) { repo.AddTeamToTournament(team, TournamentInThePastWithFullDetails); } foreach (var season in TournamentInThePastWithFullDetails.Seasons) { repo.CreateCompetition(season.Competition); Competitions.Add(season.Competition); repo.CreateSeason(season, season.Competition.CompetitionId.Value); repo.AddTournamentToSeason(TournamentInThePastWithFullDetails, season); Seasons.Add(season); } Tournaments.Add(TournamentInThePastWithFullDetails); MatchListings.Add(TournamentInThePastWithFullDetails.ToMatchListing()); for (var i = 0; i < 5; i++) { var tournamentMatch = seedDataGenerator.CreateMatchInThePastWithMinimalDetails(); tournamentMatch.Tournament = TournamentInThePastWithFullDetails; tournamentMatch.StartTime = TournamentInThePastWithFullDetails.StartTime.AddHours(i); tournamentMatch.OrderInTournament = i + 1; repo.CreateMatch(tournamentMatch); Matches.Add(tournamentMatch); TournamentMatchListings.Add(tournamentMatch.ToMatchListing()); } TournamentInThePastWithFullDetails.History.AddRange(new[] { new AuditRecord { Action = AuditAction.Create, ActorName = nameof(SqlServerDataSourceFixture), AuditDate = DateTimeOffset.UtcNow.AccurateToTheMinute().AddMonths(-2), EntityUri = TournamentInThePastWithFullDetails.EntityUri }, new AuditRecord { Action = AuditAction.Update, ActorName = nameof(SqlServerDataSourceFixture), AuditDate = DateTimeOffset.UtcNow.AccurateToTheMinute().AddDays(-7), EntityUri = TournamentInThePastWithFullDetails.EntityUri } }); foreach (var audit in TournamentInThePastWithFullDetails.History) { repo.CreateAudit(audit); } MatchInThePastWithFullDetailsAndTournament = seedDataGenerator.CreateMatchInThePastWithFullDetails(members); MatchInThePastWithFullDetailsAndTournament.Tournament = TournamentInThePastWithMinimalDetails; MatchInThePastWithFullDetailsAndTournament.Season.FromYear = MatchInThePastWithFullDetailsAndTournament.Season.UntilYear = 2018; repo.CreateMatchLocation(MatchInThePastWithFullDetailsAndTournament.MatchLocation); foreach (var team in MatchInThePastWithFullDetailsAndTournament.Teams) { repo.CreateTeam(team.Team); } var playersForMatchInThePastWithFullDetailsAndTournament = playerIdentityFinder.PlayerIdentitiesInMatch(MatchInThePastWithFullDetailsAndTournament); foreach (var player in playersForMatchInThePastWithFullDetailsAndTournament) { repo.CreatePlayer(player.Player); repo.CreatePlayerIdentity(player); } repo.CreateCompetition(MatchInThePastWithFullDetailsAndTournament.Season.Competition); repo.CreateSeason(MatchInThePastWithFullDetailsAndTournament.Season, MatchInThePastWithFullDetailsAndTournament.Season.Competition.CompetitionId.Value); repo.CreateMatch(MatchInThePastWithFullDetailsAndTournament); Teams.AddRange(MatchInThePastWithFullDetailsAndTournament.Teams.Select(x => x.Team)); Competitions.Add(MatchInThePastWithFullDetailsAndTournament.Season.Competition); MatchLocations.Add(MatchInThePastWithFullDetailsAndTournament.MatchLocation); Matches.Add(MatchInThePastWithFullDetailsAndTournament); TournamentMatchListings.Add(MatchInThePastWithFullDetailsAndTournament.ToMatchListing()); Seasons.Add(MatchInThePastWithFullDetailsAndTournament.Season); PlayerIdentities.AddRange(playerIdentityFinder.PlayerIdentitiesInMatch(MatchInThePastWithFullDetailsAndTournament)); CompetitionWithMinimalDetails = seedDataGenerator.CreateCompetitionWithMinimalDetails(); repo.CreateCompetition(CompetitionWithMinimalDetails); Competitions.Add(CompetitionWithMinimalDetails); CompetitionWithFullDetails = seedDataGenerator.CreateCompetitionWithFullDetails(); repo.CreateCompetition(CompetitionWithFullDetails); foreach (var season in CompetitionWithFullDetails.Seasons) { repo.CreateSeason(season, CompetitionWithFullDetails.CompetitionId.Value); Seasons.Add(season); } Competitions.Add(CompetitionWithFullDetails); var competitionForSeason = seedDataGenerator.CreateCompetitionWithMinimalDetails(); competitionForSeason.UntilYear = 2021; SeasonWithMinimalDetails = seedDataGenerator.CreateSeasonWithMinimalDetails(competitionForSeason, 2020, 2020); competitionForSeason.Seasons.Add(SeasonWithMinimalDetails); repo.CreateCompetition(competitionForSeason); repo.CreateSeason(SeasonWithMinimalDetails, competitionForSeason.CompetitionId.Value); Competitions.Add(competitionForSeason); Seasons.Add(SeasonWithMinimalDetails); SeasonWithFullDetails = seedDataGenerator.CreateSeasonWithFullDetails(competitionForSeason, 2021, 2021, seedDataGenerator.CreateTeamWithMinimalDetails("Team 1 in season"), seedDataGenerator.CreateTeamWithMinimalDetails("Team 2 in season")); competitionForSeason.Seasons.Add(SeasonWithFullDetails); Teams.AddRange(SeasonWithFullDetails.Teams.Select(x => x.Team)); foreach (var team in SeasonWithFullDetails.Teams) { repo.CreateTeam(team.Team); } repo.CreateSeason(SeasonWithFullDetails, competitionForSeason.CompetitionId.Value); foreach (var team in SeasonWithFullDetails.Teams) { repo.AddTeamToSeason(team); } Seasons.Add(SeasonWithFullDetails); MatchLocationWithMinimalDetails = seedDataGenerator.CreateMatchLocationWithMinimalDetails(); repo.CreateMatchLocation(MatchLocationWithMinimalDetails); MatchLocations.Add(MatchLocationWithMinimalDetails); MatchLocationWithFullDetails = seedDataGenerator.CreateMatchLocationWithFullDetails(); repo.CreateMatchLocation(MatchLocationWithFullDetails); Teams.AddRange(MatchLocationWithFullDetails.Teams); MatchLocations.Add(MatchLocationWithFullDetails); foreach (var team in Teams.Where(t => t.Club == null || t.Club.ClubId == ClubWithOneTeam.ClubId)) { TeamListings.Add(team.ToTeamListing()); } foreach (var club in Clubs.Where(c => c.Teams.Count == 0 || c.Teams.Count > 1)) { TeamListings.Add(club.ToTeamListing()); } for (var i = 0; i < 30; i++) { var competition = seedDataGenerator.CreateCompetitionWithMinimalDetails(); repo.CreateCompetition(competition); Competitions.Add(competition); var matchLocation = seedDataGenerator.CreateMatchLocationWithMinimalDetails(); repo.CreateMatchLocation(matchLocation); MatchLocations.Add(matchLocation); var match = seedDataGenerator.CreateMatchInThePastWithMinimalDetails(); match.MatchLocation = matchLocation; match.StartTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTimeOffset.UtcNow.AccurateToTheMinute().AddMonths(i - 15), UkTimeZone()); match.MatchType = i % 2 == 0 ? MatchType.FriendlyMatch : MatchType.LeagueMatch; match.PlayerType = i % 3 == 0 ? PlayerType.Mixed : PlayerType.Ladies; match.Comments = seedDataGenerator.CreateComments(i, members); repo.CreateMatch(match); Matches.Add(match); MatchListings.Add(match.ToMatchListing()); var tournament = seedDataGenerator.CreateTournamentInThePastWithMinimalDetails(); tournament.TournamentLocation = matchLocation; tournament.StartTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTimeOffset.UtcNow.AccurateToTheMinute().AddMonths(i - 20).AddDays(5), UkTimeZone()); tournament.Comments = seedDataGenerator.CreateComments(i, members); repo.CreateTournament(tournament); Tournaments.Add(tournament); MatchListings.Add(tournament.ToMatchListing()); } } }