public User Update(User user)
 {
     _ctx.Attach(user).State = EntityState.Modified;
     //_ctx.Entry(user).Reference(u => u.Orders).IsModified = true;
     _ctx.SaveChanges();
     return(user);
 }
示例#2
0
 public Vehicle Create(Vehicle vehicle)
 {
     _ctx.Attach(vehicle).State = EntityState.Added;
     _ctx.SaveChanges();
     return(vehicle);
 }
 public Order Create(Order order)
 {
     _ctx.Attach(order).State = EntityState.Added;
     _ctx.SaveChanges();
     return(order);
 }