public Order UpdateOrder(Order order)
        {
            ctx.Attach(order).State = EntityState.Modified;
            ctx.Entry(order).Reference(order => order.Customer).IsModified = false;
            ctx.SaveChanges();

            return(ReadOrderByID(order.ID));
        }
Beispiel #2
0
        public User UpdateUser(User user)
        {
            ctx.Attach(user).State = EntityState.Modified;
            ctx.Entry(user).Reference(user => user.Customer).IsModified = true;
            ctx.SaveChanges();

            return(GetUserByID(user.ID));
        }