private InternalCache(InternalCache details) { _mergeRequests = new Dictionary <ProjectKey, IEnumerable <MergeRequest> >(); _versions = new Dictionary <MergeRequestKey, IEnumerable <Version> >(); _commits = new Dictionary <MergeRequestKey, IEnumerable <Commit> >(); _approvals = new Dictionary <MergeRequestKey, MergeRequestApprovalConfiguration>(); foreach (KeyValuePair <ProjectKey, IEnumerable <MergeRequest> > kv in details._mergeRequests) { _mergeRequests[kv.Key] = kv.Value.ToArray(); // make a copy } foreach (KeyValuePair <MergeRequestKey, IEnumerable <Version> > kv in details._versions) { SetVersions(kv.Key, kv.Value.ToArray()); // make a copy } foreach (KeyValuePair <MergeRequestKey, IEnumerable <Commit> > kv in details._commits) { SetCommits(kv.Key, kv.Value.ToArray()); // make a copy } foreach (KeyValuePair <MergeRequestKey, MergeRequestApprovalConfiguration> kv in details._approvals) { SetApprovals(kv.Key, kv.Value); } }
internal InternalCacheUpdater(InternalCache internalCache) { _cache = internalCache; }