Ejemplo n.º 1
0
 public Task <StoreFrontState> Handle(GetStock request, CancellationToken cancellationToken) =>
 _hydrator.Hydrate(request.OwnerId)
 .Bind(store => store.Get().ToTryAsync())
 .Match(state => state, _ => new StoreFrontState(Guid.Empty, ImmutableDictionary <Guid, Item> .Empty));
Ejemplo n.º 2
0
 public Task <AccountLedgerState> Handle(GetAccountBalance request, CancellationToken cancellationToken) =>
 _hydrator.Hydrate(request.OwnerId)
 .Bind(store => store.Get().ToTryAsync())
 .Match(state => state, _ => new AccountLedgerState(Guid.Empty, 0));
Ejemplo n.º 3
0
 public Task <UserState> Handle(GetUser request, CancellationToken cancellationToken) =>
 _hydrator.Hydrate(request.Id).Bind(store => store.Get().ToTryAsync())
 .Match(state => state, _ => new (Guid.Empty));