Interface for sending IJsonMessage messages.
The example below demonstrates sending a JSON image message.
using System.Collections.Generic;
namespace DataSourceExamples.Messaging.JSON
{
class SendingAJSONMessage
{
void SendJSONMessage(ICachingPublisher publisher, string subject)
{
IJsonMessage message = publisher.CachedMessageFactory.CreateJsonMessage(subject, new Person("Andrew"));
publisher.Publish(message);
}
}
internal class Person
{
public Person() { }
public string Email { get; set; }
public bool Active { get; set; }
public System.DateTime CreatedDate {
get;
set; }
public IList<string> Roles { get; set; }
public Person(String name)
{
this.name = name;
Email = name;
}
private String name;
public String getName()
{
return name;
}
}
}