Exemplo n.º 1
0
        public IResult Delete(Vehicle car)
        {
            Vehicle result = _vehicleDal.Get(v => v.CarId == car.CarId && v.VehicleName == car.VehicleName);

            if (result != null)
            {
                _vehicleDal.Delete(car);
                return(new SuccessResult(Messages.CarDeleted));
            }
            else
            {
                return(new ErrorResult(Messages.CarInvalid));
            }
        }
Exemplo n.º 2
0
 public Vehicle Get(int id)
 {
     return(_vehicleDal.Get(v => v.VehicleId == id));
 }
Exemplo n.º 3
0
 public IDataResult <Car> GetById(int carId)
 {
     return(new SuccessDataResult <Car>(_vehicleDal.Get(c => c.Id == carId)));
 }
 public IDataResult <Vehicle> GetById(int vehicleId)
 {
     return(new SuccessDataResult <Vehicle>(_vehicleDal.Get(c => c.ID == vehicleId)));
 }
Exemplo n.º 5
0
 public Vehicle GetById(int productId)
 {
     return(_productDal.Get(p => p.VehicleId == productId));
 }
Exemplo n.º 6
0
 public IDataResult <Vehicle> BringById(int id)
 {
     return(new SuccessDataResult <Vehicle>(_vehicleDal.Get(v => v.Id == id)));
 }