Exemple #1
0
 // GET: Customer/Index
 public ActionResult Index()
 {
     using (DbMagnifierModel dbMagnifierModel = new DbMagnifierModel())
     {
         return(View(dbMagnifierModel.Customers.ToList()));
     }
 }
Exemple #2
0
        public ActionResult Create(Customer customer)
        {
            try
            {
                using (DbMagnifierModel dbMagnifierModel = new DbMagnifierModel())
                {
                    dbMagnifierModel.Customers.Add(customer);
                    dbMagnifierModel.SaveChanges();
                }
                // TODO: Add insert logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }