private static Dictionary <string, OutputCacheSetting> LoadConfigFile(string[] files) { string configFilePath = files[0]; if (File.Exists(configFilePath) == false) { throw new FileNotFoundException("未能找到文件:" + configFilePath + " ,如果要启用 SetOutputCacheModule,必须配置这个文件。"); } OutputCacheConfig config = XmlHelper.XmlDeserializeFromFile <OutputCacheConfig>(configFilePath, Encoding.UTF8); return(config.Settings.ToDictionary(x => x.FilePath, StringComparer.OrdinalIgnoreCase)); }
public void Configuration(IAppBuilder app) { //Se utiliza para configurar la ruta del API var config = new HttpConfiguration(); // Habilitar CORS - Para evitar Error No ‘Access-Control-Allow-Origin’ app.UseCors(GetCorsOptions()); // DI & IoC DIConfig.Configure(app, config); // Auth AuthConfig.ConfigureAuthServer(app, config); AuthConfig.ConfigureResourceServer(app); // WebApi WebApiConfig.Configure(app, config); // Cache OutputCacheConfig.Configure(app, config); }