예제 #1
0
 public EfCoreUnitOfWork(TimeEstimateDBContext context)
 {
     Context                      = context;
     WalletRepository             = new WalletRepository(context);
     SupportedBankRepository      = new SupportedBankRepository(context);
     PaymentTransactionRepository = new PaymentTransactionRepository(context);
 }
예제 #2
0
        // 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);
        }
예제 #4
0
 public SupportedBankRepository(TimeEstimateDBContext context) : base(context)
 {
 }
 public PaymentTransactionRepository(TimeEstimateDBContext context) : base(context)
 {
 }
예제 #6
0
 public EfCoreBaseRepository(TimeEstimateDBContext context)
 {
     _context = context;
     DbSet    = context.Set <TEntity>();
 }
예제 #7
0
 public WalletRepository(TimeEstimateDBContext context) : base(context)
 {
 }