7 instantiations of GraphItem
NuGet.Commands (4)
RestoreCommand\DependencyGraphResolver.cs (3)
606Item = new GraphItem<RemoteResolveResult>( 684Item = new GraphItem<RemoteResolveResult>( 693Item = new GraphItem<RemoteResolveResult>(toResolvedDependencyGraphItem.Item.Key)
RestoreCommand\DependencyGraphResolver.DependencyGraphItem.cs (1)
132return new GraphItem<RemoteResolveResult>(item.Key)
NuGet.DependencyResolver.Core (3)
Remote\RemoteDependencyWalker.cs (1)
320node.Item = new GraphItem<RemoteResolveResult>(node.Item.Key)
ResolverUtility.cs (2)
146return new GraphItem<RemoteResolveResult>(match.Library) 558return new GraphItem<RemoteResolveResult>(match.Library)
101 references to GraphItem
NuGet.CommandLine.XPlat (1)
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (1)
483var firstMatchingEntry = matchingPackageEntries
NuGet.Commands (46)
RestoreCommand\CompatibilityChecker.cs (2)
70foreach (var node in graph.Flattened) 341private async Task VerifyDotnetToolCompatibilityChecks(CompatibilityData compatibilityData, GraphItem<RemoteResolveResult> node, RestoreTargetGraph graph, List<CompatibilityIssue> issues)
RestoreCommand\DependencyGraphResolver.cs (2)
328HashSet<GraphItem<RemoteResolveResult>> flattenedGraphItems = new(); 978GraphItem<RemoteResolveResult> currentGraphItem = await currentDependencyGraphItem.GetGraphItemAsync(_request.Project.RestoreMetadata, projectTargetFramework.PackagesToPrune, IsNewerThanNET10(projectTargetFramework.FrameworkName), isRootProject, targetGraphName, _logger);
RestoreCommand\DependencyGraphResolver.DependencyGraphItem.cs (6)
25/// Gets or initializes a <see cref="Task{TResult}" /> that returns a <see cref="GraphItem{TItem}" /> containing a <see cref="RemoteResolveResult" /> that represents the resolved graph item after looking it up in the configured feeds. 27public required Task<GraphItem<RemoteResolveResult>> FindLibraryTask { get; init; } 75/// Gets the <see cref="GraphItem{TItem}" /> with the <see cref="RemoteResolveResult" /> of this dependency graph item from calling the delegate specified in <see cref="FindLibraryTask" />. 81/// <returns>A <see cref="GraphItem{TItem}" /> with the <see cref="RemoteResolveResult" /> of the result of finding the library.</returns> 82public async Task<GraphItem<RemoteResolveResult>> GetGraphItemAsync( 91GraphItem<RemoteResolveResult> item = await FindLibraryTask;
RestoreCommand\DependencyGraphResolver.ResolvedDependencyGraphItem.cs (4)
33/// <param name="item">The <see cref="GraphItem{TItem}" /> with a <see cref="RemoteResolveResult" /> of the resolved library.</param> 38GraphItem<RemoteResolveResult> item, 93/// Gets the <see cref="GraphItem{TItem}" /> with a <see cref="RemoteResolveResult" /> of the resolved library. 95public GraphItem<RemoteResolveResult> Item { get; }
RestoreCommand\Diagnostics\IndexedRestoreTargetGraph.cs (7)
18private readonly Dictionary<string, GraphItem<RemoteResolveResult>> _lookup 19= new Dictionary<string, GraphItem<RemoteResolveResult>>(StringComparer.OrdinalIgnoreCase); 33foreach (var node in graph.Flattened) 72public GraphItem<RemoteResolveResult> GetItemById(string id) 74if (_lookup.TryGetValue(id, out var node)) 85public GraphItem<RemoteResolveResult> GetItemById(string id, LibraryType libraryType) 87if (_lookup.TryGetValue(id, out var node)
RestoreCommand\Diagnostics\UnexpectedDependencyMessages.cs (3)
158var match = indexedGraph.GetItemById(dependency.Name, LibraryType.Package); 256foreach (var node in graph.Flattened) 274var match = indexedGraph.GetItemById(dependencyId, LibraryType.Package);
RestoreCommand\IRestoreTargetGraph.cs (1)
56ISet<GraphItem<RemoteResolveResult>> Flattened { get; }
RestoreCommand\LockFileBuilder.cs (3)
63foreach (var item in libraryItems) 193foreach (var graphItem in targetGraph.Flattened.OrderBy(x => x.Key)) 446var resolvedEntry = targetGraph?
RestoreCommand\Logging\TransitiveNoWarnUtils.cs (1)
105foreach (var dependencyGraphItem in targetGraph.Flattened)
RestoreCommand\ProjectRestoreCommand.cs (1)
493foreach (var node in graph.Flattened)
RestoreCommand\RestoreTargetGraph.cs (3)
51public ISet<GraphItem<RemoteResolveResult>> Flattened { get; } 73ISet<GraphItem<RemoteResolveResult>> flattened, 121var flattened = new HashSet<GraphItem<RemoteResolveResult>>();
RestoreCommand\Utility\AuditUtility.cs (2)
380GraphItem<RemoteResolveResult>? currentProject = graph.Graphs.FirstOrDefault()?.Item; 382foreach (GraphItem<RemoteResolveResult>? node in graph.Flattened.Where(r => r.Key.Type == LibraryType.Package))
RestoreCommand\Utility\BuildAssetsUtils.cs (2)
857ISet<GraphItem<RemoteResolveResult>> items) 861foreach (var item in items)
RestoreCommand\Utility\IncludeFlagUtils.cs (8)
84var unifiedNodes = new Dictionary<string, GraphItem<RemoteResolveResult>>(StringComparer.OrdinalIgnoreCase); 90foreach (var item in targetGraph.Flattened 106GraphItem<RemoteResolveResult> unifiedRoot; 163GraphItem<RemoteResolveResult> child; 206private static bool IsPackageOrProject(GraphItem<RemoteResolveResult> item) 218private static int OrderType(GraphItem<RemoteResolveResult> item) 241public DependencyNode(GraphItem<RemoteResolveResult> item, LibraryIncludeFlags dependencyType) 255public GraphItem<RemoteResolveResult> Item { get; }
RestoreCommand\Utility\LockFileUtils.cs (1)
489GraphItem<RemoteResolveResult> graphItem,
NuGet.DependencyResolver.Core (54)
GraphItemKeyComparer.cs (5)
12/// A <see cref="GraphItem{T}"/> Key based comparer. Two instances are equal only if the Keys are equal. 14public sealed class GraphItemKeyComparer<T> : IEqualityComparer<GraphItem<T>> 36public bool Equals(GraphItem<T> x, GraphItem<T> y) 45public int GetHashCode(GraphItem<T> obj)
GraphModel\GraphEdge.cs (2)
18public GraphEdge(GraphEdge<TItem> outerEdge, GraphItem<TItem> item, LibraryDependency edge) 33public GraphItem<TItem> Item { get; }
GraphModel\GraphItem.cs (4)
14public class GraphItem<TItem> : IEquatable<GraphItem<TItem>> 31return Equals(obj as GraphItem<TItem>); 34public bool Equals(GraphItem<TItem> other) 50private bool KeyCompare(GraphItem<TItem> other)
GraphModel\GraphNode.cs (1)
31public GraphItem<TItem> Item { get; set; }
GraphModel\Tracker.cs (26)
15public void Track(GraphItem<TItem> item) 20public bool IsDisputed(GraphItem<TItem> item) 25public bool IsAmbiguous(GraphItem<TItem> item) 30public void MarkAmbiguous(GraphItem<TItem> item) 38public bool IsBestVersion(GraphItem<TItem> item) 46foreach (var known in entry) 58public IEnumerable<GraphItem<TItem>> GetDisputes(GraphItem<TItem> item) 63return Enumerable.Empty<GraphItem<TItem>>(); 74private Entry? TryGetEntry(GraphItem<TItem> item) 80private Entry GetOrAddEntry(GraphItem<TItem> item) 91private sealed class Entry : IEnumerable<GraphItem<TItem>> 108public void AddItem(GraphItem<TItem> item) 114else if (_storage is GraphItem<TItem> existingItem) 121_storage = new HashSet<GraphItem<TItem>>(capacity: 3) { existingItem, item }; 127((HashSet<GraphItem<TItem>>)_storage).Add(item); 136IEnumerator<GraphItem<TItem>> IEnumerable<GraphItem<TItem>>.GetEnumerator() 146public bool HasMultipleItems => _storage is HashSet<GraphItem<TItem>>; 148public struct Enumerator : IEnumerator<GraphItem<TItem>>, IDisposable, IEnumerator 159private GraphItem<TItem> _current; 161private HashSet<GraphItem<TItem>>.Enumerator _setEnumerator; 173else if (_entry._storage is GraphItem<TItem>) 180_setEnumerator = ((HashSet<GraphItem<TItem>>)_entry._storage).GetEnumerator(); 184public readonly GraphItem<TItem> Current => _current; 197_current = (GraphItem<TItem>)_entry._storage!;
Remote\RemoteDependencyWalker.cs (7)
92var rootItem = await ResolverUtility.FindLibraryCachedAsync( 219var dependencyItem = await graphNodeCreationData.GraphItemTask; 367var item = node.Item; 381GraphItem<RemoteResolveResult> item, LibraryDependency parentDependency, LibraryRange childDependencyLibrary, bool isRoot) 721/// A <see cref="Task{TResult}"/> that represents the retrieval of the necessary <see cref="GraphItem{TItem}"/> to complete construction of the <see cref="GraphNode{TItem}"/>. 723public readonly Task<GraphItem<RemoteResolveResult>> GraphItemTask; 740public GraphNodeCreationData(Task<GraphItem<RemoteResolveResult>> graphItemTask, HashSet<LibraryDependency> runtimeDependencies, LibraryRange libraryRange, GraphEdge<RemoteResolveResult> outerEdge)
Remote\RemoteWalkContext.cs (4)
26FindLibraryEntryCache = new TaskResultCache<LibraryRangeCacheKey, GraphItem<RemoteResolveResult>>(); 47internal TaskResultCache<LibraryRangeCacheKey, GraphItem<RemoteResolveResult>> FindLibraryEntryCache { get; } 108if (!FindLibraryEntryCache.TryGetValue(key, out Task<GraphItem<RemoteResolveResult>>? task)) 113GraphItem<RemoteResolveResult> item = await task;
ResolverUtility.cs (5)
20public static Task<GraphItem<RemoteResolveResult>> FindLibraryCachedAsync( 36public static async Task<GraphItem<RemoteResolveResult>> FindLibraryEntryAsync( 48GraphItem<RemoteResolveResult>? graphItem = null; 111private static async Task<GraphItem<RemoteResolveResult>> CreateGraphItemAsync( 554private static GraphItem<RemoteResolveResult> CreateUnresolvedResult(LibraryRange libraryRange)