Esempio n. 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,
                              AntlContext context, UserManager <ApplicationUser> userManager, RoleManager <IdentityRole <int> > roleManager)
        {
            AntlSeed.SeedAsync(context, userManager, roleManager).GetAwaiter().GetResult();
            app.UseStatusCodePages();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseSwagger();

            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "Antl API V1");
                c.RoutePrefix = string.Empty;
            });

            app.UseHttpsRedirection();

            app.UseAuthentication();

            app.UseMvc();
        }
Esempio n. 2
0
 public GenericRepository(AntlContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
     _set     = _context.Set <TEntity>() ?? throw new ArgumentNullException(nameof(TEntity));
 }