Пример #1
0
 /// <summary>
 /// Creates a new instance of AstoriaRequestMessage. This is meant to be a constructor for unit tests only.
 /// </summary>
 /// <param name="host">IDataServiceHost instance to access all the request headers.</param>
 /// <param name="selector">Object to select acceptable content types.</param>
 internal AstoriaRequestMessage(IDataServiceHost host, IAcceptableContentTypeSelector selector)
 {
     Debug.Assert(host != null, "host != null");
     this.host     = host;
     this.httpVerb = HttpVerbs.None;
     this.acceptableContentTypeSelector = selector;
     this.CacheHeaders();
 }
Пример #2
0
        public void AttachHost(IDataServiceHost host)
        {
            if (host == null)
            {
                throw new ArgumentNullException();
            }

            throw new NotImplementedException();
        }
Пример #3
0
 /// <summary>
 /// Constructs a new instance of DataServiceOperationContext object
 /// </summary>
 /// <param name="host">RequestMessage instance for the current operation context.</param>
 internal DataServiceOperationContext(IDataServiceHost host)
 {
     Debug.Assert(host != null, "host != null");
     this.hostInterface   = host;
     this.lazyMetadataUri = new SimpleLazy <Uri>(() =>
     {
         Debug.Assert(this.AbsoluteServiceUri != null, "Cannot get the metadata uri if the absolute service uri is not initialized");
         return(RequestUriProcessor.AppendEscapedSegment(this.AbsoluteServiceUri, XmlConstants.UriMetadataSegment));
     });
 }
 /// <summary>
 /// Constructs a new instance of DataServiceOperationContext object
 /// </summary>
 /// <param name="host">RequestMessage instance for the current operation context.</param>
 internal DataServiceOperationContext(IDataServiceHost host)
 {
     Debug.Assert(host != null, "host != null");
     this.hostInterface = host;
     this.lazyMetadataUri = new SimpleLazy<Uri>(() =>
     {
         Debug.Assert(this.AbsoluteServiceUri != null, "Cannot get the metadata uri if the absolute service uri is not initialized");
         return RequestUriProcessor.AppendEscapedSegment(this.AbsoluteServiceUri, XmlConstants.UriMetadataSegment);
     });
 }
Пример #5
0
 internal DataServiceHostWrapper(IDataServiceHost host)
 {
     this.host                 = host;
     this.httpVerb             = HttpVerbs.None;
     this.requestAccept        = host.RequestAccept;
     this.requestAcceptCharSet = host.RequestAcceptCharSet;
     this.requestContentType   = host.RequestContentType;
     this.requestIfMatch       = host.RequestIfMatch;
     this.requestIfNoneMatch   = host.RequestIfNoneMatch;
 }
 /// <summary>
 /// Constructs an instance of the DataServiceHostWrapper object.
 /// </summary>
 /// <param name="host">IDataServiceHost instance to wrap.</param>
 internal DataServiceHostWrapper(IDataServiceHost host)
 {
     Debug.Assert(host != null, "host != null");
     this.host                 = host;
     this.astoriaHttpVerb      = AstoriaVerbs.None;
     this.requestAccept        = host.RequestAccept;
     this.requestAcceptCharSet = host.RequestAcceptCharSet;
     this.requestContentType   = host.RequestContentType;
     this.requestIfMatch       = host.RequestIfMatch;
     this.requestIfNoneMatch   = host.RequestIfNoneMatch;
     this.requestMaxVersion    = host.RequestMaxVersion;
     this.requestVersion       = host.RequestVersion;
 }
Пример #7
0
        /// <summary>A helper method for DataService.ctor(host).</summary>
        public void WebDataServiceConstructorTestHelper <T>(IDataServiceHost host)
        {
            DataService <T> target = new DataService <T>();

            target.AttachHost(host);
        }
Пример #8
0
 /// <summary>
 /// Creates a new instance of AstoriaRequestMessage.
 /// </summary>
 /// <param name="host">IDataServiceHost instance to access all the request headers.</param>
 internal AstoriaRequestMessage(IDataServiceHost host)
     : this(host, new AcceptableContentTypeSelector())
 {
 }
 /// <summary>
 /// Constructs a new instance of DataServiceOperationContext object
 /// </summary>
 /// <param name="host">Host instance for the current operation context.</param>
 internal DataServiceOperationContext(IDataServiceHost host)
 {
     Debug.Assert(host != null, "host != null");
     this.hostInterface = host;
 }
Пример #10
0
 public void AttachHost(IDataServiceHost host)
 {
   Contract.Requires(host != null);
 }
Пример #11
0
 /// <summary>
 /// Creates a new instance of AstoriaResponseMessage.
 /// </summary>
 /// <param name="host">Host instance associated with this request.</param>
 internal AstoriaResponseMessage(IDataServiceHost host)
 {
     Debug.Assert(host != null, "host != null");
     this.host2 = host as IDataServiceHost2;
     this.host  = host;
 }
 /// <summary>
 /// Constructs a new instance of DataServiceOperationContext object
 /// </summary>
 /// <param name="host">Host instance for the current operation context.</param>
 internal DataServiceOperationContext(IDataServiceHost host)
 {
     Debug.Assert(host != null, "host != null");
     this.hostInterface = host;
 }
Пример #13
0
        public IAsyncResult BeginPerformOperation(IAccountIdentifier accountId, string accountName, IDataServiceHost host, RequestStartedCallback requestStartedCallback, CheckPermissionDelegate checkPermissionCallback, QueryRowCommandPropertiesAvailableCallback queryRowCommandPropertiesAvailableCallback, Dictionary <string, string> continuationToken, ContinuationTokenAvailableCallback continuationTokenAvailableCallback, bool operationIsConditional, RequestContext requestContext, AsyncCallback callback, object state)
        {
            TableProtocolHead tableProtocolHead = host as TableProtocolHead;

            NephosAssertionException.Assert(tableProtocolHead != null, "Expecting host to be instance of TableProtocolHead.");
            AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("TableManager.PerformOperation", callback, state);

            asyncIteratorContext.Begin(this.PerformOperationImpl(accountId, accountName, tableProtocolHead, requestStartedCallback, checkPermissionCallback, queryRowCommandPropertiesAvailableCallback, continuationToken, continuationTokenAvailableCallback, operationIsConditional, requestContext, asyncIteratorContext));
            return(asyncIteratorContext);
        }
Пример #14
0
 internal DataServiceOperationContext(IDataServiceHost host)
 {
     this.hostInterface = host;
 }
 internal DataServiceOperationContext(IDataServiceHost host)
 {
     this.hostInterface = host;
 }
Пример #16
0
 /// <summary>
 /// Creates a new instance of AstoriaResponseMessage.
 /// </summary>
 /// <param name="host">Host instance associated with this request.</param>
 internal AstoriaResponseMessage(IDataServiceHost host)
 {
     Debug.Assert(host != null, "host != null");
     this.host2 = host as IDataServiceHost2;
     this.host = host;
 }