public bool Update(CarDto carDto) { try { _context.Car.Update(carDto.DtoToEntity()); _context.SaveChanges(); return(true); } catch { return(false); } }
public bool Delete(CarDto carDto) { try { if (carDto != null) { _context.Car.Remove(carDto.DtoToEntity()); _context.SaveChanges(); return(true); } return(false); } catch { return(false); } }