Beispiel #1
0
 public ActionResult Create(Hostel h)
 {
     if (ModelState.IsValid)
     {
         db.Hostels.Add(h);
         db.SaveChanges();
         return(RedirectToAction("Index", "Hostel"));
     }
     return(View());
 }
Beispiel #2
0
 public ActionResult Create(Faculty f)
 {
     db.faculties.Add(f);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }