DataSource.NET  8.0.3.290770-7760911e
Caplin.DataSource.Messaging.JSON.IJsonMessage Interface Reference

Interface for sending IJsonMessage messages. More...

Inheritance diagram for Caplin.DataSource.Messaging.JSON.IJsonMessage:
Caplin.DataSource.Messaging.IMessage Caplin.DataSource.Messaging.JSON.IJsonChannelMessage

Public Member Functions

bool IsPatch ()
 Checks if the JSON object is a patch. More...
 

Properties

string JsonString [get]
 Gets the the JSON object string. More...
 
Object JsonTree [get]
 Gets the the JSON object. More...
 
string JsonTreeString [get, set]
 Gets the the JSON tree string represenatation. More...
 
- Properties inherited from Caplin.DataSource.Messaging.IMessage
bool Image [get, set]
 Gets or sets a boolean value indicating whether this IMessage represents an image or an update. More...
 
string Subject [get]
 Gets the subject of this message. More...
 

Detailed Description

Interface for sending IJsonMessage messages.

The example below demonstrates sending a JSON image message.

using System;
using System.Collections.Generic;
namespace DataSourceExamples.Messaging.JSON
{
class SendingAJSONMessage
{
void SendJSONMessage(ICachingPublisher publisher, string subject)
{
// Create a JSON message.
IJsonMessage message = publisher.CachedMessageFactory.CreateJsonMessage(subject, new Person("Andrew"));
// Send the message to subscribed peers.
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;
}
}
}

Member Function Documentation

bool Caplin.DataSource.Messaging.JSON.IJsonMessage.IsPatch ( )

Checks if the JSON object is a patch.

True if the object is a patch, false if it's an image.

Property Documentation

string Caplin.DataSource.Messaging.JSON.IJsonMessage.JsonString
get

Gets the the JSON object string.

The JSON text. This may represent a JSON image or a JSON patch.

Object Caplin.DataSource.Messaging.JSON.IJsonMessage.JsonTree
get

Gets the the JSON object.

string Caplin.DataSource.Messaging.JSON.IJsonMessage.JsonTreeString
getset

Gets the the JSON tree string represenatation.


Generated on Wed Jul 31 2024 17:13:02 for DataSource.NET