Exemplo n.º 1
0
 public ActionResult FixtureAdd(FixtureAddViewModel fixtureAddViewModel)
 {
     if (ModelState.IsValid)
     {
         fixtureAddViewModel.Fixture.Home = clubRepository.GetById(fixtureAddViewModel.HomeClubId);
         fixtureAddViewModel.Fixture.Away = clubRepository.GetById(fixtureAddViewModel.AwayClubId);
         fixtureRepository.Insert(fixtureAddViewModel.Fixture);
         return(RedirectToAction("FixtureList", "Home"));
     }
     else
     {
         // Not sure how can I pass this to the get method.
         ViewBag.Error = "Invalid values. Match not saved.";
         return(RedirectToAction("FixtureAdd", "Home"));
     }
 }
Exemplo n.º 2
0
 public void Put(int id, [FromBody] TFixture value)
 {
     FixtureRepository.Insert <TFixture, TAvailableSources>(value);
 }