コード例 #1
0
        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"));
        }
コード例 #2
0
 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)));
 }