Example #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddADSLogger();

            services.AddMvc()
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
        }
Example #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddADSConfiguration();
            services.AddLogging(loggingBuilder => loggingBuilder.AddSerilog(dispose: true));
            services.AddADSLogger();

            services.AddSwaggerGen(swagger =>
            {
                var contact = new Contact()
                {
                    Name  = Configuration.GetSection("Swagger:ContactName").Value,
                    Url   = Configuration.GetSection("Swagger:ContactUrl").Value,
                    Email = Configuration.GetSection("Swagger:ContactEmail").Value
                };

                swagger.SwaggerDoc(Configuration.GetSection("Swagger:DocNameV1").Value,
                                   new Info
                {
                    Title       = Configuration.GetSection("Swagger:DocInfoTitle").Value,
                    Version     = Configuration.GetSection("Swagger:DocInfoVersion").Value,
                    Description = Configuration.GetSection("Swagger:DocInfoDescription").Value,
                    Contact     = contact
                });

                var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
                var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
                swagger.IncludeXmlComments(xmlPath);
            });

            services.AddMvc()
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
        }
Example #3
0
        private void StartConfiguracion(IServiceCollection services)
        {
            services.AddLogging(loggingBuilder => loggingBuilder.AddSerilog(dispose: true));
            services.AddADSConfiguration();
            services.AddADSLogger();

            services.AddSingleton <IConsultaClienteRepositorio, ConsultaClienteRepositorio>();
            services.AddSingleton <IConsultaClienteService, ConsultaClienteService>();
        }
        public static IServiceCollection AddADSLogger(this IServiceCollection services,
                                                      Action <string> configure)
        {
            var kafkaServer = "";

            configure(kafkaServer);
            services.AddADSLogger(kafkaServer);

            return(services);
        }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="services"></param>
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext <RegistroCivilContexto>(options =>
            {
                var connection = Configuration.GetSection("Global:Services:Siaerp:ConnectionString").Value;
                options.UseOracle(connection);
            });

            services.AddDbContext <OdsContexto>(options =>
            {
                var connection = Configuration.GetSection("registrocivil:ConnectionStrings:OdsConnection").Value;
                options.UseOracle(connection);
            }
                                                );

            services.AddScoped <IRegistroCivilServicio, RegistroCivilServicio>();
            services.AddScoped <IConsultaLogRepositorio, ConsultaLogRepositorio>();
            services.AddScoped <IDatosPersonaRcRepositorio, DatosPersonaRcRepositorio>();
            services.AddADSConfiguration();
            services.AddLogging(loggingBuilder => loggingBuilder.AddSerilog(dispose: true));
            services.AddADSLogger();
            services.AddSwaggerGen(swagger =>
            {
                var contact = new Contact()
                {
                    Name = SwaggerConfiguration.ContactName, Url = SwaggerConfiguration.ContactUrl
                };
                swagger.SwaggerDoc(SwaggerConfiguration.DocNameV1,
                                   new Info
                {
                    Title       = SwaggerConfiguration.DocInfoTitle,
                    Version     = SwaggerConfiguration.DocInfoVersion,
                    Description = SwaggerConfiguration.DocInfoDescription,
                    Contact     = contact
                }
                                   );
                var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
                var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
                swagger.IncludeXmlComments(xmlPath);
            });
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
        }
        public static IServiceCollection AddADSLogger(this IServiceCollection services)
        {
            services.AddADSLogger("");

            return(services);
        }