Esempio n. 1
0
        private async Task <IResult> CheckFindeksScoreSufficiency(Rental rental)
        {
            var car = await _carDal.GetAsync(c => c.Id == rental.CarId);

            var findeks = await _findeksDal.GetAsync(f => f.CustomerId == rental.CustomerId);

            if (findeks == null)
            {
                return(new ErrorResult(Messages.FindeksNotFound));
            }
            if (findeks.Score < car.MinFindeksScore)
            {
                return(new ErrorResult(Messages.FindeksNotEnoughForCar));
            }

            return(new SuccessResult());
        }
Esempio n. 2
0
 public async Task <IDataResult <Findeks> > Get(string id)
 {
     return(new SuccessDataResult <Findeks>(await _findeksDal.GetAsync(f => f.Id == id)));
 }