當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。