示例#1
0
        public static AbstractActionRepresentationStrategy GetStrategy(bool inline, IOidStrategy oidStrategy, HttpRequest req, ActionContextFacade actionContext, RestControlFlags flags)
        {
            AbstractActionRepresentationStrategy strategy;

            if (inline)
            {
                if (actionContext.Target.IsViewModelEditView)
                {
                    strategy = new FormActionMemberRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
                else if (InlineDetails(actionContext, flags))
                {
                    strategy = new ActionMemberWithDetailsRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
                else
                {
                    strategy = new ActionMemberRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
            }
            else
            {
                if (actionContext.Target.IsViewModelEditView)
                {
                    strategy = new FormActionRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
                else
                {
                    strategy = new ActionRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
            }

            strategy.CreateParameters();

            return(strategy);
        }
        public static AbstractActionRepresentationStrategy GetStrategy(bool inline, IOidStrategy oidStrategy, HttpRequestMessage req, ActionContextFacade actionContext, RestControlFlags flags) {
            AbstractActionRepresentationStrategy strategy;
            if (inline) {
                if (actionContext.Target.IsViewModelEditView) {
                    strategy = new FormActionMemberRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
                else if (InlineDetails(actionContext, flags)) {
                    strategy = new ActionMemberWithDetailsRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
                else {
                    strategy = new ActionMemberRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
            }
            else {
                if (actionContext.Target.IsViewModelEditView) {
                    strategy = new FormActionRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
                else {
                    strategy = new ActionRepresentationStrategy(oidStrategy, req, actionContext, flags);
                }
            }

            strategy.CreateParameters();

            return strategy;
        }