public UriMtHelper(IOidStrategy oidStrategy, HttpRequestMessage req, FilterFromInvokeContext context)
     : this(oidStrategy, req)
 {
     typeAction = context.Id;
     cachedId   = "";
     CachedType = oidStrategy.GetLinkDomainTypeBySpecification(context.ThisSpecification);
 }
 protected FilterFromInvokeRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, FilterFromInvokeContext context, RestControlFlags flags)
     : base(oidStrategy, flags) {
     SelfRelType = new TypeActionFilterInvokeRelType(RelValues.Self, new UriMtHelper(oidStrategy, req, context));
     SetScalar(context);
     SetValue(req, context);
     SetLinks(req, context);
     SetExtensions();
     SetHeader();
 }
Beispiel #3
0
        public RestSnapshot(IOidStrategy oidStrategy, FilterFromInvokeContext filterFromInvokeContext, HttpRequestMessage req, RestControlFlags flags)
            : this(oidStrategy, req, true)
        {
            logger.DebugFormat("RestSnapshot:{0}", filterFromInvokeContext.GetType().FullName);

            populator = () => {
                representation = FilterFromInvokeRepresentation.Create(oidStrategy, req, filterFromInvokeContext, flags);
                SetHeaders();
            };
        }
        private void SetLinks(HttpRequestMessage req, FilterFromInvokeContext context) {
            var uris = context.OtherSpecifications.Select(os => new DomainTypeRelType(new UriMtHelper(OidStrategy, req, os)).GetUri().AbsoluteUri).ToArray();

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

            Links = tempLinks.ToArray();
        }
 public static FilterFromInvokeRepresentation Create(IOidStrategy oidStrategy, HttpRequestMessage req, FilterFromInvokeContext context, RestControlFlags flags) {
     return new FilterFromInvokeRepresentation(oidStrategy, req, context, flags);
 }
 private void SetValue(HttpRequestMessage req, FilterFromInvokeContext context) {
     Id = context.Id;
     Value = context.Value.Select(v => CreateDomainLink(OidStrategy, req, v)).ToArray();
 }
 private void SetScalar(FilterFromInvokeContext context) {
     Id = context.Id;
 }
        public RestSnapshot(IOidStrategy oidStrategy, FilterFromInvokeContext filterFromInvokeContext, HttpRequestMessage req, RestControlFlags flags)
            : this(oidStrategy, req, true) {
            logger.DebugFormat("RestSnapshot:{0}", filterFromInvokeContext.GetType().FullName);

            populator = () => {
                representation = FilterFromInvokeRepresentation.Create(oidStrategy, req, filterFromInvokeContext, flags);
                SetHeaders();
            };
        }
 public UriMtHelper(IOidStrategy oidStrategy, HttpRequestMessage req, FilterFromInvokeContext context)
     : this(oidStrategy, req) {
     typeAction = context.Id;
     cachedId = "";
     CachedType = oidStrategy.GetLinkDomainTypeBySpecification(context.ThisSpecification);
 }