public EfCoreUnitOfWork(TimeEstimateDBContext context) { Context = context; WalletRepository = new WalletRepository(context); SupportedBankRepository = new SupportedBankRepository(context); PaymentTransactionRepository = new PaymentTransactionRepository(context); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, TimeEstimateDBContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } context.GetInfrastructure().GetService <IMigrator>().Migrate(); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); }
public void Setup() { var dbContextFactory = new SampleDbContextFactory(); var bankAPIDeterminator = new BankAPIDeterminator(); _context = dbContextFactory.CreateDbContext(new string[] { }); _unitOfWork = new EfCoreUnitOfWork(_context); _walletService = new WalletService(_unitOfWork, bankAPIDeterminator); }
public SupportedBankRepository(TimeEstimateDBContext context) : base(context) { }
public PaymentTransactionRepository(TimeEstimateDBContext context) : base(context) { }
public EfCoreBaseRepository(TimeEstimateDBContext context) { _context = context; DbSet = context.Set <TEntity>(); }
public WalletRepository(TimeEstimateDBContext context) : base(context) { }