コード例 #1
0
 private void SetScalars(ActionTypeContextFacade actionTypeContext) {
     Id = actionTypeContext.ActionContext.Id;
     FriendlyName = actionTypeContext.ActionContext.Action.Name;
     Description = actionTypeContext.ActionContext.Action.Description;
     HasParams = actionTypeContext.ActionContext.VisibleParameters.Any();
     MemberOrder = actionTypeContext.ActionContext.Action.MemberOrder;
 }
コード例 #2
0
 private void SetParameters(HttpRequestMessage req, ActionTypeContextFacade actionTypeContext) {
     IEnumerable<LinkRepresentation> parms = actionTypeContext.ActionContext.VisibleParameters.
         Select(p => LinkRepresentation.Create(OidStrategy,new ParamTypeRelType(new UriMtHelper(OidStrategy, req, new ParameterTypeContextFacade {
             Action = actionTypeContext.ActionContext.Action,
             OwningSpecification = actionTypeContext.OwningSpecification,
             Parameter = p.Parameter
         })), Flags));
     Parameters = parms.ToArray();
 }
コード例 #3
0
 protected ActionTypeRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, ActionTypeContextFacade actionTypeContext, RestControlFlags flags)
     : base(oidStrategy, flags) {
     SelfRelType = new TypeMemberRelType(RelValues.Self, new UriMtHelper(oidStrategy ,req, actionTypeContext));
     SetScalars(actionTypeContext);
     SetLinks(req, actionTypeContext);
     SetParameters(req, actionTypeContext);
     SetExtensions();
     SetHeader();
 }
コード例 #4
0
        private void SetLinks(HttpRequestMessage req, ActionTypeContextFacade actionTypeContext) {
            var domainTypeUri = new UriMtHelper(OidStrategy, req, actionTypeContext);
            var tempLinks = new List<LinkRepresentation> {
                LinkRepresentation.Create(OidStrategy, SelfRelType, Flags),
                LinkRepresentation.Create(OidStrategy ,new DomainTypeRelType(RelValues.Up, domainTypeUri), Flags),
                LinkRepresentation.Create(OidStrategy, new DomainTypeRelType(RelValues.ReturnType, new UriMtHelper(OidStrategy, req, actionTypeContext.ActionContext.Action.ReturnType)), Flags)
            };

            if (actionTypeContext.ActionContext.Action.ReturnType.IsCollection) {
                tempLinks.Add(LinkRepresentation.Create(OidStrategy ,new DomainTypeRelType(RelValues.ElementType, new UriMtHelper(OidStrategy, req, actionTypeContext.ActionContext.Action.ElementType)), Flags));
            }

            Links = tempLinks.ToArray();
        }
コード例 #5
0
 public static ActionTypeRepresentation Create(IOidStrategy oidStrategy, HttpRequestMessage req, ActionTypeContextFacade actionTypeContext, RestControlFlags flags) {
     return new ActionTypeRepresentation(oidStrategy, req, actionTypeContext, flags);
 }
コード例 #6
0
        public RestSnapshot(IOidStrategy oidStrategy, ActionTypeContextFacade actionTypeContext, HttpRequestMessage req, RestControlFlags flags)
            : this(oidStrategy,req, true) {
            logger.DebugFormat("RestSnapshot:{0}", actionTypeContext.GetType().FullName);

            populator = () => {
                representation = ActionTypeRepresentation.Create(oidStrategy ,req, actionTypeContext, flags);
                SetHeaders();
            };
        }
コード例 #7
0
 public UriMtHelper(IOidStrategy oidStrategy, HttpRequestMessage req, ActionTypeContextFacade actionTypeContext)
     : this(oidStrategy ,req) {
     action = actionTypeContext.ActionContext.Action;
     spec = actionTypeContext.OwningSpecification;
     cachedId = "";
     CachedType = spec.DomainTypeName(oidStrategy);
 }