Ejemplo n.º 1
0
 /// <summary>
 /// Closes the save stream if there's any and sets it to null
 /// </summary>
 internal void CloseSaveStream()
 {
     if (this.SaveStream != null)
     {
         DataServiceSaveStream stream = this.SaveStream;
         this.SaveStream = null;
         stream.Close();
     }
 }
Ejemplo n.º 2
0
 private void SetupMediaResourceRequest(ODataRequestMessageWrapper mediaResourceRequest, DataServiceSaveStream saveStream, string etag)
 {
     IEnumerable<string> keys;
     base.mediaResourceRequestStream = saveStream.Stream;
     WebUtil.ApplyHeadersToRequest(saveStream.Args.Headers, mediaResourceRequest, true);
     Dictionary<string, string> headers = saveStream.Args.Headers;
     if (headers.ContainsKey("Accept"))
     {
         keys = new List<string>(headers.Count - 1);
         foreach (string str in headers.Keys)
         {
             if (str != "Accept")
             {
                 ((List<string>) keys).Add(str);
             }
         }
     }
     else
     {
         keys = headers.Keys;
     }
     mediaResourceRequest.AddHeadersToReset(keys);
     if (etag != null)
     {
         mediaResourceRequest.SetHeader("If-Match", etag);
         mediaResourceRequest.AddHeadersToReset("If-Match");
     }
 }