public void Update(Parametro parametro) { using (Context db = new Context()) { db.Entry(parametro).State = EntityState.Modified; db.SaveChanges(); } }
public ActionResult Index(Parametro teleEntrega) { try { if (ModelState.IsValid) { ParametroService teleEntregaService = new ParametroService(); teleEntregaService.Update(teleEntrega); TempData["message"] = "Parâmetros alterados com sucesso"; return RedirectToAction("Index"); } } catch (Exception ex) { ViewBag.Error = ex.Message; } return View(teleEntrega); }