/// <summary> /// Configure the container with the necessary routes for your ServiceStack application. /// </summary> /// <param name="container">The built-in IoC used with ServiceStack.</param> public override void Configure(Container container) { //Permit modern browsers (e.g. Firefox) to allow sending of any REST HTTP Method SetConfig(new EndpointHostConfig { GlobalResponseHeaders = { { "Access-Control-Allow-Origin", "*" }, { "Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS" }, }, }); Plugins.Add(new CorsFeature(allowedHeaders: "Content-Type, Authorization, Session-Id")); ServiceStack.Text.JsConfig.EmitCamelCaseNames = true; var config = new SiteConfig(new ConfigurationResourceManager()); container.Register(config); var logger = new LogHelper(ConfigService.AppName); container.Register(logger); var dbConnectionFactory = new OrmLiteConnectionFactory(ConfigurationManager.ConnectionStrings["MainServer"].ConnectionString, SqlServerDialect.Provider); container.Register<IDbConnectionFactory>(dbConnectionFactory); }
public RecordResponseFilter(string applicationName) { _logHelper = new LogHelper(applicationName); }
public static LogHelper BuildLogHelper(string applicationName) { var lh = new LogHelper(applicationName); lh.BuildApplicationVersion(Assembly.GetExecutingAssembly()); return (lh); }