public Order Update(Order order)
 {
     _ctx.Attach(order).State = EntityState.Modified;
     _ctx.Entry(order).Reference(o => o.User).IsModified    = true;
     _ctx.Entry(order).Reference(o => o.Vehicle).IsModified = true;
     _ctx.SaveChanges();
     return(order);
 }
示例#2
0
 public Vehicle Update(Vehicle vehicle)
 {
     _ctx.Attach(vehicle).State = EntityState.Modified;
     _ctx.Entry(vehicle).Reference(v => v.User).IsModified = true;
     _ctx.SaveChanges();
     return(vehicle);
 }