Created
January 11, 2013 07:56
-
-
Save danielmarbach/4508795 to your computer and use it in GitHub Desktop.
"Microsoft.Usage", "CA2202:Do not dispose objects multiple times"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var stream = new MemoryStream()) | |
using (var writer = new StreamWriter(stream) { AutoFlush = true }) | |
{ | |
writer.Write(message.Xml); | |
stream.Seek(0, SeekOrigin.Begin); | |
this.documentSession.StoreAttachement( | |
"someId", null, stream, new RavenJObject { { "Content-Type", "application/xml" }, }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's equal to the official MSDN documentation: http://msdn.microsoft.com/it-it/library/ms182334.aspx