Beispiel #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, ILoggerFactory loggerFactory,
                              DataAccess.AppDbContext appDbContext,
                              UserManager <ApplicationUser> userManager,
                              RoleManager <ApplicationRole> roleManager,
                              IDispatcher dispatcher)
        {
            loggerFactory.AddLog4Net();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            app.UseOpenCqrs().EnsureDomainDbCreated();
            appDbContext.Database.Migrate();

            app.EnsureIdentityCreated(userManager, roleManager);

            app.UseStaticFiles();
            app.UseAuthentication();
            app.UseTheme();



            app.AddRoutes();
            app.AddLocalisation();
        }
Beispiel #2
0
        protected override void Seed(DataAccess.AppDbContext context)
        {
            // Seeding Dummy Data for Testing purposes

            SeedUser(context);

            SeedProduct(context);

            SeedCustomer(context);
        }
 public ProductService(DataAccess.AppDbContext db)
 {
     this.db = db;
     this.db.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
 }