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));
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));
public Task <UserState> Handle(GetUser request, CancellationToken cancellationToken) => _hydrator.Hydrate(request.Id).Bind(store => store.Get().ToTryAsync()) .Match(state => state, _ => new (Guid.Empty));