public ActionResult GetAllMatches(int spieltag) { var matches = _matchDataRepository.GetMatchesByGroup(spieltag); using (var ctxt = new MatchInfoContext()) { foreach (var m in matches) { ctxt.Items.Add(new MatchInfoItem() { GroupId = m.GroupId, MatchId = m.MatchId, MatchNr = m.MatchNr, HomeTeamId = m.HomeTeamId, AwayTeamId = m.AwayTeamId, HomeTeam = m.HomeTeam, AwayTeam = m.AwayTeam, HomeTeamScore = m.HomeTeamScore, AwayTeamScore = m.AwayTeamScore, HomeTeamIcon = m.HomeTeamIcon, AwayTeamIcon = m.AwayTeamIcon, KickoffTime = m.KickoffTime, KickoffTimeUtc = m.KickoffTimeUTC, IsFinished = m.IsFinished, HasProlongation = m.HasVerlaengerung }); } ctxt.SaveChanges(); } return(RedirectToAction("Index")); }
public DummyController(MatchInfoContext _ctx) { _ctx = ctx ?? throw new ArgumentNullException(nameof(ctx)); }
public MatchInfoRepository(MatchInfoContext context) { _context = context ?? throw new ArgumentException(nameof(context)); }