public void Add(MatchViewModel viewModel) { var m = new Match { Timestamp = viewModel.Timestamp, AwayPoints = viewModel.AwayPoints, HomePoints = viewModel.HomePoints, HomeTeamId = viewModel.HomeTeamId, AwayTeamId = viewModel.AwayTeamId, MatchId = viewModel.MatchId }; _context.Matches.Add(m); _context.SaveChanges(); }
public IActionResult SaveSettings([FromBody] Settings settings) { var s = _context.Parameters.FirstOrDefault(i => i.Name == "Settings"); if (s == null) { s = new Parameter() { Name = "Settings" }; _context.Parameters.Add(s); } s.Value = JsonConvert.SerializeObject(settings); _context.SaveChanges(); _captureService.SetDevice(settings.Device); return(Ok()); }
public void AddTeam(Team team) { _context.Teams.Add(team); _context.SaveChanges(); }