public async Task Refresh(string key, Func <Task <IDocument> > doc, Func <Task <Stream> > stream) { if (!AllocatedFiles.Contains(key)) { AllocatedFiles.Add(key); await CacheInvalidator.Allocated(key, doc, stream); } else { await CacheInvalidator.Refresh(key, doc, stream); } }