Пример #1
0
        public async Task <IStreamsIdData> GetOrCreateAsync(string clientId)
        {
            var partitionKey = StreamsIdEntity.GeneratePartitionKey();
            var rowKey       = StreamsIdEntity.GenerateRowKey(clientId);

            var data = await _streamsIdTableStorage.GetDataAsync(partitionKey, rowKey);

            if (data != null)
            {
                return(data);
            }

            var newEntity = StreamsIdEntity.Create(new StreamsIdEntity {
                ClientId = clientId
            });
            await _streamsIdTableStorage.InsertAsync(newEntity);

            return(newEntity);
        }
Пример #2
0
        public async Task <IEnumerable <IStreamsIdData> > GetStreamsIdsAsync()
        {
            var partitionKey = StreamsIdEntity.GeneratePartitionKey();

            return(await _streamsIdTableStorage.GetDataAsync(partitionKey));
        }