本文整理汇总了C#中IImmutableSet.Sum方法的典型用法代码示例。如果您正苦于以下问题:C# IImmutableSet.Sum方法的具体用法?C# IImmutableSet.Sum怎么用?C# IImmutableSet.Sum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IImmutableSet
的用法示例。
在下文中一共展示了IImmutableSet.Sum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteEvent
protected virtual void WriteEvent(DbCommand command, IPersistentRepresentation e, IImmutableSet<string> tags)
{
var manifest = string.IsNullOrEmpty(e.Manifest) ? e.Payload.GetType().QualifiedTypeName() : e.Manifest;
var serializer = Serialization.FindSerializerFor(e.Payload);
var binary = serializer.ToBinary(e.Payload);
AddParameter(command, "@PersistenceId", DbType.String, e.PersistenceId);
AddParameter(command, "@SequenceNr", DbType.Int64, e.SequenceNr);
AddParameter(command, "@Timestamp", DbType.Int64, TimestampProvider.GenerateTimestamp(e));
AddParameter(command, "@IsDeleted", DbType.Boolean, false);
AddParameter(command, "@Manifest", DbType.String, manifest);
AddParameter(command, "@Payload", DbType.Binary, binary);
if (tags.Count != 0)
{
var tagBuilder = new StringBuilder(";", tags.Sum(x => x.Length) + tags.Count + 1);
foreach (var tag in tags)
{
tagBuilder.Append(tag).Append(';');
}
AddParameter(command, "@Tag", DbType.String, tagBuilder.ToString());
}
else AddParameter(command, "@Tag", DbType.String, DBNull.Value);
}