コード例 #1
0
 public IActionResult Create(Carrier carrier)
 {
     if (ModelState.IsValid)
     {
         _context.Carrier.Add(carrier);
         _context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(carrier);
 }
コード例 #2
0
        public IActionResult EditRate(Carrier carrier)
        {
            Rating ratingModel = new Rating() {Rate=carrier.Rate,CarrierID=carrier.CarrierID,UserGUID= GuidModel.GuidIDUser };

            _context.Rating.Add(ratingModel);
            _context.SaveChanges();
            return RedirectToAction("Index");
        }