示例#1
0
        public static void AddRouteValues(RouteValueDictionary routeValueDictionary, string routeName, object routeValue)
        {
            IModelUnbinder unbinder = DefaultModelUnbinder;

            if (routeValue != null)
            {
                unbinder = ModelUnbinders.FindUnbinderFor(routeValue.GetType()) ?? (ModelUnbinderProviders.FindUnbinderFor(routeValue.GetType()) ?? DefaultModelUnbinder);
            }
            unbinder.UnbindModel(routeValueDictionary, routeName, routeValue);
        }
            public void UnbindModel(RouteValueDictionary routeValueDictionary, string routeName, object routeValue)
            {
                var typedObject = routeValue as T;

                _unbinder.UnbindModel(routeValueDictionary, routeName, typedObject);
            }