Example #1
0
 public static ValueTask <IEvent> DeserializeAsync(
     this IEventSerializer serializer,
     Event @event,
     CancellationToken cancellationToken = default)
 {
     return(serializer.DeserializeAsync(@event, cancellationToken));
 }
Example #2
0
 public static ValueTask <T> DeserializeAsync <T>(
     this IEventSerializer serializer,
     Event @event,
     CancellationToken cancellationToken = default)
     where T : IEvent
 {
     return(serializer.DeserializeAsync <Guid, T>(@event, cancellationToken));
 }
Example #3
0
 public static async IAsyncEnumerable <IEvent> DeserializeAsync <T>(
     this IAsyncEnumerable <Event <T> > events,
     IEventSerializer serializer,
     [EnumeratorCancellation] CancellationToken cancellationToken)
 {
     await foreach (var @event in events.WithCancellation(cancellationToken))
     {
         yield return(await serializer.DeserializeAsync(@event, cancellationToken));
     }
 }
Example #4
0
 private Task <IEvent> Deserialize <TAggregateId>(Event <TAggregateId> @event, CancellationToken cancellationToken)
 {
     return(_serializer.DeserializeAsync(@event, cancellationToken).AsTask());
 }