Ejemplo n.º 1
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);
            };
        }