예제 #1
0
 public ActionResult Create(Alias alias)
 {
     if (ModelState.IsValid)
     {
         db.Aliases.Add(alias);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(alias);
 }
예제 #2
0
 public ActionResult Edit(Alias alias)
 {
     if (ModelState.IsValid)
     {
         db.Entry(alias).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(alias);
 }
예제 #3
0
        //
        // GET: /Alias/Create

        public ActionResult Create()
        {
            var alias = new Alias {Email = "*****@*****.**", CreateDate = System.DateTime.Now};
            return View(alias);
        }