public User Update(User user) { _ctx.Attach(user).State = EntityState.Modified; //_ctx.Entry(user).Reference(u => u.Orders).IsModified = true; _ctx.SaveChanges(); return(user); }
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); }