private async Task FillCache(IEnumerable <int> entities) { var missing = entities.Except(_cache.Where(e => e.Value.Entity != null).Select(e => e.Key)).ToList(); if (missing.Count == 0) { return; } foreach (var entity in await CaptureTime(() => _graph.GetEntities(missing))) { _cache.Get(entity.Id).Entity = entity; } }
protected override Task <IReadOnlyCollection <Entity> > GetItems(IEnumerable <int> ids) { return(_source.GetEntities(ids)); }