// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <AnimalPlanetDbContext>(options => options.UseNpgsql( Configuration.GetConnectionString("DefaultConnection"))); services.AddIdentity <User, Role>( options => { options.User.RequireUniqueEmail = true; }) .AddEntityFrameworkStores <AnimalPlanetDbContext>() .AddDefaultTokenProviders(); DalDependencyInstaller.Install(services); BlDependencyInstaller.Install(services); ConfigurationDependencyInstaller.Install(services); services.AddControllersWithViews(options => { options.CacheProfiles.Add("NoCaching", new CacheProfile() { Location = ResponseCacheLocation.None, NoStore = true }); }); services.AddRazorPages(); }
public void ConfigureServices(IServiceCollection services) { services.AddControllersWithViews(); services.AddDbContext <QualitativeDbContext>(options => options.UseNpgsql(Configuration.GetConnectionString("Postgres"))); BlDependencyInstaller.Install(services); DalDependencyInstaller.Install(services); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(options => { options.Conventions.Add(new StatusCodeConvention()); options.Filters.Add(new ModelStateValidationFilter()); }).AddNewtonsoftJson(options => { options.SerializerSettings.Converters.Add(new StringEnumConverter()); }); BlDependencyInstaller.Install(services); DalDependencyInstaller.Install(services, Configuration); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "Calendar.Web", Version = "v1" }); c.DocumentFilter <HideDocsFilter>(); c.GeneratePolymorphicSchemas(); var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); c.IncludeXmlComments(xmlPath); }); services.AddMvc(); services.AddSwaggerGenNewtonsoftSupport(); }