public async Task <ActionResult <Car> > PutCar(long id, Car car) { if (id != car.CarId) { return(null); } _context.Entry(car).State = EntityState.Modified; await _context.SaveChangesAsync(); return(car); }
public async Task <ActionResult <TypeCar> > PutTypeCar(long id, TypeCar typeCar) { if (id != typeCar.TypeCarId) { return(null); } _context.Entry(typeCar).State = EntityState.Modified; await _context.SaveChangesAsync(); return(typeCar); }
public async Task <ActionResult <FamilyCar> > PutFamilyCar(long id, FamilyCar familyCar) { if (id != familyCar.FamilyCarId) { return(null); } _context.Entry(familyCar).State = EntityState.Modified; await _context.SaveChangesAsync(); return(familyCar); }
public async Task <ActionResult <User> > PutUser(long id, User user) { if (id != user.UserId) { return(null); } _context.Entry(user).State = EntityState.Modified; await _context.SaveChangesAsync(); return(user); }
public async Task <ActionResult <Car> > UpdateUserCar(long userId, long carId, Car car) { /* var car = await _context.Car.Where(u => u.CarId == carId && u.UserId == userId) * .FirstOrDefaultAsync();*/ if (userId != car.UserId && carId != car.CarId) { return(null); } _context.Entry(car).State = EntityState.Modified; await _context.SaveChangesAsync(); return(car); }