Message Constructor
Definition
Message(string, Uri, string, T, DateTime?)
Initializes a new instance of the Message<T> class.
public Message(string id, Uri source, string type, T data, DateTime? time = null)
Parameters
idstringThe identifier of the message.
sourceUriThe context that describes the origin of the message.
typestringThe type that describes the type of event related to the originating occurrence.
dataTThe payload of the message.
timeDateTime?The time at which this message was generated.
Exceptions
- ArgumentNullException
idcannot be null - or -sourcecannot be null - or -typecannot be null - or -datacannot be null.- ArgumentException
idcannot be empty or consist only of white-space characters - or -typecannot be empty or consist only of white-space characters - or -timewas not expressed as the Coordinated Universal Time (UTC).