Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="app"></param>
        public void Configuration(IAppBuilder app)
        {
            HttpConfiguration config = new HttpConfiguration();

            RouteConfig.Configure(config);
            FormatterConfig.Configure(config);
            SwaggerConfig.Configure(config);

            app.UseWebApi(config);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Specifies how the ASP.NET application will respond to individual HTTP request.
        /// </summary>
        /// <param name="app">Instance of <see cref="IAppBuilder"/>.</param>
        public void Configuration(IAppBuilder app)
        {
            var corsOptions = CorsConfig.ConfigureCors(ConfigurationManager.AppSettings["cors"]);

            app.UseCors(corsOptions);

            var configuration = new HttpConfiguration();

            FormatterConfig.Configure(configuration);
            RouteConfig.Configure(configuration);
            ServiceConfig.Configure(configuration);

            app.UseWebApi(configuration);
        }
Exemplo n.º 3
0
        public static HttpConfiguration Build(Container container)
        {
            var configuration = new HttpConfiguration();

            FormatterConfig.Configure(configuration);
            SwaggerConfig.Configure(configuration);

            container.RegisterWebApiControllers(configuration, Assembly.GetExecutingAssembly(), typeof(IpAdressesController).Assembly);
            container.EnableHttpRequestMessageTracking(configuration);
            configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container);

            configuration.MapHttpAttributeRoutes();

            container.Verify();
            return(configuration);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Specifies how the ASP.NET application will respond to individual HTTP request.
        /// </summary>
        /// <param name="app">Instance of <see cref="IAppBuilder"/>.</param>
        public void Configuration(IAppBuilder app)
        {
            CorsConfig.ConfigureCors(ConfigurationManager.AppSettings["cors"]);
            app.UseCors(CorsConfig.Options);

            var configuration = new HttpConfiguration();

            AutofacConfig.Configure(configuration);
            app.UseAutofacMiddleware(AutofacConfig.Container);

            FormatterConfig.Configure(configuration);
            RouteConfig.Configure(configuration);
            ServiceConfig.Configure(configuration);

            app.UseWebApi(configuration);
        }
Exemplo n.º 5
0
        protected void Application_Start(object sender, EventArgs e)
        {
            GlobalConfiguration.Configure(config =>
            {
                RouterConfig.Configure(config);

                /* GlobalConfiguration.Configure(configuration =>
                 *  {
                 *      configuration.Routes.MapHttpRoute(
                 *          name: "DefaulApi",
                 *          routeTemplate: "api/{controller}/{id}",
                 *          defaults: new { id = RouteParameter.Optional });
                 *
                 *  });
                 */
                FormatterConfig.Configure(config);
            });
        }
Exemplo n.º 6
0
        /// <summary>
        /// Specifies how the ASP.NET application will respond to individual HTTP request.
        /// </summary>
        /// <param name="app">Instance of <see cref="IAppBuilder"/>.</param>
        public void Configuration(IAppBuilder app)
        {
            LogConfig.Configure();

            app.UseRequestLogging();

            CorsConfig.ConfigureCors(ConfigurationManager.AppSettings["cors"]);
            app.UseCors(CorsConfig.Options);

            HttpConfiguration configuration = new HttpConfiguration();

            FormatterConfig.Configure(configuration);
            RouteConfig.Configure(configuration);
            ServiceConfig.Configure(configuration);
            SwaggerConfig.Configure(configuration);

            app.UseWebApi(configuration);
            MappingProfile map = new MappingProfile();

            map.Iniciar();
        }
        /// <summary>
        /// Specifies how the ASP.NET application will respond to individual HTTP request.
        /// </summary>
        /// <param name="app">Instance of <see cref="IAppBuilder"/>.</param>
        public void Configuration(IAppBuilder app)
        {
            CorsConfig.ConfigureCors(ConfigurationManager.AppSettings["cors"]);
            app.UseCors(CorsConfig.Options);

            var configuration = new HttpConfiguration();

            AutofacConfig.Configure(configuration);
            app.UseAutofacMiddleware(AutofacConfig.Container);

            FormatterConfig.Configure(configuration);
            RouteConfig.Configure(configuration);
            ServiceConfig.Configure(configuration);
            SwaggerConfig.Configure(configuration);

            app.Use((context, next) =>
            {
                context.Response.Headers.Remove("Server");
                return(next.Invoke());
            });

            app.UseWebApi(configuration);
        }