Skip to content

Instantly share code, notes, and snippets.

@sakapon
Last active September 17, 2015 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakapon/7642c1731e653906f5c4 to your computer and use it in GitHub Desktop.
Save sakapon/7642c1731e653906f5c4 to your computer and use it in GitHub Desktop.
EventHubsSample / SenderWpf
using System;
using System.Text;
using Microsoft.ServiceBus.Messaging;
using Newtonsoft.Json;
namespace SenderWpf
{
public class AppModel
{
public static void SendMessage()
{
var client = EventHubClient.Create("sakapon-event-201508");
var obj = new { id = 123, text = "Hello" };
var message = JsonConvert.SerializeObject(obj);
var data = new EventData(Encoding.UTF8.GetBytes(message));
client.Send(data);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment