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


C# ActionCall.ParentChain方法代码示例

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


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

示例1: GetSwaggerOperations

        public IEnumerable<Operation> GetSwaggerOperations(ActionCall call)
        {
            var parameters = createParameters(call);
            var outputType = call.OutputType();
            var route = call.ParentChain().Route;

            var verbs = getRouteVerbs(route);

            return verbs.Select(verb =>
                                          {
                                              var summary = call.InputType().GetAttribute<DescriptionAttribute>(d => d.Description);

                                              return new Operation
                                                         {
                                                             parameters = parameters.ToArray(),
                                                             httpMethod = verb,
                                                             responseTypeInternal = outputType.FullName,
                                                             responseClass = outputType.Name,
                                                             nickname = call.InputType().Name,
                                                             summary = summary,

                                                             //TODO not sure how we'd support error responses
                                                             errorResponses = new ErrorResponses[0],

                                                             //TODO get notes, nickname, summary from metadata?
                                                         };
                                          });
        }
开发者ID:styson,项目名称:fubumvc-swagger,代码行数:28,代码来源:SwaggerMapper.cs

示例2: Alter

        public override void Alter(ActionCall call)
        {
            var entityType = _entityType ?? call.HandlerType.GetEntityType();

            var role = CrudRules.SecurableNameForViewing(entityType);
            call.ParentChain().Authorization.AddRole(role);
        }
开发者ID:pjdennis,项目名称:fubumvc,代码行数:7,代码来源:LinkToViewAttribute.cs

示例3: Attach

        public virtual void Attach(IViewProfile viewProfile, ViewBag bag, ActionCall action)
        {
            // No duplicate views!
            var outputNode = action.ParentChain().Output;
            if (outputNode.HasView(viewProfile.ConditionType)) return;

            var log = new ViewAttachmentLog(viewProfile);
            action.Trace(log);

            foreach (var filter in _filters)
            {
                var viewTokens = filter.Apply(action, bag);
                var count = viewTokens.Count();

                if (count > 0)
                {
                    log.FoundViews(filter, viewTokens.Select(x => x.Resolve()));
                }

                if (count != 1) continue;

                var token = viewTokens.Single().Resolve();
                outputNode.AddView(token, viewProfile.ConditionType);

                break;
            }
        }
开发者ID:jorferreira,项目名称:fubumvc,代码行数:27,代码来源:ViewAttacher.cs

示例4: Alter

        public override void Alter(ActionCall call)
        {
            var chain = call.ParentChain();

            if (_formatters == FormatterOptions.All)
            {
                chain.Input.AllowHttpFormPosts = true;
                chain.UseFormatter<JsonFormatter>();
                chain.UseFormatter<XmlFormatter>();

                return;
            }

            if ((_formatters & FormatterOptions.Json) != 0)
            {
                chain.UseFormatter<JsonFormatter>();
            }

            if ((_formatters & FormatterOptions.Xml) != 0)
            {
                chain.UseFormatter<XmlFormatter>();
            }

            if ((_formatters & FormatterOptions.Html) != 0)
            {
                chain.Input.AllowHttpFormPosts = true;
            }
            else
            {
                chain.Input.AllowHttpFormPosts = false;
            }
        }
开发者ID:mtscout6,项目名称:fubumvc,代码行数:32,代码来源:ConnegAttribute.cs

示例5: Alter

        public override void Alter(ActionCall call)
        {
            var chain = call.ParentChain();
            var alias = call.BuildRouteForPattern(_pattern);

            chain.AddRouteAlias(alias);
        }
开发者ID:mtscout6,项目名称:fubumvc,代码行数:7,代码来源:UrlAliasAttribute.cs

示例6: Alter

 public override void Alter(ActionCall call)
 {
     var inputType = call.InputType();
     Types.Each(attType =>
     {
         var ruleType = RuleTypeFor(inputType, attType);
         call.ParentChain().Authorization.AddPolicy(ruleType);
     });
 }
开发者ID:RobertTheGrey,项目名称:fubumvc,代码行数:9,代码来源:AuthorizedByAttribute.cs

示例7: addCreationPermission

 private void addCreationPermission(ActionCall action)
 {
     // If there are no other permissioning, add one
     if (!action.HasAttribute<AuthorizationAttribute>())
     {
         var permissionName = CrudRules.SecurableNameForCreation(_entityType);
         action.ParentChain().Authorization.AddRole(permissionName);
     }
 }
开发者ID:pjdennis,项目名称:fubumvc,代码行数:9,代码来源:CrudActionModifier.cs

示例8: Alter

        public override void Alter(ActionCall call)
        {
            var token = new WebFormViewToken(ViewType);
            call.ParentChain().AddToEnd(token.ToBehavioralNode());

            // TODO -- add some tracing back here.
            /*
             *
                    graph.Observer.RecordCallStatus(x,
                      "Action '{0}' has {1} declared, using WebForms view '{2}'".ToFormat(
                        x.Description, typeof(WebFormsEndpointAttribute).Name, token));
             *
             */
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:14,代码来源:WebFormsEndpointAttribute.cs

示例9: Attach

        public void Attach(IViewProfile viewProfile, ViewBag bag, ActionCall action)
        {
            // No duplicate views!
            var outputNode = action.ParentChain().Output;
            if (outputNode.HasView(viewProfile.Condition)) return;

            foreach (var filter in _policy.Filters())
            {
                var viewTokens = filter.Apply(action, bag);
                var count = viewTokens.Count();

                if (count != 1) continue;

                var token = viewTokens.Single().Resolve();

                _attached.Add(token);
                outputNode.AddView(token, viewProfile.Condition);

                break;
            }
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:21,代码来源:ViewAttacher.cs

示例10: Alter

 public override void Alter(ActionCall call)
 {
     var html = call.ParentChain().Output.AddHtml();
     html.MoveToFront();
 }
开发者ID:4lexm,项目名称:fubumvc,代码行数:5,代码来源:Attributes.cs

示例11: Alter

        public override void Alter(ActionCall call)
        {
            var authorizationNode = call.ParentChain().Authorization;

            Types.Each(authorizationNode.Add);
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:6,代码来源:AuthorizedByAttribute.cs

示例12: Alter

 public override void Alter(ActionCall call)
 {
     var chain = call.ParentChain();
     chain.Tags.Fill(_tags);
 }
开发者ID:,项目名称:,代码行数:5,代码来源:

示例13: IsApiCall

 private static bool IsApiCall(ActionCall actionCall)
 {
     return actionCall.ParentChain().InputType().CanBeCastTo<IApi>();
 }
开发者ID:modulexcite,项目名称:dovetail-bootstrap,代码行数:4,代码来源:ConfigureFubuMVC.cs

示例14: Configure

 public void Configure(ActionCall action, MenuItemAttribute att, NavigationGraph graph)
 {
     var registrations = att.ToMenuRegistrations(action.ParentChain());
     graph.AddRegistrations(registrations);
 }
开发者ID:aluetjen,项目名称:fubumvc,代码行数:5,代码来源:MenuItemAttributeConfigurator.cs

示例15: Alter

        public override void Alter(ActionCall call)
        {
            var chain = call.ParentChain();

            Alter(chain);
        }
开发者ID:NeilSorensen,项目名称:fubumvc,代码行数:6,代码来源:CacheAttribute.cs


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