예제 #1
0
        public static async Task <(CustomerAggregate root, bool ok)> LoadAsync(
            this IEventStoreSession sess,
            string streamId,
            IAggregateRootServices services)
        {
            var aggregate = new CustomerAggregate(streamId, services);
            var success   = await sess.HydrateAsync <CustomerAggregate, Customer>(aggregate).ConfigureAwait(false);

            return(success ? (aggregate, true) : (null, false));
        }
예제 #2
0
 public static async Task <bool> HydrateAsync(this IEventStoreSession sess, CustomerAggregate aggregate)
 {
     return(await sess.HydrateAsync <CustomerAggregate, Customer>(aggregate).ConfigureAwait(false));
 }