Exemplo n.º 1
0
        public Details UpdateDetails(Details details)
        {
            var updateDetails = new Details()
            {
                CustomerId = details.CustomerId, OrderId = this.GetOrderId(details.CustomerId)
            };

            {
                _db.Details.Attach(updateDetails);
                _db.Entry(updateDetails).Property(x => x.OrderId).IsModified = true;
                _db.SaveChanges();
            }

            return(details);
        }
Exemplo n.º 2
0
 public bool UpdateProduct(Product product)
 {
     _db.Entry(product).State = EntityState.Modified;
     _db.SaveChanges();
     return(product != null);
 }