本文整理汇总了C#中CheckpointTag.ToJson方法的典型用法代码示例。如果您正苦于以下问题:C# CheckpointTag.ToJson方法的具体用法?C# CheckpointTag.ToJson怎么用?C# CheckpointTag.ToJson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CheckpointTag
的用法示例。
在下文中一共展示了CheckpointTag.ToJson方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessEvent
public bool ProcessEvent(
string partition, CheckpointTag eventPosition, string streamId, string eventType, string category, Guid eventid,
int sequenceNumber, string metadata, string data, out string newState, out EmittedEvent[] emittedEvents)
{
CheckDisposed();
if (eventType == null)
throw new ArgumentNullException("eventType");
if (streamId == null)
throw new ArgumentNullException("streamId");
_eventPosition = eventPosition;
_emittedEvents = null;
_query.Push(
data.Trim(), // trimming data passed to a JS
new[]
{
streamId, eventType, category ?? "", sequenceNumber.ToString(CultureInfo.InvariantCulture),
metadata ?? "", partition, eventPosition.ToJson()
});
newState = _query.GetState();
emittedEvents = _emittedEvents == null ? null : _emittedEvents.ToArray();
return true;
}
示例2: GetStatePartition
public string GetStatePartition(
CheckpointTag eventPosition, string streamId, string eventType, string category, Guid eventid,
int sequenceNumber, string metadata, string data)
{
CheckDisposed();
if (eventType == null)
throw new ArgumentNullException("eventType");
if (streamId == null)
throw new ArgumentNullException("streamId");
var partition = _query.GetPartition(
data.Trim(), // trimming data passed to a JS
new string[] { streamId, eventType, category ?? "", sequenceNumber.ToString(CultureInfo.InvariantCulture), metadata ?? "", eventPosition.ToJson() });
if (partition == "")
return null;
else
return partition;
}