コード例 #1
0
 public ActionResult Edit([Bind(Include = "InvoiceId,DateCreated,DeliverDate,Vat,TotalPrice,ClientName")] Invoice invoice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(invoice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(invoice));
 }
コード例 #2
0
        public async Task <ActionResult> Edit([Bind(Include = "InvoiceId,Number,Date,Customer,Amount,DueDate")] Invoice invoice)
        {
            if (ModelState.IsValid)
            {
                db.Entry(invoice).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(invoice));
        }