// Because findeks points come from a mock server we can //use CustomerFindeksManager here to get the value. //But in a real scenario this function would use another api to get findeks private IResult CheckIfCustomerFindeksIsEnough(Rental rental) { CustomerFindeks customerFindeks = _ICustomerFindeksDal.Get(c => c.CustomerId == rental.CustomerId); Car car = _ICarDal.Get(c => c.Id == rental.CarId); if (customerFindeks.Findeks >= car.Findeks) { return(new SuccessResult()); } return(new ErrorResult(Messages.LowFindeksPoints)); }
public IDataResult <CustomerFindeks> GetByCustomerId(int id) { return(new SuccessDataResult <CustomerFindeks> (_ICustomerFindeksDal.Get(p => p.CustomerId == id))); }