Exemplo n.º 1
0
        private void CreateFixture(int season, int week, string type, string homeTeam, string awayTeam)
        {
            FixturesDocument newFixture = new FixturesDocument()
            {
                Season     = season,
                Week       = week,
                Type       = type,
                HomeTeamId = homeTeam,
                AwayTeamId = awayTeam,
                Played     = false,
                HomeScore  = 0,
                AwayScore  = 0
            };

            _fixturesService.Create(newFixture);
        }
Exemplo n.º 2
0
 public FixturesDocument Create(FixturesDocument fixture)
 {
     _fixtures.InsertOne(fixture);
     return(fixture);
 }
Exemplo n.º 3
0
        public ActionResult <FixturesDocument> CreateFixture(FixturesDocument fixture)
        {
            _fixturesService.Create(fixture);

            return(CreatedAtRoute("GetFixture", new { id = fixture.Id.ToString() }, fixture));
        }