示例#1
0
 public CarAdDetailsQueryHandler(
     ICarAdQueryRepository carAdRepository,
     IDealerQueryRepository dealerRepository)
 {
     this.carAdRepository  = carAdRepository;
     this.dealerRepository = dealerRepository;
 }
 public LoginUserCommandHandler(
     IIdentity identity,
     IDealerQueryRepository dealerRepository)
 {
     this.identity         = identity;
     this.dealerRepository = dealerRepository;
 }
 public DeleteCarAdCommandHandler(
     ICurrentUser currentUser,
     ICarAdQueryRepository carAdRepository,
     IDealerQueryRepository dealerRepository)
 {
     this.currentUser      = currentUser;
     this.carAdRepository  = carAdRepository;
     this.dealerRepository = dealerRepository;
 }
 public MineCarAdsQueryHandler(
     ICarAdQueryRepository carAdRepository,
     IDealerQueryRepository dealerRepository,
     ICurrentUser currentUser)
     : base(carAdRepository)
 {
     this.currentUser      = currentUser;
     this.dealerRepository = dealerRepository;
 }
示例#5
0
 public ChangeAvailabilityCommandHandler(
     ICurrentUser currentUser,
     ICarAdQueryRepository carAdRepository,
     IDealerQueryRepository dealerRepository)
 {
     this.currentUser      = currentUser;
     this.carAdRepository  = carAdRepository;
     this.dealerRepository = dealerRepository;
 }
示例#6
0
 public CreateUserCommandHandler(
     IIdentity identity,
     IDealerFactory dealerFactory,
     IDealerQueryRepository dealerRepository)
 {
     this.identity         = identity;
     this.dealerFactory    = dealerFactory;
     this.dealerRepository = dealerRepository;
 }
示例#7
0
        public static async Task <Result> DealerHasCarAd(
            this ICurrentUser currentUser,
            IDealerQueryRepository dealerRepository,
            int carAdId,
            CancellationToken cancellationToken)
        {
            var dealerId = await dealerRepository.GetDealerId(
                currentUser.UserId,
                cancellationToken);

            var dealerHasCar = await dealerRepository.HasCarAd(
                dealerId,
                carAdId,
                cancellationToken);

            return(dealerHasCar
                ? Result.Success
                : "You cannot edit this car ad.");
        }
 public DealerDetailsQueryHandler(IDealerQueryRepository dealerRepository)
 => this.dealerRepository = dealerRepository;