"景先生毕设|www.jxszl.com

C# AppSettings类代码示例

2023-12-29 17:05编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中AppSettings类的典型用法代码示例。如果您正苦于以下问题:C#AppSettings类的具体用法?C#AppSettings怎么用?C#AppSettings使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:Configure publicoverridevoidConfigure(Funq.Containercontainer) { //SetJSONwebservicestoreturnidiomaticJSONcamelCaseproperties ServiceStack.Text.JsConfig.EmitCamelCaseNames=true; ControllerBuilder.Current.SetControllerFactory(newFunqControllerFactory(container)); varappSettings=newAppSettings(); varconnString=appSettings.Get("SQLSERVER_CONNECTION_STRING", ConfigUtils.GetConnectionString("UserAuth")); container.Register( newOrmLiteConnectionFactory(connString,SqlServerDialect.Provider)); //Usinganin-memorycache container.Register(newMemoryCacheClient()); ConfigureAuth(container); vardbFactory=container.Resolve(); dbFactory.Run(d=>d.CreateTableIfNotExists()); dbFactory.Run(db=>db.CreateTableIfNotExists()); dbFactory.Run(d=>d.CreateTableIfNotExists()); SetConfig(newEndpointHostConfig { DefaultContentType=ContentType.Json, EnableFeatures=Feature.All.Remove(Feature.Html).Remove(Feature.Xml), AppendUtf8CharsetOnContentTypes=newHashSet{ContentType.Json} }); //OrifHazRedis //container.Register(newPooledRedisClientManager()); }
原文链接:http://www.jxszl.com/biancheng/C/556562.html