title: Azure ServiceBus Message Serialization/Deserialization
body: <p>I am using a .NET Core application to send an object through an Azure Service Bus Queue and have it received by a Web Job (.NET Core as well.)</p>
  
  <p>My question is how to serialize/deserialize to send/receive the object?</p>
  
  <p>I found lots of references to the legacy <code>BroakerMessage.GetBody()</code> to receive the message, but not to the new .NET Core method. Please advise, thanks.</p>
  
  <p>Sender code:</p>
  
  <pre><code>using Microsoft.Azure.ServiceBus;
  
  MyClass object = new MyClass();
  var message = new Message(object);
  await queueClient.SendAsync(message);
  </code></pre>
  
  <p>Receiver code:</p>
  
  <pre><code>using Microsoft.Azure.ServiceBus;
  
  public void ProcessQueueMessage([ServiceBusTrigger("queue")] Message message, TextWriter log)
  {
  }
  </code></pre>