Last active
September 17, 2015 16:02
-
-
Save sakapon/7642c1731e653906f5c4 to your computer and use it in GitHub Desktop.
EventHubsSample / SenderWpf
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 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