Пример #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, DotIdContext dotIdContext, IDataSeeder dataSeeder)
        {
            //dotIdContext.Database.EnsureDeleted();

            //dotIdContext.Database.Migrate();
            //dataSeeder.SeedData();

            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();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Report}/{action=Index}/{id?}");
            });
        }
Пример #2
0
        public ReportController(IMediator mediator, IMapper mapper, DotIdContext dotIdContext)
        {
            _mediator = mediator;

            _mapper = mapper;

            _dotIdContext = dotIdContext;
        }
Пример #3
0
        public DataSeederTests()
        {
            var serviceProvider = new ServiceCollection()
                                  .AddEntityFrameworkInMemoryDatabase()
                                  .BuildServiceProvider();

            _options = new DbContextOptionsBuilder <DotIdContext>()
                       .UseInMemoryDatabase(Guid.NewGuid().ToString())
                       .UseInternalServiceProvider(serviceProvider)
                       .Options;
            var context = new DotIdContext(_options);

            var locationSeeder  = new LocationImportStrategy(context);
            var queryRepository = new QueryRepository(Options.Create(new ConnectionStrings()
            {
                SqlServer = "Server=localhost;Database=DotId;User Id=testuser;Password=testuser;"
            }));

            var scoreSeeder = new ScoreImportStrategy(context, queryRepository);

            _dataSeeder = new DataSeeder(locationSeeder, scoreSeeder);
        }
Пример #4
0
 public LocationImportStrategy(DotIdContext dotIdContext)
 {
     _dotIdContext = dotIdContext;
 }
Пример #5
0
        public ScoreImportStrategy(DotIdContext dotIdContext, IQueryRepository queryRepository)
        {
            _dotIdContext = dotIdContext;

            _queryRepository = queryRepository;
        }
        public GetReportHandler(DotIdContext dotIdContext, IQueryRepository queryRepository, IOptions <ConnectionStrings> options)
        {
            _dotIdContext = dotIdContext;

            _queryRepository = queryRepository;
        }