Пример #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().AddJsonOptions(option =>
            {
                option.JsonSerializerOptions.IgnoreNullValues = true;
            }).SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
            .AddMvcOptions(option => option.EnableEndpointRouting = false)
            .AddNewtonsoftJson(options =>
                               options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver());

            services.AddControllers();

            DependencyInjections.AddInfraStructure(services, Configuration);
            var configuration = GetConfiguration();

            services.AddSingleton(typeof(IConfiguration), configuration);

            services.AddSwaggerDocument(config =>
            {
                config.PostProcess = document =>
                {
                    document.Info.Version = "v1";
                    document.Info.Title   = "API Distribuição de Lucros";
                };
            });
        }
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddMvc();
     services.AddControllers();
     services.AddDbContext <ApiVentasContext>(options => options.UseSqlServer(Configuration.GetConnectionString("ApiVentasConnection")));
     services.Configure <AppSettings>(Configuration.GetSection("AppSettings"));
     DependencyInjections.Register(services);
 }
Пример #3
0
 public void ConfigureServices(IServiceCollection services)
 {
     DependencyInjections.Add(services);
     Swagger.Add(services);
     ControllersAndNewtonsoftJson.Add(services);
     HealthCheck.Add(services);
     HttpClient.Add(services, Configuration);
 }
Пример #4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext <IFLikeContext>(options =>
                                                  options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));


            services.AddAuthentication(sharedOptions =>
            {
                sharedOptions.DefaultScheme          = CookieAuthenticationDefaults.AuthenticationScheme;
                sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
            })
            .AddAzureAd(options => Configuration.Bind("AzureAd", options))
            .AddCookie();

            DependencyInjections.AddDependencyInjections(services);
            services.AddAutoMapper(x => AutoMapperConfig.GetConfig());
            services.AddMvc();
        }
Пример #5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext <IFLikeContext>(options =>
                                                  options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

            services.AddIdentity <ApplicationUser, IdentityRole>()
            .AddEntityFrameworkStores <IFLikeContext>()
            .AddDefaultTokenProviders();

            services.AddAuthentication().AddFacebook(facebookOptions =>
            {
                facebookOptions.AppId     = "1521598354575145";
                facebookOptions.AppSecret = "d5cec77e269fa5de45781bdbbf380e4a";
            });

            DependencyInjections.AddDependencyInjections(services);
            services.AddMvc();

            services.AddSignalR();
        }