public IActionResult SaveMatch(int refereeid, int matchid) { RefereeMatch rf = new RefereeMatch(); rf.MatchId = matchid; rf.RefereeId = refereeid; _context.Add(rf); _context.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult AssignReferee(RefereeMatchInputVM model) { for (var i = 0; i < model.Ids.Count(); i++) { var refereeMatch = new RefereeMatch { MatchId = model.MatchId, RefereeId = model.Ids[i] }; _dateRefereeMatch.Add(refereeMatch); } return(RedirectToAction(nameof(Index))); }