Пример #1
0
        /// <summary>
        /// Loads Default Configuration.
        /// </summary>
        /// <param name="app">App Builder.</param>
        public void Configuration(IAppBuilder app)
        {
            var config = new HttpConfiguration();

            config.MapHttpAttributeRoutes();
            AllowCors(app);
            config.DependencyResolver = GetSpringResolver();
            SwaggerConfiguration.Register(config);
            app.UseWebApi(config);
            SetJsonCamelCaseFormatter(config);
        }
Пример #2
0
 protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
 {
     this.Pipelines = pipelines;
     this.EnableCors(pipelines);
     this.EnableCSRF(pipelines);
     this.SetupLogger(pipelines, container);
     this.AddRequestKey(pipelines, container);
     this.SetupMapper(container);
     Api.ApiBasicConfiguration.Pipelines?.Invoke(pipelines, container);
     SwaggerConfiguration.Register(container.Resolve <JsonSerializerSettings>());
     Api.ApiBasicConfiguration.ApplicationStartup?.Invoke(pipelines, container);
 }