Working with System.Threading.Tasks.Task<Stream> instead of Stream
问题 I was using a method like below on the previous versions of WCF Web API: // grab the posted stream Stream stream = request.Content.ContentReadStream; // write it to using (FileStream fileStream = File.Create(fullFileName, (int)stream.Length)) { byte[] bytesInStream = new byte[stream.Length]; stream.Read(bytesInStream, 0, (int)bytesInStream.Length); fileStream.Write(bytesInStream, 0, bytesInStream.Length); } But on the preview 6, HttpRequestMessage.Content.ContentReadStream property is gone. I