Example #1
0
        public IResult Add(Rental rental)
        {
            var result  = _rentalDal.UserFindex(x => x.Id == rental.CustomerId);
            var result2 = _rentalDal.CardFindex(x => x.CarId == rental.CarId);

            if (result.Data > result2.Data)
            {
                _rentalDal.Add(rental);
                return(new SuccessResult(Messages.RentalAdd));
            }
            else
            {
                return(new ErrorResult(Messages.NotFindex));
            }
        }