public ActionResult Create(Alias alias) { if (ModelState.IsValid) { db.Aliases.Add(alias); db.SaveChanges(); return RedirectToAction("Index"); } return View(alias); }
public ActionResult Edit(Alias alias) { if (ModelState.IsValid) { db.Entry(alias).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(alias); }
// // GET: /Alias/Create public ActionResult Create() { var alias = new Alias {Email = "*****@*****.**", CreateDate = System.DateTime.Now}; return View(alias); }