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()); }
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()); }