Esempio n. 1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IMigrationManager migrationManager, ISeedService seedService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/JobOffer/Error");
            }

            app.UseStaticFiles();
            app.UseStatusCodePagesWithReExecute("/JobOffer/Error", "?statusCode={0}");
            app.UseRequestLocalization();
            app.UseAuthentication();

            migrationManager.Apply().Wait();
            seedService.Seed().Wait();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=JobOffer}/{action=Popular}/{id?}");
            });
        }
Esempio n. 2
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ISeedService seedService)
        {
            if (env.IsDevelopment())
            {
            }


            try {
                seedService.Seed().Wait();
            }
            catch (Exception ex) {
                throw ex;
            }
        }
        public async Task <IActionResult> Create()
        {
            await _seedService.Seed();

            return(Ok());
        }
 public void Seed()
 {
     _seedService.Seed();
 }
        public async Task <IActionResult> Seed()
        {
            await _seedService.Seed();

            return(RedirectToAction("Index"));
        }
Esempio n. 6
0
 public AuthService(IUserRepository userRepositoryParam, ISeedService seedService)
 {
     this.userRepository = userRepositoryParam;
     seedService.Seed(userRepository);
 }