public DonateHandler(ICampaignRepository campaignRepository, IFundraiserRepository fundraiserRepository, IDonationRepository donationRepository, IEventBus eventBus) { _campaignRepository = campaignRepository; _fundraiserRepository = fundraiserRepository; _donationRepository = donationRepository; _eventBus = eventBus; }
public FundraiserController(IFundraiserRepository fundraiserService, IMapper mapper, IHubContext <ZonorHub> signalHub) { this.fundraiserService = fundraiserService ?? throw new ArgumentNullException(nameof(fundraiserService)); this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); this.signalHub = signalHub ?? throw new ArgumentNullException(nameof(signalHub)); }
private void Init() { var builder = new DbContextOptionsBuilder <FundraiseContext>() .UseInMemoryDatabase("FundraiseTestDB"); var context = new FundraiseContext(builder.Options); _fundraiserRepository = new FundraiserRepository(context); var campaignRepository = new CampaignRepository(context); testCampaign = campaignRepository.Create("test campaign", "USD", null, DateTime.Now.AddMonths(2)); }
public MockDonationRepository(FundContext dbContext, IFundraiserRepository fundraiserRepository, IDonorRepository donorRepository) { this.dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); this.fundraiserRepository = fundraiserRepository ?? throw new ArgumentNullException(nameof(fundraiserRepository)); this.donorRepository = donorRepository ?? throw new ArgumentNullException(nameof(donorRepository)); Donations = new List <Donation> { new Donation { FundraiserId = fundraiserRepository.GetFundraisersAsync().Result.First().Id, DonorId = donorRepository.GetDonorsAsync().Result.First().Id, Amount = 10, DonationDate = DateTimeOffset.Now }, new Donation { FundraiserId = fundraiserRepository.GetFundraisersAsync().Result.First().Id, DonorId = donorRepository.GetDonorsAsync().Result.Last().Id, Amount = 40, DonationDate = DateTimeOffset.Now }, }; }
public HomeController(ILogger<HomeController> logger, IMapper mapper, IFundraiserRepository fundraiserService, IDonorRepository donorService) : base(logger, mapper) { this.donorService = donorService ?? throw new ArgumentNullException(nameof(donorService)); this.fundraiserService = fundraiserService ?? throw new ArgumentNullException(nameof(fundraiserService)); }
public FundraiserController(CampaignRepository campaignRepository, FundraiserRepository fundraiserRepository, IDonationRepository donationRepository) { _campaignRepository = campaignRepository; _fundraiserRepository = fundraiserRepository; _donationRepository = donationRepository; }
public GetByIdHandler(IFundraiserRepository fundraiserRepository) { _fundraiserRepository = fundraiserRepository; }
public FundraisersController(IFundraiserRepository fundraiserService, IMapper mapper) { this.fundraiserService = fundraiserService ?? throw new ArgumentNullException(nameof(fundraiserService)); this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public CreateHandler(IFundraiserRepository fundraiserRepository) { _fundraiserRepository = fundraiserRepository; }
public FundraisersByCreatorIdHandler(IFundraiserRepository fundraiserRepository) { _fundraiserRepository = fundraiserRepository; }