コード例 #1
0
 public static Task <T> FindAsync <T>(
     this ISnapshotStore store,
     Guid id,
     CancellationToken cancellationToken)
     where T : class, IAggregate
 {
     return(store.FindAsync <T, Guid>(id, cancellationToken));
 }
コード例 #2
0
 public static Task <TAggregate> FindAsync <TAggregate, TId>(
     this ISnapshotStore store,
     TId id,
     CancellationToken cancellationToken)
     where TAggregate : class, IAggregate <TId>
 {
     return(store.FindAsync <TAggregate, TId>(id, cancellationToken: cancellationToken));
 }
コード例 #3
0
 public static Task <T> FindAsync <T>(
     this ISnapshotStore store,
     Guid id,
     int maxVersion = int.MaxValue,
     CancellationToken cancellationToken = default)
     where T : class, IAggregate
 {
     return(store.FindAsync <T, Guid>(id, maxVersion, cancellationToken));
 }
コード例 #4
0
 /// <summary>
 /// 查找
 /// </summary>
 /// <param name="identity">标识</param>
 /// <returns></returns>
 public static Snapshot Find(this ISnapshotStore snapshotStore, IIdentity identity)
 {
     return(snapshotStore.FindAsync(identity)
            .GetAwaiter()
            .GetResult());
 }