public UriMtHelper(IOidStrategy oidStrategy, HttpRequestMessage req, TypeActionInvokeContext context)
     : this(oidStrategy, req)
 {
     typeAction = context.Id;
     cachedId   = "";
     CachedType = oidStrategy.GetLinkDomainTypeBySpecification(context.ThisSpecification);
 }
Beispiel #2
0
 protected TypeActionInvokeRepresentation(HttpRequestMessage req, TypeActionInvokeContext context, RestControlFlags flags) : base(flags) {
     SelfRelType = new TypeActionInvokeRelType(RelValues.Self, new UriMtHelper(req, context));
     SetScalars(context);
     SetLinks(req, context);
     SetExtensions();
     SetHeader();
 }
Beispiel #3
0
        public RestSnapshot(TypeActionInvokeContext typeActionInvokeContext, HttpRequestMessage req, RestControlFlags flags)
            : this(req, true)
        {
            logger.DebugFormat("RestSnapshot:{0}", typeActionInvokeContext.GetType().FullName);

            populator = () => {
                representation = TypeActionInvokeRepresentation.Create(req, typeActionInvokeContext, flags);
                SetHeaders();
            };
        }
        private void SetLinks(HttpRequestMessage req, TypeActionInvokeContext context) {
            string uri = new DomainTypeRelType(new UriMtHelper(OidStrategy, req, context.OtherSpecification)).GetUri().AbsoluteUri;

            var tempLinks = new List<LinkRepresentation> {
                LinkRepresentation.Create(OidStrategy,SelfRelType,
                    Flags,
                    new OptionalProperty(JsonPropertyNames.Arguments,
                        MapRepresentation.Create(new OptionalProperty(context.ParameterId,
                            MapRepresentation.Create(new OptionalProperty(JsonPropertyNames.Href,
                                uri))))))
            };

            Links = tempLinks.ToArray();
        }
 public static TypeActionInvokeRepresentation Create(IOidStrategy oidStrategy, HttpRequestMessage req, TypeActionInvokeContext context, RestControlFlags flags) {
     return new TypeActionInvokeRepresentation(oidStrategy, req, context, flags);
 }
 private void SetScalars(TypeActionInvokeContext context) {
     Id = context.Id;
     Value = context.Value;
 }
        public RestSnapshot(IOidStrategy oidStrategy, TypeActionInvokeContext typeActionInvokeContext, HttpRequestMessage req, RestControlFlags flags)
            : this(oidStrategy,req, true) {
            logger.DebugFormat("RestSnapshot:{0}", typeActionInvokeContext.GetType().FullName);

            populator = () => {
                representation = TypeActionInvokeRepresentation.Create(oidStrategy, req, typeActionInvokeContext, flags);
                SetHeaders();
            };
        }
Beispiel #8
0
 public UriMtHelper(HttpRequestMessage req, TypeActionInvokeContext context)
     : this(req) {
     typeAction = context.Id;
     cachedId = "";
     cachedType = OidStrategyHolder.OidStrategy.GetLinkDomainTypeBySpecification(context.ThisSpecification);
 }