public async Task <VoltageSummaryReadModel> Get(string key, CancellationToken cancellationToken)
        {
            var queryable = _readContext.GetQueryable <VoltageSummary>();
            var iterator  = queryable.Where(p => p.Key == key).ToFeedIterator();
            var response  = await ToReadModel(iterator);

            return(response.FirstOrDefault());
        }
コード例 #2
0
        public async Task <EnergySummaryReadModel> Get(string key, CancellationToken cancellationToken)
        {
            var queryable = _readContext.GetQueryable <EnergySummaryEntity>();
            var iterator  = queryable.Where(p => p.Partition == "ES_" + key).ToFeedIterator();
            var result    = await iterator.ReadNextAsync();

            var response = ToReadModel(result);

            return(response.FirstOrDefault());
        }