private LinkRepresentation CreateDetailsLink()
        {
            var opts = new List <OptionalProperty>();

            if (propertyContext.Property.IsEager(propertyContext.Target))
            {
                opts.Add(new OptionalProperty(JsonPropertyNames.Value, MemberAbstractRepresentation.Create(OidStrategy, req, propertyContext, Flags)));
            }

            return(LinkRepresentation.Create(OidStrategy, new MemberRelType(new UriMtHelper(OidStrategy, req, propertyContext)), Flags, opts.ToArray()));
        }
示例#2
0
 public RestSnapshot(PropertyContextSurface propertyContext, HttpRequestMessage req, RestControlFlags flags, bool value = false)
     : this(propertyContext, req, false)
 {
     FilterBlobsAndClobs(propertyContext, flags);
     populator = () => {
         if (value)
         {
             representation = CollectionValueRepresentation.Create(propertyContext, req, flags);
         }
         else
         {
             representation = RequestingAttachment() ? AttachmentRepresentation.Create(req, propertyContext, flags) :
                              MemberAbstractRepresentation.Create(req, propertyContext, flags);
         }
         SetHeaders();
     };
 }
        public RestSnapshot(IOidStrategy oidStrategy, PropertyContextFacade propertyContext, HttpRequest req, RestControlFlags flags, bool collectionValue)
            : this(oidStrategy, propertyContext, req, false)
        {
            FilterBlobsAndClobs(propertyContext, flags);
            populator = logger => {
                if (collectionValue)
                {
                    Representation = CollectionValueRepresentation.Create(oidStrategy, propertyContext, req, flags);
                }
                else
                {
                    Representation = RequestingAttachment()
                        ? AttachmentRepresentation.Create(oidStrategy, req, propertyContext, flags)
                        : MemberAbstractRepresentation.Create(oidStrategy, req, propertyContext, flags);
                }

                SetHeaders(logger);
            };
        }