当前位置: 首页>>代码示例>>C#>>正文


C# RouteDefinition.ApplyInputType方法代码示例

本文整理汇总了C#中FubuMVC.Core.Registration.Routes.RouteDefinition.ApplyInputType方法的典型用法代码示例。如果您正苦于以下问题:C# RouteDefinition.ApplyInputType方法的具体用法?C# RouteDefinition.ApplyInputType怎么用?C# RouteDefinition.ApplyInputType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FubuMVC.Core.Registration.Routes.RouteDefinition的用法示例。


在下文中一共展示了RouteDefinition.ApplyInputType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddBasicRouteInputs

        public static void AddBasicRouteInputs(ActionCall call, RouteDefinition route)
        {
            call.InputType()
                .GetProperties()
                .Where(x => x.HasAttribute<RouteInputAttribute>())
                .Each(prop => route.Append("{" + prop.Name + "}"));

            route.ApplyInputType(call.InputType());
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:9,代码来源:DefaultUrlPolicy.cs

示例2: Build

        public IRouteDefinition Build(ActionCall call)
        {
            Type viewModelType = call.HandlerType.GetGenericArguments()[0];

            var route = new RouteDefinition(viewModelType.Name.Replace("ViewModel","").ToLower());
            route.ApplyInputType(viewModelType);
            route.AddHttpMethodConstraint("POST");

            return route;
        }
开发者ID:davidroberts63,项目名称:Fubu-NerdDinner,代码行数:10,代码来源:SaveHandlerUrlPolicy.cs

示例3: Build

        public IRouteDefinition Build(ActionCall call)
        {
            // Later on we need to put in real plural naming.
            string pattern = call.HandlerType.GetGenericArguments()[0].Name.Replace("ViewModel", "") + "es";

            var route = new RouteDefinition(pattern.ToLower());
            route.ApplyInputType(call.InputType());
            route.AddHttpMethodConstraint("GET");

            return route;
        }
开发者ID:davidroberts63,项目名称:Fubu-NerdDinner,代码行数:11,代码来源:ListingHandlerUrlPolicy.cs

示例4: sets_the_full_url

        public void sets_the_full_url()
        {
            var fullUrl = "this/is/a/test";

            var route = new RouteDefinition("blah");
            route.ApplyInputType(typeof(object));
            
            theChain.Route = route;
            
            theUrlResolver.Stub(x => x.UrlFor(theInput, theChain)).Return(fullUrl);
            theResolver.Stub(x => x.Find(theSearch)).Return(theChain);

            theRequest.Attach(theServices);

            theRequest.Url.ShouldEqual(fullUrl);
        }
开发者ID:joemcbride,项目名称:FubuMVC.Core.UI,代码行数:16,代码来源:FormRequestTester.cs

示例5: Build

        public IRouteDefinition Build(ActionCall call)
        {
            string pattern = call.HandlerType.GetGenericArguments()[0].Name.Replace("ViewModel", "");

            var route = new RouteDefinition(pattern.ToLower());
            route.Append("{Id}");

            if (call.InputType().Name.StartsWith("Edit`"))
            {
                route.Append("edit");
            }
            else if (call.InputType().Name.StartsWith("Get`"))
            {
                route.Append("view");
            }

            route.ApplyInputType(call.InputType());
            route.AddHttpMethodConstraint("GET");

            return route;
        }
开发者ID:davidroberts63,项目名称:Fubu-NerdDinner,代码行数:21,代码来源:GetHandlerUrlPolicy.cs


注:本文中的FubuMVC.Core.Registration.Routes.RouteDefinition.ApplyInputType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。