Esempio n. 1
0
        public async Task <IActionResult> CreateMatch([FromBody] PostMatch model)
        {
            using MatchHelper mh = new MatchHelper(_dbcontext, _matchRepository, _oddRepository);

            if (ModelState.IsValid)
            {
                //model.MatchDate = DateTime.Today;
                //model.MatchTime = DateTime.Now.TimeOfDay;
                //model.Sport = (int)Sports.Football;
                return(Ok(await mh.InsertMatchWithOdd(model)));
            }
            else
            {
                return(BadRequest(ModelState));
            }
        }