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.Goalie GetGoalieFromDB(SthsData.Goalie goalie) { var dbGoalie = Database.Goalies .Where(p => p.Name == goalie.Name) .FirstOrDefault(); if (dbGoalie == null) { dbGoalie = new DataEF.Goalie() { Name = goalie.Name, }; Database.Goalies.Add(dbGoalie); } return(dbGoalie); }
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); }