private void CreateStandingsForNewSeason(int season) { List <TeamsDocument> _teams = _teamsService.Get(); foreach (var team in _teams) { StandingsDocument newRecord = new StandingsDocument { Season = season, TeamId = team.Id, Conference = team.Conference, Division = team.Division, DivisionRank = 1, ConferenceRank = 1, OverallRank = 1, OverallWins = 0, OverallLosses = 0, OverallTies = 0, OverallPct = 0, OverallPointsFor = 0, OverallPointsAgainst = 0, HomeWins = 0, HomeLosses = 0, HomeTies = 0, AwayWins = 0, AwayLosses = 0, AwayTies = 0, DivisionWins = 0, DivisionLosses = 0, DivisionTies = 0, DivisionPct = 0, ConferenceWins = 0, ConferenceLosses = 0, ConferenceTies = 0, ConferencePct = 0, CurrentStreak = 'W', StreakLength = 0, LastFive = new char[] { '-', '-', '-', '-', '-' }, ScheduleWeight = 0 }; _standingsService.Create(newRecord); } }
public ActionResult <StandingsDocument> CreateRecord(StandingsDocument record) { _standingsService.Create(record); return(CreatedAtRoute("GetRecord", new { id = record.Id.ToString() }, record)); }
public StandingsDocument Create(StandingsDocument standings) { _standings.InsertOne(standings); return(standings); }