示例#1
0
        /// <summary>
        /// 获取路由配置
        /// </summary>
        public Dictionary <string, List <CustomRouteData> > GetRouteDatas()
        {
            var routeDic = new Dictionary <string, List <CustomRouteData> >();
            var routeSet = JsonConfigurationHelper.GetAppSettings <List <CustomRouteData> >(Path.Combine(_rootPath, "App_Data"), "routesettings.json", "RouteTable");

            var singleDic = routeSet.GroupBy(o => o.BusinessCode).ToDictionary(
                k => k.Key,
                v => v.Select(o => o).ToList()
                );

            //跨配置文件BusinessCode必须保持唯一
            foreach (var route in singleDic)
            {
                routeDic.Add(route.Key, route.Value);
            }
            return(routeDic);
        }
示例#2
0
 /// <summary>
 /// 获取Host配置
 /// </summary>
 /// <returns></returns>
 public List <ServiceHostData> GetHostDatas()
 {
     return(JsonConfigurationHelper.GetAppSettings <List <ServiceHostData> >(Path.Combine(_rootPath, "App_Data"), "hostsettings.json", "HostTable"));
 }