public PaymentStatusService(IUnitOfWorkBase <PaymentContext> unitOfWork, ILogger <PaymentStatusService> logger) { UnitOfWork = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork)); if (PaymentStatusRepo == null) { PaymentStatusRepo = UnitOfWork.GetRepository <PaymentStatus>(); } Logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public PaymentService(IPaymentStatusService paymentStatusService, IUnitOfWorkBase <PaymentContext> unitOfWork, ILogger <PaymentService> logger, IExpensivePaymentGateway expensivePaymentGateway, ICheapPaymentGateway cheapPaymentGateway, IPremiumPaymentService premiumPaymentService) { PaymentStatusService = paymentStatusService; UnitOfWork = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork)); if (PaymentRepo == null) { PaymentRepo = UnitOfWork.GetRepository <Payment>(); } ExpensivePaymentGateway = expensivePaymentGateway; CheapPaymentGateway = cheapPaymentGateway; PremiumPaymentService = premiumPaymentService; Logger = logger ?? throw new ArgumentNullException(nameof(logger)); }