Exemple #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, SocNetContext socNetContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseSpaStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    "default",
                    "{controller}/{action=Index}/{id?}");
            });

            app.UseSpa(spa =>
            {
                spa.Options.SourcePath = "ClientApp";

                if (env.IsDevelopment())
                {
                    spa.UseReactDevelopmentServer("start");
                }
            });

            socNetContext.Database.EnsureCreated();
        }
        public DatasetTests()
        {
            var dbOptions = new DbContextOptionsBuilder <SocNetContext>().UseSqlite("Data Source=tests.db").Options;

            this.db = new SocNetContext(dbOptions);
            this.db.Database.EnsureCreated();

            var repository = new DatasetRepository(this.db, new DbConfiguration());

            this.datasetService = new DatasetService(repository);
        }
Exemple #3
0
 public DatasetRepository(SocNetContext socNetContext, DbConfiguration dbConfig)
 {
     this.db       = socNetContext;
     this.dbConfig = dbConfig;
 }