コード例 #1
0
 public EntityState EditEntity(TEntity entity)
 {
     try
     {
         return(dbContext.Entry(entity).State = EntityState.Modified);
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #2
0
 public ActionResult Delete(Bids bids)
 {
     try
     {
         // TODO: Add delete logic here
         var bidsinfo = db.bids.Where(x => x.CustomerId == bids.CustomerId && x.ProductId == bids.ProductId).FirstOrDefault();
         db.Entry(bidsinfo).State = System.Data.Entity.EntityState.Deleted;
         db.SaveChanges();
         //bidsService.RemoveBids(bidsinfo);
         return(RedirectToAction("Details", new { id = bids.CustomerId }));
     }
     catch
     {
         return(View());
     }
 }