示例#1
0
 // GET: Garage
 public ActionResult Index()
 {
     using (UsersEntities3 data = new UsersEntities3())
     {
         return(View(data.CarDBs.ToList()));
     }
 }
示例#2
0
        public ActionResult Create(CarDB car)
        {
            using (UsersEntities3 data = new UsersEntities3())
            {
                data.CarDBs.Add(car);
                data.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }