예제 #1
0
        public ActionResult Create([Bind(Include = "id,name,animal,size,food,photo,customer_id,active,indoors_safe,under13_safe")] Pet pet)
        {
            if (ModelState.IsValid)
            {
                db.Pets.Add(pet);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pet));
        }
예제 #2
0
 public ActionResult Register(Customer X)
 {
     if (ModelState.IsValid)
     {
         using (PetBucketDatabaseEntities db = new PetBucketDatabaseEntities())
         {
             db.Customers.Add(X);
             db.SaveChanges();
             ModelState.Clear();