예제 #1
0
        protected virtual async Task <ICommitTrailStore> GetCommitLogsAsync()
        {
            var commitLogs = new CommitTrailStore(
                this._credentials, this._tenant, this._loggerFactory);

            await commitLogs.InitAsync().ConfigureAwait(false);

            return(commitLogs);
        }
예제 #2
0
        public virtual async Task <IEventStream> GetStreamAsync(Tenant tenant, string streamName)
        {
            var credentials = new StorageCredentials(
                (await this._configStore.GetAsync(StorageConstants.TableAccountName).ConfigureAwait(false)),
                (await this._configStore.GetAsync(StorageConstants.TableAccountKey).ConfigureAwait(false)));

            var commitLogs = new CommitTrailStore(credentials, tenant, _factory);
            var stream     = new EventStream(credentials, tenant, streamName, commitLogs, _factory);

            if (!((await commitLogs.InitAsync().ConfigureAwait(false)) && (await stream.Init().ConfigureAwait(false))))
            {
                throw new InvalidProgramException(Exceptions.FailedToCreateEventStream);
            }
            return(stream);
        }