Esempio n. 1
0
        public static MyRouteInfo GetRouteInfo(this MyRequestContext context)
        {
            var info     = new MyRouteInfo();
            var theGroup = context.GetOrCreate(context.GetGroupName_RouteInfos());

            theGroup.Items.SetProperties(info);
            return(info);
        }
Esempio n. 2
0
        public static MyRequestContext SetRouteInfo(this MyRequestContext context, RouteData routeData)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var theGroup = context.GetOrCreate(context.GetGroupName_RouteInfos());

            foreach (var item in routeData.DataTokens)
            {
                theGroup.Items[item.Key] = item.Value?.ToString();
            }
            foreach (var item in routeData.Values)
            {
                theGroup.Items[item.Key] = item.Value?.ToString();
            }
            return(context);
        }