public ActionResult Edit(VMTemplate vmtemplate)
 {
     if (ModelState.IsValid) { db.Entry(vmtemplate).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(vmtemplate);
 }
 public ActionResult Create(VMTemplate vmtemplate)
 {
     try { if (ModelState.IsValid) { db.VMTemplates.Add(vmtemplate); db.SaveChanges(); return View("Success"); }  return View(vmtemplate); } catch (Exception e) { Api.Core.Exceptions.ExceptionManager.HandleException(e); return View("Error"); }
 }