Esempio n. 1
0
        public ActionResult GetAllConfig()
        {
            //读取整个配置文件的配置
            var config = AppConfigurtaionServices.GetSectionObject <AppsettingConfig>();

            return(new JsonResult(config));
            //返回:{"connectionStrings":{"cxyOrder":"Server=LAPTOP-AQUL6MDE\\MSSQLSERVERS;Database=CxyOrder;User ID=sa;Password=123456;Trusted_Connection=False;"},"appsettings":{"systemName":"PDF .NET CORE","date":"2017-07-23T00:00:00","author":"PDF"},"serviceUrl":"https://www.baidu.com/getnews"}
        }
Esempio n. 2
0
        public ActionResult GetConfig()
        {
            //读取Appsettings节点配置
            var config = AppConfigurtaionServices.GetSectionObject <Appsettings>("Appsettings");

            return(new JsonResult(config));
            //返回:{"systemName":"PDF .NET CORE","date":"2017-07-23T00:00:00","author":"PDF"}
        }