예제 #1
0
        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);
            }
        }
예제 #2
0
 internal InternalCacheUpdater(InternalCache internalCache)
 {
     _cache = internalCache;
 }