daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Dec 14th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var message = new BrokeredMessage(objMess.MessageBody);
  2.    
  3. var reader = new StreamReader(receivedMessage.GetBody<Stream>());
  4.  
  5. @string3http://schemas.microsoft.com/2003/10/Serialization/�  .
  6. Rest of Message Body
  7.    
  8. private BrokeredMessage GetBrokeredMessageWithBody(object body)
  9. {
  10.     var json = JsonConvert.SerializeObject(body);
  11.     return new BrokeredMessage(GenerateStreamFromString(json));
  12. }
  13.  
  14. private Stream GenerateStreamFromString(string s)
  15. {
  16.     var stream = new MemoryStream();
  17.     var writer = new StreamWriter(stream);
  18.     writer.Write(s);
  19.     writer.Flush();
  20.     stream.Position = 0;
  21.     return stream;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top