private DataEF.Season GetSeason() { var season = new DataEF.Season { Number = SourceSeason.Number, SeasonType = dbSeasonType, League = dbLeague, }; Database.Seasons.Add(season); return(season); }
private DataEF.SkaterSeasonStat SetSkaterStats(DataEF.Season dbSeason, DataEF.Skater dbSkater, SthsData.SkaterSeasonStats skaterStats) { var dbSeasonStats = new DataEF.SkaterSeasonStat() { Season = dbSeason, Skater = dbSkater, Team = DataDB, }; PopulateSkaterStats(dbSeasonStats, skaterStats); Database.SkaterSeasonStats.Add(dbSeasonStats); return(dbSeasonStats); }
private DataEF.GoalieSeasonStat SetGoalieStats(DataEF.Season dbSeason, DataEF.Goalie dbGoalie, SthsData.GoalieSeasonStats goalieStats) { var dbSeasonStats = new DataEF.GoalieSeasonStat() { Season = dbSeason, Goalie = dbGoalie, Team = DataDB, }; PopulateGoalieStats(dbSeasonStats, goalieStats); Database.GoalieSeasonStats.Add(dbSeasonStats); return(dbSeasonStats); }
private DataEF.SkaterSeasonStat SetSubtotalSkaterStats(DataEF.Season dbSeason, DataEF.Skater dbSkater, SthsData.SkaterSeasonStats skaterStats) { var dbSeasonSubtotalStats = new DataEF.SkaterSeasonStat() { Season = dbSeason, Skater = dbSkater, Team = dbSeason.Teams.Where(a => a.Acronym == skaterStats.TeamAcronym).First(), IsSubtotal = true }; PopulateSkaterStats(dbSeasonSubtotalStats, skaterStats); Database.SkaterSeasonStats.Add(dbSeasonSubtotalStats); return(dbSeasonSubtotalStats); }
private DataEF.GoalieSeasonStat SetSubtotalGoalieStats(DataEF.Season dbSeason, DataEF.Goalie dbGoalie, SthsData.GoalieSeasonStats goalieStats) { var dbSeasonStats = new DataEF.GoalieSeasonStat() { Season = dbSeason, Goalie = dbGoalie, Team = dbSeason.Teams.Where(a => a.Acronym == goalieStats.TeamAcronym).First(), IsSubtotal = true, }; PopulateGoalieStats(dbSeasonStats, goalieStats); Database.GoalieSeasonStats.Add(dbSeasonStats); return(dbSeasonStats); }
public void SetGoaliesAndStats(DataEF.Season dbSeason) { foreach (var sourceGoalie in DataSource.Goalies) { var dbGoalie = GetGoalieFromDB(sourceGoalie); SetGoalieStats(dbSeason, dbGoalie, sourceGoalie.SeasonTotals); // If the team was traded, add the subtotal seasons as well if (sourceGoalie.SeasonSubTotals != null) { foreach (var subTotal in sourceGoalie.SeasonSubTotals) { SetSubtotalGoalieStats(dbSeason, dbGoalie, subTotal); } } } }
public void SetSkatersAndStats(DataEF.Season dbSeason) { foreach (var sourceSkater in DataSource.Skaters) { var dbSkater = GetSkaterFromDB(sourceSkater); SetSkaterStats(dbSeason, dbSkater, sourceSkater.SeasonTotals); // If the team was traded, add the subtotal seasons as well if (sourceSkater.SeasonSubTotals != null) { foreach (var subTotal in sourceSkater.SeasonSubTotals) { SetSubtotalSkaterStats(dbSeason, dbSkater, subTotal); } } } }