Beispiel #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvc(config =>
            {
                // Add XML Content Negotiation
                config.RespectBrowserAcceptHeader = true;
                //config.InputFormatters.Add(new XmlSerializerInputFormatter());
                //config.OutputFormatters.Add(new XmlSerializerOutputFormatter());
            })
            .AddJsonOptions(options =>
            {
                options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            })

            .AddFluentValidation();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "Backend for frontend API", Version = "v1"
                });
            });

            services.AddCors();

            services.AddOptions();

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            var result = Resolver.BuildServiceProvider(services);

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// This method gets called by the runtime. Use this method to add services to the container.
        /// </summary>
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvc()
            .AddJsonOptions(options =>
            {
                options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            })
            .AddFluentValidation();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "Teams API", Version = "v1"
                });
            });

            services.AddCors();

            var connectionString = Configuration[Consts.Configuration.ConnectionString];

            var builder = Resolver.BuildServiceProvider(services, connectionString);

            builder.Register(c => endpoint)
            .As <IMessageSession>()
            .SingleInstance();

            var container = builder.Build();

            endpoint = BootstrapNServiceBusForMessaging(container);

            return(new AutofacServiceProvider(container));
        }
Beispiel #3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvc()
            .AddJsonOptions(options =>
            {
                options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            })
            .AddFluentValidation();

            services.AddCors();
            services.AddMvc();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "WorkOrders API", Version = "v1"
                });
            });

            var connectionString = Configuration[Consts.Configuration.ConnectionString];
            var biztalk          = Configuration[Consts.Configuration.Biztalk];

            var result = Resolver.BuildServiceProvider(services, connectionString, biztalk);

            return(result);
        }
Beispiel #4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvc(config =>
            {
                // Add XML Content Negotiation
                config.RespectBrowserAcceptHeader = true;
                //config.InputFormatters.Add(new XmlSerializerInputFormatter());
                //config.OutputFormatters.Add(new XmlSerializerOutputFormatter());
            })
            .AddJsonOptions(options =>
            {
                options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            })
            .AddFluentValidation();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "EccSetup API", Version = "v1"
                });
            });

            services.AddCors();

            services.Configure <StorageConfiguration>(Configuration);

            var connectionString = Configuration[Consts.Configuration.ConnectionString];

            var result = Resolver.BuildServiceProvider(services, connectionString);

            return(result);
        }