466 implementations of Count
Aspire.Dashboard.Tests (1)
Model\ResourceStateViewModelTests.cs (1)
226public int Count => resources.Length;
Aspire.Hosting (2)
IInteractionService.cs (2)
491public int Count => _files.Count; 662public int Count => _inputs.Count;
Aspire.Hosting.JavaScript (1)
DenoOtlpExporterAnnotation.cs (1)
25public int Count => s_activationEnvironmentVariables.Count;
Aspire.Hosting.TestUtilities (1)
Utils\OtlpExporterActivationTestExtensions.cs (1)
42public int Count => activationEnvironmentVariables.Count;
Aspire.RabbitMQ.Client (1)
src\Components\Aspire.RabbitMQ.Client\RabbitMQEventSourceLogForwarder.cs (1)
76public int Count { get; }
ConfigurationSchemaGenerator (1)
RuntimeSource\SourceGenerators\ImmutableEquatableArray.cs (1)
22public int Count => _values.Length;
GenerateDocumentationAndConfigFiles (23)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\roslyn\src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.AspNetCore.Components (4)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (1)
208public int Count => 4;
ResourceAssetCollection.cs (1)
68int IReadOnlyCollection<ResourceAsset>.Count => _resources.Count;
src\aspnetcore\src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
312public int Count => _count;
src\aspnetcore\src\Http\Routing\src\PathTokenizer.cs (1)
28public int Count
Microsoft.AspNetCore.Components.Endpoints (4)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (3)
369public int Count => 4; 453public int Count => 3; 520public int Count => 3;
Rendering\EndpointHtmlRenderer.cs (1)
291public int Count => _form.Count;
Microsoft.AspNetCore.Components.Server (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (1)
1156public int Count => 2;
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.AspNetCore.Hosting (4)
Internal\HostingApplicationDiagnostics.cs (1)
651public int Count => 2;
Internal\HostingRequestFinishedLog.cs (1)
22public int Count => 12;
Internal\HostingRequestStartingLog.cs (1)
21public int Count => 10;
Internal\HostingRequestUnhandledLog.cs (1)
19public int Count => 7;
Microsoft.AspNetCore.Http (1)
parent\parent\parent\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
143public int Count => _dictionaryStorage != null ? _dictionaryStorage.Count : _count;
Microsoft.AspNetCore.Http.Abstractions (2)
Routing\EndpointMetadataCollection.cs (1)
63public int Count => _items.Length;
Routing\RouteValueDictionary.cs (1)
312public int Count => _count;
Microsoft.AspNetCore.Http.Connections (1)
Internal\ConnectionLogScope.cs (1)
33public int Count => string.IsNullOrEmpty(ConnectionId) ? 0 : 1;
Microsoft.AspNetCore.Http.Connections.Client (1)
Internal\ConnectionLogScope.cs (1)
41public int Count => string.IsNullOrEmpty(ConnectionId) ? 0 : 1;
Microsoft.AspNetCore.Http.Extensions (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (3)
223public int Count => 4; 307public int Count => 3; 374public int Count => 3;
Microsoft.AspNetCore.HttpLogging (1)
HttpLog.cs (1)
25public int Count => _keyValues.Count;
Microsoft.AspNetCore.Identity (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (1)
35public int Count => 3;
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelStateDictionary.cs (1)
137public int Count { get; private set; }
ModelBinding\Validation\ValidationStateDictionary.cs (1)
55public int Count => _inner.Count;
Microsoft.AspNetCore.Mvc.Core (7)
Diagnostics\EventData.cs (1)
26int IReadOnlyCollection<KeyValuePair<string, object>>.Count => Count;
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (5)
595public int Count => 4; 1501public int Count => 2; 1561public int Count => 2; 1621public int Count => 2; 1775public int Count => 2;
MvcCoreLoggerExtensions.cs (1)
307public int Count => 2;
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
AttributeDictionary.cs (1)
57public int Count => _items == null ? 0 : _items.Count;
ViewComponents\DefaultViewComponentInvoker.cs (1)
309public int Count => 2;
Microsoft.AspNetCore.Razor.Utilities.Shared (1)
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
Microsoft.AspNetCore.Routing (1)
PathTokenizer.cs (1)
28public int Count
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (2)
257public int Count => 3; 1115public int Count => 4;
Internal\ConnectionLogScope.cs (1)
33public int Count => 1;
Microsoft.AspNetCore.SignalR.Client.Core (1)
Internal\ConnectionLogScope.cs (1)
42public int Count => string.IsNullOrEmpty(ConnectionId) ? 0 : 1;
Microsoft.AspNetCore.SignalR.Core (2)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (1)
131public int Count => 3;
Internal\HubGroupList.cs (1)
45public int Count => _groups.Count;
Microsoft.Build (25)
BackEnd\BuildManager\GlobalPropertiesLookup.cs (1)
39public int Count => _backingProperties.Count;
Collections\ArrayDictionary.cs (1)
84public int Count => count;
Instance\ImmutableProjectCollections\ImmutableProjectMetadataCollectionConverter.cs (1)
46public int Count => _properties.Count;
Instance\ImmutableProjectCollections\LazyStringValuedList.cs (1)
37public int Count => EnsureListInitialized().Count;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\5057ed6cf5d6323b\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\5057ed6cf5d6323b\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\8b3a4ac2431f87ea\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\ArrayBuilder.cs (1)
106public int Count
Microsoft.Build.Framework (1)
Collections\ReadOnlyEmptyDictionary.cs (1)
56public int Count
Microsoft.CodeAnalysis (32)
Collections\OrderedSet.cs (1)
47public int Count
InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
Operations\IOperation.OperationList.cs (1)
33public int Count => _operation.ChildOperationsCount;
Operations\IOperation.OperationList.Reversed.cs (1)
35public int Count => _operation.ChildOperationsCount;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\roslyn\src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
Syntax\ChildSyntaxList.cs (1)
29public int Count
Syntax\SeparatedSyntaxList.cs (1)
96public int Count
Syntax\SyntaxList`1.cs (1)
109public int Count
Syntax\SyntaxNodeOrTokenList.cs (1)
124public int Count
Syntax\SyntaxTokenList.cs (1)
117public int Count => Node == null ? 0 : (Node.IsList ? Node.SlotCount : 1);
Syntax\SyntaxTriviaList.cs (1)
107public int Count
Text\TextLineCollection.cs (1)
21public abstract int Count { get; }
Microsoft.CodeAnalysis.Analyzers (23)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\roslyn\src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.AnalyzerUtilities (23)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\roslyn\src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.CodeStyle (23)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\roslyn\src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.Extensions.Package (21)
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\roslyn\src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
Microsoft.CodeAnalysis.NetAnalyzers (1)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (1)
76public int Count
Microsoft.CodeAnalysis.Razor.Compiler (6)
Language\Intermediate\IntermediateNodeCollection.cs (1)
49public int Count => _inner.Count;
Language\Syntax\ChildSyntaxList.cs (1)
26public int Count => _count;
Language\Syntax\SyntaxList`1.cs (1)
65public int Count
Language\Syntax\SyntaxTokenList.cs (1)
84public int Count
Language\TagHelperCollection.Builder.cs (1)
42public int Count => _items.Count;
Language\TagHelperCollection.cs (1)
78public abstract int Count { get; }
Microsoft.CodeAnalysis.ResxSourceGenerator (23)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\roslyn\src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Microsoft.CodeAnalysis.Workspaces (24)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\roslyn\src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Workspace\Solution\ChecksumCollection.cs (1)
27public int Count => children.Length;
Microsoft.Diagnostics.DataContractReader.DataGenerator (1)
EquatableArray.cs (1)
26public int Count => _items?.Length ?? 0;
Microsoft.Extensions.AI (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.AI.Abstractions (5)
AdditionalPropertiesDictionary{TValue}.cs (1)
74public int Count => _dictionary.Count;
Embeddings\GeneratedEmbeddings.cs (1)
56public int Count => _embeddings.Count;
Functions\AIFunctionArguments.cs (1)
111public int Count => _arguments.Count;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.AI.Abstractions.Tests (2)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
1128public int Count => 1; 1176public int Count => _dictionary.Count;
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
src\runtime\src\libraries\Common\src\SourceGenerators\ImmutableEquatableArray.cs (1)
22public int Count => _values.Length;
Microsoft.Extensions.Diagnostics.HealthChecks (2)
DefaultHealthCheckService.cs (1)
297public int Count => _values.Count;
HealthCheckLogScope.cs (1)
14int IReadOnlyCollection<KeyValuePair<string, object>>.Count { get; } = 1;
Microsoft.Extensions.Http (1)
Logging\HttpHeadersLogValue.cs (1)
70public int Count => Values.Count;
Microsoft.Extensions.Http.Diagnostics (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Extensions.Logging (1)
LoggerFactoryScopeProvider.cs (1)
171public int Count { get; }
Microsoft.Extensions.Logging.Abstractions (9)
FormattedLogValues.cs (1)
81public int Count
FormattedLogValuesObsolete.cs (1)
35public int Count => _inner.Count;
LoggerMessage.cs (7)
489public int Count => 1; 533public int Count => 2; 585public int Count => 3; 612public int Count => 4; 668public int Count => 5; 730public int Count => 6; 796public int Count => 7;
Microsoft.Extensions.Logging.Generators (1)
src\runtime\src\libraries\Common\src\SourceGenerators\ImmutableEquatableArray.cs (1)
22public int Count => _values.Length;
Microsoft.Extensions.Primitives (1)
StringValues.cs (1)
91public int Count
Microsoft.Extensions.Telemetry (3)
Logging\ExtendedLogger.LegacyTagJoiner.cs (1)
79public int Count
Logging\ExtendedLogger.ModernTagJoiner.cs (1)
84public int Count => _incomingTagsCount + _redactedTagsCount + _extraTags.Count + StaticTags!.Length;
Logging\Import\LoggerFactoryScopeProvider.cs (1)
183public int Count { get; }
Microsoft.Extensions.Telemetry.Abstractions (1)
Logging\LoggerMessageState.ReadOnlyList.cs (1)
16int IReadOnlyCollection<KeyValuePair<string, object?>>.Count => TagsCount;
Microsoft.Gen.BuildMetadata.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.ComplianceReports.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.ContextualOptions.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.Logging.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.MetadataExtractor.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.Metrics.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Gen.MetricsReports.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
src\Shared\EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Microsoft.Maui (2)
Primitives\ItemDelegateList.cs (1)
15 public int Count => ItemDelegate.GetCount();
Primitives\LockableObservableListWrapper.cs (1)
46 public int Count
Microsoft.Maui.Controls (7)
DragAndDrop\DataPackagePropertySetView.cs (1)
29 public int Count => _dataPackagePropertySet.Count;
ListProxy.cs (1)
112 public int Count
ReadOnlyCastingList.cs (2)
28 public int Count 58 public int Count
SynchronizedList.cs (1)
44 public int Count
TemplatedItemsList.cs (2)
338 public int Count 1271 public int Count
Microsoft.ML.Core (1)
Data\IEstimator.cs (1)
24public int Count => _columns.Count();
Microsoft.ML.Data (1)
Transforms\Normalizer.cs (1)
496public int Count => _infos.Length;
Microsoft.ML.DataView (1)
DataViewSchema.cs (1)
27public int Count => _columns.Length;
Microsoft.ML.StandardTrainers (1)
Standard\LinearModelParameters.cs (1)
67public int Count => _pred.Weight.Length;
Microsoft.Private.Windows.Core (2)
System\Collections\Generic\ListConverter.cs (1)
28public int Count => _values.Count;
System\Private\Windows\BinaryFormat\Serializer\ArraySingleString.StringListAdapter.cs (1)
30int IReadOnlyCollection<string?>.Count => _recordList.Count;
Microsoft.TemplateEngine.Abstractions (2)
Parameters\ParameterDefinitionSet.cs (1)
47public int Count => _parameters.Count;
Parameters\ParameterSetData.cs (1)
70public int Count => _parametersData.Count;
Microsoft.TemplateEngine.Edge (1)
Template\InputDataSet.cs (1)
76public int Count => _parametersData.Count;
Microsoft.TemplateEngine.Utils (1)
CombinedList.cs (1)
19public int Count => _first.Count + _second.Count;
PresentationFramework (2)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (2)
67public int Count 428public int Count => _FromVectorView.Count;
Roslyn.Diagnostics.Analyzers (23)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
86public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
33public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
28public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
58public readonly int Count => ReadOnlyDictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
24public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
82public int Count => _set.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Builder.cs (1)
34public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
56public readonly int Count => ReadOnlySet.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
83public int Count => _list.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
26public int Count => _builder.Count;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
35public readonly int Count => ReadOnlyList.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (1)
128int IReadOnlyCollection<T>.Count => Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
230public int Count => _count - _freeCount; 1339public int Count => _dictionary.Count; 1547public int Count => _dictionary.Count;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
358public int Count => _count - _freeCount;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (1)
181public int Count => _size;
src\roslyn\src\Dependencies\Collections\Specialized\SpecializedCollections.Singleton.Collection`1.cs (1)
46public int Count => 1;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
111public int Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (1)
41public int Count => list.Count;
Shared (2)
EmptyCollections\EmptyReadonlyDictionary.cs (1)
21public int Count => 0;
EmptyCollections\EmptyReadOnlyList.cs (1)
24public int Count => 0;
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
1128public int Count => 1; 1176public int Count => _dictionary.Count;
System.Collections (11)
System\Collections\Generic\LinkedList.cs (1)
49public int Count
System\Collections\Generic\OrderedDictionary.cs (3)
237public int Count => _count; 1477public int Count => _dictionary.Count; 1672public int Count => _dictionary.Count;
System\Collections\Generic\PriorityQueue.cs (1)
945public int Count => _queue._size;
System\Collections\Generic\SortedDictionary.cs (3)
137public int Count 587public int Count 748public int Count
System\Collections\Generic\SortedList.cs (1)
282public int Count
System\Collections\Generic\SortedSet.cs (1)
266public int Count
System\Collections\Generic\Stack.cs (1)
57public int Count => _size;
System.Collections.Concurrent (3)
System\Collections\Concurrent\BlockingCollection.cs (1)
103public int Count
System\Collections\Concurrent\ConcurrentBag.cs (1)
480public int Count
System\Collections\Concurrent\ConcurrentStack.cs (1)
134public int Count
System.Collections.Immutable (16)
System\Collections\Frozen\FrozenDictionary.cs (1)
367public int Count => CountCore;
System\Collections\Frozen\FrozenSet.cs (1)
264public int Count => CountCore;
System\Collections\Immutable\ImmutableArray_1.Builder.cs (1)
90public int Count
System\Collections\Immutable\ImmutableArray_1.cs (1)
67int IReadOnlyCollection<T>.Count
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (1)
136public int Count
System\Collections\Immutable\ImmutableDictionary_2.cs (1)
133public int Count
System\Collections\Immutable\ImmutableExtensions.cs (2)
128public int Count 195public int Count
System\Collections\Immutable\ImmutableHashSet_1.Builder.cs (1)
83public int Count
System\Collections\Immutable\ImmutableHashSet_1.cs (1)
92public int Count
System\Collections\Immutable\ImmutableList_1.Builder.cs (1)
66public int Count
System\Collections\Immutable\ImmutableList_1.cs (1)
142public int Count => _root.Count;
System\Collections\Immutable\ImmutableSortedDictionary_2.Builder.cs (1)
114public int Count
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
108public int Count
System\Collections\Immutable\ImmutableSortedSet_1.Builder.cs (1)
72public int Count
System\Collections\Immutable\ImmutableSortedSet_1.cs (1)
115public int Count
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\TagList.netcore.cs (1)
52public readonly int Count => _tagsCount;
System.Formats.Nrbf (1)
System\Formats\Nrbf\RecordMap.cs (1)
20public int Count => _map.Count;
System.Linq (4)
System\Linq\Lookup.cs (1)
325public int Count => 0;
System\Linq\Range.SpeedOpt.cs (1)
40public int Count => int.CreateTruncating(_endExclusive - _start);
System\Linq\Repeat.SpeedOpt.cs (1)
34public int Count => _count;
System\Linq\SkipTake.SpeedOpt.cs (1)
104public int Count => GetAdjustedCount(_minIndexInclusive, _maxIndexInclusive, _source.Count);
System.Linq.AsyncEnumerable (1)
System\Linq\ToLookupAsync.cs (1)
226public int Count => 0;
System.Linq.Expressions (1)
System\Linq\Expressions\Compiler\CompilerScope.cs (1)
551public int Count => _provider.ParameterCount;
System.Net.Http (3)
System\Net\Http\Headers\HeaderStringValues.cs (1)
36public int Count => _value switch
System\Net\Http\Headers\HttpHeadersNonValidated.cs (1)
28public int Count => _headers?.Count ?? 0;
System\Net\Http\HttpRequestOptions.cs (1)
50int IReadOnlyCollection<KeyValuePair<string, object?>>.Count => Options.Count;
System.Net.Primitives (1)
System\Net\CookieCollection.cs (1)
121public int Count
System.Net.WebSockets.Client (1)
System\Net\WebSockets\HttpResponseHeadersReadOnlyCollection.cs (1)
41public int Count => _headers.Count;
System.Private.CoreLib (17)
src\runtime\src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (1)
71public int Count => _count;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (1)
1136public int Count
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (1)
256public int Count
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (3)
209public int Count => _count - _freeCount; 2045public int Count => _dictionary.Count; 2240public int Count => _dictionary.Count;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (1)
348public int Count => _count - _freeCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (1)
127public int Count => _size;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (1)
55public int Count => _size;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\Collection.cs (1)
32public int Count => items.Count;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (1)
33public int Count => list.Count;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyDictionary.cs (3)
71public int Count => m_dictionary.Count; 278public int Count => _collection.Count; 331public int Count => _collection.Count;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlySet.cs (1)
34public int Count => _set.Count;
System\Array.NativeAot.cs (1)
531public int Count
System\Runtime\InteropServices\TypeMapLazyDictionary.NativeAot.cs (1)
129public int Count => throw new NotSupportedException();
System.Private.Windows.Core (2)
System\Collections\Generic\ListConverter.cs (1)
28public int Count => _values.Count;
System\Private\Windows\BinaryFormat\Serializer\ArraySingleString.StringListAdapter.cs (1)
30int IReadOnlyCollection<string?>.Count => _recordList.Count;
System.Private.Windows.Core.TestUtilities (2)
XUnit\EnumerableTupleTheoryData.cs (2)
17public int Count => _data.Count(); 35public int Count => _data.Count();
System.Reflection.Metadata (25)
System\Reflection\Metadata\PortablePdb\HandleCollections.Debug.cs (7)
27public int Count 126public int Count 232public int Count 440public int Count 546public int Count 645public int Count 752public int Count
System\Reflection\Metadata\TypeSystem\HandleCollections.TypeSystem.cs (18)
26public int Count 134public int Count 251public int Count 372public int Count 479public int Count 599public int Count 719public int Count 839public int Count 955public int Count 1054public int Count 1166public int Count 1261public int Count 1351public int Count 1441public int Count 1531public int Count 1664public int Count 1775public int Count 1865public int Count
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (1)
55public int Count => _headerParameters.Count;
System.Text.Json.SourceGeneration (1)
src\runtime\src\libraries\Common\src\SourceGenerators\ImmutableEquatableArray.cs (1)
22public int Count => _values.Length;
System.Text.RegularExpressions (4)
System\Text\RegularExpressions\CaptureCollection.cs (1)
62public int Count => _capcount;
System\Text\RegularExpressions\GroupCollection.cs (2)
67public int CountCount => _match._matchcount.Length;
System\Text\RegularExpressions\MatchCollection.cs (1)
104public int Count
System.Windows.Forms.Primitives (1)
System\Windows\Forms\NonNullCollection.cs (1)
32public int Count => _list.Count;
3291 references to Count
aspire (121)
Agents\SkillDefinition.cs (1)
141if (ApplicableLanguages.Count == 0)
Backchannel\AuxiliaryBackchannelMonitor.cs (1)
327var fileProviders = new List<PhysicalFileProvider>(_socketDirectories.Count);
Backchannel\ResourceSnapshotMapper.cs (1)
195if (matches.Count == 1)
Commands\AgentInitCommand.cs (4)
240if (selectedLocations.Count > 0) 368if (selectedSkills.Contains(SkillDefinition.PlaywrightCli) && selectedLocations.Count > 0) 466if (result.ConfiguredClients.Count > 0) 714if (installedSkills.Count == 0)
Commands\ApiListCommand.cs (2)
59if (items.Count is 0) 72InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ApiCommandStrings.FoundApiEntries, items.Count, scope));
Commands\ApiSearchCommand.cs (2)
73if (items.Count is 0) 86InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ApiCommandStrings.FoundSearchResults, items.Count, query));
Commands\AppHostLauncher.cs (6)
313if (existingSockets.Count > 0) 315logger.LogDebug("Found {Count} running instance(s) for this AppHost, stopping them first.", existingSockets.Count); 913if (replayEntries.Count == 0 && displayLines.Count == 0) 918if (displayLines.Count > 0) 924if (replayEntries.Count > 0)
Commands\DashboardRunCommand.cs (3)
248for (var i = 0; i < unmatchedTokens.Count; i++) 307for (var i = 0; i < unmatchedTokens.Count; i++) 309if (unmatchedTokens[i].Equals(bareKey, StringComparison.OrdinalIgnoreCase) && i + 1 < unmatchedTokens.Count)
Commands\DescribeCommand.cs (3)
209if (resourceName is not null && snapshots.Count == 0) 303var changedSnapshots = new List<ResourceSnapshot>(batch.Snapshots.Count); 334if (snapshots.Count == 0)
Commands\DocsListCommand.cs (2)
54if (docs.Count is 0) 67InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, DocsCommandStrings.FoundDocumentationPages, docs.Count));
Commands\DocsSearchCommand.cs (2)
68if (response is null || response.Results.Count is 0) 82InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, DocsCommandStrings.FoundSearchResults, response.Results.Count, query));
Commands\InitCommand.cs (2)
195if (commands.Count > 0) 200commands.Count == 1
Commands\InstallationInfoOutput.cs (2)
77logger.LogDebug("Discovered {InstallationCount} Aspire CLI installation(s) for doctor output.", installations.Count); 153for (var i = 0; i < installs.Count; i++)
Commands\NewCommand.cs (1)
228if (template.SelectableAppHostLanguages.Count == 0)
Commands\ParseResultHelper.cs (5)
69var forwardedTokens = new List<string>(parseResult.Tokens.Count); 103if (parseResult.UnmatchedTokens.Count > 0) 131var loggableTokens = new List<string>(parseResult.Tokens.Count); 288var emittedValue = optionResult is { Tokens.Count: 1 } && 329if (unmatchedTokens.Count == 0)
Commands\PipelineCommandBase.cs (12)
508var remaining = new List<string>(unmatchedTokens.Count); 510for (var i = 0; i < unmatchedTokens.Count; i++) 517if (++i >= unmatchedTokens.Count) 1073if (activity.Data.Inputs is not { Count: > 0 } inputs) 1079var hasValidationErrors = inputs.Any(input => input.ValidationErrors is { Count: > 0 }); 1083if (!hasValidationErrors && inputs.Count > 1) 1090var answers = new PublishingPromptInputAnswer[inputs.Count]; 1091for (var i = 0; i < inputs.Count; i++) 1099if (!hasValidationErrors || input.ValidationErrors is { Count: > 0 }) 1102var promptText = BuildPromptText(input, inputs.Count, activity.Data.StatusText, activity.Data); 1132if (input.ValidationErrors is { Count: > 0 } errors) 1171if (input.Options is null || input.Options.Count == 0)
Commands\ResourceCommand.cs (8)
316if (parseResult.Errors.Count > 0) 497for (var i = 0; i < arguments.Count; i++) 502i + 1 < arguments.Count && 520for (var i = 0; i < arguments.Count; i++) 529i + 1 < arguments.Count && 736resourceName = resourceArgumentResult?.Tokens.Count > 0 ? resourceArgumentResult.Tokens[0].Value : null; 738var commandName = commandArgumentResult?.Tokens.Count > 0 ? commandArgumentResult.Tokens[0].Value : null; 755return result?.Tokens.Count > 0 ? result.Tokens[0].Value : null;
Commands\ResourceCommandHelpParser.cs (2)
55return result?.Tokens.Count > 0 ? result.Tokens[0].Value : null; 61return result?.Tokens.Count > 0 ? result.Tokens[0].Value : null;
Commands\RunCommand.cs (1)
1501if (appHostArgs.Count > 0)
Commands\StartCommand.cs (1)
115if (appHostArgs.Count > 0)
Commands\TelemetryCommandHelpers.cs (1)
492if (matches.Count > 0)
Documentation\ApiDocs\ApiDocsIndexService.cs (4)
497if (results.Count >= topK) 615if (_itemsById is null || memberContainerIds.Count is 0) 772(results.Count is 0 || 868var items = new List<ApiReferenceItem>(entries.Count);
Documentation\ApiDocs\ApiMemberMarkdownParser.cs (1)
29if (string.IsNullOrWhiteSpace(markdown) || memberGroupsByPageUrl.Count is 0)
Documentation\Docs\DocsIndexService.cs (2)
267var documentCount = documents.Count; 513for (var i = 0; i < doc.Sections.Count; i++)
Documentation\Docs\DocsSearchService.cs (4)
48if (Results.Count is 0) 56sb.AppendLine(CultureInfo.InvariantCulture, $"Found {Results.Count} relevant documentation snippets:"); 59for (var i = 0; i < Results.Count; i++) 138_logger.LogDebug("Search for '{Query}' returned {Count} results", query, searchResults.Count);
Interaction\ConsoleInteractionService.cs (2)
317if (choicesList.Count == 0) 388if (choicesList.Count == 0)
Mcp\Tools\ListDocsTool.cs (2)
47if (docs.Count is 0) 58sb.AppendLine(CultureInfo.InvariantCulture, $"Found {docs.Count} documentation pages:");
Mcp\Tools\ListIntegrationsTool.cs (1)
155if (inScopeConnections.Count == 1)
Mcp\Tools\RefreshToolsTool.cs (2)
25var totalToolCount = KnownMcpTools.All.Count + resourceToolMap.Count;
NuGet\BundleNuGetService.cs (3)
285var redacted = new List<string>(args.Count); 286for (var i = 0; i < args.Count; i++) 289if (string.Equals(args[i], "--source", StringComparison.Ordinal) && i + 1 < args.Count)
Projects\AppHostCandidateFinder.cs (8)
109using var discoveryActivity = profilingTelemetry.StartAppHostCandidateDiscovery(searchDirectory, scope, patterns.Count, nugetCachePath is not null); 116if (patterns.Count == 0) 132logger.LogDebug("Using git-included file list ({Count} entries) as discovery source.", includedPaths.Count); 133using var matchActivity = profilingTelemetry.StartAppHostCandidateGitMatch(includedPaths.Count, patterns.Count); 137discoveryActivity.SetAppHostDiscoveryIncludedFileCount(includedPaths.Count); 163using var walkActivity = profilingTelemetry.StartAppHostCandidateFilesystemWalk(searchDirectory, patterns.Count, applyDirectoryExclusions, nugetCachePath is not null); 393if (patterns.Count == 0)
Projects\AppHostServerClosureSnapshots.cs (2)
85var lines = new List<string>(Entries.Count + 1) 187var values = new List<string>(entries.Count + 1)
Projects\DotNetAppHostProject.cs (2)
1922if (runArguments.Count < 2 || !string.Equals(runArguments[0], "exec", StringComparison.Ordinal)) 2522if (matchingSockets.Count == 0)
Projects\GuestAppHostProject.cs (1)
1628if (matchingSockets.Count == 0)
Projects\PrebuiltAppHostServer.cs (3)
292if (packageRefs.Count > 0) 295output.AppendError($" packages: {string.Join(", ", preview)}{(packageRefs.Count > 5 ? $", … (+{packageRefs.Count - 5} more)" : string.Empty)}");
Scaffolding\ScaffoldingService.cs (2)
170if (conflictingFiles.Count > 0) 314if (preservedScriptNames.Count > 0)
Telemetry\InternalMicrosoftDetector.cs (3)
251if (stage.Count == 0) 456for (var index = 0; index < probes.Count; index++) 990if (candidateTasks.Count == 0)
Telemetry\ProfilingTelemetry.cs (1)
792activity.SetTag(Tags.ProcessCommandArgsCount, args.Count);
Tui\TerminalViewerApp.cs (2)
161e.PeerId, e.PrimaryPeerId, e.Width, e.Height, e.Peers.Count); 523var peers = connection.Peers.Count + 1;
Utils\AppHostArgumentRedactor.cs (4)
46for (var i = 0; i < args.Count; i++) 80if (firstRedactedIndex >= args.Count) 85var redacted = new List<string>(args.Count); 86for (var i = 0; i < args.Count; i++)
Utils\ConsoleActivityLogger.cs (1)
339if (_pipelineSucceeded && pipelineSummary is { Count: > 0 })
Utils\EnvironmentChecker\DevCertsCheck.cs (5)
73if (certInfos.Count == 0) 101if (certInfos.Count > 1) 121Message = string.Format(CultureInfo.CurrentCulture, DoctorCommandStrings.DevCertsMultipleNoneTrustedMessageFormat, certInfos.Count), 128else if (trustedCount < certInfos.Count) 135Message = string.Format(CultureInfo.CurrentCulture, DoctorCommandStrings.DevCertsMultipleSomeUntrustedMessageFormat, certInfos.Count),
Utils\FileSystemHelper.cs (1)
151if (paths.Count == 0)
Utils\Markdown\MarkdownToSpectreConverter.cs (3)
212for (var i = 0; i < widths.Count; i++) 215AppendTableSeparatorCell(builder, widths[i], definitions is { Count: > 0 } && i < definitions.Count ? definitions[i].Alignment : null);
aspire-managed (3)
NuGet\Commands\ManifestCommand.cs (2)
105manifest.ManagedAssemblies.Count, 106manifest.NativeLibraries.Count,
NuGet\Commands\RestoreCommand.cs (1)
202var summary = results.Count > 0 ? results[0] : null;
Aspire.Cli.EndToEnd.Tests (4)
Helpers\CliE2ETestHelpers.cs (2)
746if (commits.Count == 0) 767log($"No darc feed carrying Aspire.ProjectTemplates {version} found in the last {commits.Count} commits of '{branch}'.");
Helpers\KubernetesDeployTestHelpers.cs (1)
368for (var i = 0; i < parameterResponses.Count; i++)
StartStopTests.cs (1)
251Assert.Equal(2, bothInstances.Count);
Aspire.Cli.Tests (54)
Agents\CommonAgentApplicatorsTests.cs (2)
16Assert.Equal(4, SkillLocation.All.Count); 51Assert.Equal(2, SkillDefinition.CliDefined.Count);
Backchannel\ResourceSnapshotWatcherTests.cs (2)
440Assert.Equal(resourceCount, batch.Snapshots.Count); 546Assert.Equal(resourceCount, finalCapture.Resources.Count);
Commands\AgentMcpCommandTests.cs (1)
377var expectedToolCount = KnownMcpTools.All.Count;
Commands\AppHostLauncherTests.cs (3)
1509if (ChildLogLines.Count > 0) 1562for (var i = 0; i < arguments.Count; i++) 1571if (logFileIndex < 0 || logFileIndex + 1 >= arguments.Count)
Commands\NewCommandTemplateConfigPersistenceTests.cs (1)
528return template.SelectableAppHostLanguages.Count == 0
Commands\ParseResultHelperTests.cs (1)
103Assert.Equal(expectParseErrors, parseResult.Errors.Count > 0);
Commands\PublishCommandPromptingIntegrationTests.cs (4)
157Assert.Equal(3, receivedPrompt.Inputs[0].Options?.Count); 460Assert.Equal(4, receivedPrompt.Inputs.Count); 474Assert.Equal(3, receivedPrompt.Inputs[2].Options?.Count); 1057StatusText = prompt.Inputs.Count > 1
Commands\StopCommandTests.cs (1)
1258execution.Arguments.Count == 2 &&
Commands\TelemetryCommandTests.cs (1)
166Assert.Equal(3, result.Count);
Commands\TypeScriptAppHostToolingCheckTests.cs (1)
75Assert.Equal(requiredCommands.Length, results.Count);
DotNet\DotNetCliRunnerTests.cs (1)
1519Assert.Equal(2, projects.Count);
Interaction\ConsoleInteractionServiceTests.cs (6)
1498Assert.Equal(2, result.Count); 1511Assert.Equal(3, result.Count); 1795Assert.Equal(2, result.Count); 1843Assert.Equal(2, result.Count); 1920Assert.Equal(2, result.Count); 1958Assert.Equal(2, result.Count);
Mcp\ApiDocs\ApiDocsIndexServiceTests.cs (1)
104Assert.Equal(3, results.Count);
Mcp\ApiDocs\ApiMemberMarkdownParserTests.cs (1)
97Assert.Equal(2, items.Count);
Mcp\Docs\DocsIndexServiceTests.cs (5)
46Assert.Equal(2, docs.Count); 196results.Count > 0, 263Assert.Equal(3, results.Count); 449Assert.Equal(3, doc.Sections.Count); 670for (var i = 1; i < results.Count; i++)
Mcp\Docs\DocsSearchServiceTests.cs (2)
163Assert.Equal(2, response.Results.Count); 351Assert.Equal(2, response.Results.Count);
Mcp\Docs\LlmsTxtParserTests.cs (13)
81Assert.Equal(3, result.Count); 108Assert.Equal(3, doc.Sections.Count); 259Assert.Equal(2, result.Count); 290Assert.Equal(3, result.Count); 324Assert.Equal(3, result.Count); 406Assert.Equal(2, result.Count); 452Assert.Equal(2, result.Count); 459Assert.Equal(2, overview.Sections.Count); 658Assert.Equal(4, result.Count); 701Assert.True(certificatesDoc.Sections.Count > 0, "Certificate doc should have sections"); 721Assert.True(appHostConfigDoc.Sections.Count > 0, "AppHost config doc should have sections"); 737Assert.True(dockerComposeDoc.Sections.Count > 0, "Docker Compose doc should have sections"); 753Assert.True(eventingDoc.Sections.Count > 0, "Eventing doc should have sections");
Projects\PrebuiltAppHostServerTests.cs (4)
1953for (var i = 0; i < argsList.Count - 1; i++) 2960for (var i = 0; i < arguments.Count; i++) 2969Assert.True(optionIndex >= 0 && optionIndex < arguments.Count - 1, $"Option '{optionName}' was not found."); 3000for (var i = 0; i < args.Count - 1; i++)
Telemetry\AspireCliTelemetryTests.cs (2)
837var tagsAfterFirstInit = (await telemetry.GetDefaultTagsAsync()).Count; 841Assert.Equal(tagsAfterFirstInit, tags.Count); // Should have the same number of tags after second init
Utils\MarkdownToSpectreConverterTests.cs (2)
186Assert.Equal(3, table.Columns.Count); 433Assert.Equal(3, table.Columns.Count);
Aspire.Dashboard (50)
Api\TelemetryApiService.cs (1)
590if (matches.Count == 1)
Authentication\AspirePolicyEvaluator.cs (1)
40if (policy.AuthenticationSchemes != null && policy.AuthenticationSchemes.Count > 0)
Components\Controls\Chart\ChartFilterTags.razor.cs (2)
69var parsed = new double[values.Count]; 72for (var i = 0; i < values.Count; i++)
Components\Pages\ConsoleLogs.razor.cs (3)
697if (_terminalSizePresets.Count > 0) 1114if (batch.Count is 0) 1388if (_terminalSizePresets.Count == 0 && _terminalViewRef is not null)
Components\Pages\StructuredLogs.razor.cs (2)
484var filters = (serializable.Filters.Count > 0) ? TelemetryFilterFormatter.SerializeFiltersToString(serializable.Filters) : null; 636new ComponentTelemetryProperty(TelemetryPropertyKeys.StructuredLogsFilterCount, new AspireTelemetryProperty(ViewModel.Filters.Count.ToString(CultureInfo.InvariantCulture), AspireTelemetryPropertyType.Metric))
Components\Pages\Traces.razor.cs (1)
339var filters = (serializable.Filters.Count > 0) ? TelemetryFilterFormatter.SerializeFiltersToString(serializable.Filters) : null;
DashboardWebApplication.cs (6)
620logger.LogError("Failed to start the dashboard due to {Count} configuration error(s).", validationFailures.Count); 665for (var i = 0; i < frontendAddresses.Count; i++) 1003if (_validationFailures.Count > 0) 1037if (_validationFailures.Count > 0) 1086Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures)); 1092Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures));
Model\DimensionFilterViewModel.cs (2)
34: selectedValues.Count == 0 78private string DebuggerToString() => $"Name = {Name}, SelectedValues = {SelectedValues.Count}";
Otlp\Storage\SqliteTelemetryRepository.Logs.cs (3)
496if (context.LogIds is { Count: > 0 }) 501if (context.ResourceKeys.Count > 0) 504for (var i = 0; i < context.ResourceKeys.Count; i++)
Otlp\Storage\SqliteTelemetryRepository.Metrics.Reads.cs (2)
333for (var i = 0; i < dimensions.Count; i++) 371for (var dimensionIndex = 0; dimensionIndex < dimensionIds.Count; dimensionIndex++)
Otlp\Storage\SqliteTelemetryRepository.Traces.Reads.cs (12)
182if (context.ResourceKeys.Count > 0) 184var resourcePredicates = new List<string>(context.ResourceKeys.Count); 185for (var index = 0; index < context.ResourceKeys.Count; index++) 284var attributePredicates = new List<string>(attributeFilter.AttributeNames.Count); 293var scopePredicates = new List<string>(scopeFilter.ScopePrefixes.Count); 303var matchPredicates = new List<string>(noMatchFilter.Filters.Count); 429if (context.SpanIdentities is { Count: > 0 }) 431var identityPredicates = new List<string>(context.SpanIdentities.Count); 432for (var index = 0; index < context.SpanIdentities.Count; index++) 442if (context.ResourceKeys.Count > 0) 444var predicates = new List<string>(context.ResourceKeys.Count); 445for (var index = 0; index < context.ResourceKeys.Count; index++)
Otlp\Storage\SqliteTelemetryRepository.Traces.Writes.cs (1)
1107attributes.Count > 0)
ServiceClient\DashboardClient.cs (1)
877if (batch.Count == 1)
ServiceClient\SqliteResourceRepository.cs (5)
188var resourcesToSave = new List<ResourceToSave>(resources.Count); 309if (logLines.Count == 0) 329var consoleLogsToInsert = new List<ConsoleLogToInsert>(logLines.Count); 392if (resourceNames.Count == 0) 493if (changes.Count == 0)
Utils\SqliteBatchInsert.cs (8)
36for (var parameterIndex = 0; parameterIndex < columnNames.Count; parameterIndex++) 74columnNames.Count, 89var generatedIds = new List<long>(data.Count); 93columnNames.Count, 104if (generatedIds.Count != data.Count) 106throw new InvalidOperationException($"The batch insert returned {generatedIds.Count} generated IDs; expected {data.Count}."); 137for (var batchStart = 0; batchStart < data.Count; batchStart += batchSize) 139var rowCount = Math.Min(batchSize, data.Count - batchStart);
Aspire.Dashboard.Components.Tests (50)
Controls\AspireMenuTests.cs (1)
320Assert.Equal(2, menuItems.Count);
Controls\ChartFiltersTests.cs (1)
59Assert.Equal(dimensionFilter.Values.Count, dimensionFilter.SelectedValues.Count);
Controls\LogViewerTests.cs (1)
86invocation.Arguments.Count == 2 &&
Controls\UrlsColumnDisplayTests.cs (2)
42Assert.Equal(totalUrls, overflowItems.Count); 68Assert.Equal(totalUrls, overflowItems.Count);
Dialogs\InteractionsInputDialogTests.cs (5)
66Assert.Equal(2, fields.Count); 202Assert.Equal(2, fields.Count); 402Assert.Equal(expectedDisabled ? 0 : 1, cut.FindAll(".secret-text-toggle-button").Count); 619invocation.Arguments.Count == 2 && 682cut.WaitForAssertion(() => Assert.Equal(fileCount, cut.FindAll(".uploaded-file-container").Count));
Dialogs\ManageDataDialogTests.cs (2)
313Assert.Equal(expectedCount, toggleButtons.Count); 349Assert.Equal(expectedCount, GetSelectionCheckboxes(cut).Count);
Layout\MainLayoutTests.cs (3)
246invocation.Arguments.Count == 1 && 976invocation.Arguments.Count == 1 && 1013invocation.Arguments.Count == 1 &&
Layout\MobileNavMenuTests.cs (3)
53Assert.Equal(cut.FindAll("fluent-menu-item").Count, menu.QuerySelectorAll(":scope > fluent-menu-item").Length); 54Assert.Equal(cut.FindAll("fluent-menu-item").Count - 1, cut.FindAll("fluent-divider").Count);
Pages\ConsoleLogsTerminalTests.cs (12)
72cut.WaitForState(() => cut.FindComponents<TerminalView>().Count > 0); 122cut.WaitForState(() => cut.FindComponents<TerminalView>().Count > 0); 172cut.WaitForState(() => cut.FindComponents<TerminalView>().Count > 0); 227cut.WaitForState(() => cut.FindComponents<TerminalView>().Count > 0); 276cut.WaitForState(() => cut.FindComponents<TerminalView>().Count > 0); 329cut.WaitForState(() => cut.FindComponents<TerminalView>().Count > 0); 420cut.WaitForState(() => cut.FindComponents<TerminalView>().Count > 0); 443cut.WaitForState(() => cut.FindComponents<TerminalView>().Count == 0); 482cut.WaitForState(() => cut.FindComponents<TerminalView>().Count > 0); 505cut.WaitForState(() => cut.FindComponents<LogViewer>().Count > 0); 511cut.WaitForAssertion(() => Assert.Equal(2, cut.FindAll(".log-content").Count)); 564cut.WaitForState(() => cut.FindComponents<TerminalView>().Count > 0);
Pages\ConsoleLogsTests.cs (1)
451cut.WaitForAssertion(() => Assert.Equal(2, cut.FindAll(".log-content").Count));
Pages\MetricsTests.cs (1)
233cut.WaitForState(() => cut.FindComponents<MetricTable>().Count == 1);
Pages\ResourcesTests.cs (4)
456invocation.Arguments.Count == 2 && 481Assert.True(mobileColumnOrder.Count < desktopColumnOrder.Count); 625return filterComponents.Count == 3;
Pages\StructuredLogsTests.cs (2)
232invocation.Arguments.Count == 2 && 314cut.WaitForAssertion(() => Assert.Equal(expectedMessageCount, cut.FindComponents<DashboardMessageBar>().Count));
Pages\TraceDetailsTests.cs (10)
143cut.WaitForAssertion(() => Assert.Equal(2, cut.FindComponent<FluentDataGrid<SpanWaterfallViewModel>>().FindAll(".fluent-data-grid-row").Count)); 203invocation.Arguments.Count == 2 && 259return rows.Count == 3; 273return rows.Count == 2; 327return rows.Count == 3; 354return rows.Count == 4; 409return rows.Count == 3; 795cut.WaitForAssertion(() => Assert.Equal(2, cut.FindAll(".main-grid-expand-button").Count)); 878cut.WaitForAssertion(() => Assert.Equal(2, cut.FindAll(".main-grid-expand-button").Count)); 953cut.WaitForAssertion(() => Assert.Equal(2, cut.FindAll(".main-grid-expand-button").Count));
Pages\TracesTests.cs (2)
54invocation.Arguments.Count == 2 && 92cut.WaitForAssertion(() => Assert.Equal(expectedMessageCount, cut.FindComponents<DashboardMessageBar>().Count));
Aspire.Dashboard.Tests (3)
Integration\Playwright\AccessibilityTests.cs (1)
461sb.AppendLine($"Found {blocking.Count} serious/critical WCAG 2.x A/AA accessibility violation(s) on '{relativeUrl}' ({scanContext}):");
Model\DashboardDataSourceTests.cs (1)
718Assert.Equal(DashboardRunStore.MaxRuns - activeRunCount, selectableRuns.Count);
Model\SqliteResourceRepositoryTests.cs (1)
960Assert.Equal(9, queries.Count);
Aspire.Deployment.EndToEnd.Tests (2)
FoundryHostedAgentDeploymentTests.cs (1)
425Assert.Equal(3, snapshot.Tools.Count);
Helpers\DeploymentReporter.cs (1)
49if (deploymentUrls.Count > 0)
Aspire.Hosting (64)
ApplicationModel\ExecutableLaunchRecipe.cs (3)
798while (projectLaunchArgumentIndex < appHostArguments.Count && 805while (projectLaunchArgumentIndex < appHostArguments.Count && 811if (projectLaunchArgumentIndex >= appHostArguments.Count)
ApplicationModel\ExpressionResolver.cs (2)
22var args = new object?[expr.ValueProviders.Count]; 25for (var i = 0; i < expr.ValueProviders.Count; i++)
ApplicationModel\ProcessCommandOptions.cs (1)
67if (value.Count == 0)
ApplicationModel\ProjectLaunchArgsOverrideAnnotation.cs (1)
64if (arguments.Count == 0)
ApplicationModel\ProjectLaunchConfigurationFactory.cs (1)
35BuildEnvironment = projectMetadata.BuildEnvironment.Count == 0
ApplicationModel\ReferenceExpression.cs (2)
204var args = new object?[ValueProviders.Count]; 205for (var i = 0; i < ValueProviders.Count; i++)
ApplicationModel\ResourceCommandService.cs (16)
244if (argumentValues is { Count: > 0 }) 285if (orderedArgumentValues is { Count: var argumentCount } && argumentCount > annotation.Arguments.Count) 287return (CreateArguments(annotation.Arguments, orderedArgumentValues: null), $"Command '{resolvedCommandName}' accepts {annotation.Arguments.Count} argument(s), but {argumentCount} were provided."); 290if (orderedArgumentValues is { Count: > 0 }) 293.Take(orderedArgumentValues.Count) 341if (!nonInteractive && !argumentsProvided && annotation.Arguments.Count > 0) 682if (dynamicLoading.AlwaysLoadOnStart || dynamicLoading.DependsOnInputs is not { Count: > 0 } dependencies) 730if (commandArguments is not { Count: > 0 }) 735var inputs = new InteractionInput[commandArguments.Count]; 736for (var i = 0; i < commandArguments.Count; i++) 753if (commandArguments is not { Count: > 0 }) 758var inputs = new InteractionInput[commandArguments.Count]; 759for (var i = 0; i < commandArguments.Count; i++) 762var value = orderedArgumentValues is not null && i < orderedArgumentValues.Count 774if (annotation.Arguments.Count == 0)
ApplicationModel\ResourceLoggerService.cs (3)
738if (logEntries.Count == 0) 852var logs = new LogLine[entries.Count]; 853for (var i = 0; i < entries.Count; i++)
ApplicationModel\TerminalAnnotation.cs (2)
73if (terminalHosts.Count == 0) 78for (var i = 0; i < terminalHosts.Count; i++)
ApplicationModel\TerminalResourceSnapshotProperties.cs (1)
50var replicaCount = terminalHosts.Count;
Ats\InteractionExports.cs (2)
228if (choices is { Count: > 0 }) 241var list = new List<KeyValuePair<string, string>>(choices.Count);
Backchannel\AuxiliaryBackchannelRpcTarget.cs (2)
481var tasks = new Task<(TerminalReplicaInfo Info, bool HostResponded)>[hosts.Count]; 482for (var i = 0; i < hosts.Count; i++)
Dashboard\DashboardService.cs (1)
364while (sentLines < group.Count)
Dashboard\DashboardServiceData.cs (2)
280if (files.Count == 0) 327if (requestInput.Files is { Count: > 0 })
Dashboard\proto\Partials.cs (1)
121if (command.Arguments is { Count: > 0 } arguments)
Dcp\ContainerCreator.cs (1)
367if (terminalAnnotation.TerminalHosts.Count > 0)
Dcp\DcpResourceWatcher.cs (1)
702if (flushedLogEntries.Count == 0)
Dcp\ExecutableCreator.cs (3)
150if (plan.Mechanism == ExecutableLaunchMechanism.Ide && plan.LaunchConfigurations.Count == 0) 186if (plan.LaunchConfigurations.Count > 0) 302replicaIndex < terminalAnnotation.TerminalHosts.Count)
Dcp\Process\ProcessOutputCapture.cs (3)
73if (output.Count == 0) 78var linesShown = Math.Min(maxLines, output.Count); 79IEnumerable<string> lines = output.Skip(output.Count - linesShown);
Dcp\Process\ProcessResult.cs (1)
14TotalProcessOutputLineCount = totalProcessOutputLineCount ?? ProcessOutput.Count;
Dcp\ResourceSnapshotBuilder.cs (1)
273(uint)index < (uint)effectiveArgs.Count)
IInteractionService.cs (1)
491public int Count => _files.Count;
InteractionService.cs (2)
165for (var i = 0; i < inputs.Count; i++) 241if (dynamic.DependsOnInputs == null || dynamic.DependsOnInputs.Count == 0 || dynamic.AlwaysLoadOnStart)
ParameterResourceBuilderExtensions.cs (1)
271Options = options.Options is { Count: > 0 } optionValues ? optionValues.Select(static option => KeyValuePair.Create(option.Key, option.Value)).ToArray() : null,
Publishing\ManifestPublishingContext.cs (5)
493if (resolvedEndpoints.Count > 0) 710var arguments = new string[referenceExpression.ManifestExpressions.Count]; 743for (var i = 0; i < providers.Count; i++) 896if (referenceExpression.ValueProviders.Count == 1 && 898referenceExpression.ManifestExpressions.Count == 1 &&
Publishing\ProcessFailedException.cs (2)
25TotalProcessOutputLineCount = totalProcessOutputLineCount ?? processOutput.Count; 44public override string Message => ProcessOutput.Count > 0
ResourceBuilderExtensions.cs (3)
3344if (exportOptions.SuccessExitCodes is { Count: > 0 } successExitCodes) 3497if (successExitCodes is null || successExitCodes.Count == 0) 5255return builder.WithAnnotation(new HiddenAnnotation(HiddenBehavior.OnCompletion) { SuccessfulExitCodes = exitCodes.Count > 0 ? [.. exitCodes] : [0] }, ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure (20)
AzureProvisioningController.cs (11)
397if (tenantOptions.Count > 0) 430if (subscriptionOptions.Count > 0) 670var useChoiceInput = locationOptions.Count > 0; 1029if (azureResources.Count == 0) 1040var afterProvisionTasks = new List<Task>(azureResources.Count); 2116if (resourceIds.Count == 0) 2151_logger.LogInformation("Deleted {Count} Azure resource(s) for resource {ResourceName}.", resourceIds.Count, intent.ResourceName); 2457json["deletedResourceCount"] = result.ResourceIds.Count; 2827var resourceName = requiredDeploymentResourceName ?? (targetResources.Count == 1 ? targetResources.Single().Resource.Name : string.Join(", ", targetResources.Select(static resource => resource.Resource.Name))); 3894var tasks = new List<Task>(azureResources.Count); 4211public bool IsNone => !IsAllResources && ResourceNames.Count == 0;
AzureProvisioningFailureDetails.cs (1)
127var locationMessage = attemptedLocations.Count == 0
AzurePublishingContext.cs (2)
234var args = new object[expr.ValueProviders.Count]; 236for (var i = 0; i < expr.ValueProviders.Count; i++)
Provisioning\Internal\DefaultArmClientProvider.cs (2)
180if (provider.Value.Data.ResourceTypes is not { Count: > 0 } resourceTypes) 188resourceTypeMetadata.Locations is not { Count: > 0 } locations)
src\Aspire.Hosting\Dcp\Process\ProcessOutputCapture.cs (3)
73if (output.Count == 0) 78var linesShown = Math.Min(maxLines, output.Count); 79IEnumerable<string> lines = output.Skip(output.Count - linesShown);
src\Aspire.Hosting\Dcp\Process\ProcessResult.cs (1)
14TotalProcessOutputLineCount = totalProcessOutputLineCount ?? ProcessOutput.Count;
Aspire.Hosting.Azure.AppContainers (3)
BaseContainerAppContext.cs (2)
343if (expr.Format == "{0}" && expr.ValueProviders.Count == 1) 355var args = new object[expr.ValueProviders.Count];
ContainerAppContext.cs (1)
138if (resolvedEndpoints.Count == 0)
Aspire.Hosting.Azure.AppService (3)
AzureAppServiceWebsiteContext.cs (3)
98if (resolvedEndpoints.Count == 0) 269if (expr.Format == "{0}" && expr.ValueProviders.Count == 1) 281var args = new object[expr.ValueProviders.Count];
Aspire.Hosting.Azure.CosmosDB (2)
AzureCosmosDBContainerResource.cs (1)
93if (value.Count == 0)
AzureCosmosDBExtensions.cs (1)
694Kind = container.PartitionKeyPaths.Count > 1 ? CosmosDBPartitionKind.MultiHash : CosmosDBPartitionKind.Hash,
Aspire.Hosting.Azure.Sandboxes (8)
AzureSandboxContainerDeployment.cs (8)
390resolvedEnvironmentVariables.Values.Count > 0, 410stateSection.Data["HasRuntimeEnvironmentConfiguration"] = resolvedEnvironmentVariables.Values.Count > 0; 753Environment = environmentVariables.Count > 0 ? environmentVariables : null, 757Entrypoint = imageMetadata.Entrypoint.Count > 0 ? [.. imageMetadata.Entrypoint] : null, 758Cmd = imageMetadata.Command.Count > 0 ? [.. imageMetadata.Command] : null, 1266var arguments = new object?[expression.ValueProviders.Count]; 1268for (var i = 0; i < expression.ValueProviders.Count; i++) 1950if (ownerIds.Count == 0)
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubExtensions.cs (1)
126if (urlExpression.ManifestExpressions.Count == 0)
Aspire.Hosting.Blazor (1)
BlazorDotNetCliRunner.cs (1)
25var argumentList = new List<string>(arguments.Count + 2)
Aspire.Hosting.Browsers (1)
BrowserLogsEventLogger.cs (1)
279details.Count > 0
Aspire.Hosting.Browsers.Tests (1)
src\Aspire.Hosting.Browsers\BrowserLogsEventLogger.cs (1)
279details.Count > 0
Aspire.Hosting.CodeGeneration.Go (15)
AtsGoCodeGenerator.cs (14)
424var targetTypes = capability.ExpandedTargetTypes.Count > 0 488if (enumTypes.Count == 0) 524if (dtoTypes.Count == 0) 544if (dto.Properties.Count == 0) 598if (exportedValues.Count == 0) 1131if (p.CallbackParameters is { Count: > 0 } cps) 1133for (var i = 0; i < cps.Count; i++) 1560if (p.CallbackParameters is { Count: > 0 } cps) 1562for (var i = 0; i < cps.Count; i++) 1584else if (p.CallbackParameters is { Count: > 0 } callbackParameters && callbackParameters.Any(cp => cp.Type.Category == AtsTypeCategory.Dto)) 1586var argNames = new List<string>(callbackParameters.Count); 1587for (var i = 0; i < callbackParameters.Count; i++) 1597for (var i = 0; i < callbackParameters.Count; i++) 1885if (typeRef.UnionTypes is not { Count: > 0 } types)
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
40if (candidates.Count != 1)
Aspire.Hosting.CodeGeneration.Go.Tests (1)
AtsGoCodeGeneratorTests.cs (1)
162Assert.Equal(2, addTestRedis.Parameters.Count);
Aspire.Hosting.CodeGeneration.Java (19)
AtsJavaCodeGenerator.cs (19)
654if (enumTypes.Count == 0) 704if (dtoTypes.Count == 0) 795if (exportedValues.Count == 0) 1015if (leftCallbackParameters.Count != rightCallbackParameters.Count) 1020for (var i = 0; i < leftCallbackParameters.Count; i++) 1155if (parameters.Count == 0) 1180var overloadParameters = new List<string>(parameters.Count); 1181var callArguments = new List<string>(parameters.Count); 1183for (var i = 0; i < parameters.Count; i++) 1235if (handleTypes.Count == 0) 1398if (unionTypes is null || unionTypes.Count == 0) 1587if (unionTypes is null || unionTypes.Count == 0) 1884var parameterCount = callbackParameters?.Count ?? 0; 1929for (var i = 0; i < callbackParameters.Count; i++) 1953for (var i = 0; i < arguments.Count; i++) 1966=> property.IsCallback && (property.CallbackParameters?.Count ?? 0) <= 1; 1981var callbackParameter = property.CallbackParameters is { Count: 1 } ? property.CallbackParameters[0] : null; 2493var targetTypes = capability.ExpandedTargetTypes.Count > 0
Aspire.Hosting.CodeGeneration.Java.Tests (1)
AtsJavaCodeGeneratorTests.cs (1)
130Assert.Equal(2, addTestRedis.Parameters.Count);
Aspire.Hosting.CodeGeneration.Python (9)
AtsPythonCodeGenerator.cs (9)
297if (parameter.CallbackParameters is not { Count: > 0 } callbackParameters || 307var tupleSuffix = callbackParameters.Count == 1 ? "," : string.Empty; 377var fullCap = items.OrderByDescending(c => c.Parameters.Count).First(); 579if (typeRef.UnionTypes is null || typeRef.UnionTypes.Count == 0) 609if (typeRef.UnionTypes is null || typeRef.UnionTypes.Count == 0) 894if (enumTypes.Count == 0) 913if (dtoTypes.Count == 0) 945if (exportedValues.Count == 0) 1942if (expandedTypes is { Count: > 0 })
Aspire.Hosting.CodeGeneration.Python.Tests (1)
AtsPythonCodeGeneratorTests.cs (1)
99Assert.Equal(2, addTestRedis.Parameters.Count);
Aspire.Hosting.CodeGeneration.Rust (5)
AtsRustCodeGenerator.cs (5)
138if (enumTypes.Count == 0) 192if (dtoTypes.Count == 0) 263if (exportedValues.Count == 0) 402if (handleTypes.Count == 0) 850var targetTypes = capability.ExpandedTargetTypes.Count > 0
Aspire.Hosting.CodeGeneration.Rust.Tests (1)
AtsRustCodeGeneratorTests.cs (1)
158Assert.Equal(2, addTestRedis.Parameters.Count);
Aspire.Hosting.CodeGeneration.TypeScript (21)
AtsTypeScriptCodeGenerator.cs (7)
623var enumValues = enumType.ValueInfos.Count > 0 692if (exportedValues.Count == 0) 1806if (callbackParameters is null || callbackParameters.Count == 0) 1810else if (callbackParameters.Count == 1) 1856if (callbackParameters is null || callbackParameters.Count == 0) 1861else if (callbackParameters.Count == 1) 1872for (var i = 0; i < callbackParameters.Count; i++)
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
40if (candidates.Count != 1)
TypeScriptApiExportWriter.cs (3)
103if (item.Members.Count > 0) 137if (member.Parameters.Count > 0) 183if (values.Count == 0)
TypeScriptApiProjector.cs (10)
1323var values = enumType.ValueInfos.Count > 0 1496=> extends.Count > 0 1742if (typeRef.UnionTypes is null || typeRef.UnionTypes.Count == 0) 1795if (typeRef.UnionTypes == null || typeRef.UnionTypes.Count == 0) 1892if (typeRef.UnionTypes == null || typeRef.UnionTypes.Count == 0) 2341if (aCallbackParams.Count != bCallbackParams.Count) 2346for (var i = 0; i < aCallbackParams.Count; i++) 2547if (typeRef.Category == AtsTypeCategory.Union && typeRef.UnionTypes is { Count: > 0 }) 2677if (expandedTypes is { Count: > 0 })
Aspire.Hosting.CodeGeneration.TypeScript.Tests (3)
AtsTypeScriptCodeGeneratorTests.cs (3)
161Assert.Equal(2, addTestRedis.Parameters.Count); 320Assert.Equal(2, nameSetterCapability.Parameters.Count); // context + value 2089Assert.Equal(2, waitForReadyAsync.Parameters.Count);
Aspire.Hosting.DevTunnels (1)
DevTunnelHealthCheck.cs (1)
63return HealthCheckResult.Healthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelHealthy, _tunnelResource.TunnelId, tunnelStatus.HostConnections, tunnelStatus.Ports?.Count));
Aspire.Hosting.Docker (7)
DockerComposeServiceResource.cs (1)
382if (serviceInfo.Publishers is not { Count: > 0 })
DockerComposeServiceResourceExtensions.cs (2)
74if (expr is { Format: "{0}", ValueProviders.Count: 1 }) 79var args = new object[expr.ValueProviders.Count];
src\Aspire.Hosting\Dcp\Process\ProcessOutputCapture.cs (3)
73if (output.Count == 0) 78var linesShown = Math.Min(maxLines, output.Count); 79IEnumerable<string> lines = output.Skip(output.Count - linesShown);
src\Aspire.Hosting\Dcp\Process\ProcessResult.cs (1)
14TotalProcessOutputLineCount = totalProcessOutputLineCount ?? ProcessOutput.Count;
Aspire.Hosting.Dotnet (5)
DotnetProjectBuildEnvironmentCallbackAnnotation.cs (1)
30if (environment.Count == 0)
DotnetProjectMetadata.cs (1)
51var snapshot = new Dictionary<string, string>(environment.Count, comparer);
DotnetProjectResource.cs (3)
201var subject = resourceNames.Count == 1 204var publishTarget = resourceNames.Count == 1 ? "this resource" : "these resources"; 205var runOnlySubject = resourceNames.Count == 1 ? "it" : "a resource";
Aspire.Hosting.Foundry (8)
HostedAgent\AzureHostedAgentResource.cs (3)
186if (endpointProtocols.Count == 0) 442var args = new object?[expression.ValueProviders.Count]; 443for (var i = 0; i < expression.ValueProviders.Count; i++)
Toolbox\FoundryToolboxReadinessProbe.cs (2)
101requiredToolNames.Count > 0 || requiredMcpServerLabels.Count > 0;
Toolbox\FoundryToolboxReconciler.cs (2)
62if (tools.Count == 0) 94if (metadata.Count > maximumUserMetadataEntries)
Toolbox\FoundryToolboxToolDefinition.cs (1)
325if (ToolNames.Count > 0)
Aspire.Hosting.Foundry.Tests (3)
PromptAgentTests.cs (2)
170Assert.Equal(2, agent.Resource.Tools.Count); 462Assert.Equal(4, agent.Resource.Tools.Count);
ToolboxTests.cs (1)
428Assert.Equal(2, tools.Count);
Aspire.Hosting.JavaScript (2)
DenoHostingExtensions.cs (1)
646return permission.Values.Count == 0
DenoOtlpExporterAnnotation.cs (1)
25public int Count => s_activationEnvironmentVariables.Count;
Aspire.Hosting.Kubernetes (8)
KubernetesEnvironmentResource.cs (2)
642var args = new object[expression.ValueProviders.Count]; 644for (var i = 0; i < expression.ValueProviders.Count; i++)
KubernetesResource.cs (2)
610if (expr is { Format: "{0}", ValueProviders.Count: 1 }) 619var args = new object[expr.ValueProviders.Count];
src\Aspire.Hosting\Dcp\Process\ProcessOutputCapture.cs (3)
73if (output.Count == 0) 78var linesShown = Math.Min(maxLines, output.Count); 79IEnumerable<string> lines = output.Skip(output.Count - linesShown);
src\Aspire.Hosting\Dcp\Process\ProcessResult.cs (1)
14TotalProcessOutputLineCount = totalProcessOutputLineCount ?? ProcessOutput.Count;
Aspire.Hosting.Maui.Tests (1)
MauiWithArgsTests.cs (1)
243Assert.True(i >= 0 && i + 1 < args.Count, "expected -f <tfm>");
Aspire.Hosting.Radius (12)
Publishing\RadCredentialRegisterStep.cs (5)
337var result = new List<string>(args.Count); 338for (var i = 0; i < args.Count; i++) 341if (secretFlags.Contains(args[i]) && i + 1 < args.Count) 357for (var i = 0; i < args.Count - 1; i++) 369if (string.IsNullOrEmpty(text) || secretValues.Count == 0)
Publishing\RadiusDeploymentPipelineStep.cs (2)
260if (parameters.Count == 0) 309parameters.Count, _environment.Name);
Publishing\RadiusInfrastructureBuilder.cs (4)
572if (storeConstructs.Count == 0) 1247if (expression.ValueProviders.Count == 0) 1254var providerParts = new List<EnvPart>[expression.ValueProviders.Count]; 1255for (var i = 0; i < expression.ValueProviders.Count; i++)
Publishing\SealedSecretApplyStep.cs (1)
154if (missing.Count > 0)
Aspire.Hosting.RemoteHost (28)
AssemblyLoader.cs (2)
62activity.SetAssemblyCount(assemblies.Count); 122if (assemblyNames.Count == 0)
Ats\CapabilityDispatcher.cs (4)
759if (unionMemberTypes is { Count: > 0 }) 869if (TryGetUnionMemberClrTypes(parameter.CustomAttributes) is { Count: > 0 } unionMemberTypes) 879if (TryGetUnionMemberClrTypes(property.CustomAttributes) is { Count: > 0 } unionMemberTypes) 913if (parameter?.Type?.UnionTypes is not { Count: > 0 } unionTypes)
AtsCapabilityScanner.cs (8)
890BaseType = typeInfo.BaseTypeHierarchy.Count > 0 ? typeInfo.BaseTypeHierarchy[0] : null 938.Where(c => c.ExpandedTargetTypes.Count > 0) 1018(c.TargetTypeId is not null && c.ExpandedTargetTypes.Count == 0)); 1435if (exportedValues.Count <= 1) 1441var uniqueValues = new List<AtsExportedValueInfo>(exportedValues.Count); 1493if (prefixPathSegments.Count >= fullPathSegments.Count) 1498for (var i = 0; i < prefixPathSegments.Count; i++)
AtsContextFactory.cs (7)
39context.Capabilities.Count, 40context.HandleTypes.Count, 41context.DtoTypes.Count, 42context.EnumTypes.Count, 43context.ExportedValues.Count, 44context.Diagnostics.Count); 56logger.LogDebug("Creating AtsContext from {AssemblyCount} assemblies...", assemblies.Count);
CodeGeneration\CodeGenerationService.cs (7)
70context.Capabilities.Count, 71context.HandleTypes.Count, 72context.DtoTypes.Count, 73context.EnumTypes.Count, 74context.ExportedValues.Count, 75context.Diagnostics.Count); 389var exportingAssemblyNames = new List<string>(manifestAssemblyNames.Count);
Aspire.Hosting.RemoteHost.Tests (4)
AtsCapabilityScannerTests.cs (3)
319Assert.Equal(4, capability.Parameters.Count); 384Assert.Equal(3, capability.Parameters.Count); 548Assert.Equal(2, callbackParam.CallbackParameters.Count);
AtsContextFilterTests.cs (1)
357Assert.True(filteredContext.HandleTypes.Count > 0);
Aspire.Hosting.Rust (6)
RustCargoTargetResolver.cs (3)
155$"{many.Count} binary targets. Call WithCargoBinTarget(\"<name>\") to select one.") 181var runnablePackages = defaultPackages.Where(static p => p.BinTargetNames.Count > 0).ToList(); 194=> metadata.Packages is { Count: > 0 } packages
RustDockerfileGenerator.cs (2)
326for (var i = 0; i < cargoArgs.Count; i++) 329if (cargoArgs[i] == "--config" && i + 1 < cargoArgs.Count)
RustHostingExtensions.cs (1)
506if (options.Features is { Count: > 0 } features)
Aspire.Hosting.Tasks (2)
RunAspireCliCommand.cs (2)
143? new ProcessStartInfo(GetCommandProcessorPath(), BuildCommandProcessorArguments(arguments.Count)) 154for (var index = 0; index < arguments.Count; index++)
Aspire.Hosting.Tests (35)
ApplicationModel\Docker\DockerfileBuilderCallbackAnnotationTests.cs (1)
162Assert.Equal(2, annotation.Callbacks.Count);
ApplicationModel\Docker\DockerfileBuilderIntegrationTests.cs (1)
174Assert.Equal(2, dockerfileBuilder.Stages.Count);
ApplicationModel\Docker\DockerfileBuilderTests.cs (1)
105Assert.Equal(2, builder.Stages.Count);
ApplicationModel\Docker\WithDockerfileBuilderTests.cs (1)
53Assert.Equal(2, callbackAnnotation.Callbacks.Count);
Backchannel\GetTerminalInfoAsyncTests.cs (1)
299var control = controlListeners is not null && i < controlListeners.Count && controlListeners[i] is { } listener
Dcp\DcpExecutorTests.cs (5)
1727Assert.Equal(8, watchLogsResults1.Count); 3278Assert.True(watchLogsResults.Count >= 2, $"Expected at least 2 log entries, got {watchLogsResults.Count}"); 9982Assert.Equal(2, hosts.Count); 10348Assert.InRange(index, 0, specArgs.Count - 1);
Dcp\ProcessUtilTests.cs (1)
79Assert.Equal(2, processResult.ProcessOutput.Count);
Lifecycle\TerminalHostFailureDiagnosticServiceTests.cs (3)
42Assert.Equal(2, logs.Count); 210Assert.Equal(2, replay.Count); 302if (batch.Count > 0)
Pipelines\DistributedApplicationPipelineTests.cs (1)
2501Assert.Equal(2, cloneBeforeStart.FinalActions.Count);
Publishing\ComposeServiceParsingTests.cs (1)
98Assert.Equal(2, results[0].Publishers?.Count);
Publishing\PipelineActivityReporterTests.cs (1)
985Assert.Equal(4, activity.Data.PipelineSummary.Count);
ReferenceExpressionTests.cs (2)
149Assert.Equal(3, conditional.ValueProviders.Count); 212Assert.Equal(3, outerConditional.ValueProviders.Count);
ResourceDependencyTests.cs (8)
410Assert.Equal(3, dependencies.Count); // D only appears once 453Assert.Equal(3, dependencies.Count); // Each resource only appears once 758Assert.Equal(2, dependencies.Count); 878Assert.Equal(2, dependencies.Count); 913Assert.Equal(2, dependencies.Count); 994Assert.Equal(3, dependencies.Count); 1016Assert.Equal(singleDeps.Count, multiDeps.Count);
ResourceLoggerServiceTests.cs (5)
51Assert.Equal(2, allLogs.Count); 132Assert.Equal(2, allLogs.Count); 190Assert.Equal(2, allLogs.Count); 209Assert.Equal(4, allLogs.Count); 612Interlocked.Add(ref observedByStableSubscription, batch.Count);
WithTerminalTests.cs (3)
298Assert.Equal(2, hosts.Count); 1133Assert.Equal(3, hosts.Count); 1163Assert.Equal(3, hosts.Count);
Aspire.Hosting.TestUtilities (2)
Utils\DotnetFileAppProcess.cs (1)
81return arguments is null or { Count: 0 }
Utils\OtlpExporterActivationTestExtensions.cs (1)
42public int Count => activationEnvironmentVariables.Count;
Aspire.Hosting.Yarp (1)
ConfigurationBuilder\YarpRoute.cs (1)
280transforms = new List<IReadOnlyDictionary<string, string>>(routeConfig.Transforms.Count + 1);
Aspire.RabbitMQ.Client.Tests (2)
AspireRabbitMQLoggingTests.cs (2)
169Assert.Equal(3, errorEvent.Count); 215Assert.Equal(4, errorEvent.Count);
Aspire.RabbitMQ.Client.v6.Tests (2)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (2)
169Assert.Equal(3, errorEvent.Count); 215Assert.Equal(4, errorEvent.Count);
Aspire.Templates.Tests (1)
TemplateTestsBase.cs (1)
209if (allRows.Count == 0)
Aspire.TerminalHost (3)
TerminalHostArgs.cs (3)
78if (r.Tokens.Count > 0 88if (r.Tokens.Count > 0 114if (parseResult.Errors.Count > 0)
Aspire.TestTools (1)
GitHubCli.cs (1)
357for (var i = 0; i < arguments.Count; i++)
Aspire.TypeSystem (1)
ApiReferenceExportOptions.cs (1)
50if (exportingAssemblyNames.Count == 0)
crossgen2 (5)
Crossgen2RootCommand.cs (4)
373if (result.Tokens.Count > 0) 389if (result.Tokens.Count == 0 ) 408if (result.Tokens.Count == 0 ) 421if (result.Tokens.Count == 0)
Program.cs (1)
236if (_typeSystemContext.InputFilePaths.Count == 0)
csc (2)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
467writer.Write(TelemetryEvents.Count);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
485if (environmentVariables.Count == 0)
dotnet-aot (29)
NativeEntryPoint.cs (1)
214if (parseResult.Errors.Count == 0)
parent\dotnet\Commands\Run\CommonRunHelpers.cs (1)
95argumentCountBeforeDoubleDash = applicationArguments.Count - argumentsAfterDoubleDash.Length;
parent\dotnet\Commands\Solution\Remove\SolutionRemoveCommand.cs (3)
31if (_projects.Count == 0) 103for (int i = 0; i < solution.SolutionFolders.Count; i++) 114nonFolderDescendants += current.Files?.Count ?? 0;
parent\dotnet\Commands\Solution\SolutionArgumentValidator.cs (1)
21if (_arguments.Count == 0)
parent\dotnet\Commands\Test\MTP\ArtifactPostProcessingPlanner.cs (3)
74group.Artifacts.Count >= 2 154&& kindGroup.Artifacts.Count + extensionGroup.Artifacts.Count >= 2;
parent\dotnet\Commands\Test\MTP\ArtifactPostProcessingTelemetry.cs (2)
63["jobs_planned"] = plan.Jobs.Count.ToString(CultureInfo.InvariantCulture), 66["artifact_count"] = groups.Sum(group => group.Artifacts.Count).ToString(CultureInfo.InvariantCulture),
parent\dotnet\Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (6)
680for (int i = 0; i < arguments.Count; i++) 697while (i + 1 < arguments.Count && !arguments[i + 1].StartsWith("-", StringComparison.Ordinal)) 745for (int i = 0; i < arguments.Count; i++) 752if (i + 1 < arguments.Count && 772for (int i = 0; i < arguments.Count; i++) 779return i + 1 >= arguments.Count || !IsOffValue(arguments[i + 1]);
parent\dotnet\Commands\Test\MTP\Terminal\TerminalTestReporter.cs (4)
523if (flaky.Count == 0) 551if (tests.Count == 0) 598if (slowest.Count == 0) 627if (tests.Count == 0)
parent\dotnet\Commands\Tool\Common\ToolManifestFinderExtensions.cs (1)
38if (manifestFilesContainPackageId.Count > 1)
parent\dotnet\Commands\Tool\Search\SearchResultPrinter.cs (2)
17if (searchResultPackages.Count == 0) 76if (p.Versions.Count != 0)
parent\dotnet\Extensions\ParseResultExtensions.cs (1)
69List<string> otherTokens = new(parseResult.Tokens.Count - 1);
parent\dotnet\NugetPackageDownloader\FirstPartyNuGetPackageSigningVerifier.cs (1)
105if (certificateChain.Count < 2)
parent\dotnet\NugetPackageDownloader\NuGetPackageDownloader.cs (1)
530if (sources.Count == 0)
parent\dotnet\Parser.cs (1)
92if (parseResult.GetValue(rootCommand.DiagOption) && parseResult.Tokens.Count == 1)
parent\dotnet\SdkVulnerability\SdkVulnerabilityInfo.cs (1)
29public bool HasVulnerabilities => Cves.Count > 0;
dotnet-dev-certs (2)
Program.cs (2)
358reporter.Output(certificates.Count switch 361_ => $"{certificates.Count} {certificateState} certificates were found: {CertificateManager.ToCertificateDescription(certificates)}"
dotnet-format (4)
CodeFormatter.cs (2)
176var totalFileCount = solution.Projects.Sum(project => project.DocumentIds.Count); 206projectFileCount += project.DocumentIds.Count;
Formatters\DocumentFormatter.cs (2)
164for (var index = 0; index < changes.Count; index++) 168var changeMessage = changes.Count > 1 || change.NewText?.Length != formattedText.Length
dotnet-svcutil-lib (1)
Shared\MSBuildProj.cs (1)
906foreach (var rtLib in depContext.RuntimeLibraries.Where(l => l.NativeLibraryGroups.Count == 0))
dotnet-watch (8)
CommandLine\CommandLineOptions.cs (7)
254if (optionResult.Tokens.Count == 0 && !optionResult.Implicit) 270var unmatchedTokensBeforeDashDash = parseResult.UnmatchedTokens.Count - (dashDashIndex >= 0 ? parseResult.Tokens.Count - dashDashIndex - 1 : 0); 281for (int i = 0; i < parseResult.UnmatchedTokens.Count; i++) 354var unmatchedTokensBeforeDashDash = parseResult.UnmatchedTokens.Count - (dashDashIndex >= 0 ? parseResult.Tokens.Count - dashDashIndex - 1 : 0); 390for (var i = 0; i < list.Count; i++)
Watch\StaticFileHandler.cs (1)
20for (int i = 0; i < files.Count; i++)
GenerateDocumentationAndConfigFiles (39)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (13)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 463if (source is null or { Count: 0 }) 466var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 475if (source is null or { Count: 0 }) 478var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 509if (source is null or { Count: 0 }) 513var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 522if (source is null or { Count: 0 }) 526var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 535if (source is null or { Count: 0 }) 539var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 655for (int i = 0, length = list.Count; i < length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
36switch (list.Count) 50for (int i = 0, n = list.Count; i < n; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
ILAssembler (7)
EntityRegistry.cs (6)
266for (int i = 0; i < GetSeenEntities(TableIndex.TypeDef).Count; i++) 348for (int i = 0; i < GetSeenEntities(TableIndex.MethodDef).Count; i++) 686for (int i = ownerIndex + 1; i < listOwner.Count; i++) 701if (otherList.Count != 0 && !otherList[otherList.Count - 1].Handle.IsNil) 703return MetadataTokens.EntityHandle(tokenType, MetadataTokens.GetRowNumber(otherList[otherList.Count - 1].Handle) + 1);
VTableExportPEBuilder.cs (1)
255if (_dataLabelFixups is null || _dataLabelFixups.Count == 0 || _mappedFieldData is null)
ilc (4)
ILCompilerRootCommand.cs (3)
398if (result.Tokens.Count > 0) 414if (result.Tokens.Count == 0) 433if (result.Tokens.Count == 0)
Program.cs (1)
139if (typeSystemContext.InputFilePaths.Count == 0)
ILCompiler.Compiler (18)
Compiler\Dataflow\FlowAnnotations.cs (1)
657Debug.Assert(attrs is null || attrs.Count == typeDef.Instantiation.Length);
Compiler\DependencyAnalysis\EETypeNode.cs (1)
968for (int i = 0; i < virtualSlots.Count; i++)
Compiler\DependencyAnalysis\InterfaceDispatchMapNode.cs (1)
173for (int interfaceMethodSlot = 0; interfaceMethodSlot < virtualSlots.Count; interfaceMethodSlot++)
Compiler\DependencyAnalysis\SealedVTableNode.cs (2)
124for (int i = 0; i < virtualSlots.Count; i++) 163for (int interfaceMethodSlot = 0; interfaceMethodSlot < virtualSlots.Count; interfaceMethodSlot++)
Compiler\ILScanner.cs (1)
307for (int i = 0; i < vtableSliceNode.Slots.Count; i++)
Compiler\SourceLinkWriter.cs (1)
54if (map.Entries.Count == 0)
Compiler\VirtualMethodCallHelper.cs (2)
73for (int slot = 0; slot < virtualSlots.Count; slot++) 111for (int slot = 0; slot < virtualSlots.Count; slot++)
parent\parent\Common\Compiler\NativeAotNameMangler.cs (2)
217var assemblies = new List<string>(context.InputFilePaths.Count + context.ReferenceFilePaths.Count + 1);
parent\parent\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (1)
125Debug.Assert(_sections.Sections.Count == sectionIndex);
parent\parent\Common\Compiler\TypeMapMetadata.cs (1)
364public bool IsEmpty => _states.Count == 0;
parent\parent\Common\TypeSystem\IL\Stubs\TypeSystemThrowingILEmitter.cs (3)
34if (helper.Signature.Length != exception.Arguments.Count + 1) 60if (helper.Signature.Length != exception.Arguments.Count + 1) 78Debug.Assert(helper.Signature.Length == exception.Arguments.Count + 1);
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (2)
101Debug.Assert(argumentValues.Count == 1); 1429if (argumentValues.Count > argsParam)
ILCompiler.ReadyToRun (23)
Compiler\DependencyAnalysis\ReadyToRun\InstrumentationDataTableNode.cs (1)
226DependencyListEntry[] symbols = new DependencyListEntry[pgoEmitter.ReferencedImports.Count];
Compiler\TypeMapAssemblyTargetsNode.cs (2)
47if (map.Value.TargetModules.Count == 0 && map.Value.HasAssemblyTargetAttributes) 78if (map.Value.TargetModules.Count == 0 && map.Value.HasAssemblyTargetAttributes)
ObjectWriter\MapFileBuilder.cs (14)
111writer.WriteLine($"Section count: {_outputInfoBuilder.Sections.Count,10}"); 112writer.WriteLine($"Node count: {_outputInfoBuilder.Nodes.Count,10}"); 113writer.WriteLine($"Symbol count: {_outputInfoBuilder.Symbols.Count,10}"); 200for (int sectionIndex = 0; sectionIndex < _outputInfoBuilder.Sections.Count; sectionIndex++) 220while (nodeIndex < _outputInfoBuilder.Nodes.Count || symbolIndex < _outputInfoBuilder.Symbols.Count) 222if (nodeIndex >= _outputInfoBuilder.Nodes.Count 223|| symbolIndex < _outputInfoBuilder.Symbols.Count 245if (symbolIndex < _outputInfoBuilder.Symbols.Count && OutputItem.Comparer.Instance.Compare(node, _outputInfoBuilder.Symbols[symbolIndex]) == 0) 262while (nodeIndex < _outputInfoBuilder.Nodes.Count || symbolIndex < _outputInfoBuilder.Symbols.Count) 264if (nodeIndex >= _outputInfoBuilder.Nodes.Count 265|| symbolIndex < _outputInfoBuilder.Symbols.Count 288if (symbolIndex < _outputInfoBuilder.Symbols.Count && OutputItem.Comparer.Instance.Compare(node, _outputInfoBuilder.Symbols[symbolIndex]) == 0)
parent\parent\Common\Compiler\NativeAotNameMangler.cs (2)
217var assemblies = new List<string>(context.InputFilePaths.Count + context.ReferenceFilePaths.Count + 1);
parent\parent\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (1)
125Debug.Assert(_sections.Sections.Count == sectionIndex);
parent\parent\Common\Compiler\TypeMapMetadata.cs (1)
364public bool IsEmpty => _states.Count == 0;
parent\parent\Common\JitInterface\SwiftPhysicalLowering.cs (1)
109List<FieldLayoutInterval> consolidatedIntervals = new(Intervals.Count);
PortableCallHelpers\PortableCallHelpersGenerator.cs (1)
170List<EcmaModule> modules = new(context.InputFilePaths.Count);
ILCompiler.RyuJit (4)
parent\parent\Common\JitInterface\SwiftPhysicalLowering.cs (1)
109List<FieldLayoutInterval> consolidatedIntervals = new(Intervals.Count);
parent\parent\Common\TypeSystem\IL\Stubs\TypeSystemThrowingILEmitter.cs (3)
34if (helper.Signature.Length != exception.Arguments.Count + 1) 60if (helper.Signature.Length != exception.Arguments.Count + 1) 78Debug.Assert(helper.Signature.Length == exception.Arguments.Count + 1);
illink (2)
ILLink.CodeFixProvider (1)
DynamicallyAccessedMembersCodeFixProvider.cs (1)
103Location targetLocation = diagnostic.AdditionalLocations.Count > 0
ILLink.RoslynAnalyzer (2)
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (2)
101Debug.Assert(argumentValues.Count == 1); 1429if (argumentValues.Count > argsParam)
Infrastructure.Tests (2)
Pipelines\NpmCliPackageTests.cs (2)
755return descriptions.Count switch 760_ => $"{string.Join(", ", descriptions.Take(descriptions.Count - 1))}, and {descriptions[^1]}"
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
407if (index < details.MessageArgs.Count)
Microsoft.Analyzers.Extra.Tests (24)
AsyncCallInsideUsingBlockAnalyzerTests.cs (2)
405for (int i = 0; i < d.Count; i++) 410d.Count.Should().Be(expected);
AsyncMethodWithoutCancellationTests.cs (2)
166for (int i = 0; i < d.Count; i++) 171d.Count.Should().Be(expected);
CallAnalysis\ArraysTests.cs (2)
127Assert.Equal(54, d.Count); 128for (int i = 0; i < d.Count; i++)
CallAnalysis\LegacyCollectionTests.cs (2)
49Assert.Equal(8, d.Count); 50for (int i = 0; i < d.Count; i++)
CallAnalysis\SplitTests.cs (1)
35for (int i = 0; i < d.Count; i++)
CallAnalysis\StartsEndsWithTests.cs (4)
61Assert.Equal(8, d.Count); 63for (int i = 0; i < d.Count; i++) 119Assert.Equal(8, d.Count); 121for (int i = 0; i < d.Count; i++)
CallAnalysis\StaticTimeTests.cs (2)
82Assert.Equal(17, d.Count); 83for (int i = 0; i < d.Count; i++)
CallAnalysis\ValueTupleTests.cs (2)
51Assert.Equal(16, d.Count); 52for (int i = 0; i < d.Count; i++)
CoalesceAnalyzerTests.cs (4)
97Assert.Equal(4, d.Count); 98for (int i = 0; i < d.Count; i++) 165Assert.Equal(5, d.Count); 166for (int i = 0; i < d.Count; i++)
ConditionalAccessAnalyzerTests.cs (2)
110Assert.Equal(8, d.Count); 111for (int i = 0; i < d.Count; i++)
MakeExeTypesInternalTests.cs (1)
162for (int i = 0; i < d.Count; i++)
Microsoft.Analyzers.Local.Tests (11)
ApiLifecycle\ApiLifecycleAnalyzerTest.cs (4)
44Assert.Equal(expectedDiagnostics, diagnostics.Count); 46for (int i = 0; i < diagnostics.Count; i++) 70Assert.Equal(expectedDiagnostics, diagnostics.Count); 72for (int i = 0; i < diagnostics.Count; i++)
CallAnalysis\ToInvariantStringTests.cs (2)
42Assert.Equal(4, d.Count); 43for (int i = 0; i < d.Count; i++)
InternalReferencedInPublicDocAnalyzerTests.cs (4)
43var casesCnt = Math.Max(firstList.Count, secondList.Count); 46var first = $"{firstPrefix} {firstList[i % firstList.Count]}"; 47var second = $"{secondPrefix} {secondList[i % secondList.Count]}";
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.AspNetCore.AsyncState (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerHandler.cs (1)
381var messages = new List<string>(exceptions.Count);
Microsoft.AspNetCore.Authorization (1)
AuthorizationPolicy.cs (1)
267if (requirementData.Count > 0)
Microsoft.AspNetCore.Authorization.Policy (3)
AuthorizationMiddlewareResultHandler.cs (2)
28if (policy.AuthenticationSchemes.Count > 0) 42if (policy.AuthenticationSchemes.Count > 0)
PolicyEvaluator.cs (1)
36if (policy.AuthenticationSchemes != null && policy.AuthenticationSchemes.Count > 0)
Microsoft.AspNetCore.Components (53)
ParameterView.cs (1)
435if (nextIndex < _cascadingParameters.Count)
Rendering\ComponentState.cs (5)
51if (_cascadingParameters.Count != 0) 217_hasCascadingParameters = _cascadingParameters.Count != 0; 238remainingCascadingParameters ??= new(_cascadingParameters.Count /* upper bound on capacity needed */); 303var numCascadingParameters = _cascadingParameters!.Count; 320var numCascadingParameters = _cascadingParameters!.Count;
ResourceAssetCollection.cs (1)
68int IReadOnlyCollection<ResourceAsset>.Count => _resources.Count;
Routing\RouteTable.cs (2)
110else if (parameter.ParameterPolicies.Count > 0 && !parameter.IsCatchAll) 114for (var i = 0; i < parameter.ParameterPolicies.Count; i++)
Routing\RouteTableFactory.cs (6)
319for (var k = 0; k < x.RoutePattern.PathSegments.Count; k++) 323if (leftSegment.Parts.Count != rightSegment.Parts.Count) 328for (var l = 0; l < leftSegment.Parts.Count; l++) 349for (var i = 0; i < obj.RoutePattern.PathSegments.Count; i++) 352for (var j = 0; j < segment.Parts.Count; j++)
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePattern.cs (1)
141var parametersCount = parameters.Count;
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternDebugStringFormatter.cs (6)
22var segments = new string[pattern.PathSegments.Count]; 23for (var i = 0; i < pattern.PathSegments.Count; i++) 49if (pattern.RequiredValues.Count == 0) 54for (var i = 0; i < pattern.Parameters.Count; i++) 77var parts = new string[segment.Parts.Count]; 78for (var i = 0; i < segment.Parts.Count; i++)
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternFactory.cs (6)
476for (var j = 0; j < segment.Parts.Count; j++) 546for (var i = 0; i < segment.Parts.Count; i++) 610parameter.ParameterPolicies.Count > 0) 617parameterConstraints = new List<RoutePatternParameterPolicyReference>(parameter.ParameterPolicies.Count); 621if (parameter.ParameterPolicies.Count > 0) 627&& parameter.ParameterPolicies.Count == 0
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (9)
33_hasDefaultValue = new bool[RoutePattern.PathSegments.Count]; 34_defaultValues = new object[RoutePattern.PathSegments.Count]; 36for (var i = 0; i < RoutePattern.PathSegments.Count; i++) 86var pathSegment = i >= RoutePattern.PathSegments.Count ? null : RoutePattern.PathSegments[i]; 106for (; i < RoutePattern.PathSegments.Count; i++) 163for (; i < RoutePattern.PathSegments.Count; i++) 291var indexOfLastSegment = routeSegment.Parts.Count - 1; 339Debug.Assert(routeSegment.Parts.Count > 1); 402if (indexOfLastSegmentUsed == (routeSegment.Parts.Count - 1))
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternParser.cs (2)
322for (var j = 0; j < segment.Parts.Count; j++) 327(i != segments.Count - 1 || j != segment.Parts.Count - 1))
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternPathSegment.cs (1)
35public bool IsSimple => Parts.Count == 1;
src\aspnetcore\src\Http\Routing\src\Template\RoutePrecedence.cs (8)
60ValidateSegementLength(routePattern.PathSegments.Count); 64for (var i = 0; i < routePattern.PathSegments.Count; i++) 114ValidateSegementLength(routePattern.PathSegments.Count); 120for (var i = 0; i < routePattern.PathSegments.Count; i++) 179if (pathSegment.Parts.Count > 1) 194if (parameterPart.ParameterPolicies.Count > 0) 251if (pathSegment.Parts.Count > 1) 276if (parameterPart.ParameterPolicies.Count > 0)
src\aspnetcore\src\Http\Routing\src\Tree\UrlMatchingTree.cs (5)
82for (var i = 0; i < entry.RoutePattern.PathSegments.Count; i++) 98Debug.Assert(segment.Parts.Count == 1); 185if (parameterPart.ParameterPolicies.Count > 0 && !parameterPart.IsCatchAll) 207if (parameterPart.ParameterPolicies.Count > 0 && parameterPart.IsCatchAll) 252for (var i = currentParameterIndex; i < segments.Count; i++)
Microsoft.AspNetCore.Components.AI (6)
Components\ConversationTurnRenderer.cs (1)
54var role = _turn.RequestBlocks.Count > 0 ? "user" : "assistant";
Components\MessageListContext.cs (3)
57if (rich.Content.Count > 0) 308if (children.Count > 0) 346if (columnIndex < table.Alignment.Count &&
Engine\UIAgent.cs (2)
209if (thread is not null && messages.Count > 0) 243if (updates is not { Count: > 0 })
Microsoft.AspNetCore.Components.AI.SourceGenerators (3)
ToolBlockEmitter.cs (3)
68if (candidate.Parameters.Count > 0) 113if (candidate.ResultProperties.Count > 0) 119if (candidate.ResultProperties.Count == 1)
Microsoft.AspNetCore.Components.Endpoints (24)
Assets\ImportMapDefinition.cs (1)
89for (var i = 0; i < asset.Properties!.Count; i++)
Discovery\AssemblyComponentLibraryDescriptor.cs (2)
50return $"Assembly = {AssemblyName}, Pages = {Pages.Count}, Components = {Components.Count}";
Discovery\ComponentCollectionBuilder.cs (2)
51totalCount += value.Count; 63for (var i = 0; i < components.Count; i++, current++)
Discovery\PageCollectionBuilder.cs (2)
50totalCount += value.Count; 63for (var i = 0; i < pages.Count; i++)
Discovery\PageComponentBuilder.cs (2)
32ArgumentOutOfRangeException.ThrowIfZero(value.Count, nameof(value)); 75for (var i = 0; i < RouteTemplates.Count; i++)
Discovery\RazorComponentApplication.cs (3)
40for (var i = 0; i < Components.Count; i++) 65return $"Pages = {Pages.Count}, Components = {Components.Count}";
FormMapping\Converters\FileConverter.cs (2)
42for (var i = 0; i < targetFiles.Count; i++) 67if (formFileCollection.Count == 0)
FormMapping\FormDataReader.cs (3)
171return _readOnlyMemoryKeys.Count > 0; 176_prefixResolver = new PrefixResolver(_readOnlyMemoryKeys.Keys, _readOnlyMemoryKeys.Count); 317$"Key count = {_readOnlyMemoryKeys.Count}, Prefix = {_currentPrefixBuffer}, Error count = {_errorCount}, Current depth = {_currentDepth}";
FormMapping\HttpContextFormValueMapper.cs (1)
117if (form.Count == 0)
Forms\DataAnnotationsClientValidationProvider.cs (2)
66if (renderedFields.Count == 0) 98if (customRule.Parameters is { Count: > 0 } parameters)
Rendering\SSRRenderModeBoundary.cs (1)
246var dict = new Dictionary<string, object?>(latestParameters.Count);
src\aspnetcore\src\Shared\Components\PrerenderComponentApplicationStore.cs (1)
68if (state is not null && state.Count > 0)
src\aspnetcore\src\Shared\Components\ResourceCollectionResolver.cs (2)
63if (descriptor.Selectors.Count == 0) 66for (var i = 0; i < descriptor.Properties.Count; i++)
Microsoft.AspNetCore.Components.Forms (3)
EditContext.cs (1)
284for (var i = 0; i < validators.Count; i++)
EditContextDataAnnotationsExtensions.cs (2)
232if (validateContext.ValidationErrors is { Count: > 0 } validationErrors) 304if (validateContext.ValidationErrors is { Count: > 0 } validationErrors)
Microsoft.AspNetCore.Components.Server (18)
Circuits\CircuitFactory.cs (2)
72if (components.Count > 0) 102var circuitHandlers = components.Count == 0 ? [] : scope.ServiceProvider.GetServices<CircuitHandler>()
Circuits\CircuitHost.cs (7)
141if (Descriptors.Count > 0) 149var count = Descriptors.Count; 166if (Descriptors.Count > 0) 176_isFirstUpdate = Descriptors.Count == 0; 668if (circuitHandlers.Count == 0) 676for (var i = circuitHandlers.Count - 1; i >= 0; i--) 782if (Descriptors.Count > 0)
Circuits\CircuitPersistenceManager.cs (1)
126if (batch.Operations.Length != rootComponentDescriptors.Count)
Circuits\PersistedCircuitState.cs (1)
17return $"ApplicationStateCount={ApplicationState?.Count ?? 0}, RootComponentsLength={RootComponents?.Length ?? 0} bytes";
Circuits\ResumedPersistedCircuitState.cs (2)
16$"ApplicationStateCount={ApplicationState?.Count ?? 0}, RootComponentCount={RootComponentDescriptors?.Count ?? 0}";
src\aspnetcore\src\Components\Shared\src\WebRootComponentParameters.cs (2)
28var count = _parameterDefinitions.Count; 29if (count != other._parameterDefinitions.Count)
src\aspnetcore\src\Shared\Components\PrerenderComponentApplicationStore.cs (1)
68if (state is not null && state.Count > 0)
src\aspnetcore\src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (2)
300if (parameterTypes.Count != argumentCount) 303$"Invocation provides {argumentCount} argument(s) but target expects {parameterTypes.Count}.");
Microsoft.AspNetCore.Components.Web (6)
Forms\ClientValidation\ClientValidationData.cs (1)
49if (registry is null || registry.Fields.Count == 0)
Forms\InputBase.cs (1)
361if (AdditionalAttributes!.Count == 1)
Forms\InputFile\InputFileChangeEventArgs.cs (4)
25public int FileCount => _files.Count; 31public IBrowserFile File => _files.Count switch 46if (_files.Count > maximumFileCount) 48throw new InvalidOperationException($"The maximum number of files accepted is {maximumFileCount}, but {_files.Count} were supplied.");
Microsoft.AspNetCore.Components.WebAssembly (3)
src\aspnetcore\src\Components\Shared\src\WebRootComponentParameters.cs (2)
28var count = _parameterDefinitions.Count; 29if (count != other._parameterDefinitions.Count)
src\aspnetcore\src\Shared\Components\PrerenderComponentApplicationStore.cs (1)
68if (state is not null && state.Count > 0)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Builder\WebAssemblyRazorComponentsEndpointConventionBuilderExtensions.cs (1)
60if (descriptors != null && descriptors.Count > 0)
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\XmlKeyManager.cs (1)
180var elementCount = allElements.Count;
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (40)
Logging\AcceptanceTests.cs (26)
244Assert.Equal(8, state!.Count); 249Assert.Equal(7, state!.Count); 304Assert.Equal(9, state!.Count); 309Assert.Equal(7, state!.Count); 390Assert.Equal(5, logRecords.Count); 402Assert.Equal(6, requestState!.Count); 412Assert.Equal(3, requestBodyState!.Count); 415Assert.Equal(2, responseState!.Count); 419Assert.Equal(2, responseBodyState!.Count); 422Assert.Equal(2, durationState!.Count); 460Assert.Equal(9, state!.Count); 506Assert.Equal(9, state!.Count); 548Assert.Equal(7, state!.Count); 571Assert.Equal(3, logRecords.Count); 580Assert.Equal(5, firstState!.Count); 584Assert.Equal(3, secondState!.Count); 609Assert.Equal(6, logRecords.Count); 622Assert.Equal(5, firstRecord!.Count); 624Assert.Equal(5, fourthRecord!.Count); 638Assert.Equal(2, thirdRecord!.Count); 639Assert.Equal(2, sixthRecord!.Count); 665Assert.Equal(7, state!.Count); 706Assert.Equal(10, state!.Count); 740Assert.Equal(7, state!.Count); 798Assert.Equal(7, logCollector.GetSnapshot()[0].StructuredState!.Count); 987Assert.Equal(7, logCollector.GetSnapshot()[1].StructuredState!.Count);
Logging\IncomingHttpDimensionsTests.cs (2)
17Assert.Equal(9, dimensions.Count); 20Assert.Equal(names.Count, dimensions.Count);
Logging\IncomingHttpRouteUtilityTests.cs (6)
96Assert.Equal(2, sensitiveParameters.Count); 136Assert.Equal(2, sensitiveParameters.Count); 314Assert.Equal(3, sensitiveParameters.Count); 361Assert.Equal(2, sensitiveParameters.Count); 403Assert.Equal(2, sensitiveParameters.Count); 412Assert.Equal(2, sensitiveParameters.Count);
Logging\RequestHeadersEnricherTests.cs (2)
104Assert.True(enrichedState.Count == 2); 286Assert.True(enrichedState.Count == 0);
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
parent\Shared\Server\InterceptorPipelineBuilder.cs (1)
145for (var i = _interceptors.Count - 1; i >= 0; i--)
Microsoft.AspNetCore.HeaderParsing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.AspNetCore.HeaderParsing.Tests (2)
ParserTests.cs (2)
90Assert.Equal(2, result.Count); 254Assert.Equal(2, result.Count);
Microsoft.AspNetCore.Http (1)
Features\FormFeature.cs (1)
400var metadataCount = formOptionsMetadatas.Count;
Microsoft.AspNetCore.Http.Extensions (4)
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Converters\FileConverter.cs (1)
67if (formFileCollection.Count == 0)
src\aspnetcore\src\Components\Endpoints\src\FormMapping\FormDataReader.cs (3)
171return _readOnlyMemoryKeys.Count > 0; 176_prefixResolver = new PrefixResolver(_readOnlyMemoryKeys.Keys, _readOnlyMemoryKeys.Count); 317$"Key count = {_readOnlyMemoryKeys.Count}, Prefix = {_currentPrefixBuffer}, Error count = {_errorCount}, Current depth = {_currentDepth}";
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
RequestDelegateGeneratorSuppressor.cs (1)
45var location = diagnostic.AdditionalLocations.Count > 0
Microsoft.AspNetCore.Http.Results (5)
ChallengeHttpResult.cs (1)
80if (AuthenticationSchemes != null && AuthenticationSchemes.Count > 0)
ForbidHttpResult.cs (2)
91if (AuthenticationSchemes != null && AuthenticationSchemes.Count > 0) 93for (var i = 0; i < AuthenticationSchemes.Count; i++)
SignOutHttpResult.cs (2)
80if (AuthenticationSchemes.Count == 0) 86for (var i = 0; i < AuthenticationSchemes.Count; i++)
Microsoft.AspNetCore.JsonPatch (1)
Internal\ObjectVisitor.cs (1)
55for (var i = 0; i < _path.Segments.Count - 1; i++)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (1)
Internal\ObjectVisitor.cs (1)
51for (var i = 0; i < _path.Segments.Count - 1; i++)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiResponseTypeProvider.cs (1)
517for (var i = 0; i < providers.Count; i++)
Microsoft.AspNetCore.Mvc.Core (60)
ActionConstraints\HttpMethodActionConstraint.cs (2)
63if (_httpMethods.Count == 0) 71for (var i = 0; i < _httpMethods.Count; i++)
ConsumesAttribute.cs (1)
210if (candidate.Constraints == null || candidate.Constraints.Count == 0 ||
Infrastructure\ActionSelector.cs (10)
70if (matches.Count > 0) 86if (finalMatches == null || finalMatches.Count == 0) 90else if (finalMatches.Count == 1) 115var actionsCount = actions.Count; 131var matchesCount = matches.Count; 154for (var i = 0; i < candidates.Count; i++) 159for (var j = 0; j < candidate.Constraints.Count; j++) 189for (var i = 0; i < candidates.Count; i++) 198for (var j = 0; j < candidate.Constraints.Count; j++) 233if (matches?.Count > 0)
Infrastructure\CopyOnWriteList.cs (1)
43public int Count => Readable.Count;
ModelBinding\Binders\ComplexObjectModelBinder.cs (9)
83var values = new object[boundConstructor.BoundConstructorParameters!.Count]; 231if (parameters.Count == 0) 237for (var i = 0; i < parameters.Count; i++) 292for (var i = 0; i < parameters.Count; i++) 327if (boundProperties.Count == 0) 333for (var i = 0; i < boundProperties.Count; i++) 384for (var i = 0; i < boundProperties.Count; i++) 548(!performsConstructorBinding || modelMetadata.BoundConstructor!.BoundConstructorParameters!.Count == 0)) 614for (var i = 0; i < parameters.Count; i++)
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (2)
49var parameterBinders = boundConstructor.BoundConstructorParameters!.Count == 0 ? 51new IModelBinder[boundConstructor.BoundConstructorParameters.Count];
ModelBinding\FormFileValueProvider.cs (1)
44var count = formFiles.Count;
ModelBinding\FormFileValueProviderFactory.cs (1)
52if (form.Files.Count > 0)
ModelBinding\Validation\ClientValidatorCache.cs (2)
41var items = new List<ClientValidatorItem>(metadata.ValidatorMetadata.Count); 42for (var i = 0; i < metadata.ValidatorMetadata.Count; i++)
ModelBinding\Validation\CompositeClientModelValidatorProvider.cs (1)
37for (var i = 0; i < ValidatorProviders.Count; i++)
ModelBinding\Validation\DefaultComplexObjectValidationStrategy.cs (4)
66_count = _properties.Count + _parameters.Count; 84if (_index < _parameters.Count) 107var property = _properties[_index - _parameters.Count];
ModelBinding\Validation\ValidationVisitor.cs (1)
213var count = validators.Count;
ModelBinding\Validation\ValidatorCache.cs (2)
31var items = new List<ValidatorItem>(metadata.ValidatorMetadata.Count); 32for (var i = 0; i < metadata.ValidatorMetadata.Count; i++)
Routing\ActionConstraintMatcherPolicy.cs (8)
38for (var i = 0; i < endpoints.Count; i++) 90for (var i = 0; i < finalMatches.Count; i++) 121if (matches?.Count > 0) 165for (var i = 0; i < items.Count; i++) 171for (var j = 0; j < constraints.Count; j++) 200for (var i = 0; i < items.Count; i++) 210for (var j = 0; j < constraints.Count; j++) 258if (matches?.Count > 0)
Routing\ActionEndpointFactory.cs (6)
243for (var i = 0; i < groupConventions.Count; i++) 248for (var i = 0; i < conventions.Count; i++) 253for (var i = 0; i < route.Conventions.Count; i++) 347for (var i = 0; i < groupConventions.Count; i++) 446for (var i = 0; i < conventions.Count; i++) 451for (var i = 0; i < perRouteConventions.Count; i++)
Routing\ControllerActionEndpointDataSource.cs (1)
87for (var i = 0; i < actions.Count; i++)
Routing\DynamicControllerEndpointMatcherPolicy.cs (4)
40for (var i = 0; i < endpoints.Count; i++) 117if (endpoints.Count == 0 && dynamicControllerMetadata != null) 125else if (endpoints.Count == 0) 147if (endpoints.Count == 0)
Routing\EndpointRoutingUrlHelper.cs (1)
89private string DebuggerToString() => $"Endpoints = {_endpointDataSource.Endpoints.Count}";
Routing\KnownRouteValueConstraint.cs (1)
99for (var i = 0; i < actionDescriptors.Items.Count; i++)
Routing\MvcRouteHandler.cs (1)
44if (candidates == null || candidates.Count == 0)
Routing\RoutePatternWriter.cs (1)
26for (var i = 0; i < segment.Parts.Count; i++)
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
DataAnnotationsMetadataProvider.cs (1)
304var contextAttributesCount = contextAttributes.Count;
Microsoft.AspNetCore.Mvc.Razor (4)
RazorView.cs (1)
163for (var i = 0; i < ViewStartPages.Count; i++)
RazorViewEngine.cs (1)
464var viewStarts = new IRazorPage[result.ViewStartEntries!.Count];
ViewLocationCacheKey.cs (2)
103(ViewLocationExpanderValues.Count != y.ViewLocationExpanderValues.Count))
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
ChecksumValidator.cs (1)
66for (var i = 0; i < checksums.Count; i++)
PageLoaderMatcherPolicy.cs (1)
42for (var i = 0; i < endpoints.Count; i++)
RuntimeViewCompiler.cs (3)
283var expirationTokens = new List<IChangeToken>(checksums.Count); 285for (var i = 0; i < checksums.Count; i++) 318if (cSharpDocument.Diagnostics.Count > 0)
Microsoft.AspNetCore.Mvc.RazorPages (7)
ApplicationModels\DefaultPageApplicationModelProvider.cs (1)
156for (var i = 0; i < pageModel.HandlerTypeAttributes.Count; i++)
Filters\PageViewDataAttributeFilter.cs (1)
36for (var i = 0; i < Properties.Count; i++)
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (4)
43for (var i = 0; i < endpoints.Count; i++) 116if (endpoints.Count == 0 && dynamicPageMetadata != null) 124else if (endpoints.Count == 0) 146if (endpoints.Count == 0)
Infrastructure\PageActionEndpointDataSource.cs (1)
54for (var i = 0; i < actions.Count; i++)
Microsoft.AspNetCore.Mvc.TagHelpers (6)
GlobbingUrlBuilder.cs (2)
84var urls = new List<string>(1 + globbedUrls.Count) 89for (var i = 0; i < globbedUrls.Count; i++)
LinkTagHelper.cs (3)
320for (var i = 0; i < urls.Count; i++) 345if (fallbackHrefs.Count == 0) 437var fallbackHrefsCount = fallbackHrefs.Count;
ScriptTagHelper.cs (1)
369if (fallbackSrcs.Count > 0)
Microsoft.AspNetCore.Mvc.Testing (1)
WebApplicationFactory.cs (1)
527if (context == null || context.CompileLibraries.Count == 0)
Microsoft.AspNetCore.Mvc.ViewFeatures (13)
DefaultValidationHtmlAttributeProvider.cs (2)
62if (validators.Count > 0) 70for (var i = 0; i < validators.Count; i++)
Filters\ControllerViewDataAttributeFilter.cs (1)
31for (var i = 0; i < Properties.Count; i++)
Filters\SaveTempDataPropertyFilterBase.cs (2)
46for (var i = 0; i < Properties.Count; i++) 72for (var i = 0; i < Properties.Count; i++)
src\aspnetcore\src\Shared\Components\ResourceCollectionResolver.cs (2)
63if (descriptor.Selectors.Count == 0) 66for (var i = 0; i < descriptor.Properties.Count; i++)
ViewComponents\DefaultViewComponentHelper.cs (2)
96for (var i = 0; i < descriptors.Items.Count; i++) 117if (descriptor.Parameters.Count == 1 && descriptor.Parameters[0].ParameterType.IsAssignableFrom(arguments.GetType()))
ViewEngines\CompositeViewEngine.cs (4)
33if (ViewEngines.Count == 0) 44for (var i = 0; i < ViewEngines.Count; i++) 82if (ViewEngines.Count == 0) 93for (var i = 0; i < ViewEngines.Count; i++)
Microsoft.AspNetCore.OpenApi (5)
Extensions\ApiDescriptionExtensions.cs (1)
78for (var i = 0; i < routePattern.PathSegments.Count; i++)
Extensions\JsonNodeSchemaExtensions.cs (1)
323if (parameterDescription.ModelMetadata is Mvc.ModelBinding.Metadata.DefaultModelMetadata { Attributes.PropertyAttributes.Count: > 0 } metadata &&
Services\OpenApiDocumentService.cs (2)
480IOpenApiSchema finalSchema = schemas.Count == 1 662if (parameter.ModelMetadata is Mvc.ModelBinding.Metadata.DefaultModelMetadata { Attributes.PropertyAttributes.Count: > 0 } metadata &&
Services\OpenApiGenerator.cs (1)
333if (metadataList.Count > 0)
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheMiddleware.cs (1)
229if (basePolicies.Count > 0)
Microsoft.AspNetCore.Owin (1)
OwinEnvironment.cs (1)
503return _entries.Count + _contextDependentEntries.Count - (_deletedKeys?.Count ?? 0);
Microsoft.AspNetCore.Razor.Utilities.Shared (38)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\EnumerableExtensions.cs (2)
159count = collection.Count; 182count = collection.Count;
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\ImmutableArrayExtensions.cs (2)
256if (source is null || source.Count == 0) 261using var builder = new PooledArrayBuilder<TResult>(capacity: source.Count);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledArrayBuilder`1.cs (2)
292=> AddRange(list, startIndex: 0, list.Count); 453=> InsertRange(index, list, startIndex: 0, list.Count);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledDictionaryBuilder`2.cs (1)
61if (items.Count == 0)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledHashSet`1.cs (2)
217if (other is null || other.Count == 0) 222if (other.Count == 1)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledList`1.cs (1)
72if (items.Count == 0)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\ReadOnlyListExtensions.cs (26)
27var count = list.Count; 65var count = list.Count; 97return list.Count > 0 111return list.Count > 0 118var result = new T[list.Count]; 134=> list.Count > 0; 259=> list.Count > 0 ? list[0] : ThrowHelper.ThrowInvalidOperationException<T>(SR.Contains_no_elements); 331=> list.Count > 0 ? list[0] : default; 347=> list.Count > 0 ? list[0] : defaultValue; 482=> list.Count > 0 ? list[^1] : ThrowHelper.ThrowInvalidOperationException<T>(SR.Contains_no_elements); 554=> list.Count > 0 ? list[^1] : default; 570=> list.Count > 0 ? list[^1] : defaultValue; 709return list.Count switch 828return list.Count switch 855return list.Count switch 1035return new(list, 0, list.Count); 1042ArgHelper.ThrowIfGreaterThan(start, list.Count); 1044return new(list, start, list.Count - start); 1051var start = startIndex.GetOffset(list.Count); 1052var count = list.Count - start; 1061var (start, count) = range.GetOffsetAndLength(list.Count); 1071ArgHelper.ThrowIfGreaterThan(start + count, list.Count); 1163ArgHelper.ThrowIfDestinationTooShort(destination, list.Count); 1184var count = list.Count; 1456switch (list.Count) 1464var length = list.Count;
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\Utilities\SortHelper`1.cs (2)
153var count = items.Count; 183var count = items.Count;
Microsoft.AspNetCore.Routing (131)
DecisionTree\DecisionTreeBuilder.cs (1)
75var itemCount = items.Count;
DefaultLinkGenerator.cs (1)
442if (values == null || values.Count == 0)
DefaultLinkParser.cs (1)
96for (var i = 0; i < kvp.Value.Count; i++)
EndpointDataSource.cs (4)
39var wrappedEndpoints = new RouteEndpoint[endpoints.Count]; 41for (int i = 0; i < endpoints.Count; i++) 91if (endpoints is null || endpoints.Count == 0) 113if (routeValues.Count > 0)
EndpointNameAddressScheme.cs (1)
39for (var i = 0; i < endpoints.Count; i++)
HostAttribute.cs (1)
54var hostsDisplay = (Hosts.Count == 0)
Internal\DfaGraphWriter.cs (1)
45for (var i = 0; i < endpoints.Count; i++)
Matching\AcceptsMatcherPolicy.cs (14)
44return endpoints.Any(e => e.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes.Count > 0); 62if (metadata == null || metadata.ContentTypes?.Count == 0) 79for (var j = 0; j < metadata.ContentTypes?.Count; j++) 96for (var j = 0; j < metadata.ContentTypes?.Count; j++) 151for (var i = 0; i < endpoints.Count; i++) 155if (contentTypes == null || contentTypes.Count == 0) 160for (var j = 0; j < contentTypes.Count; j++) 173for (var i = 0; i < endpoints.Count; i++) 177if (contentTypes.Count == 0) 197for (var j = 0; j < contentTypes.Count; j++) 266var ordered = new (ReadOnlyMediaTypeHeaderValue mediaType, int destination)[edges.Count]; 267for (var i = 0; i < edges.Count; i++) 338x?.ContentTypes.Count > 0 ? x : null, 339y?.ContentTypes.Count > 0 ? y : null);
Matching\CandidateSet.cs (3)
229switch (endpoints.Count) 246var candidates = new CandidateState[original.Length - 1 + endpoints.Count]; 305Candidates[i + endpoints.Count - 1] = new CandidateState(original[i].Endpoint, original[i].Values, original[i].Score + scoreOffset);
Matching\DataSourceDependentMatcher.cs (1)
42for (var i = 0; i < endpoints.Count; i++)
Matching\DfaMatcherBuilder.cs (18)
84maxDepth = Math.Max(maxDepth, endpoint.RoutePattern.PathSegments.Count); 383for (var i = 0; i < segment.Parts.Count; i++) 396Debug.Assert(i == segment.Parts.Count - 1 && partParameter.IsOptional); 402for (var j = 0; j < parameterPolicyReferences.Count; j++) 433for (var i = 0; i < parameterPolicyReferences.Count; i++) 477for (var k = 0; k < parameterPolicyReferences.Count; k++) 513if (depth < endpoint.RoutePattern.PathSegments.Count) 518if (endpoint.RoutePattern.PathSegments.Count == 0) 523var lastSegment = endpoint.RoutePattern.PathSegments[endpoint.RoutePattern.PathSegments.Count - 1]; 707if (endpoints == null || endpoints.Count == 0) 712var candidates = new Candidate[endpoints.Count]; 718for (var i = 1; i < endpoints.Count; i++) 753for (var i = 0; i < routeEndpoint.RoutePattern.PathSegments.Count; i++) 800for (var i = 0; i < routeEndpoint.RoutePattern.PathSegments.Count; i++) 815for (var i = 0; i < parameterPolicyReferences.Count; i++) 850for (var i = depth; i < endpoint.RoutePattern.PathSegments.Count; i++) 922for (var k = 0; k < edges.Count; k++) 932if (edge.Endpoints.Count > 0)
Matching\HostMatcherPolicy.cs (9)
51if (hosts == null || hosts.Count == 0) 84if (hosts == null || hosts.Count == 0) 92for (var j = 0; j < hosts.Count; j++) 208for (var i = 0; i < endpoints.Count; i++) 229for (var i = 0; i < endpoints.Count; i++) 302var ordered = new (EdgeKey host, int destination)[edges.Count]; 303for (var i = 0; i < edges.Count; i++) 369x?.Hosts.Count > 0 ? x : null, 370y?.Hosts.Count > 0 ? y : null);
Matching\HttpMethodMatcherPolicy.cs (13)
61for (var i = 0; i < endpoints.Count; i++) 63if (endpoints[i].Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Count > 0) 100if (metadata == null || metadata.HttpMethods.Count == 0) 128for (var j = 0; j < metadata.HttpMethods.Count; j++) 176for (var i = 0; i < endpoints.Count; i++) 184if (httpMethods.Count == 0) 189for (var j = 0; j < httpMethods.Count; j++) 226for (var i = 0; i < endpoints.Count; i++) 231if (httpMethods.Count == 0) 246for (var j = 0; j < httpMethods.Count; j++) 317for (var i = 0; i < edges.Count; i++) 436x?.HttpMethods.Count > 0 ? x : null, 437y?.HttpMethods.Count > 0 ? y : null);
Matching\MatcherPolicy.cs (1)
51for (var i = 0; i < endpoints.Count; i++)
Matching\NegotiationMatcherPolicy.cs (5)
31for (var i = 0; i < endpoints.Count; i++) 263for (var i = 0; i < endpoints.Count; i++) 275for (var i = 0; i < endpoints.Count; i++) 362var destinations = new (string negotiationValue, double quality, int destination)[edges.Count]; 363for (var i = 0; i < edges.Count; i++)
Patterns\DefaultRoutePatternTransformer.cs (2)
201for (var i = 0; i < policies.Count; i++) 223for (var j = 0; j < segment.Parts.Count; j++)
Patterns\RoutePattern.cs (1)
141var parametersCount = parameters.Count;
Patterns\RoutePatternDebugStringFormatter.cs (6)
22var segments = new string[pattern.PathSegments.Count]; 23for (var i = 0; i < pattern.PathSegments.Count; i++) 49if (pattern.RequiredValues.Count == 0) 54for (var i = 0; i < pattern.Parameters.Count; i++) 77var parts = new string[segment.Parts.Count]; 78for (var i = 0; i < segment.Parts.Count; i++)
Patterns\RoutePatternFactory.cs (12)
476for (var j = 0; j < segment.Parts.Count; j++) 546for (var i = 0; i < segment.Parts.Count; i++) 610parameter.ParameterPolicies.Count > 0) 617parameterConstraints = new List<RoutePatternParameterPolicyReference>(parameter.ParameterPolicies.Count); 621if (parameter.ParameterPolicies.Count > 0) 627&& parameter.ParameterPolicies.Count == 0 1041if (leftDictionary.Count is 0) 1045if (rightDictionary.Count is 0) 1050var combinedDictionary = new Dictionary<string, TValue>(leftDictionary.Count + rightDictionary.Count, StringComparer.OrdinalIgnoreCase); 1107var leftCount = leftList.Count; 1113var rightCount = rightList.Count;
Patterns\RoutePatternMatcher.cs (9)
33_hasDefaultValue = new bool[RoutePattern.PathSegments.Count]; 34_defaultValues = new object[RoutePattern.PathSegments.Count]; 36for (var i = 0; i < RoutePattern.PathSegments.Count; i++) 86var pathSegment = i >= RoutePattern.PathSegments.Count ? null : RoutePattern.PathSegments[i]; 106for (; i < RoutePattern.PathSegments.Count; i++) 163for (; i < RoutePattern.PathSegments.Count; i++) 291var indexOfLastSegment = routeSegment.Parts.Count - 1; 339Debug.Assert(routeSegment.Parts.Count > 1); 402if (indexOfLastSegmentUsed == (routeSegment.Parts.Count - 1))
Patterns\RoutePatternParser.cs (2)
322for (var j = 0; j < segment.Parts.Count; j++) 327(i != segments.Count - 1 || j != segment.Parts.Count - 1))
Patterns\RoutePatternPathSegment.cs (1)
35public bool IsSimple => Parts.Count == 1;
RouteValuesAddressScheme.cs (3)
92for (var i = 0; i < endpoints.Count; i++) 101if (metadata == null && routeEndpoint.RoutePattern.RequiredValues.Count == 0) 118if (routeEndpoint.RoutePattern.RequiredValues.Count > 0)
Template\DefaultTemplateBinderFactory.cs (1)
49for (var i = 0; i < kvp.Value.Count; i++)
Template\RoutePrecedence.cs (8)
60ValidateSegementLength(routePattern.PathSegments.Count); 64for (var i = 0; i < routePattern.PathSegments.Count; i++) 114ValidateSegementLength(routePattern.PathSegments.Count); 120for (var i = 0; i < routePattern.PathSegments.Count; i++) 179if (pathSegment.Parts.Count > 1) 194if (parameterPart.ParameterPolicies.Count > 0) 251if (pathSegment.Parts.Count > 1) 276if (parameterPart.ParameterPolicies.Count > 0)
Template\RouteTemplate.cs (1)
32Segments = new List<TemplateSegment>(other.PathSegments.Count);
Template\TemplateBinder.cs (8)
84for (var i = 0; i < pattern.Parameters.Count; i++) 116for (var i = 0; i < pattern.Parameters.Count; i++) 254var parameterCount = _pattern.Parameters.Count; 515var segmentsCount = segments.Count; 523var partsCount = parts.Count; 722var slots = new KeyValuePair<string, object?>[pattern.Parameters.Count + filters.Length]; 724for (var i = 0; i < pattern.Parameters.Count; i++) 731slots[i + pattern.Parameters.Count] = new KeyValuePair<string, object?>(filters[i].Key, null);
Template\TemplateSegment.cs (1)
32var partCount = other.Parts.Count;
Tree\LinkGenerationDecisionTree.cs (1)
39for (var i = 0; i < entries.Count; i++)
ValidationEndpointFilterFactory.cs (1)
79if (validateContext is { ValidationErrors.Count: > 0 })
Microsoft.AspNetCore.SignalR.Client.Core (1)
Internal\SerializedHubMessage.cs (1)
35for (var i = 0; i < messages.Count; i++)
Microsoft.AspNetCore.SignalR.Core (3)
Internal\DefaultHubDispatcher.cs (2)
765if (descriptor.AuthorizationMetadata.Count == 0) 828arguments = new object?[descriptor.OriginalParameterTypes!.Count];
SerializedHubMessage.cs (1)
31for (var i = 0; i < messages.Count; i++)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
836var paramCount = paramTypes.Count;
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (2)
Protocol\MessagePackHubProtocolWorker.cs (2)
300if (parameterTypes.Count != argumentCount) 303$"Invocation provides {argumentCount} argument(s) but target expects {parameterTypes.Count}.");
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (3)
Protocol\NewtonsoftJsonHubProtocol.cs (3)
807if (paramIndex < paramTypes.Count) 822var paramCount = paramTypes.Count; 897var paramCount = paramTypes.Count;
Microsoft.AspNetCore.SignalR.StackExchangeRedis (7)
Internal\RedisProtocol.cs (3)
59if (excludedConnectionIds != null && excludedConnectionIds.Count > 0) 61writer.WriteArrayHeader(excludedConnectionIds.Count); 237writer.WriteMapHeader(serializedHubMessages.Count);
RedisHubLifetimeManager.cs (4)
245var publishTasks = new List<Task>(connectionIds.Count); 260var publishTasks = new List<Task>(groupNames.Count); 277if (userIds.Count > 0) 280var publishTasks = new List<Task>(userIds.Count);
Microsoft.AspNetCore.StaticAssets (7)
Development\StaticAssetDevelopmentRuntimeHandler.cs (7)
80for (var i = 0; i < descriptor.Properties.Count; i++) 94for (var i = 0; i < descriptor.ResponseHeaders.Count; i++) 341if (descriptor.ResponseHeaders.Count == 0) 348for (var i = 0; i < descriptor.ResponseHeaders.Count; i++) 370if (descriptor.Properties.Count == 0) 375for (var i = 0; i < descriptor.Properties.Count; i++) 384if (propertiesList.Count < descriptor.Properties.Count)
Microsoft.AspNetCore.Testing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Build (77)
BackEnd\BuildManager\BuildManager.cs (2)
2371var finishedNodes = new HashSet<ProjectGraphNode>(projectGraph.ProjectNodes.Count); 2373var resultsPerNode = new Dictionary<ProjectGraphNode, BuildResult>(projectGraph.ProjectNodes.Count);
BackEnd\Components\Communications\LogMessagePacket.cs (1)
126var count = value.ProfiledLocations.Count;
BackEnd\Components\ProjectCache\ProjectCacheDescriptorEqualityComparer.cs (1)
49if (obj.PluginSettings.Count > 0)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (1)
560HashSet<string> excludesUnescapedForComparison = new HashSet<string>(excludes.Count, StringComparer.OrdinalIgnoreCase);
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (3)
49if (registeredResolvers.Count > 0) 70if (potentialResolvers.Count == 0) 99MSBuildEventSource.Log.SdkResolverFindResolversManifestsStop(allResolversManifests?.Count ?? 0);
BackEnd\Components\SdkResolution\SdkResolverService.cs (2)
557_specificResolversManifestsRegistry.Count + _generalResolversManifestsRegistry.Count));
BackEnd\Shared\BuildRequestConfiguration.cs (1)
216return requestedTargets != null && requestedTargets.Count > 0 ? requestedTargets : null;
BackEnd\Shared\BuildResult.cs (1)
566Assumed.Positive(targetsToKeep.Count, $"{nameof(targetsToKeep)} should contain at least one target.");
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (1)
286check.SupportedRules.Count != checkFactoryContext.RuleIds.Length
BuildCheck\Infrastructure\CheckWrapper.cs (3)
46_ruleTelemetryData = new BuildCheckRuleTelemetryData[check.SupportedRules.Count]; 88CheckConfigurationEffective effectiveConfig = effectiveConfigs[Math.Max(idx, effectiveConfigs.Count - 1)]; 107if (effectiveConfigs.Count == 1)
BuildCheck\Infrastructure\ConfigurationProvider.cs (2)
144TConfig[] configurations = new TConfig[ruleIds.Count]; 145for (int i = 0; i < ruleIds.Count; i++)
BuildCheck\Infrastructure\CustomConfigurationData.cs (2)
72if (customConfigObj.ConfigurationData != null && ConfigurationData != null && ConfigurationData.Count == customConfigObj.ConfigurationData.Count)
Collections\CopyOnReadEnumerable.cs (1)
78list = new List<TResult>(readOnlyCollection.Count);
Construction\Solution\SolutionFile.cs (3)
527return project.ProjectType != SolutionProjectType.SolutionFolder && project.ProjectConfigurations.Count > 0; 1816if ((_defaultConfigurationName.Length == 0) && (SolutionConfigurations.Count > 0)) 1854if ((_defaultPlatformName.Length == 0) && (SolutionConfigurations.Count > 0))
Construction\Solution\SolutionProjectGenerator.cs (3)
788var projectsInOrder = new List<ProjectInSolution>(_solutionFile.ProjectsInOrder.Count); 2400if ((!solutionHasReleaseConfiguration) && (_solutionFile.SolutionConfigurations.Count > 0)) 2425if (_solutionFile.SolutionConfigurations.Count > 0)
Evaluation\ExpressionShredder.cs (1)
310for (int i = 0; i < expressions.Count; i++)
Evaluation\GlobResultBuilder.cs (4)
55if (projectItemElements.Count == 0) 80var removeElementCache = new Dictionary<string, CumulativeRemoveElementData>(projectItemElements.Count); 81var globResults = new List<GlobResult>(projectItemElements.Count); 83for (var i = projectItemElements.Count - 1; i >= 0; i--)
Evaluation\Profiler\ProfilerResultPrettyPrinter.cs (1)
44if (profiledLocations.Count == 0)
Graph\GraphBuilder.cs (9)
117var graphRoots = new List<ProjectGraphNode>(entryPointNodes.Count); 121if (entryPointNode.ReferencingProjects.Count == 0) 140if (_solutionDependencies != null && _solutionDependencies.Count != 0) 261if (entryPoints.Count == 0 || !entryPoints.Any(e => FileUtilities.IsSolutionFilename(e.ProjectFile))) 266if (entryPoints.Count != 1) 274ErrorUtilities.VerifyThrowArgument(entryPoints.Count == 1, "StaticGraphAcceptsSingleSolutionEntryPoint"); 323List<ProjectGraphEntryPoint> newEntryPoints = new(projectsInSolution.Count); 351if (project.Dependencies.Count > 0) 355List<string> solutionDependenciesForProject = new(project.Dependencies.Count);
Graph\ProjectGraph.cs (9)
515ProjectNodes.Count, 585return $"#roots={GraphRoots.Count}, #nodes={ProjectNodes.Count}, #entryPoints={EntryPointNodes.Count}"; 592var toposort = new List<ProjectGraphNode>(graphNodes.Count); 593var partialRoots = new Queue<ProjectGraphNode>(graphNodes.Count); 594var inDegree = graphNodes.ToDictionary(n => n, n => n.ReferencingProjects.Count); 616Assumed.Equal(toposort.Count, graphNodes.Count, "sorted node count must be equal to total node count"); 746if (node.ProjectReferences.Count == 0)
Graph\ProjectGraphNode.cs (2)
53$"{truncatedProjectFile}, #GlobalProps={ProjectInstance.GlobalProperties.Count}, #Props={ProjectInstance.Properties.Count}, #Items={ProjectInstance.Items.Count}, #in={ReferencingProjects.Count}, #out={ProjectReferences.Count}";
Graph\ProjectInterpretation.cs (1)
292if (outerBuild.ProjectType == ProjectType.OuterBuild && outerBuild.ReferencingProjects.Count != 0)
Instance\ProjectItemInstance.cs (5)
871_directMetadata = (directMetadata == null || directMetadata.Count == 0) ? null : directMetadata; // If the metadata was all removed, toss the dictionary 1078get { return (_directMetadata == null) ? 0 : _directMetadata.Count; } 1109public bool HasCustomMetadata => _directMetadata?.Count > 0 || _itemDefinitions?.Count > 0; 1693if (_directMetadata?.Count == 0) 1763int capacity = (_itemDefinitions?.Count ?? 0) + (_directMetadata?.Count ?? 0);
Instance\TaskFactories\TaskHostTask.cs (1)
452var result = new Dictionary<string, string>(requestProperties.Count);
Logging\BinaryLogger\BinaryLogger.cs (3)
306=> AdditionalFilePaths is null || AdditionalFilePaths.Count == 0 539if (AdditionalFilePaths != null && AdditionalFilePaths.Count > 0 && stream != null) 558if (AdditionalFilePaths != null && AdditionalFilePaths.Count > 0)
Logging\BinaryLogger\BuildEventArgsWriter.cs (3)
323Write(e.Loggers.Count); 334Write(logger.OutputFilePaths.Count); 387Write(result.Value.ProfiledLocations.Count);
Logging\ParallelLogger\ParallelConsoleLogger.cs (2)
329&& _registeredLoggers.Any(logger => logger.OutputFilePaths.Count > 0)) 333foreach (var logger in _registeredLoggers.Where(logger => logger.OutputFilePaths.Count > 0))
Logging\TerminalLogger\TerminalLogger.cs (2)
637&& _registeredLoggers.Any(logger => logger.OutputFilePaths.Count > 0)) 641foreach (var logger in _registeredLoggers.Where(logger => logger.OutputFilePaths.Count > 0))
src\9f0d3f3da306d8cf\IEnumerableExtensions.cs (7)
283return readOnlyCollection.Count == 0; 311return source.Count == 0; 404var builder = new TResult[source.Count]; 420var builder = new TResult[source.Count]; 461var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 474var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 613for (int i = 0, length = list.Count; i < length; i++)
Microsoft.Build.Framework (21)
Assumed.cs (3)
146if (collection is null || collection.Count == 0) 165if (collection is null || collection.Count == 0) 934isEnabled = collection is null || collection.Count == 0;
BackEnd\TranslatorHelpers.cs (1)
208int count = localDict.Count;
BuildSubmissionStartedEventArgs.cs (1)
55writer.Write(GlobalProperties.Count);
ErrorUtilities.cs (1)
73if (parameter?.Count == 0)
FileClassifier.cs (1)
408for (int i = 0; i < locations.Count; i++)
LoggersRegisteredEventArgs.cs (3)
77var withPaths = loggers.Where(l => l.OutputFilePaths.Count > 0).ToList(); 99writer.Write(Loggers.Count); 110writer.Write(logger.OutputFilePaths.Count);
Profiler\ProfilerResult.cs (2)
37(ProfiledLocations.Count == result.ProfiledLocations.Count &&
Utilities\ArgumentExceptionExtensions.cs (1)
35if (argument.Count == 0)
Utilities\CollectionHelpers.cs (2)
59if (a.Count != b.Count)
Utilities\FileMatcher.cs (6)
628if (0 == entries.Count) 641entries.Count, 643$"Unexpected number of entries ({entries.Count}) found when enumerating '{parts[i]}' under '{longPath}'. Original path was '{path}'"); 3226subdirectories.Count, 3239List<string>?[] partitionResults = new List<string>?[subdirectories.Count]; 3242subdirectories.Count,
Microsoft.Build.NuGetSdkResolver (2)
NuGetSdkResolver.cs (1)
255if (logger.Errors.Count == 0)
src\nuget-client\build\Shared\SharedExtensions.cs (1)
171for (var index = 0; index < lst.Count; index++)
Microsoft.Build.Tasks.CodeAnalysis (3)
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (1)
726if (telemetryEvents.Count == 0 || BuildEngine is not IBuildEngine5 buildEngine5)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
467writer.Write(TelemetryEvents.Count);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
485if (environmentVariables.Count == 0)
Microsoft.Build.Tasks.Core (4)
AssemblyDependency\ResolveAssemblyReference.cs (2)
2916var combined = new List<DependentAssembly>(first.Count + second.Count);
WriteCodeFragment.cs (2)
423for (int i = 0; i < parameters.Count; i++) 509.Where(t => t.Length == positionalParameters.Count)
Microsoft.Build.Tasks.Git (1)
GitOperations.cs (1)
467var high = list.Count - 1;
Microsoft.CodeAnalysis (84)
Collections\CollectionsExtensions.cs (1)
20return collection == null || collection.Count == 0;
CommandLine\AnalyzerConfigSet.cs (1)
128var sortedAnalyzerConfigs = ArrayBuilder<AnalyzerConfig>.GetInstance(analyzerConfigs.Count);
CommandLine\ReportAnalyzerUtil.cs (1)
118var suppressorCount = nonConcurrentAnalyzersAndSuppressors.Count - nonConcurrentAnalyzers.Length;
CommandLine\SarifV1ErrorLogger.cs (1)
109additionalLocations.Count > 0 &&
CommandLine\SarifV2ErrorLogger.cs (1)
148additionalLocations.Count > 0 &&
Compilation\ParseOptions.cs (2)
174if (features.Count != other.Count)
Diagnostic\Diagnostic.cs (1)
501if (AdditionalLocations is null || AdditionalLocations.Count == 0)
Emit\EditAndContinue\DeltaMetadataWriter.cs (20)
169sizes[(int)TableIndex.TypeRef] = _typeRefIndex.Rows.Count; 170sizes[(int)TableIndex.TypeDef] = _typeDefs.GetAdded().Count; 171sizes[(int)TableIndex.Field] = _fieldDefs.GetAdded().Count; 172sizes[(int)TableIndex.MethodDef] = _methodDefs.GetAdded().Count; 173sizes[(int)TableIndex.Param] = _parameterDefs.GetAdded().Count; 174sizes[(int)TableIndex.MemberRef] = _memberRefIndex.Rows.Count; 175sizes[(int)TableIndex.StandAloneSig] = _standAloneSignatureIndex.Rows.Count; 176sizes[(int)TableIndex.EventMap] = _eventMap.GetAdded().Count; 177sizes[(int)TableIndex.Event] = _eventDefs.GetAdded().Count; 178sizes[(int)TableIndex.PropertyMap] = _propertyMap.GetAdded().Count; 179sizes[(int)TableIndex.Property] = _propertyDefs.GetAdded().Count; 180sizes[(int)TableIndex.MethodImpl] = _methodImpls.GetAdded().Count; 181sizes[(int)TableIndex.ModuleRef] = _moduleRefIndex.Rows.Count; 182sizes[(int)TableIndex.TypeSpec] = _typeSpecIndex.Rows.Count; 183sizes[(int)TableIndex.AssemblyRef] = _assemblyRefIndex.Rows.Count; 184sizes[(int)TableIndex.GenericParam] = _genericParameters.GetAdded().Count; 185sizes[(int)TableIndex.MethodSpec] = _methodSpecIndex.Rows.Count; 275if (previous.Count == 0) 280if (current.Count == 0) 1008int lastCustomAttributeRowId = _previousGeneration.CustomAttributesAdded.Count > 0
Emit\EditAndContinue\EmitBaseline.cs (7)
343Debug.Assert(tableEntriesAdded[(int)TableIndex.TypeDef] >= typesAdded.Count); 344Debug.Assert(tableEntriesAdded[(int)TableIndex.Event] >= eventsAdded.Count); 345Debug.Assert(tableEntriesAdded[(int)TableIndex.Field] >= fieldsAdded.Count); 346Debug.Assert(tableEntriesAdded[(int)TableIndex.MethodDef] >= methodsAdded.Count); 347Debug.Assert(tableEntriesAdded[(int)TableIndex.Property] >= propertiesAdded.Count); 348Debug.Assert(tableEntriesAdded[(int)TableIndex.EventMap] >= eventMapAdded.Count); 349Debug.Assert(tableEntriesAdded[(int)TableIndex.PropertyMap] >= propertyMapAdded.Count);
Emit\EditAndContinue\SymbolMatcher.cs (1)
216if (previousMembers.Count == 0)
InternalUtilities\IReadOnlyListExtensions.cs (1)
14for (int i = 0; i < list.Count; i++)
PEWriter\MetadataWriter.cs (16)
1972metadata.SetCapacity(TableIndex.AssemblyRef, assemblyRefs.Count); 2217metadata.SetCapacity(TableIndex.Event, eventDefs.Count); 2385metadata.SetCapacity(TableIndex.Field, fieldDefs.Count); 2604metadata.SetCapacity(TableIndex.MemberRef, memberRefs.Count); 2643metadata.SetCapacity(TableIndex.MethodSpec, methodSpecs.Count); 2656metadata.SetCapacity(TableIndex.MethodDef, methodDefs.Count); 2679metadata.SetCapacity(TableIndex.MethodSemantics, propertyDefs.Count * 2 + eventDefs.Count * 2); 2753metadata.SetCapacity(TableIndex.ModuleRef, moduleRefs.Count); 2793metadata.SetCapacity(TableIndex.Param, parameterDefs.Count); 2807metadata.SetCapacity(TableIndex.Property, propertyDefs.Count); 2821metadata.SetCapacity(TableIndex.TypeDef, typeDefs.Count); 2878metadata.SetCapacity(TableIndex.TypeRef, typeRefs.Count); 2938metadata.SetCapacity(TableIndex.TypeSpec, typeSpecs.Count); 2960int[] bodyOffsets = new int[methods.Count]; 2992int[] bodyOffsets = new int[methods.Count];
ReferenceManager\CommonReferenceManager.Binding.cs (1)
971for (int i = 1; i < referenceBindings.Count; i++)
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (6)
85Debug.Assert(groupSizes.Count <= ushort.MaxValue); 89if (groupSizes.Count == 0) 99builder.WriteUInt16((ushort)uc.Count); 148builder.WriteInt32(infos.Count); 172Debug.Assert(infos.Count > 0); 174builder.WriteInt32(infos.Count);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (13)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 463if (source is null or { Count: 0 }) 466var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 475if (source is null or { Count: 0 }) 478var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 509if (source is null or { Count: 0 }) 513var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 522if (source is null or { Count: 0 }) 526var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 535if (source is null or { Count: 0 }) 539var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 655for (int i = 0, length = list.Count; i < length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
36switch (list.Count) 50for (int i = 0, n = list.Count; i < n; i++)
Syntax\GreenNode.cs (2)
953switch (list.Count) 965var array = new ArrayElement<GreenNode>[list.Count];
Text\ChangedText.cs (4)
193if (changes.Count > 1) 200if (actualOldText != null && actualOldText.GetChangeRanges(oldText).Count == 0) 254Debug.Assert(changeSets.Count > 1); 257for (int i = 1; i < changeSets.Count; i++)
Text\CompositeText.cs (1)
374for (int i = 0; i < segments.Count; i++)
Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
Microsoft.CodeAnalysis.Analyzers (40)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (1)
119if (diagnostic.AdditionalLocations.Count == 1)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (13)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 463if (source is null or { Count: 0 }) 466var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 475if (source is null or { Count: 0 }) 478var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 509if (source is null or { Count: 0 }) 513var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 522if (source is null or { Count: 0 }) 526var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 535if (source is null or { Count: 0 }) 539var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 655for (int i = 0, length = list.Count; i < length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
36switch (list.Count) 50for (int i = 0, n = list.Count; i < n; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Microsoft.CodeAnalysis.AnalyzerUtilities (35)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (13)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 463if (source is null or { Count: 0 }) 466var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 475if (source is null or { Count: 0 }) 478var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 509if (source is null or { Count: 0 }) 513var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 522if (source is null or { Count: 0 }) 526var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 535if (source is null or { Count: 0 }) 539var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 655for (int i = 0, length = list.Count; i < length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
36switch (list.Count) 50for (int i = 0, n = list.Count; i < n; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAbstractValue.cs (4)
70if (values.Count == 0) 75else if (values.Count == 1) 80else if (values.Count == 2) 87for (int i = 2; i < values.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.CodeAnalysis.BuildClient.Package (2)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
467writer.Write(TelemetryEvents.Count);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
485if (environmentVariables.Count == 0)
Microsoft.CodeAnalysis.CodeStyle (30)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
138for (var index = 0; index < triviaList.Count; index++)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (13)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 463if (source is null or { Count: 0 }) 466var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 475if (source is null or { Count: 0 }) 478var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 509if (source is null or { Count: 0 }) 513var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 522if (source is null or { Count: 0 }) 526var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 535if (source is null or { Count: 0 }) 539var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 655for (int i = 0, length = list.Count; i < length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
36switch (list.Count) 50for (int i = 0, n = list.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.CodeAnalysis.CodeStyle.Fixes (12)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
120var insertionIndex = newParameterIndex ?? existingParameters.Count; 141if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
158if (statements.Count > 0) 160return semanticModel.AnalyzeControlFlow(statements[0], statements[statements.Count - 1]);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Microsoft.CodeAnalysis.CSharp (11)
Binder\Binder_Expressions.cs (1)
7459if (suppressUnsupportedRequiredMembersError && useSiteInfo.AccumulatesDiagnostics && useSiteInfo.Diagnostics is { Count: not 0 })
BoundTree\UnboundLambda.cs (2)
1467var nx = x.Arguments?.Count ?? 0; 1468var ny = y.Arguments?.Count ?? 0;
Compiler\MethodCompiler.cs (2)
1281if (capturedParameters.Count != 0) 1285var initializers = ArrayBuilder<BoundStatement>.GetInstance(capturedParameters.Count);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
145var builder = ArrayBuilder<BoundExpression>.GetInstance(bytes.Count + 1);
Symbols\ConstraintsHelper.cs (1)
1306useSiteInfo.Dependencies.Count == 1 ?
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4958var members = ArrayBuilder<Symbol>.GetInstance(membersSoFar.Count + 1);
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
120if (capturedParameters.Count == 0)
Syntax\CSharpSyntaxTree.cs (2)
542if (changes.Count == 0 && newText == oldText) 565if (workingChanges.Count == 1 && workingChanges[0].Span == new TextSpan(0, this.Length) && workingChanges[0].NewLength == newText.Length)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
240while (index + 1 < statements.Count && statements[index + 1] is LocalFunctionStatementSyntax) 244if (index == statements.Count - 1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
158for (var i = declarationIndex + 1; i < statements.Count; i++)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
70var references = new List<ExpressionSyntax>(diagnostic.AdditionalLocations.Count - 2); 72for (var i = 2; i < diagnostic.AdditionalLocations.Count; i++)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (3)
68if (originalBlockStatements.Count == currentBlockStatements.Count) 87for (var i = 0; i < list.Count; i++)
Microsoft.CodeAnalysis.CSharp.Features (12)
AddImport\CSharpAddImportFeatureService.cs (1)
408CreateNameSyntax(namespaceParts, namespaceParts.Count - 1));
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (2)
46var completionCount = context.Items.Count; 49if (completionCount < context.Items.Count)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
240while (index + 1 < statements.Count && statements[index + 1] is LocalFunctionStatementSyntax) 244if (index == statements.Count - 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
158for (var i = declarationIndex + 1; i < statements.Count; i++)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
70var references = new List<ExpressionSyntax>(diagnostic.AdditionalLocations.Count - 2); 72for (var i = 2; i < diagnostic.AdditionalLocations.Count; i++)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (3)
68if (originalBlockStatements.Count == currentBlockStatements.Count) 87for (var i = 0; i < list.Count; i++)
Wrapping\SeparatedSyntaxList\CSharpParameterWrapper.cs (1)
62var firstToken = attributes?.Count > 0
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (5)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpAvoidDuplicateElementInitializationFixer.cs (1)
33if (diagnostic?.AdditionalLocations.Count != 1)
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (2)
30if (diagnostic is not { AdditionalLocations.Count: > 0 }) 167if (diagnostic.AdditionalLocations.Count != dictionaryAccessors.Count + additionalNodes)
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidRedundantRegexIsMatchBeforeMatch.Fixer.cs (1)
99if (diagnostic.AdditionalLocations.Count < 1)
Microsoft.NetCore.Analyzers\Runtime\CSharpPreferReadOnlySpanPropertiesOverReadOnlyArrayFields.Fixer.cs (1)
422var replacements = ImmutableArray.CreateBuilder<(SyntaxNode Original, SyntaxNode Replacement)>(diagnostic.AdditionalLocations.Count);
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
CodeGeneration\CSharpSyntaxGenerator.cs (10)
1029if (index >= 0 && index < existingAttributes.Count) 1033else if (existingAttributes.Count > 0) 1035return this.InsertNodesAfter(declaration, existingAttributes[existingAttributes.Count - 1], WithRequiredTargetSpecifier(newAttributes, declaration)); 1064if (index >= 0 && index < existingAttributes.Count) 1068else if (existingAttributes.Count > 0) 1070return this.InsertNodesAfter(d, existingAttributes[existingAttributes.Count - 1], newAttributes); 1346if (index >= 0 && index < existingMembers.Count) 1350else if (existingMembers.Count > 0) 1352return this.InsertNodesAfter(declaration, existingMembers[existingMembers.Count - 1], newMembers); 3084var count = subDecls.Count;
Microsoft.CodeAnalysis.Extensions.Package (19)
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (13)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 463if (source is null or { Count: 0 }) 466var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 475if (source is null or { Count: 0 }) 478var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 509if (source is null or { Count: 0 }) 513var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 522if (source is null or { Count: 0 }) 526var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 535if (source is null or { Count: 0 }) 539var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 655for (int i = 0, length = list.Count; i < length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
36switch (list.Count) 50for (int i = 0, n = list.Count; i < n; i++)
Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.CodeAnalysis.Features (61)
AddImport\AbstractAddImportFeatureService.cs (2)
147var projectToAssembly = new ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>>(concurrencyLevel: 2, capacity: project.Solution.ProjectIds.Count); 148var referenceToCompilation = new ConcurrentDictionary<PortableExecutableReference, Compilation>(concurrencyLevel: 2, capacity: project.Solution.Projects.Sum(p => p.MetadataReferences.Count));
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
584if (refLocations.Count > 0)
Completion\CompletionList.cs (1)
188internal bool IsEmpty => ItemsList.Count == 0 && SuggestionModeItem is null;
Completion\CompletionService_GetCompletions.cs (2)
100if (!triggeredContexts.Any(static cc => cc.Items.Count > 0)) 238=> cc.Items.Count > 0 || cc.SuggestionModeItem != null;
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (2)
95var count = context.Items.Count; 98if (context.Items.Count > count)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
164if (context.Items.Count > 0)
Copilot\ICopilotChangeAnalysisService.cs (2)
118var projectDocumentCount = newDocument.Project.DocumentIds.Count; 122.GetProjectsThatThisProjectTransitivelyDependsOn(document.Project.Id).Count;
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (1)
81var count = documentAnalysisScope != null ? 1 : project.DocumentIds.Count + 1;
Diagnostics\Service\DiagnosticAnalyzerService.ProjectStates.cs (1)
55if (project.AnalyzerReferences.Count == 0)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (3)
856if (features.Count != other.Count) 2718if (editScript.Edits.Length == 0 && triviaEdits.Count == 0)
EditAndContinue\DeclarationBodyMap.cs (2)
29Contract.ThrowIfFalse(forwardMatch.Count == reverseMatch.Count);
EditAndContinue\EditSession.cs (5)
901using var _0 = ArrayBuilder<SemanticEdit>.GetInstance(edits.Count, out var mergedEditsBuilder); 903using var _2 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol)>.GetInstance(edits.Count, out var resolvedSymbols); 907for (var i = 0; i < edits.Count; i++) 931if (edits.Count == mergedEditsBuilder.Count) 1008for (var i = 0; i < edits.Count; i++)
EditAndContinue\Utilities\BidirectionalMap.cs (7)
21Contract.ThrowIfFalse(forward.Count == reverse.Count); 28var forward = new Dictionary<T, T>(Forward.Count + 1); 29var reverse = new Dictionary<T, T>(Reverse.Count + 1); 44if (map.Forward.Count == 0) 49var count = Forward.Count + map.Forward.Count;
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (1)
120var sortText = context.Items.Count.ToString("0000");
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (1)
112var sortText = context.Items.Count.ToString("0000");
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
667count += project.DocumentIds.Count;
NavigateTo\RoslynNavigateToItem.cs (4)
252var activeDiff = activeFolders.Count - commonCount; 253var itemDiff = itemFolders.Count - commonCount; 264var maxCommon = Math.Min(activeFolders.Count, itemFolders.Count);
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (3)
94while (statements.Count == 1 && blockFacts.IsScopeBlock(statements[0])) 116blockFacts.GetExecutableBlockStatements(parent).Count == statements.Count)
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
206if (insideStatements.Count == 0) 220var controlFlow = semanticModel.AnalyzeControlFlow(insideStatements[0], insideStatements[insideStatements.Count - 1]);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
136if (insideStatements.Count == 0) 151var controlFlow = semanticModel.AnalyzeControlFlow(insideStatements[0], insideStatements[insideStatements.Count - 1]);
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (6)
102if (statements.Count > 0 && statements[0] == statement) 105if (rootStatements.Count > 0 && ifGenerator.IsIfOrElseIf(rootStatements[0].Parent)) 133if (statements.Count > 0 && ifGenerator.IsIfOrElseIf(statements[0])) 176if (statements.Count == 1) 216if (!remainingStatements.SequenceEqual(remainingOuterStatements.Take(statements.Count - 1), syntaxFacts.AreEquivalent)) 222var controlFlow = semanticModel.AnalyzeControlFlow(statements[0], statements[statements.Count - 1]);
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
138for (var index = 0; index < triviaList.Count; index++)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
120var insertionIndex = newParameterIndex ?? existingParameters.Count; 141if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
158if (statements.Count > 0) 160return semanticModel.AnalyzeControlFlow(statements[0], statements[statements.Count - 1]);
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (6)
85Debug.Assert(groupSizes.Count <= ushort.MaxValue); 89if (groupSizes.Count == 0) 99builder.WriteUInt16((ushort)uc.Count); 148builder.WriteInt32(infos.Count); 172Debug.Assert(infos.Count > 0); 174builder.WriteInt32(infos.Count);
Microsoft.CodeAnalysis.NetAnalyzers (17)
Microsoft.CodeQuality.Analyzers\Maintainability\CodeMetricsAnalyzer.cs (1)
228if (values.Count == 1 &&
Microsoft.NetCore.Analyzers\InteropServices\SpecifyMarshalingForPInvokeStringArguments.Fixer.cs (1)
101else if (types.MarshalAs.Equals(attributeType?.ContainingType) && arguments.Count == 1)
Microsoft.NetCore.Analyzers\Performance\DoNotGuardCall.Fixer.cs (1)
64if (diagnostic.AdditionalLocations.Count < 2 ||
Microsoft.NetCore.Analyzers\Performance\PreferConvertToHexStringOverBitConverter.Fixer.cs (2)
76var toLowerInvocation = diagnostic.AdditionalLocations.Count == 2 132return diagnostic is { AdditionalLocations.Count: > 0, Properties.Count: 1 } &&
Microsoft.NetCore.Analyzers\Performance\PreferHashDataOverComputeHash.Fixer.cs (1)
320var disposeCount = additionalLocations.Count - hashCreationIndex - 1;
Microsoft.NetCore.Analyzers\Runtime\UseExceptionThrowHelpersFixer.cs (2)
67diagnostic.AdditionalLocations.Count != 0 && 73if (diagnostic.AdditionalLocations.Count == 2)
src\11b41c7305441175\PropertySetAbstractValue.cs (4)
69if (values.Count == 0) 74else if (values.Count == 1) 79else if (values.Count == 2) 86for (int i = 2; i < values.Count; i++)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
37=> dictionary.Count == other.Count &&
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IEnumerableOfIMethodSymbolExtensions.cs (2)
204if (member.Parameters.Length != expectedParameterTypesInOrder.Count) 207for (int index = 0; index < expectedParameterTypesInOrder.Count; index++)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
331/// - <see cref="System.Collections.Generic.IReadOnlyCollection{T}.Count"/>
Microsoft.CodeAnalysis.Razor.Compiler (11)
Language\Components\ComponentGenericTypePass.cs (4)
151|| existingValue.GenericTypeNames.Count > typeParameters.Count) 284if (typeParameters.Count == 0) 359for (int i = 0; i < typeParameters.Count; i++)
Language\Components\ComponentLoweringPass.cs (1)
100for (var j = 0; j < usings.Count; j++)
Language\Legacy\CSharpCodeParser.cs (1)
1578for (var i = 0; i < descriptor.Tokens.Count; i++)
Language\Legacy\ImplicitExpressionEditHandler.cs (1)
284for (var i = 0; i < tokens.Count; i++)
Mvc.Version2_X\ViewComponentTagHelperDescriptorFactory.cs (2)
93if (methods.Count == 0) 99else if (methods.Count > 1)
Mvc\ViewComponentTagHelperDescriptorFactory.cs (2)
93if (methods.Count == 0) 99else if (methods.Count > 1)
Microsoft.CodeAnalysis.ResxSourceGenerator (32)
AbstractResxGenerator.cs (1)
898public bool HasArguments => _arguments.Count > 0;
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (13)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 463if (source is null or { Count: 0 }) 466var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 475if (source is null or { Count: 0 }) 478var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 509if (source is null or { Count: 0 }) 513var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 522if (source is null or { Count: 0 }) 526var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 535if (source is null or { Count: 0 }) 539var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 655for (int i = 0, length = list.Count; i < length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
36switch (list.Count) 50for (int i = 0, n = list.Count; i < n; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
Microsoft.CodeAnalysis.VisualBasic (1)
Binding\Binder_XmlLiterals.vb (1)
1431Debug.Assert(namespaces.Count > 0)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
1587For i = 0 To nodes.Count - 1
Microsoft.CodeAnalysis.VisualBasic.Features (1)
AddImport\VisualBasicAddImportFeatureService.vb (1)
315Dim nameSyntax = CreateNameSyntax(nameSpaceParts, nameSpaceParts.Count - 1)
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Performance\BasicPreferDictionaryTryMethodsOverContainsKeyGuardFixer.vb (2)
20If diagnostic Is Nothing OrElse diagnostic.AdditionalLocations.Count = 0 Then 127If diagnostic.AdditionalLocations.Count <> dictionaryAccessors.Count + additionalNodes Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (16)
CodeGeneration\VisualBasicSyntaxGenerator.vb (15)
1535If index >= 0 AndAlso index < existingAttributes.Count Then 1537ElseIf existingAttributes.Count > 0 Then 1538Return Me.InsertNodesAfter(declaration, existingAttributes(existingAttributes.Count - 1), WithRequiredTargetSpecifier(newAttributes, declaration)) 1592If index >= 0 AndAlso index < existingReturnAttributes.Count Then 1594ElseIf existingReturnAttributes.Count > 0 Then 1595Return Me.InsertNodesAfter(declaration, existingReturnAttributes(existingReturnAttributes.Count - 1), newAttributes) 2874If index >= 0 AndAlso index < existingImports.Count Then 2876ElseIf existingImports.Count > 0 Then 2877Return Me.InsertNodesAfter(declaration, existingImports(existingImports.Count - 1), newImports) 2940If index >= 0 AndAlso index < existingMembers.Count Then 2942ElseIf existingMembers.Count > 0 Then 2943Return Me.InsertNodesAfter(declaration, existingMembers(existingMembers.Count - 1), members) 3425Dim count = subDecls.Count 3451Dim count = subDecls.Count 3463Dim count = subDeclarations.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
1587For i = 0 To nodes.Count - 1
Microsoft.CodeAnalysis.Workspaces (83)
CodeFixesAndRefactorings\FixAllLogger.cs (2)
82m[DocumentCount] = fixAllState.Project.DocumentIds.Count; 86m[DocumentCount] = fixAllState.Solution.Projects.Sum(p => p.DocumentIds.Count);
Diagnostics\DiagnosticData.cs (2)
290if (diagnostic.AdditionalLocations.Count == 0) 295using var _ = ArrayBuilder<DiagnosticDataLocation>.GetInstance(diagnostic.AdditionalLocations.Count, out var builder);
Differencing\MapBasedLongestCommonSubsequence.cs (2)
17foreach (var edit in GetEdits(oldNodes, oldNodes.Count, newNodes, newNodes.Count))
Differencing\Match.LongestCommonSubsequence.cs (4)
31foreach (var pair in GetMatchingPairs(oldNodes, oldNodes.Count, newNodes, newNodes.Count)) 41foreach (var edit in GetEdits(oldNodes, oldNodes.Count, newNodes, newNodes.Count))
Editing\SyntaxGenerator.cs (10)
1083attributeArguments: args.Count > 0 ? args : null); 1158=> this.InsertAttributes(declaration, this.GetAttributes(declaration).Count, attributes); 1186=> this.InsertReturnAttributes(declaration, this.GetReturnAttributes(declaration).Count, attributes); 1208=> this.InsertAttributeArguments(attributeDeclaration, this.GetAttributeArguments(attributeDeclaration).Count, attributeArguments); 1230=> this.InsertNamespaceImports(declaration, this.GetNamespaceImports(declaration).Count, imports); 1258=> this.InsertMembers(declaration, this.GetMembers(declaration).Count, members); 1331=> this.InsertParameters(declaration, this.GetParameters(declaration).Count, parameters); 1347=> this.InsertSwitchSections(switchStatement, this.GetSwitchSections(switchStatement).Count, switchSections); 1389=> this.InsertAccessors(declaration, this.GetAccessors(declaration).Count, accessors); 1574for (int i = 0, count = list.Count; i < count; i++)
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
465var order = new Dictionary<ProjectId, int>(capacity: solution.ProjectIds.Count);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (1)
93if (scope != null && scope.Count == 1)
Log\WorkspaceStructureLogger.cs (1)
45var totalProjects = solution.ProjectIds.Count;
Serialization\AbstractOptionsSerializationService.cs (1)
198writer.WriteInt32(options.Features.Count);
Serialization\SerializerService_Reference.cs (3)
104if (portable is ISupportTemporaryStorage { StorageHandles: { Count: > 0 } handles } && 371Contract.ThrowIfTrue(handles.Count == 0); 376writer.WriteInt32(handles.Count);
Shared\Extensions\SourceTextExtensions.cs (2)
65if (ranges.Count == 0) 71if (ranges.Count == 1)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (13)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 463if (source is null or { Count: 0 }) 466var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 475if (source is null or { Count: 0 }) 478var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 509if (source is null or { Count: 0 }) 513var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 522if (source is null or { Count: 0 }) 526var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 535if (source is null or { Count: 0 }) 539var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 655for (int i = 0, length = list.Count; i < length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
36switch (list.Count) 50for (int i = 0, n = list.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
1251if (w.CurrentSolution.ProjectIds.Count == 1)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (3)
142if (oldSolution.ProjectIds.Count == 0) 165return oldSolution.ProjectIds.Count == 0 578if (projectToRetarget.MetadataReferences.Count > 0 &&
Workspace\Solution\ChecksumCollection.cs (1)
97Contract.ThrowIfFalse(values.Count == checksums.Children.Length);
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
19if (projectReferences.Count == 0)
Workspace\Solution\ProjectDependencyGraph.cs (1)
144else if (projectReferences.Count == 0)
Workspace\Solution\Solution.cs (1)
880var builder = new FixedSizeArrayBuilder<AnalyzerReference>(oldProject.AnalyzerReferences.Count - 1);
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (1)
123if (projectState.AnalyzerReferences.Count == 0)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
490(this.ProjectState.MetadataReferences.Count > 0 ||
Workspace\Solution\SolutionState.cs (5)
171Contract.ThrowIfFalse(SortedProjectStates.Length == ProjectIds.Count); 421using var _1 = ArrayBuilder<ProjectId>.GetInstance(ProjectIds.Count + projectStates.Count, out var newProjectIdsBuilder); 769if (projectReferences.Count == 0) 878if (metadataReferences.Count == 0) 1242if (analyzerReferences.Count == 0)
Workspace\Solution\StateChecksums.cs (1)
566var checksums = new FixedSizeArrayBuilder<Checksum>(references.Count);
Workspace\Workspace.cs (1)
739using var _ = ArrayBuilder<ProjectInfo>.GetInstance(projects.Count, out var builder);
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
348var results = new FixedSizeArrayBuilder<DocumentInfo>(documentFileInfos.Count);
MSBuild\MSBuildWorkspace.cs (1)
491var relativePath = (info.Folders != null && info.Folders.Count > 0)
Microsoft.Data.Analysis (17)
DataFrame.BinaryOperations.cs (14)
18if (values.Count != Columns.Count) 57if (values.Count != Columns.Count) 96if (values.Count != Columns.Count) 135if (values.Count != Columns.Count) 174if (values.Count != Columns.Count) 212if (values.Count != Columns.Count) 249if (values.Count != Columns.Count) 286if (values.Count != Columns.Count) 360if (values.Count != Columns.Count) 393if (values.Count != Columns.Count) 426if (values.Count != Columns.Count) 459if (values.Count != Columns.Count) 492if (values.Count != Columns.Count) 525if (values.Count != Columns.Count)
DataFrame.Join.Extrensions.cs (3)
19while (i < sortedList1.Count && j < sortedList2.Count) 23while (j < sortedList2.Count)
Microsoft.Data.Analysis.Tests (6)
ArrayComparer.cs (5)
67Assert.Equal(expectedArray.Fields.Count, array.Fields.Count); 69for (int i = 0; i < array.Fields.Count; i++) 161if (s2 == null || s1 == null || s1.HasMetadata != s2.HasMetadata || s1.FieldsList.Count != s2.FieldsList.Count)
DataFrameTests.cs (1)
952Assert.Equal(columns.Count, df.Columns.Count);
Microsoft.Diagnostics.DataContractReader.Contracts (7)
Contracts\GC\GC_1.cs (3)
390if (gens.Count < 5) 391throw new InvalidOperationException($"Expected at least 5 generations in the generation table, got {gens.Count}."); 514if (heap.GenerationTable.Count > 0)
Contracts\StressLog.cs (1)
212readPointer = new TargetPointer((ulong)readPointer + stressMsgHeaderSize + pointerSize * (uint)parsedMessage.Args.Count);
Data\Frames\ArgumentRegisters.cs (1)
16Dictionary<string, TargetNUInt> registers = new(type.Fields.Count);
Data\Frames\CalleeSavedRegisters.cs (1)
16Dictionary<string, TargetNUInt> registers = new(type.Fields.Count);
Data\Frames\HijackArgs.cs (1)
16Dictionary<string, TargetNUInt> registers = new(type.Fields.Count);
Microsoft.Diagnostics.DataContractReader.Legacy (24)
Dbi\DacDbiImpl.cs (2)
6468if (state < (uint)suspensionPoints.Count) 6471int varCount = localInfos.Count;
SOSDacImpl.cs (20)
1453for (int i = 0; i < GCConstants.DAC_NUMBERGENERATIONS && i < heapData.GenerationTable.Count; i++) 1462for (int i = 0; i < GCConstants.DAC_NUMBERGENERATIONS + 3 && i < heapData.FillPointers.Count; i++) 1587for (int i = 0; i < GCConstants.DAC_NUMBERGENERATIONS && i < heapData.GenerationTable.Count; i++) 1596for (int i = 0; i < GCConstants.DAC_NUMBERGENERATIONS + 3 && i < heapData.FillPointers.Count; i++) 1790_regions = new SOSMemoryRegion[regions.Count]; 1791for (int i = 0; i < regions.Count; i++) 4181SOSStackRefData[] sosRefs = new SOSStackRefData[refs.Count]; 4182for (int i = 0; i < refs.Count; i++) 5262for (int i = 0; i < Math.Min(GCConstants.DAC_NUM_GC_DATA_POINTS, heapData.InterestingData.Count); i++) 5266for (int i = 0; i < Math.Min(GCConstants.DAC_MAX_COMPACT_REASONS_COUNT, heapData.CompactReasons.Count); i++) 5270for (int i = 0; i < Math.Min(GCConstants.DAC_MAX_EXPAND_MECHANISMS_COUNT, heapData.ExpandMechanisms.Count); i++) 5274for (int i = 0; i < Math.Min(GCConstants.DAC_MAX_GC_MECHANISM_BITS_COUNT, heapData.InterestingMechanismBits.Count); i++) 5335for (int i = 0; i < Math.Min(GCConstants.DAC_MAX_GLOBAL_GC_MECHANISMS_COUNT, globalMechanismsData.Count); i++) 5855*pGenerations = (uint)heapData.GenerationTable.Count; 5892uint totalGenerationCount = (uint)heapData.GenerationTable.Count; 5962uint numFillPointers = (uint)heapData.FillPointers.Count; 6025uint totalGenerationCount = (uint)heapData.GenerationTable.Count; 6095uint numFillPointers = (uint)heapData.FillPointers.Count; 7393ArgumentCount = (uint)msg.Args.Count, 7422uint toFetch = Math.Min(argCount, (uint)msg.Args.Count);
SOSDacImpl.IXCLRDataProcess.cs (2)
53uint count = (uint)functionEntries.Count; 71for (int i = 0; i < functionEntries.Count; i++)
Microsoft.Diagnostics.NETCore.Client (3)
DiagnosticsClient\EventPipeSessionConfiguration.cs (3)
289writer.Write(config.Providers.Count); 302writer.Write(config.Providers.Count); 326writer.Write((uint)filter.EventIds.Count);
Microsoft.DotNet.ApiCompat.Task (1)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\SuppressionFileHelper.cs (1)
69if (unnecessarySuppressions.Count == 0)
Microsoft.DotNet.ApiCompatibility (7)
ApiComparer.cs (3)
97int rightCount = right.Count; 115IAssemblySetMapper assemblySetMapper = _elementMapperFactory.CreateAssemblySetMapper(Settings, right.Count); 117for (int rightIndex = 0; rightIndex < right.Count; rightIndex++)
Runner\ApiCompatRunner.cs (4)
126Debug.Assert(assemblySymbols.Count == metadataInformation.Count); 127List<ElementContainer<IAssemblySymbol>> elementContainerList = new(metadataInformation.Count); 128for (int i = 0; i < metadataInformation.Count; i++)
Microsoft.DotNet.ApiSymbolExtensions (2)
AssemblySymbolLoader.cs (2)
190MetadataReference?[] metadataReferences = new MetadataReference[relativePaths.Count]; 191for (int i = 0; i < relativePaths.Count; i++)
Microsoft.DotNet.Arcade.Sdk (1)
src\GenerateResxSource.cs (1)
527public bool HasArguments => _arguments.Count > 0;
Microsoft.DotNet.Build.Tasks.Installers (1)
src\RpmBuilder.cs (1)
201if (paths is null || paths.Count == 0)
Microsoft.DotNet.Cli.CommandLine (3)
SpanParsableExtensions.cs (3)
83if (tokenizationResult.Tokens.Count == 0) 96var coll = ImmutableArray.CreateBuilder<T>(tokenizationResult.Tokens.Count); 123if (tokenizationResult.Tokens.Count == 0)
Microsoft.DotNet.Cli.Definitions (7)
Commands\Pack\PackCommandDefinition.cs (1)
88if (r.Tokens.Count == 0)
Commands\Test\TestCommandDefinition.MicrosoftTestingPlatform.cs (2)
304if (optionResult.Tokens.Count == 1 && 314if (argumentResult.Tokens.Count != 1)
Common\CommonOptions.cs (2)
51if (result.Tokens.Count == 0) 129if (argumentResult.Tokens.Count == 0)
Help\HelpBuilder.cs (2)
113if (items.Count == 0) 133for (var i = 0; i < items.Count; i++)
Microsoft.DotNet.HotReload.Watch (20)
Build\BuildReporter.cs (1)
25logger.Log(MessageDescriptor.WatchingFilesForChanges, fileItems.Count);
Build\BuildResult.cs (1)
14public bool IsSuccess => TargetResults.Count > 0;
Build\EvaluationResult.cs (1)
124logger.Log(MessageDescriptor.LoadedProjects, projectGraph.Graph.ProjectNodes.Count, projectLoadingStopwatch.Elapsed.TotalSeconds);
Build\LoadedProjectGraph.cs (1)
58if (projectNodes.Count > 1)
HotReload\HotReloadDotNetWatcher.cs (2)
322_context.Logger.Log(MessageDescriptor.ProjectsRebuilt, updatesBuilder.ProjectsToRebuild.Count); 329_context.Logger.Log(MessageDescriptor.ProjectDependenciesDeployed, updatesBuilder.ProjectsToRedeploy.Count);
HotReload\ProjectUpdatesBuilder.StaticWebAssets.cs (2)
59if (builder.Assets.Count == 0) 65if (builder.ProjectInstancesToRegenerate.Count > 0)
HotReload\RunningProjectsManager.cs (3)
348if (builder.ManagedCodeUpdates.Count > 0) 353if (builder.StaticAssetUpdates.Count > 0) 409logger.Log(MessageDescriptor.ProjectsRestarted, projectsToRestart.Count);
Process\ProcessRunner.cs (1)
164for (var i = 0; i < processSpec.Arguments.Count; i++)
src\sdk\src\Dotnet.Watch\HotReloadAgent.PipeRpc\NamedPipeContract.cs (2)
69await stream.WriteAsync(Updates.Count, cancellationToken); 117await stream.WriteAsync(log.Count, cancellationToken);
src\sdk\src\Dotnet.Watch\HotReloadClient\DefaultHotReloadClient.cs (3)
172if (environmentVariables.Count == 0) 180await stream.WriteAsync(environmentVariables.Count, cancellationToken); 208if (applicableUpdates.Count == 0)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\AbstractBrowserRefreshServer.cs (1)
299if (openConnections.Count == 0)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\WebAssemblyHotReloadClient.cs (1)
99if (applicableUpdates.Count == 0)
Utilities\PathUtilities.cs (1)
22if (directories.Count == 0)
Microsoft.DotNet.NuGetRepack.Tasks (2)
src\NuGetVersionUpdater.cs (2)
378if (exceptions.Count == 1) 383if (exceptions.Count > 1)
Microsoft.DotNet.PackageValidation (10)
ApiCompatRunnerExtensions.cs (7)
25Debug.Assert(leftContentItems.Count > 0); 26Debug.Assert(rightContentItems.Count > 0); 53MetadataInformation[] left = new MetadataInformation[leftContentItems.Count]; 54for (int leftIndex = 0; leftIndex < leftContentItems.Count; leftIndex++) 63MetadataInformation[] right = new MetadataInformation[rightContentItems.Count]; 64for (int rightIndex = 0; rightIndex < rightContentItems.Count; rightIndex++) 86if (package.AssemblyReferences is not null && package.AssemblyReferences.Count > 0)
Validators\BaselinePackageValidator.cs (2)
90if (baselineRuntimeSpecificAssets != null && baselineRuntimeSpecificAssets.Count > 0) 122options.BaselinePackageFrameworkFilter.FoundExcludedTargetFrameworks.Count > 0)
Validators\CompatibleFrameworkInPackageValidator.cs (1)
34if (options.Package.FrameworksInPackage.Count < 2)
Microsoft.Extensions.AI (9)
ChatRouting\SemanticRoutingChatClient.cs (2)
100if (clientProfiles.Count == 0) 141if (utterances is null || utterances.Count == 0)
Realtime\OpenTelemetryRealtimeClientSession.cs (2)
708if (options.OutputModalities is { Count: > 0 } modalities) 724if (options.Tools is { Count: > 0 })
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Abstractions (5)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Functions\AIFunctionArgumentsTests.cs (1)
77Assert.Equal(2, args.Count);
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
1176public int Count => _dictionary.Count;
Microsoft.Extensions.AI.Evaluation (3)
CompositeEvaluator.cs (2)
51if (evaluator.EvaluationMetricNames.Count == 0) 148if (e.EvaluationMetricNames.Count == 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Console (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.NLP (3)
BLEUEvaluator.cs (1)
72if (context.References.Count is 0)
GLEUEvaluator.cs (1)
72if (context.References.Count is 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Quality (6)
IntentResolutionEvaluator.cs (1)
110if (context is not null && context.ToolDefinitions.Count is 0)
RetrievalEvaluator.cs (2)
103if (context.RetrievedContextChunks.Count is 0) 150if (++count < context.RetrievedContextChunks.Count)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
TaskAdherenceEvaluator.cs (1)
109if (context is not null && context.ToolDefinitions.Count is 0)
ToolCallAccuracyEvaluator.cs (1)
120if (context.ToolDefinitions.Count is 0)
Microsoft.Extensions.AI.Evaluation.Reporting (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Evaluation.Safety (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.Integration.Tests (6)
ChatClientIntegrationTests.cs (5)
1151Assert.Equal(4, chatClient.LastSummarizedConversation.Count); 1194Assert.Equal(4, chatClient.LastSummarizedConversation.Count); 1254Assert.Equal(3, summarizingChatClient.LastSummarizedConversation.Count); 1292Assert.Equal(3, chatClient.LastSummarizedConversation.Count); 1334Assert.Equal(3, chatClient.LastSummarizedConversation.Count);
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.OpenAI (8)
OpenAIChatClient.cs (2)
418if (update.ToolCallUpdates is { Count: > 0 } toolCallUpdates) 559if (openAICompletion.Annotations is { Count: > 0 })
OpenAIResponsesChatClient.cs (2)
587case MessageResponseItem mri when mri.Content is { Count: > 0 } mriContent && mriContent.Any(c => c.OutputTextAnnotations is { Count: > 0 }): 1755if (source.OutputTextAnnotations is { Count: > 0 })
OpenAISpeechToTextClient.cs (3)
72int segmentCount = translation.Segments.Count; 86int segmentCount = transcription.Segments.Count; 94int wordCount = transcription.Words.Count;
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIConversionTests.cs (1)
1829Assert.Equal(2, streamingUpdate.ToolCallUpdates.Count);
OpenAIResponseClientTests.cs (1)
6928string body = responses[Math.Min(_index++, responses.Count - 1)];
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
951Assert.Equal(2, tpocMeasurements.Count);
ChatRouting\FailoverChatClientTests.cs (1)
1321if (index >= _owner._updates.Count)
Microsoft.Extensions.AmbientMetadata.Application (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AmbientMetadata.Build (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.AsyncState (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Caching.Hybrid (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Compliance.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Compliance.Redaction (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Compliance.Testing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Compliance.Testing.Tests (2)
FakeRedactorTests.cs (1)
90Assert.Equal(fakeRedactorProvider.Collector.AllRedactorRequests.Count, iterations.Length);
RedactionFakesAcceptanceTests.cs (1)
212Assert.Equal(2, collector.AllRedactedData.Count);
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
ConfigurationBindingGenerator.Suppressor.cs (1)
55Location location = diagnostic.AdditionalLocations.Count > 0
Microsoft.Extensions.DataIngestion (2)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Writers\VectorStoreWriter.cs (1)
99if (preExistingKeys?.Count > 0)
Microsoft.Extensions.DataIngestion.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.DataIngestion.Markdig (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.DataIngestion.MarkItDown (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.DataIngestion.Tests (21)
Chunkers\HeaderChunkerTests.cs (5)
42Assert.Equal(5, chunks.Count); 74Assert.Equal(2, chunks.Count); 122Assert.Equal(2, chunks.Count); 149Assert.Equal(2, chunks.Count); 179Assert.Equal(6, chunks.Count);
Chunkers\NoOverlapTokenChunkerTests.cs (2)
34Assert.Equal(2, chunks.Count); 55Assert.Equal(8, chunks.Count);
Chunkers\OverlapTokenChunkerTests.cs (2)
40Assert.Equal(3, chunks.Count); 47for (int i = 0; i < chunks.Count - 1; i++)
Chunkers\SectionChunkerTests.cs (3)
68Assert.Equal(2, chunks.Count); 129Assert.Equal(4, chunks.Count); 157Assert.Equal(2, chunks.Count);
Chunkers\SemanticSimilarityChunkerTests.cs (2)
101Assert.Equal(2, chunks.Count); 178Assert.Equal(3, chunks.Count);
IngestionPipelineTests.cs (2)
92Assert.Equal(_sampleFiles.Count, ingestionResults.Count); 213Assert.Equal(_sampleFiles.Count, ingestionResults.Count);
Processors\ClassificationEnricherTests.cs (2)
92Assert.Equal(3, got.Count); 113Assert.Equal(chunks.Count, got.Count);
Processors\KeywordEnricherTests.cs (1)
113Assert.Equal(chunks.Count, got.Count);
Processors\SentimentEnricherTests.cs (1)
100Assert.Equal(chunks.Count, got.Count);
Processors\SummaryEnricherTests.cs (1)
97Assert.Equal(chunks.Count, got.Count);
Microsoft.Extensions.DependencyInjection.AutoActivation (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.DependencyModel (7)
DependencyContextWriter.cs (7)
33if (context.RuntimeGraph.Count > 0) 77if (compilationOptions.Defines?.Count > 0) 135int count = libraries.Count; 188if (group == null || group.RuntimeFiles.Count == 0) 198if (dependencies.Count == 0) 213int count = resourceAssemblies.Count; 327if (group.RuntimeFiles.Count != 0)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (2)
ExceptionSummarizer.cs (1)
90if (descriptionIndex >= exceptionSummaryProvider.Descriptions.Count || descriptionIndex < 0)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DefaultHealthCheckService.cs (1)
255if (entry.Data.Count > 0 && logger.IsEnabled(LogLevel.Debug))
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.Probes (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (7)
Linux\Disk\LinuxSystemDiskMetricsTests.cs (3)
164Assert.Equal(4, diskIoMeasurement.Count); 170Assert.Equal(4, operationMeasurement.Count); 176Assert.Equal(2, ioTimeMeasurement.Count);
Windows\Disk\WindowsDiskMetricsTests.cs (2)
90Assert.Equal(4, measurements.Count); 164Assert.Equal(4, measurements.Count);
Windows\WindowsContainerSnapshotProviderTests.cs (1)
234Assert.Equal(2, snapshot.Count);
Windows\WindowsSnapshotProviderTests.cs (1)
69Assert.Equal(2, logRecords.Count);
Microsoft.Extensions.Diagnostics.Testing (3)
Metrics\CollectedMeasurement.cs (2)
100public bool MatchesTags(params KeyValuePair<string, object?>[] tags) => ContainsTags(tags) && (Tags.Count == tags.Length); 107public bool MatchesTags(params string[] tags) => ContainsTags(Throw.IfNull(tags)) && (Tags.Count == tags.Length);
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Diagnostics.Testing.Tests (15)
Logging\FakeLoggerProviderTests.cs (1)
48Assert.Equal(2, records.Count);
Logging\FakeLoggerTests.cs (3)
31Assert.Equal(2, records.Count); 280Assert.Equal(2, logger.LatestRecord.Scopes.Count); 314Assert.Equal(expectedRecordCount, records.Count);
Metrics\MeasurementExtensionsTests.cs (4)
31Assert.Equal(2, filtered[1].Tags.Count); 56Assert.Equal(2, filtered[1].Tags.Count); 81Assert.Equal(2, filtered[1].Tags.Count); 109Assert.Equal(2, filtered[1].Tags.Count);
Metrics\MetricCollectorTests.cs (7)
73Assert.Equal(2, collector.GetMeasurementSnapshot().Count); 118Assert.Equal(2, collector.GetMeasurementSnapshot().Count); 165Assert.Equal(2, collector.GetMeasurementSnapshot().Count); 226Assert.Equal(2, collector.GetMeasurementSnapshot().Count); 399Assert.Equal(3, snap.Count); 400Assert.Equal(3, collector.GetMeasurementSnapshot().Count); 415Assert.Equal(3, snap.Count);
Microsoft.Extensions.DotNetDeltaApplier (2)
src\sdk\src\Dotnet.Watch\HotReloadAgent.PipeRpc\NamedPipeContract.cs (2)
69await stream.WriteAsync(Updates.Count, cancellationToken); 117await stream.WriteAsync(log.Count, cancellationToken);
Microsoft.Extensions.FileProviders.Embedded (2)
Manifest\ManifestDirectory.cs (2)
89var list = new List<ManifestEntry>(Children.Count); 90for (var i = 0; i < Children.Count; i++)
Microsoft.Extensions.Hosting.Testing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Hosting.Testing.Tests (1)
FakeHostTests.cs (1)
70for (var i = 0; i < 50 && hostMock.Invocations.Count == 0; i++)
Microsoft.Extensions.Http (1)
HttpMessageHandlerBuilder.cs (1)
92for (int i = additionalHandlersList.Count - 1; i >= 0; i--)
Microsoft.Extensions.Http.Diagnostics (9)
Logging\Internal\HttpHeadersRedactor.cs (5)
104if (input.Count == 0) 111if (input.Count == 1) 123for (int i = 1; i < input.Count; i++) 139for (int i = 0; i < input.Count; i++) 147if (i < input.Count - 1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Extensions.Http.Diagnostics.Tests (6)
Logging\HttpClientLoggerTest.cs (4)
367Assert.Equal(2, logRecords.Count); 775Assert.Equal(2, logRecords.Count); 813Assert.Equal(2, logRecords.Count); 858Assert.Equal(2, logRecords.Count);
Logging\HttpClientLoggingExtensionsTest.cs (2)
726Assert.Equal(2, outerLogs.Count); // 1 request start + 1 request stop 735Assert.Equal(6, innerLogs.Count); // 3 attempts × (1 start + 1 stop/failed)
Microsoft.Extensions.Http.Resilience (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Logging.Console (1)
JsonConsoleFormatter.cs (1)
34bufferedRecord.Attributes.Count > 0, null, bufferedRecord.Attributes, bufferedRecord.Timestamp);
Microsoft.Extensions.Logging.EventSource (2)
EventSourceLogger.cs (2)
261var arguments = new KeyValuePair<string, string?>[keyValuePairs.Count]; 262for (int i = 0; i < keyValuePairs.Count; i++)
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Roslyn4.0.cs (1)
93LoggerClassSpec? loggerClassSpec = logClasses.Count > 0 ? logClasses[0].ToSpec() : null;
Microsoft.Extensions.ObjectPool.DependencyInjection (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Options.Contextual (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Options.SourceGeneration (1)
Generator.cs (1)
51if (validatorTypes.Count > 0)
Microsoft.Extensions.Primitives (3)
CompositeChangeToken.cs (3)
41for (int i = 0; i < ChangeTokens.Count; i++) 73for (int i = 0; i < ChangeTokens.Count; i++) 114for (int i = 0; i < ChangeTokens.Count; i++)
Microsoft.Extensions.Resilience (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.ServiceDiscovery (6)
Configuration\ConfigurationServiceEndpointProvider.cs (1)
41_includeAllSchemes = serviceDiscoveryOptions.Value.AllowAllSchemes && query.IncludedSchemes.Count == 0;
LoadBalancing\RoundRobinServiceEndpointSelector.cs (2)
23if (_endpoints is not { Count: > 0 } collection) 28return collection[(int)(Interlocked.Increment(ref _next) % collection.Count)];
ServiceDiscoveryOptions.cs (1)
48if (requestedSchemes.Count > 0)
ServiceEndpointWatcher.Log.cs (1)
25ResolutionSucceededCore(logger, endpointSource.Endpoints.Count, serviceName, string.Join(", ", endpointSource.Endpoints.Select(GetEndpointString)));
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Dns (4)
Resolver\EncodedDomainName.cs (3)
37if (Labels.Count != other.Labels.Count) 42for (int i = 0; i < Labels.Count; i++)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (6)
DnsServiceEndpointResolverTests.cs (3)
27Assert.True(initialResult.Endpoints.Count > 0); 31Assert.True(initialResult.Endpoints.Count > 0); 35Assert.True(initialResult.Endpoints.Count > 0);
DnsSrvServiceEndpointResolverTests.cs (3)
148Assert.Equal(3, initialResult.EndpointSource.Endpoints.Count); 229Assert.Equal(3, initialResult.EndpointSource.Endpoints.Count); 245Assert.Equal(2, initialResult.EndpointSource.Endpoints.Count);
Microsoft.Extensions.ServiceDiscovery.Tests (5)
ConfigurationServiceEndpointResolverTests.cs (4)
302Assert.Equal(2, initialResult.EndpointSource.Endpoints.Count); 324Assert.Equal(2, initialResult.EndpointSource.Endpoints.Count); 369Assert.Equal(3, initialResult.EndpointSource.Endpoints.Count); 414Assert.Equal(3, initialResult.EndpointSource.Endpoints.Count);
ServiceEndpointResolverTests.cs (1)
129Assert.Equal(2, resolverResult.EndpointSource.Endpoints.Count);
Microsoft.Extensions.ServiceDiscovery.Yarp (3)
ServiceDiscoveryDestinationResolver.cs (2)
27var tasks = new List<Task<(List<(string Name, DestinationConfig Config)>, IChangeToken ChangeToken)>>(destinations.Count); 61var results = new List<(string Name, DestinationConfig Config)>(result.Endpoints.Count);
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (2)
YarpServiceDiscoveryTests.cs (2)
145Assert.Equal(4, result.Destinations.Count); 303Assert.Equal(3, result.Destinations.Count);
Microsoft.Extensions.Telemetry (9)
Buffering\LogBufferingFilterRuleSelector.cs (6)
100if (rule.Attributes?.Count > 0 && attributes?.Count > 0) 117if (currentBest?.Attributes?.Count > 0) 119if (ruleCandidate.Attributes is null || ruleCandidate.Attributes.Count == 0) 124if (ruleCandidate.Attributes.Count < currentBest.Attributes.Count)
Logging\ExtendedLogger.LegacyTagJoiner.cs (1)
45Count = _incomingTags.Count;
src\Shared\LogBuffering\SerializedLogRecordFactory.cs (1)
30for (int i = 0; i < attributes.Count; i++)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Telemetry.Abstractions (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.Telemetry.Abstractions.Tests (6)
Latency\LatencyRegistryExtensionsTests.cs (3)
80Assert.True(lcro.CheckpointNames.Count == 1); 81Assert.True(lcro.MeasureNames.Count == 2); 82Assert.True(lcro.TagNames.Count == 3);
Logging\LoggerMessageStateTests.cs (3)
141Assert.Equal(1, list.Count); 151Assert.Equal(1, list.Count); 157Assert.Equal(1, list.Count);
Microsoft.Extensions.Telemetry.PerformanceTests (1)
BenchLogger.cs (1)
41int count = l.Count;
Microsoft.Extensions.TimeProvider.Testing (1)
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Extensions.VectorData.Abstractions (2)
ProviderServices\CollectionModel.cs (1)
134{ Count: 0 } => throw new InvalidOperationException($"The '{_recordType.Name}' type does not have any vector properties."),
src\Shared\Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Microsoft.Gen.BuildMetadata.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.ComplianceReports (1)
ComplianceReportsGenerator.cs (1)
73if (classifiedTypes.Count == 0)
Microsoft.Gen.ComplianceReports.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.Logging (1)
LoggingGenerator.cs (1)
44if (logTypes.Count > 0)
Microsoft.Gen.Logging.Generated.Tests (10)
LoggerMessageAttributeTests.cs (1)
160Assert.Equal(expectedState.Length, collector.LatestRecord.StructuredState!.Count);
LogMethodTests.cs (4)
129Assert.Equal(3, collector.LatestRecord.StructuredState!.Count); 137Assert.Equal(3, collector.LatestRecord.StructuredState!.Count); 1043Assert.Equal(3, collector.LatestRecord.StructuredState!.Count); 1063Assert.Equal(expected, rol.Count);
LogPropertiesTests.cs (3)
63Assert.Equal(2, state.Count); 80Assert.Equal(2, state.Count); 120Assert.Equal(21, state.Count);
TagProviderTests.cs (2)
167Assert.Equal(2, state.Count); 193Assert.Equal(2, state.Count);
Microsoft.Gen.Logging.Unit.Tests (6)
ParserTests.cs (2)
747else if (d.Count > 0) 749Assert.Fail($"Expected no diagnostics, got {d.Count} diagnostics");
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.MetadataExtractor (7)
MetadataReportsGenerator.cs (2)
126if (meteringClasses.Count == 0) 153if (classifiedTypes.Count == 0)
src\Generators\Microsoft.Gen.ComplianceReports\ComplianceReportsGenerator.cs (1)
73if (classifiedTypes.Count == 0)
src\Generators\Microsoft.Gen.MetricsReports\MetricDefinitionEmitter.cs (3)
23if (metricClasses == null || metricClasses.Count == 0) 30for (int i = 0; i < metricClasses.Count; i++) 36if (i < metricClasses.Count - 1)
src\Generators\Microsoft.Gen.MetricsReports\MetricsReportsGenerator.cs (1)
70if (meteringClasses.Count == 0)
Microsoft.Gen.MetadataExtractor.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.Metrics (1)
MetricsGenerator.cs (1)
37if (metricClasses.Count > 0)
Microsoft.Gen.Metrics.Generated.Tests (2)
MetricTests.cs (2)
171Assert.Equal(2, measurements.Count); 195Assert.Equal(2, measurements.Count);
Microsoft.Gen.Metrics.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Gen.MetricsReports (4)
MetricDefinitionEmitter.cs (3)
23if (metricClasses == null || metricClasses.Count == 0) 30for (int i = 0; i < metricClasses.Count; i++) 36if (i < metricClasses.Count - 1)
MetricsReportsGenerator.cs (1)
70if (meteringClasses.Count == 0)
Microsoft.Gen.MetricsReports.Unit.Tests (4)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
75&& document.Folders.Count == 1
Microsoft.Maui (3)
Layouts\GridLayoutManager.cs (2)
157 int count = rowDefinitions.Count; 178 int count = columnDefinitions.Count;
VisualDiagnostics\VisualDiagnosticsOverlay.cs (1)
109 if (WindowElements.Count == 0)
Microsoft.Maui.Controls (98)
Application\Application.cs (4)
95 if (Windows.Count == 0) 121 if (Windows.Count == 1) 538 if (Windows.Count > 1) 543 if (Windows.Count > 0)
ContentPresenter.cs (1)
43 for (var i = 0; i < LogicalChildrenInternal.Count; i++)
Element\Element.cs (3)
706 for (var i = 0; i < children.Count; i++) 812 for (var i = 0; i < children.Count; i++) 1086 int ICollection<Element>.Count => _inner.Count;
LegacyLayouts\Layout.cs (3)
436 var oldBounds = new Rect[LogicalChildrenInternal.Count]; 465 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 548 int count = children.Count;
LegacyLayouts\StackLayout.cs (5)
70 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 157 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 193 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 424 for (var i = 0; i < LogicalChildrenInternal.Count; i++) 452 for (var i = 0; i < LogicalChildrenInternal.Count; i++)
NavigationPage\NavigationPage.cs (9)
464 CurrentPage = (Page)newStack[newStack.Count - 1]; 477 for (int i = 0; i < newStack.Count; i++) 497 while (InternalChildren.Count > newStack.Count) 691 var visiblePage = Navigation.NavigationStack[NavigationStack.Count - 1]; 780 var currentPage = NavigationStack[NavigationStack.Count - 1]; 781 var newCurrentPage = NavigationStack[NavigationStack.Count - 2]; 810 if (NavigationStack.Count == 1) 820 var lastIndex = NavigationStack.Count - 1; 825 lastIndex = NavigationStack.Count - 1;
NavigationPage\NavigationPageToolbar.cs (5)
159 if (navPage.Navigation.NavigationStack.Count == 0) 162 if (navPage.Navigation.NavigationStack.Count > 1) 224 if (stack.Count == 0) 230 if (stack.Count > 1) 231 previousPage = stack[stack.Count - 1];
Platform\ModalNavigationManager\ModalNavigationManager.cs (1)
290 if (ModalStack.Count == 0)
ReadOnlyCastingList.cs (1)
60 get { return _readonlyList.Count; }
ReadOnlyListAdapter.cs (1)
33 get { return _collection.Count; }
Region.cs (3)
75 for (int i = 0; i < Regions.Count; i++) 103 Rect[] rectangles = new Rect[Regions.Count]; 104 for (int i = 0; i < Regions.Count; i++)
Routing.cs (2)
46 var navigationStackCount = section.Navigation.NavigationStack.Count; 51 var navigationModalStackCount = section.Navigation.ModalStack.Count;
Shell\BaseShellItem.cs (4)
175 if (Navigation.ModalStack.Count > 0) 177 Navigation.ModalStack[Navigation.ModalStack.Count - 1] 182 else if (Navigation.NavigationStack.Count > 1) 184 Navigation.NavigationStack[Navigation.NavigationStack.Count - 1]
Shell\RouteRequestBuilder.cs (1)
204 var nextMatch = matchedSegments.Count;
Shell\Shell.cs (6)
958 if (Application.Current is null || Application.Current.Windows.Count == 0) 961 if (Application.Current.Windows.Count == 1) 1538 if (currentContent != null && currentContent.Stack.Count > 1) 1944 currentPage = navStack[navStack.Count - 1] ?? 2109 if (ModalStack.Count == 0 && !_shell.CurrentItem.CurrentItem.IsPoppingModalStack) 2131 if (ModalStack.Count == 0)
Shell\ShellElementCollection.cs (1)
215 return (sgi.ShellElementCollection.VisibleItemsReadOnly.Count > 0) ||
Shell\ShellNavigationManager.cs (14)
157 if (!modalStackPreBuilt && currentShellSection?.Navigation.ModalStack.Count > 0) 167 for (int i = currentShellSection.Stack.Count - 1; i >= 1; i--) 185 nextActiveSection?.Navigation?.NavigationStack?.Count > 1) 491 (modalStack?.Count > 0 ? modalStack[modalStack.Count - 1] : null) ?? 492 (navStack?.Count > 0 ? navStack[navStack.Count - 1] : null); 521 bool stackAtRoot = sectionStack == null || sectionStack.Count <= 1; 545 for (int i = 1; i < sectionStack.Count; i++) 552 if (modalStack != null && modalStack.Count > 0) 554 for (int i = 0; i < modalStack.Count; i++) 560 for (int j = 1; j < topPage.Navigation.NavigationStack.Count; j++) 587 for (int i = 0; i < modalStack.Count; i++) 590 for (int j = 1; j < modalStack[i].Navigation.NavigationStack.Count; j++)
Shell\ShellSection.cs (18)
58 if (Navigation.ModalStack.Count > 0) 60 if (Navigation.ModalStack[Navigation.ModalStack.Count - 1] is NavigationPage np) 61 return np.Navigation.NavigationStack[np.Navigation.NavigationStack.Count - 1]; 63 return Navigation.ModalStack[Navigation.ModalStack.Count - 1]; 330 if (Navigation.ModalStack.Count > 0) 351 if (Navigation.ModalStack.Count == 0) 419 while (navStack.Count > popCount && Navigation.ModalStack.Count > 0) 440 else if (Navigation.ModalStack.Count > 0) 442 await Navigation.ModalStack[Navigation.ModalStack.Count - 1].Navigation.PopAsync(isAnimated); 561 for (int i = Navigation.ModalStack.Count - 1; i >= 0; i--) 653 if (stack.Count > 1) 655 DisplayedPage = stack[stack.Count - 1]; 891 int modalStackCount = Navigation.ModalStack.Count; 894 var pageToPop = Navigation.ModalStack[Navigation.ModalStack.Count - 1]; 900 if (page == null && Navigation.ModalStack.Count == 1) 904 else if (Navigation.ModalStack.Count > 1 && Navigation.ModalStack[Navigation.ModalStack.Count - 2] == page) 1167 var page = ModalStack[ModalStack.Count - 1];
Shell\ShellUriHandler.cs (1)
451 if (routeRequestBuilder.FullSegments.Count <= i || currentSeg != routeRequestBuilder.FullSegments[i])
ShellToolbar.cs (6)
73 if (stack.Count == 0) 82 if (stack.Count > 1) 83 previousPage = stack[stack.Count - 1]; 94 _drawerToggleVisible = stack.Count <= 1 && flyoutBehavior is FlyoutBehavior.Flyout; 95 BackButtonVisible = backButtonVisible && stack.Count > 1; 181 else if (_shell.Navigation?.NavigationStack?.Count <= 1)
TemplatedView\TemplatedView.cs (1)
33 for (var i = 0; i < LogicalChildrenInternal.Count; i++)
TemplateUtilities.cs (1)
93 for (var i = 0; i < children.Count; i++)
ViewExtensions.cs (2)
511 if (modalStack.Count > 0) 513 var currentPage = modalStack[modalStack.Count - 1];
VisualElement\VisualElement.cs (1)
1380 for (var i = 0; i < LogicalChildrenInternal.Count; i++)
Window\Window.cs (4)
427 if (Navigation.ModalStack.Count == 0) 433 if (Navigation.ModalStack.Count == 0) 678 if (Navigation.ModalStack.Count > 0) 680 return Navigation.ModalStack[Navigation.ModalStack.Count - 1].SendBackButtonPressed();
Microsoft.Maui.Controls.Build.Tasks (1)
CompiledMarkupExtensions\ArrayExtension.cs (1)
22 var n = items.Count;
Microsoft.Maui.Graphics (5)
Text\AttributedTextExtensions.cs (4)
91 if (text.Runs == null || text.Runs.Count == 0) 95 if (!(startIndexForSearch < text.Runs.Count)) 149 } while (index < text.Runs.Count); 164 if (text.Runs?.Count > 0)
Text\XmlAttributedTextWriter.cs (1)
43 if (attributedText.Runs != null && attributedText.Runs.Count > 0)
Microsoft.ML.AutoML (8)
ColumnInference\PurposeInference.cs (4)
146if (imagePathCount < data.Count - 1) 148Double avgLength = 1.0 * sumLength / data.Count; 149Double cardinalityRatio = 1.0 * seen.Count / data.Count; 150Double avgSpaces = 1.0 * sumSpaces / data.Count;
Experiment\MetricsAgents\RankingMetricsAgent.cs (2)
42return metrics.NormalizedDiscountedCumulativeGains[Math.Min(metrics.NormalizedDiscountedCumulativeGains.Count, (int)_dcgTruncationLevel) - 1]; 44return metrics.DiscountedCumulativeGains[Math.Min(metrics.DiscountedCumulativeGains.Count, (int)_dcgTruncationLevel) - 1];
Sweepers\SmacSweeper.cs (1)
331for (var treeId = 0; treeId < forest.TrainedTreeEnsemble.Trees.Count; treeId++)
Tuner\SmacTuner.cs (1)
323for (var treeId = 0; treeId < forest.TrainedTreeEnsemble.Trees.Count; treeId++)
Microsoft.ML.AutoML.Tests (2)
AutoFitTests.cs (2)
455Assert.Equal(10, bestRun.ValidationMetrics.DiscountedCumulativeGains.Count); 456Assert.Equal(10, bestRun.ValidationMetrics.NormalizedDiscountedCumulativeGains.Count);
Microsoft.ML.Core (14)
Data\AnnotationUtils.cs (1)
304if (list?.Count != 1 || !schema.Schema[list[0].Index].HasSlotNames(vectorSize))
Data\ProgressReporter.cs (7)
133Contracts.Assert(entry.Header.MetricNames.Count == 0 && entry.Header.UnitNames.Count == 0); 233Contracts.Assert(entry.Header.MetricNames.Count == 0 && entry.Header.UnitNames.Count == 0); 559Progress = new Double?[header.UnitNames.Count]; 560ProgressLim = new Double?[header.UnitNames.Count]; 561Metrics = new Double?[header.MetricNames.Count];
Data\RoleMappedSchema.cs (3)
172if (cols.Count == 1) 244=> _map.TryGetValue(role.Value, out var cols) && cols.Count == 1; 250=> _map.TryGetValue(role.Value, out var cols) && cols.Count > 1;
Environment\ConsoleEnvironment.cs (2)
273for (int i = 0; i < ev.ProgressEntry.Header.UnitNames.Count; i++) 286for (int i = 0; i < ev.ProgressEntry.Header.MetricNames.Count; i++)
Utilities\Utils.cs (1)
87return x == null ? 0 : x.Count;
Microsoft.ML.Data (13)
DataView\RowToRowMapperTransform.cs (2)
176Contracts.Assert(0 <= col && col < _bindings.AddedColumnIndices.Count); 177return 0 <= col && col < _bindings.AddedColumnIndices.Count && active[_bindings.AddedColumnIndices[col]];
Evaluators\BinaryClassifierEvaluator.cs (3)
145host.CheckParam(prob.Count == 1, nameof(schema), "Cannot have multiple probability columns"); 162Host.Assert(prob == null || prob.Count == 1); 633Host.Assert(prob == null || prob.Count == 1);
Evaluators\EvaluatorUtils.cs (2)
1594int numLabels = confusionMatrix?.Counts == null ? 0 : confusionMatrix.Counts.Count; 1610rowDigitLen = Math.Max(confusionMatrix.PredictedClassesIndicators.Count - 1, 0).ToString().Length;
Evaluators\Metrics\ConfusionMatrix.cs (2)
116_host.CheckParam(predictedClassIndicatorIndex > -1 && predictedClassIndicatorIndex < Counts.Count, 118_host.CheckParam(actualClassIndicatorIndex > -1 && actualClassIndicatorIndex < Counts.Count,
Transforms\ColumnBindingsBase.cs (2)
754Contracts.Assert(index < AddedColumnIndices.Count); 778Contracts.Assert(-AddedColumnIndices.Count <= src && src < InputSchema.Count);
Transforms\ColumnConcatenatingTransformer.cs (2)
446int[] sources = new int[_parent._columns[iinfo].Sources.Count]; 463for (int i = 0; i < _parent._columns[iinfo].Sources.Count; i++)
Microsoft.ML.FastTree (2)
Utils\RegressionTreeBaseUtils.cs (2)
41for (int i = 0; i < trees.Count; i++) 122for (int i = 0; i < quantileTrees.Count; i++)
Microsoft.ML.GenAI.Core (1)
Trainer\CausalLMDataset.cs (1)
86var enumerable = Enumerable.Range(0, labelIds.Count)
Microsoft.ML.IntegrationTests (8)
IntrospectiveTraining.cs (7)
96Assert.Equal(3, treeCollection.Trees.Count); 97Assert.Equal(3, treeCollection.TreeWeights.Count); 103Assert.Equal(tree.SplitGains.Count, tree.NumberOfNodes); 104Assert.Equal(tree.NumericalSplitThresholds.Count, tree.NumberOfNodes); 198Assert.Equal(numTopics, ldaDetails.ItemScoresPerTopic.Count); 200Assert.Equal(numTopics, ldaDetails.WordScoresPerTopic.Count); 245Assert.Equal(numFeatures, weights.Count);
Validation.cs (1)
51Assert.Equal(5, cvResult.Count);
Microsoft.ML.Maml (2)
HelpCommand.cs (2)
314if (names.Count <= 1) 318for (int i = 1; i < names.Count; i++)
Microsoft.ML.OnnxTransformer (1)
OnnxTransform.cs (1)
698Contracts.Assert(outputCache.OutputOnnxValues.Count > 0);
Microsoft.ML.PerformanceTests (1)
Harness\Metrics.cs (1)
55if (results.Count != 1)
Microsoft.ML.Samples (4)
Dynamic\Trainers\BinaryClassification\Gam.cs (1)
77for (int j = 0; j < binUpperBounds.Count; j++)
Dynamic\Trainers\BinaryClassification\GamWithOptions.cs (1)
85for (int j = 0; j < binUpperBounds.Count; j++)
Dynamic\Trainers\Regression\GamAdvanced.cs (1)
77for (int j = 0; j < binUpperBounds.Count; j++)
Dynamic\Trainers\Regression\GamWithOptionsAdvanced.cs (1)
85for (int j = 0; j < binUpperBounds.Count; j++)
Microsoft.ML.StandardTrainers (2)
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (1)
374for (int i = 0; i < FeatureColumns.Count; i++)
Optimizer\LearningRateScheduler.cs (1)
112for (int i = 0; i < _lrSchedule.Count; i++)
Microsoft.ML.Tests (14)
PermutationFeatureImportanceTests.cs (6)
579for (int i = 0; i < pfi[0].PerClassLogLoss.Count; i++) 656for (int i = 0; i < pfi[0].PerClassLogLoss.Count; i++) 721for (int i = 0; i < pfi[0].DiscountedCumulativeGains.Count; i++) 726for (int i = 0; i < pfi[0].NormalizedDiscountedCumulativeGains.Count; i++) 792for (int i = 0; i < pfi[0].DiscountedCumulativeGains.Count; i++) 797for (int i = 0; i < pfi[0].NormalizedDiscountedCumulativeGains.Count; i++)
Scenarios\IrisPlantClassificationTests.cs (1)
95Assert.Equal(3, metrics.PerClassLogLoss.Count);
Scenarios\IrisPlantClassificationWithStringLabelTests.cs (1)
98Assert.Equal(3, metrics.PerClassLogLoss.Count);
ScenariosWithDirectInstantiation\IrisPlantClassificationTests.cs (1)
100Assert.Equal(3, metrics.PerClassLogLoss.Count);
TrainerEstimators\MatrixFactorizationTests.cs (5)
93Assert.Equal(leftMatrix.Count, model.Model.NumberOfRows * model.Model.ApproximationRank); 94Assert.Equal(rightMatrix.Count, model.Model.NumberOfColumns * model.Model.ApproximationRank); 102Assert.Equal(0.468956589698792, leftMatrix[leftMatrix.Count - 1], 0.0001); 104Assert.Equal(0.503888845443726, rightMatrix[rightMatrix.Count - 1], 0.0001); 828for (int i = 0; i < leftFactorMatrix.Count; ++i)
Microsoft.ML.TimeSeries (30)
Deseasonality.cs (1)
120for (int i = 0; i < _stl.Residual.Count; ++i)
STL\FastLoess.cs (2)
46if (yValues.Count < MinTimeSeriesLength) 51_length = _y.Count;
STL\InnerStl.cs (6)
122if (yValues.Count < MinTimeSeriesLength) 125int length = yValues.Count; 181for (int i = 0; i < y.Count; i++) 258for (int i = 0; i < y.Count; i++) 313List<double> results = new List<double>(s.Count); 320for (int i = length; i < s.Count; ++i)
STL\LeastSquares.cs (7)
31if (x.Count == 0 || y.Count == 0) 33if (x.Count != y.Count) 37_length = _x.Count; 48Contracts.CheckParam(weights.Count == _length, nameof(weights)); 49if (weights.Count != _length)
STL\LocalRegression.cs (4)
41if (x.Count <= 1 || x.Count != y.Count) 48_length = _x.Count;
STL\Loess.cs (5)
52if (xValues.Count < MinTimeSeriesLength || yValues.Count < MinTimeSeriesLength) 55if (xValues.Count != yValues.Count) 60_length = xValues.Count;
STL\MathsTools.cs (3)
35double[] left = new double[values.Count]; 36double[] right = new double[values.Count]; 37int numsCount = nums.Count;
STL\PolynomialModel.cs (2)
41for (int i = 1; i < Coeffs.Count; i++) 64Contracts.CheckParam(coeffs.Count == 2, nameof(coeffs), "must contain exact 2 elements.");
Microsoft.ML.Tokenizers (38)
Model\CodeGenTokenizer.cs (2)
1575if (tokensToAdd.Count > 0) 1580for (int i = 1; i < tokensToAdd.Count; i++)
Model\EnglishRobertaTokenizer.cs (7)
836List<int> list = new List<int>(ids.Count); 858List<int> list = new List<int>(ids.Count); 880List<int> list = new List<int>(ranks.Count); 915for (int i = 0; i < tokens.Count; i++) 921List<EncodedToken> list = new List<EncodedToken>(tokens.Count); 927for (int j = i; j < tokens.Count; j++) 1065if (word.Count <= 1)
Model\SentencePieceBaseModel.cs (2)
39if (specialTokens is not null && specialTokens.Count > 0) 86if (specialTokens is not null && specialTokens.Count > 0)
Model\SentencePieceTokenizer.cs (3)
938|| (id >= 0 && id < vocab.Count && vocab[id].Piece == tokenName); 978|| (id >= 0 && id < vocab.Count && vocab[id].Piece == token); 1008for (int i = 0; i < vocab.Count; i++)
Model\SentencePieceUnigramModel.cs (10)
174_vocabReverse = new (string Piece, float Score, ModelProto.Types.SentencePiece.Types.Type Type)[pieces!.Count]; 192for (int i = 0; i < pieces.Count; i++) 249if (controlId >= 0 && controlId < pieces.Count) 266var array = new (int Id, string Token)[tokens.Count]; 267for (int i = 0; i < tokens.Count; i++) 275private static int FirstId(IReadOnlyList<(int Id, string Token)> tokens) => tokens.Count > 0 ? tokens[0].Id : -1; 302=> pieces?.Count ?? 0; 318if (index >= pieces.Count) 335if ((uint)unkId >= (uint)pieces.Count) 351for (int i = 0; i < pieces.Count; i++)
PreTokenizer\CompositePreTokenizer.cs (9)
41if (preTokenizers.Count > MaxPreTokenizersCount) 54if (specialTokens is { Count: > 0 }) 56var list = new List<PreTokenizer>(specialTokens.Count + 1); 94Debug.Assert(preTokenizerIndex < preTokenizers.Count, "Index out of range for pre-tokenizers."); 103if (preTokenizerIndex + 1 < preTokenizers.Count) 124if (preTokenizerIndex + 1 < preTokenizers.Count) 172Debug.Assert(preTokenizerIndex < preTokenizers.Count, "Index out of range for pre-tokenizers."); 181if (preTokenizerIndex + 1 < preTokenizers.Count) 202if (preTokenizerIndex + 1 < preTokenizers.Count)
PreTokenizer\RegexPreTokenizer.cs (1)
36if (specialTokens is { Count: > 0 })
Tokenizer.cs (4)
46var ids = new int[results.Tokens.Count]; 184=> EncodeToTokens(text, textSpan, settings).Tokens.Count; 237tokenCount = Math.Min(maxTokenCount, tokens.Tokens.Count); 253var token = tokens.Tokens[tokens.Tokens.Count - tokenCount];
Microsoft.ML.Tokenizers.Tests (125)
BertTokenizerTests.cs (23)
383ids1Span = stackalloc int[ids1.Count + 2]; 386Assert.Equal(ids1.Count + 2, written); 398ids1Span = stackalloc int[ids1.Count + ids2.Count + 3]; 421ids1Span = stackalloc int[ids1.Count + 2]; 438ids1Span = stackalloc int[ids1.Count + ids2.Count + 3]; 483ids1Span = stackalloc int[ids1.Count]; 486Assert.Equal(ids1.Count, written); 498ids1Span = stackalloc int[ids1.Count + ids2.Count]; 501Assert.Equal(ids1.Count + ids2.Count, written); 518ids1Span = stackalloc int[ids1.Count + 2]; 521Assert.Equal(ids1.Count + 2, written); 533ids1Span = stackalloc int[ids1.Count + ids2.Count + 3]; 536Assert.Equal(ids1.Count + ids2.Count + 3, written); 576ids1Span = stackalloc int[ids1.Count + 2]; 579Assert.Equal(ids1.Count + 2, written); 591ids1Span = stackalloc int[ids1.Count + ids2.Count + 3];
BpeTests.cs (10)
305Assert.Equal(expectedTokens.Length, encoding.Count); 306Assert.Equal(offsets.Length, encoding.Count); 307Assert.Equal(ids.Length, encoding.Count); 308Assert.Equal(ids.Length, idsList.Count); 318for (int i = 0; i < encoding.Count; i++) 425Assert.Equal(12, encoding.Count); 829for (int i = 1; i < encoding.Count; i++) 832Assert.Equal(i, subIds.Count); 839Assert.Equal(encoding[encoding.Count - i].Offset.Start.Value, index); 914Assert.Equal(unkId, ids[ids.Count - 2]);
CodeGenTests.cs (38)
691Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 696Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 701Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 706Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 715Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 720Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 725Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 730Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 735Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 740Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 743Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 745Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 747Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 749Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 751Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 753Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 755Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 757Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 827Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 833Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 839Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 845Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 857Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 863Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 869Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 875Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 881Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 887Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset); 891Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 894Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 897Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 900Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 903Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 906Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 909Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 912Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]); 998Assert.Equal(expectedTokenCount, ids.Count); 1003Assert.Equal(expectedTokenCount, ids.Count);
LlamaTests.cs (12)
360Assert.True(bpe.Vocabulary.Count > 0); 673Assert.Equal(tokenCount, encodedTokens.Count); 689for (int i = 1; i <= encodedTokens.Count; i++) 697accumulatedStringFromEnd = (encodedTokens.Count == i ? DummyPrefix : (i % 2 == 0 ? $"{DummyPrefix}Hello" : specialTokens[specialTokens.Length - 1 - (i / 2)])) + accumulatedStringFromEnd; 849Assert.True(idsConsumed < ids.Count); 854Assert.Equal(ids.Count, idsConsumed); 863Assert.True(idsConsumed < ids.Count); 868Assert.Equal(ids.Count, idsConsumed); 888Assert.True(idsConsumed < ids.Count); 893Assert.Equal(ids.Count, idsConsumed); 902Assert.True(idsConsumed < ids.Count); 912Assert.Equal(ids.Count, idsConsumed);
PreTokenizerTests.cs (2)
67Assert.True(encoding.Count >= splitParts.Length, $"Expected to have {encoding.Count} >= {splitParts.Length}");
SentencePieceTests.cs (5)
48Assert.True(tokens.Count > 0); 62Assert.True(tokens.Count > 0); 119Assert.True(tokens.Count > 1, "Byte fallback should produce multiple byte tokens."); 156Assert.True(bpeTokens.Count > 0); 157Assert.True(unigramTokens.Count > 0);
TiktokenTests.cs (20)
134Assert.Equal(externalEncoder.Count, encoder.Count); 164Assert.Equal(encoded.Count, idsCount); 218Assert.Equal(encoded.Count, idsCount); 226Assert.Equal(5584, encoded.Count); 228Assert.Equal(encoded.Count, idsCount); 258Assert.Equal(encoded.Count, idsCount); 288Assert.Equal(encoded.Count, idsCount); 302Assert.Equal(5609, encoded.Count); 303Assert.Equal(encoded.Count, idsCount); 325Assert.Equal(encoded.Count, idsCount); 339Assert.Equal(11378, encoded.Count); 340Assert.Equal(encoded.Count, idsCount); 358Assert.Equal(7230, encoded.Count); 359Assert.Equal(encoded.Count, idsCount); 377Assert.Equal(7230, encoded.Count); 378Assert.Equal(encoded.Count, idsCount); 396Assert.Equal(11378, encoded.Count); 397Assert.Equal(encoded.Count, idsCount); 586int entriesCount = GetEncoder((tokenizer as TiktokenTokenizer)!)!.Count;
TokenizerTests.cs (9)
135for (int i = 1; i <= fullIdsList.Count; i++) 144Assert.Equal(fullIdsList.Take(partialIdsList.Count), partialIdsList); 165Assert.Equal(tokenCount1, prefixIds.Count); 166Assert.Equal(prefixIds, fullIdsList.Take(prefixIds.Count)); 178if (i < fullIdsList.Count) 188Assert.Equal(tokenCount2, suffixIds.Count); 189Assert.Equal(suffixIds, fullIdsList.Skip(fullIdsList.Count - suffixIds.Count)); 192if (i == fullIdsList.Count)
UnigramTests.cs (6)
633Assert.Equal(modelTokens.Count, jsonTokens.Count); 634for (int i = 0; i < modelTokens.Count; i++) 662Assert.Equal(modelIds.Count, jsonIds.Count); 663for (int i = 0; i < modelIds.Count; i++)
Microsoft.ML.TorchSharp (10)
NasBert\NerTrainer.cs (5)
172if (target.Length != encoding.Count) 175var targetEditor = VBufferEditor.Create(ref target, encoding.Count); 177for (var i = 0; i < encoding.Count; i++) 387for (var i = 0; i < encoding.Count; i++) 401for (var i = 1; i < encoding.Count; i++)
Roberta\QATrainer.cs (5)
420var targetList = new List<int> { mapping[answerIndex] + 2 + questionTokenId.Count, mapping[answerEnd] + 2 + questionTokenId.Count }; 445for (var (i, j, tid) = (0, 0, 0); i < text.Length && tid < tokens.Count;) 866contextLength = contextTokenId.Count; 867questionLength = questionTokenId.Count;
Microsoft.ML.Transforms (17)
ExpressionTransformer.cs (2)
117for (int isrc = 0; isrc < inputColumnNames.Count; isrc++) 137for (int isrc = 0; isrc < inputColumnNames.Count; isrc++)
MetricStatistics.cs (6)
58Contracts.Assert(src.Count == dest.Count); 60for (int i = 0; i < dest.Count; i++) 271PerClassLogLoss = MetricsStatisticsUtils.InitializeArray(metrics.PerClassLogLoss.Count); 303DiscountedCumulativeGains = MetricsStatisticsUtils.InitializeArray(metrics.DiscountedCumulativeGains.Count); 306NormalizedDiscountedCumulativeGains = MetricsStatisticsUtils.InitializeArray(metrics.NormalizedDiscountedCumulativeGains.Count);
PermutationFeatureImportanceExtensions.cs (4)
643Contracts.Assert(a.Count == b.Count); 645var delta = new double[a.Count]; 646for (int i = 0; i < a.Count; i++)
Text\NgramTransform.cs (5)
327for (int i = 0; i < lims.Count; i++) 341env.Assert(lims.Count > 0); 342env.Assert(lims.Count == Utils.Size(counts)); 345int ngramLength = lims.Count; 351env.Assert(lim <= lims.Count);
Microsoft.NET.Build.Tasks (4)
DependencyContextBuilder.cs (3)
383if (lib.Library.RuntimeAssemblyGroups.Count == 0 && lib.Library.NativeLibraryGroups.Count == 0 && lib.Library.ResourceAssemblies.Count == 0)
ResolvePackageAssets.cs (1)
1623if (message.TargetGraphs is null || message.TargetGraphs.Count == 0 || message.TargetGraphs.Any(ForCurrentTargetFramework))
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (2)
parent\parent\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (2)
262if (requirements.Count == 0) 717if (group.Others == null || group.Others.Count == 0)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (2)
Data\StaticWebAsset.cs (2)
262if (requirements.Count == 0) 717if (group.Others == null || group.Others.Count == 0)
Microsoft.Private.Windows.Core (17)
System\Collections\Generic\CollectionExtensions.cs (1)
18ArgumentOutOfRangeException.ThrowIfLessThan(readOnlyList.Count, count, nameof(count));
System\IO\BinaryReaderExtensions.cs (2)
204if (values.Count == 0) 280for (int i = 0; i < values.Count; i++)
System\IO\BinaryWriterExtensions.cs (2)
32for (int i = 0; i < memberTypeInfo.Count; i++) 37for (int i = 0; i < memberTypeInfo.Count; i++)
System\Private\Windows\BinaryFormat\Serializer\ArrayRecord.cs (1)
64if (arrayInfo.Length != arrayObjects.Count)
System\Private\Windows\BinaryFormat\Serializer\ArraySingleObject.cs (1)
23: base(new ArrayInfo(objectId, arrayObjects.Count), arrayObjects)
System\Private\Windows\BinaryFormat\Serializer\ArraySinglePrimitive.cs (1)
29: base(new ArrayInfo(objectId, arrayObjects.Count), arrayObjects)
System\Private\Windows\BinaryFormat\Serializer\ArraySingleString.cs (1)
23: base(new ArrayInfo(objectId, arrayObjects.Count), new StringListAdapter(arrayObjects, recordMap))
System\Private\Windows\BinaryFormat\Serializer\ArraySingleString.StringListAdapter.cs (2)
30int IReadOnlyCollection<string?>.Count => _recordList.Count; 38for (int i = 0; i < _recordList.Count; i++)
System\Private\Windows\BinaryFormat\Serializer\ClassInfo.cs (1)
33writer.Write(MemberNames.Count);
System\Private\Windows\BinaryFormat\Serializer\ClassRecord.cs (2)
33for (int i = 0; i < ClassInfo.MemberNames.Count; i++) 64for (int i = 0; i < memberTypeInfo.Count; i++)
System\Private\Windows\BinaryFormat\Serializer\Record.cs (1)
91for (int i = 0; i < objects.Count; i++)
System\Private\Windows\Ole\DataFormatsCore.cs (2)
65for (int i = 0; i < formats.Count; i++) 128for (int i = 0; i < formats.Count; i++)
Microsoft.TemplateEngine.Abstractions (2)
Parameters\ParameterDefinitionSet.cs (1)
47public int Count => _parameters.Count;
Parameters\ParameterSetData.cs (1)
70public int Count => _parametersData.Count;
Microsoft.TemplateEngine.Cli (27)
Alias\AliasRegistry.cs (3)
42else if (aliasTokens.Count == 0) 76if (inputTokens.Count == 0) 114expandedTokens = new CombinedList<string>(aliasExpansion, expandedTokens.ToList().GetRange(1, expandedTokens.Count - 1));
ChoiceTemplateParameter.cs (4)
55if (Choices.Count > 2) 103if (argumentResult.Tokens.Count == 0) 145else if (!parameter.AllowMultipleValues && argumentResult.Tokens.Count != 1) 148argumentResult.AddError(string.Format(LocalizableStrings.ParseTemplateOption_Error_InvalidCount, or.IdentifierToken?.Value, argumentResult.Tokens.Count));
CliTemplateParameter.cs (3)
322if (argumentResult.Tokens.Count == 0) 368else if (argumentResult.Tokens.Count == 1) 386argumentResult.AddError(string.Format(LocalizableStrings.ParseTemplateOption_Error_InvalidCount, or.IdentifierToken?.Value, argumentResult.Tokens.Count));
Commands\AliasAssignmentCoordinator.cs (1)
142string flagFullText = parameter.LongNameOverrides.Count > 0 ? parameter.LongNameOverrides[0] : parameter.Name;
Commands\CommandLineUtils.cs (2)
17for (var i = 0; i < arguments.Count; i++) 77for (var i = 0; i < options.Count; i++)
Commands\create\InstantiateCommand.Help.cs (2)
201if (templateGroup.Languages.Count <= 1) 237if (templateGroup.Types.Count <= 1)
Commands\create\TemplateOption.cs (2)
49if (Aliases.Count != other.Aliases.Count)
PostActionDispatcher.cs (1)
86if (postActions.Count > 0)
PostActionProcessors\AddJsonPropertyPostActionProcessor.cs (2)
120if (jsonFiles.Count == 0) 139if (jsonFiles.Count > 1)
TabularOutput\TabularOutput.cs (3)
61if ((_settings.ColumnsToDisplay.Count == 0 && defaultColumn) || showAlways || (!string.IsNullOrWhiteSpace(columnName) && _settings.ColumnsToDisplay.Contains(columnName)) || _settings.DisplayAllColumns) 418internal int LineCount => _lines.Count; 426var text = _lines.Count > line ? _lines[line] : string.Empty;
TemplateGroup.cs (1)
178internal bool HasSingleTemplate => Templates.Count == 1;
TemplatePackageCoordinator.cs (3)
190TelemetryEventEntry.TrackEvent(TelemetryConstants.InstallEvent, new Dictionary<string, string?> { { TelemetryConstants.ToInstallCount, args.TemplatePackages.Count.ToString() } }); 193if (args.AdditionalSources?.Count > 0) 362if (args.TemplatePackages == null || args.TemplatePackages.Count <= 0)
Microsoft.TemplateEngine.Core (14)
Expressions\Cpp\CppStyleEvaluatorDefinition.cs (4)
324for (; i < tokens.Count && (tokens[i].Family == TokenFamily.Whitespace || tokens[i].Family == TokenFamily.Tab); ++i) 330for (; i < tokens.Count; ++i) 349for (int j = i + 1; j < tokens.Count; ++j) 365j = tokens.Count;
Operations\Conditional.cs (8)
61int maxListSize = Math.Max(Tokens.IfTokens.Count, Tokens.ElseTokens.Count); 62maxListSize = Math.Max(maxListSize, Tokens.ElseIfTokens.Count); 63maxListSize = Math.Max(maxListSize, Tokens.EndIfTokens.Count); 64maxListSize = Math.Max(maxListSize, Tokens.ActionableIfTokens.Count); 65maxListSize = Math.Max(maxListSize, Tokens.ActionableElseTokens.Count); 66maxListSize = Math.Max(maxListSize, Tokens.ActionableElseIfTokens.Count); 118for (int i = 0; i < tokensOfType.Count; i++)
Util\ProcessorState.cs (2)
85for (int i = 0; i < operationProviders.Count; ++i) 91for (int j = 0; j < op.Tokens.Count; ++j)
Microsoft.TemplateEngine.Edge (13)
Settings\ComponentManager.cs (1)
203if (interfaceTypesToRegisterFor.Count == 0)
Settings\FilteredTemplateInfo.cs (1)
22public bool IsMatch => MatchDisposition.Count > 0 && !MatchDisposition.Any(x => x.Kind == MatchKind.Mismatch);
Settings\Scanner.cs (2)
168if (typeList.Count > 0) 243_logger.LogDebug("Scanning mount point '{0}' by generator '{1}': found {2} templates", source.MountPoint.MountPointUri, generator.Id, templateList.Count);
Settings\TemplateInfo.cs (1)
149if (ShortNameList.Count > 0)
Settings\TemplateMatchInfo.cs (1)
46public bool IsMatch => MatchDisposition.Count > 0 && MatchDisposition.All(x => x.Kind != MatchKind.Mismatch);
Settings\TemplatePackageManager.cs (2)
352var scanResults = new ScanResult?[allTemplatePackages.Count]; 353await Task.WhenAll(Enumerable.Range(0, allTemplatePackages.Count).Select(async index =>
Template\InputDataSet.cs (1)
76public int Count => _parametersData.Count;
Template\TemplateCreator.cs (3)
176if (!forceCreation && destructiveChanges.Count > 0) 275return invalidDefaultParameters.Count > 0; 414|| userParamsWithInvalidValues.Count > 0)
Template\WellKnownSearchFilters.cs (1)
174anyParts &= parts.Length == template.Classifications.Count;
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (15)
ConfigModel\BaseValueSymbol.cs (1)
38Forms = clone.Forms.GlobalForms.Count != 0 ? clone.Forms : formsFallback;
ConfigModel\PostActionModel.cs (1)
171bool defaultIdMatch = manualInstruction.Id == null && ManualInstructionInfo.Count == 1 && locModel.Instructions.TryGetValue(DefaultIdForSingleManualInstruction, out localizedInstruction);
FileSourceHierarchicalPathMatcher.cs (2)
40for (int i = matchInfo.Modifiers.Count - 1; i >= 0; i--) 144int expect = fileSources?.Count ?? 0;
RunnableProjectConfig.cs (3)
263if (configs.Count == 1) 449if (symbol.ReplacementContexts.Count > 0) 582if (ConfigurationModel.Sources.Count == 0)
RunnableProjectConfig.ITemplate.cs (1)
77if (((ITemplateInfo)this).ShortNameList.Count > 0)
RunnableProjectGenerator.cs (1)
491if (((ITemplateInfo)this).ShortNameList.Count > 0)
Validation\MandatoryLocalizationValidationFactory.cs (3)
33int unusedPostActionLocs = locModel.PostActions.Count; 45bool instructionUsesDefaultKey = postAction.ManualInstructionInfo.Count == 1 && postAction.ManualInstructionInfo[0].Id == null && 53int unusedManualInstructionLocs = postActionLocModel.Instructions.Count;
Validation\MandatoryValidationFactory.cs (3)
39vi => (vi.ConfigModel.ShortNameList?.Count ?? 0) == 0), 91vi => (vi.ConfigModel.Classifications?.Count ?? 0) == 0), 97vi => vi.ConfigModel.PostActionModels != null && vi.ConfigModel.PostActionModels.Any(x => x.ManualInstructionInfo == null || x.ManualInstructionInfo.Count == 0)),
Microsoft.TemplateEngine.Utils (14)
CombinedList.cs (6)
19public int Count => _first.Count + _second.Count; 30if (index >= _first.Count) 32index -= _first.Count; 39if (index >= _second.Count) 66_count = items.Count;
DirectedGraph.cs (2)
70return result.Count == _vertices.Count; 92if (IsEmpty || vertices.Count == 0)
Glob.cs (5)
154if ((currentMatcher < _matchers.Count - 1 && matcher.ProducesCheckpoint && matcher.MinConsume == 0) || matcher.CanConsume(test, i, out i)) 158if (currentMatcher < _matchers.Count - 1 && matcher.ProducesCheckpoint) 165if (currentMatcher < _matchers.Count) 181if (currentMatcher == _matchers.Count && i == test.Length) 212return i == test.Length && currentMatcher == _matchers.Count;
WellKnownSearchFilters.cs (1)
19t => t.MatchDisposition.Count > 0 && t.MatchDisposition.All(x => x.Kind is MatchKind.Exact or MatchKind.Partial);
Microsoft.TemplateSearch.Common (2)
TemplateDiscoveryMetadata\BlobStorageTemplateInfo.cs (1)
109string ITemplateInfo.ShortName => ShortNameList.Count > 0 ? ShortNameList[0] : string.Empty;
TemplateSearchCache\TemplatePackageSearchData.Json.cs (1)
99if (value.Owners.Count == 1)
Microsoft.VisualStudio.TestPlatform.Common (2)
DataCollection\DataCollectionManager.cs (1)
763if (dataCollectorsToRemove == null || dataCollectorsToRemove.Count == 0)
ExtensionFramework\TestDiscoveryExtensionManager.cs (1)
165if (fileExtensions != null && fileExtensions.Count > 0)
Microsoft.VisualStudio.TestPlatform.ObjectModel (3)
Nuget.Frameworks\FallbackFramework.cs (1)
34if (fallbackFrameworks.Count == 0)
Nuget.Frameworks\HashCodeCombiner.cs (1)
122var count = list.Count;
Nuget.Frameworks\NoAllocEnumerateExtensions.cs (1)
208if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
MSBuild (5)
XMake.cs (5)
1205if (commandLineParser.IncludedResponseFiles.Count > 0) 3999if (processedParams.DistinctParameterSets.Count == 0) 4005if (processedParams.DuplicateFilePaths.Count > 0) 4010if (processedParams.AllConfigurationsIdentical && processedParams.AdditionalFilePaths.Count > 0) 4707commandLineParser.IncludedResponseFiles.Count == 1
NuGet.Build.Tasks (3)
BuildTasksUtility.cs (1)
202if (dependencyGraphSpec.Restore.Count > 0)
RestoreTask.cs (1)
313List<ITaskItem> restoredProjectOutputPaths = new List<ITaskItem>(projects.Count);
src\nuget-client\build\Shared\SharedExtensions.cs (1)
171for (var index = 0; index < lst.Count; index++)
NuGet.Build.Tasks.Console (7)
MSBuildStaticGraphRestore.cs (5)
122if (dgSpec.Restore.Count > 0) 500var projectRestoreMetadataFrameworkInfos = new List<ProjectRestoreMetadataFrameworkInfo>(projects.Count); 753var targetFrameworkInfos = new List<TargetFrameworkInformation>(projectInnerNodes.Count); 1152projectsByTargetFramework.Count > 1 || !string.IsNullOrWhiteSpace(project.GetProperty("TargetFrameworks"))), 1395MSBuildLogger.LogInformation(string.Format(CultureInfo.CurrentCulture, Strings.ProjectEvaluationSummary, projectGraph.ProjectNodes.Count, sw.ElapsedMilliseconds, buildCount, failedBuildSubmissionCount));
RestoreProjectAdapter.cs (1)
51if (TargetFrameworks.Count == 0)
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
NuGet.CommandLine.XPlat (31)
Commands\Package\Download\PackageDownloadRunner.cs (3)
96if (mappedNames.Count == 0) 254var mappedRepos = new List<SourceRepository>(mappedNames.Count); 282for (int i = 0; i < allRepos.Count; i++)
Commands\Package\PackageWithNuGetVersion.cs (2)
20if (result.Tokens.Count == 0) 25var packages = new List<PackageWithNuGetVersion>(result.Tokens.Count);
Commands\Package\PackageWithVersionRange.cs (2)
21if (result.Tokens.Count == 0) 26List<PackageWithVersionRange> packages = new List<PackageWithVersionRange>(result.Tokens.Count);
Commands\Package\Update\PackageUpdateCommandRunner.cs (9)
69if (dgSpec is null || dgSpec.Restore is null || dgSpec.Restore.Count == 0) 164.Where(id => packages is null || packages.Count == 0 || packages.Any(p => string.Equals(p.Id, id, StringComparison.OrdinalIgnoreCase))) 170.Where(l => l.Type == "package" && (packages is null || packages.Count == 0 || packages.Any(p => string.Equals(p.Id, l.Name, StringComparison.OrdinalIgnoreCase)))) 175.Where(d => d.LibraryRange.TypeConstraint == LibraryDependencyTarget.Package && (packages is null || packages.Count == 0 || packages.Any(p => string.Equals(p.Id, d.Name, StringComparison.OrdinalIgnoreCase)))) 206if (mappedSources is not null && mappedSources.Count == 0) 323bool noPackagesSpecified = args.Packages is null || args.Packages.Count == 0; 468if (packages is null || packages.Count == 0) 481if (mappedSources is not null && mappedSources.Count == 0) 640if (mappedSources is not null && mappedSources.Count == 0)
Commands\Package\Update\PackageUpdateIO.cs (7)
261if (auditSources is null || auditSources.Count == 0) 266var tasks = new List<Task<GetVulnerabilityInfoResult?>>(auditSources.Count); 288if (result.KnownVulnerabilities?.Count > 0) 348if (allowedSources.Count == 0) 353List<PackageSource> sourceMappedSources = new List<PackageSource>(allowedSources.Count); 362var sources = new List<SourceRepository>(packageSources.Count); 363for (int i = 0; i < packageSources.Count; i++)
Commands\PackageReferenceCommands\ListPackage\ListPackageCommandRunner.cs (1)
156if (listPackageArgs.ReportType == ReportType.Vulnerable && listPackageArgs.AuditSources != null && listPackageArgs.AuditSources.Count > 0)
Commands\Why\WhyCommand.cs (2)
79if (ar.Tokens.Count == 1) 85return ar.Tokens.Count > 1;
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
src\nuget-client\build\Shared\SharedExtensions.cs (1)
171for (var index = 0; index < lst.Count; index++)
Utility\HttpSourcesUtility.cs (2)
18if (packageSources == null || packageSources.Count == 0) 29httpPackageSources ??= new(capacity: packageSources.Count);
NuGet.Commands (49)
ClientCertificatesCommand\ListClientCertRunner.cs (1)
40for (var i = 0; i < items.Count; i++)
RestoreCommand\DependencyGraphResolver.cs (1)
906Dictionary<LibraryDependencyIndex, VersionRange>? pinnedPackageVersions = new(capacity: projectTargetFramework.CentralPackageVersions.Count);
RestoreCommand\DependencyGraphResolver.DependencyGraphItem.cs (1)
94if ((RuntimeDependencies == null || RuntimeDependencies.Count == 0) && (packagesToPrune == null || packagesToPrune.Count == 0))
RestoreCommand\LockFileBuilder.cs (1)
660for (var i = 0; i < package.Files.Count; i++)
RestoreCommand\Logging\WarningPropertiesCollection.cs (3)
107if (ProjectFrameworks.Count > 0 && 115bool legacy = ProjectFrameworks.Count == 1 && string.IsNullOrEmpty(ProjectFrameworks[0]); 124if (message.TargetGraphs.Count == 0)
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (3)
236if (auditSources is null || auditSources.Count == 0) 241var auditSourceRepositories = new List<SourceRepository>(auditSources.Count); 242for (int i = 0; i < auditSources.Count; i++)
RestoreCommand\RestoreCommand.cs (8)
191_enableNewDependencyResolver = _request.Project.RuntimeGraph.Supports.Count == 0 && ShouldUseNewResolverWithLockFile(_isLockFileEnabled, _request.Project) && !_request.Project.RestoreMetadata.UseLegacyDependencyResolver; 393telemetry.TelemetryEvent[SourcesCount] = _request.DependencyProviders.RemoteProviders.Count; 395telemetry.TelemetryEvent[LocalSourcesCount] = _request.DependencyProviders.RemoteProviders.Count - httpSourcesCount; 396telemetry.TelemetryEvent[FallbackFoldersCount] = _request.DependencyProviders.FallbackPackageFolders.Count; 402telemetry.TelemetryEvent[RuntimeIdentifiersCount] = _request.Project.RuntimeGraph.Runtimes.Count; 437bool isPruningEnabled = framework.PackagesToPrune.Count > 0; 1153if (framework.PackagesToPrune != null && framework.PackagesToPrune.Count > 0) 2066var hasSupports = _request.Project.RuntimeGraph.Supports.Count > 0;
RestoreCommand\RestoreCommandProvidersCache.cs (7)
120for (int i = 0; i < fallbackPackagesPaths.Count; i++) 150var localProviders = new List<IRemoteDependencyProvider>(fallbackPackagesPaths.Count + 1) { local }; 152for (int i = 0; i < fallbackPackagesPaths.Count; i++) 181var remoteProviders = new List<IRemoteDependencyProvider>(sources.Count); 207IReadOnlyList<IVulnerabilityInformationProvider> result = auditSources.Count > 0 214var vulnerabilityInformationProviders = new List<IVulnerabilityInformationProvider>(sources.Count); 217for (int i = 0; i < sources.Count; i++)
RestoreCommand\RestoreRunner.cs (3)
200if (inputRequests.Count == 0) 287if (!isNoOp && filesToBeUpdated?.Count > 0) 300if (!isNoOp && filesToBeUpdated?.Count > 0)
RestoreCommand\RestoreSummary.cs (4)
97if (restoreSummaries.Count == 0) 105var installed = new Dictionary<string, int>(restoreSummaries.Count, PathUtility.GetStringComparerBasedOnOS()); 188if (noOpCount == restoreSummaries.Count) 194logger.LogMinimal(string.Format(CultureInfo.CurrentCulture, Strings.Log_ProjectUpToDateSummary, noOpCount, restoreSummaries.Count));
RestoreCommand\Utility\AuditUtility.cs (6)
233if (knownVulnerabilities is null || knownVulnerabilities.Count == 0) 238for (int i = 0; i < knownVulnerabilities.Count; i++) 240if (knownVulnerabilities[i].Count > 0) { return true; } 445var results = new Task<GetVulnerabilityInfoResult?>[_vulnerabilityInfoProviders.Count]; 446for (int i = 0; i < _vulnerabilityInfoProviders.Count; i++) 463if (_vulnerabilityInfoProviders[i].IsAuditSource && (result?.KnownVulnerabilities is null || result.KnownVulnerabilities.Count == 0))
RestoreCommand\Utility\BuildAssetsUtils.cs (1)
542List<KeyValuePair<LockFileTargetLibrary, Lazy<LocalPackageSourceInfo>>> sortedPackages = new List<KeyValuePair<LockFileTargetLibrary, Lazy<LocalPackageSourceInfo>>>(sortedGraph.Count);
RestoreCommand\Utility\LockFileUtils.cs (1)
947managedCriteria = new(capacity: 1 + fallbackFramework.Fallback.Count)
RestoreCommand\Utility\PackageSpecFactory.cs (3)
153project.TargetFrameworks.Count > 1 || !string.IsNullOrWhiteSpace(project.OuterBuild.GetProperty("TargetFrameworks"))), 223var targetFrameworkInfos = new List<TargetFrameworkInformation>(project.TargetFrameworks.Count); 587var projectRestoreMetadataFrameworkInfos = new List<ProjectRestoreMetadataFrameworkInfo>(projects.Count);
RestoreCommand\Utility\ToolRestoreUtility.cs (1)
137.ThenBy(e => e.Request.DependencyProviders.RemoteProviders.Count)
SignCommand\CertificateProvider.cs (1)
281return chain != null && chain.Count > 0;
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
src\nuget-client\build\Shared\SharedExtensions.cs (1)
171for (var index = 0; index < lst.Count; index++)
TrustedSignersCommand\TrustedSignersCommandRunner.cs (1)
216for (var i = 0; i < trustedSigners.Count; i++)
NuGet.Configuration (10)
PackageSource\MinPublishAgeExceptions.cs (4)
33IsEnabled = items.Count > 0; 34var itemsByPattern = new Dictionary<string, MinPublishAgeExceptionItem>(items.Count, StringComparer.OrdinalIgnoreCase); 35var patterns = new string[items.Count]; 36for (int i = 0; i < items.Count; i++)
PackageSource\PackageSourceProvider.cs (2)
233if (exceptions.Count == 0) 271if (sectionItems.Count <= 1 || sectionItems.All(item => item.Origin?.ConfigFilePath == null))
PackageSourceMapping\PackageSourceMapping.cs (1)
55IsEnabled = Patterns.Count > 0;
PackageSourceMapping\PackageSourceMappingProvider.cs (1)
49if (packageSourceMappingSourceItems == null || packageSourceMappingSourceItems.Count == 0)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
NuGet.DependencyResolver.Core (8)
PackagingUtility.cs (2)
19if (dependency.Include.Count > 0) 25if (dependency.Exclude.Count > 0)
Remote\RemoteWalkContext.cs (3)
71if (sources.Count == 0) 77var filteredLibraryProviders = new List<IRemoteDependencyProvider>(sources.Count); 81for (int j = 0; j < sources.Count; ++j)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
src\nuget-client\build\Shared\SharedExtensions.cs (1)
171for (var index = 0; index < lst.Count; index++)
NuGet.Frameworks (5)
AssetTargetFallbackFramework.cs (1)
38if (fallbackFrameworks.Count == 0)
FallbackFramework.cs (1)
34if (fallbackFrameworks.Count == 0)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
src\nuget-client\build\Shared\SharedExtensions.cs (1)
171for (var index = 0; index < lst.Count; index++)
NuGet.LibraryModel (2)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
NuGet.PackageManagement (31)
Audit\AuditChecker.cs (6)
128if (knownVulnerabilities is null || knownVulnerabilities.Count == 0) 133for (var i = 0; i < knownVulnerabilities.Count; i++) 135if (knownVulnerabilities[i].Count > 0) { return true; } 152if (auditSources?.Count > 0) 154results = new(auditSources.Count); 165for (int i = 0; i < vulnerabilitySources.Count; i++)
BuildIntegration\BuildIntegratedProjectAction.cs (1)
133if (originalActionsAndInstallationContexts.Count < 1)
BuildIntegration\DependencyGraphRestoreUtility.cs (3)
79if (dgSpec.Restore.Count > 0) 216if (solutionDgSpec.Restore.Count < 1) 257if (projectAdditionalMessages != null && projectAdditionalMessages.Count > 0)
IDE\PackageRestoreManager.cs (2)
226if (items?.Count > 0) 229for (int i = 0; i < items.Count; i++)
InstallationCompatibility.cs (2)
155if (packageTypes.Count > 1) 162else if (packageTypes.Count == 1)
NuGetPackageManager.cs (10)
175var count = pathContext.FallbackPackageFolders.Count + 1; 844if (packageIdentities.Count == 0 && packageId == null) 900if (packageIdentities.Count == 0) 1014var isUpdateAll = (packageId == null && packageIdentities.Count == 0); 1028if (packageIdentities.Count > 0) 1132if (packageIdentities.Count == 1) 1645if (activeSources.Count == 0) 2895if (buildIntegratedProjects.Count == 0) 2952if (primarySources == null || primarySources.Count == 0) 3466if (dgSpecForParents.Restore.Count > 0)
PackageDownloader.cs (2)
110if (configuredPackageSources.Count > 0) 133configuredPackageSources.Count == 0 ||
Resolution\ResolverGather.cs (2)
548if (configuredPackageSources.Count > 0) 569configuredPackageSources.Count == 0 ||
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
src\nuget-client\build\Shared\SharedExtensions.cs (1)
171for (var index = 0; index < lst.Count; index++)
NuGet.Packaging (39)
PackageCreation\Xml\PackageMetadataXmlExtensions.cs (2)
106set.Packages.Any(dependency => dependency.Exclude.Count > 0 || dependency.Include.Count > 0),
RuntimeModel\RuntimeDependencySet.cs (1)
41Dependencies = dependencies is null or { Count: 0 } ? EmptyDependencies : dependencies;
RuntimeModel\RuntimeDescription.cs (4)
53InheritedRuntimes = inheritedRuntimes is null or { Count: 0 } ? Array.Empty<string>() : inheritedRuntimes; 54RuntimeDependencySets = runtimeDependencySets is null or { Count: 0 } ? EmptyRuntimeDependencySets : runtimeDependencySets; 87if (right.InheritedRuntimes.Count != 0 && left.InheritedRuntimes.Count == 0)
RuntimeModel\RuntimeGraph.cs (11)
69if (Runtimes.Count != 0 || Supports.Count != 0) 77internal bool IsEmpty => Runtimes.Count == 0 && Supports.Count == 0; 92if (source.Count == 0) 98Dictionary<string, T> clone = new(source.Count); 125var runtimes = new Dictionary<string, RuntimeDescription>(capacity: left.Runtimes.Count + right.Runtimes.Count); 147var supports = new Dictionary<string, CompatibilityProfile>(capacity: right.Supports.Count + left.Supports.Count); 202var count = inheritedRuntimes.Count;
Signing\Archive\EndOfCentralDirectoryRecord.cs (3)
56if (length < Signature.Count) 77if (buffer[i] == Signature[Signature.Count - matchingByteCount - 1]) 81if (matchingByteCount == Signature.Count)
Signing\Signatures\NuGetPackageOwners.cs (1)
23if (packageOwners == null || packageOwners.Count == 0)
Signing\Signatures\PrimarySignature.cs (1)
139if (certificates == null || certificates.Count == 0)
Signing\Signatures\Signature.cs (3)
91if (timestamps.Count == 0) 101if (timestamps.Count > 1 && !settings.AllowMultipleTimestamps) 412if (certificates == null || certificates.Count == 0)
Signing\Signatures\SigningCertificateV2.cs (1)
75var entries = new List<byte[][]>(Certificates.Count);
Signing\Utility\AttributeUtility.cs (1)
155if (packageOwners == null || packageOwners.Count == 0)
Signing\Utility\SignatureUtility.cs (4)
517if (signingCertificateV2.Certificates.Count == 0) 543if (signingCertificate.Certificates.Count == 0) 560if (certificates == null || certificates.Count == 0) 578essCertIdV2.IssuerSerial.GeneralNames.Count == 0)
Signing\Utility\SigningUtility.cs (3)
65if (chainList == null || chainList.Count == 0) 95if (chainList == null || chainList.Count == 0) 104if (request.PackageOwners?.Count > 0)
Signing\Verification\AllowListVerificationProvider.cs (1)
41if (_allowList == null || _allowList.Count == 0)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
src\nuget-client\build\Shared\SharedExtensions.cs (1)
171for (var index = 0; index < lst.Count; index++)
NuGet.ProjectModel (11)
JsonPackageSpecReader.Utf8JsonStreamReader.cs (1)
726if (imports != null && imports.Count > 0)
LockFile\LockFileExtensions.cs (1)
32if (message.TargetGraphs == null || message.TargetGraphs.Count == 0)
PackageSpecOperations.cs (2)
176int dictSize = centralPackageVersions.ContainsKey(dependency.Id) ? centralPackageVersions.Count : centralPackageVersions.Count + 1;
PackageSpecReferenceDependencyProvider.cs (1)
425var children = new List<ExternalProjectReference>(parent.ExternalProjectReferences.Count);
PackageSpecWriter.cs (3)
537SetCentralDependencies(writer, framework.CentralPackageVersions.Count, framework.CentralPackageVersions.Values, hashing); 572if (frameworkReferences?.Count > 0) 605if (packagesToPrune.Count == 0)
ProjectLockFile\PackagesLockFileUtilities.cs (1)
485if (transitiveDependencies != projectDependency.Dependencies.Count && packagesToPrune?.Count == 0)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
NuGet.Protocol (28)
DependencyInfo\ResolverMetadataClient.cs (1)
105for (int i = 0; i < pages.Count; i++)
LegacyFeed\V2FeedListResource.cs (1)
221if (_currentPage.Items.Count != _take) // Last page not filled completely, no more pages left
LegacyFeed\V2FeedParser.cs (1)
133if (packages.Items.Count < 1)
LocalRepositories\LocalPackageSearchResource.cs (1)
117if (packageTypes.Count == 0)
PackagesFolder\NuGetv3LocalRepositoryUtility.cs (1)
26for (var i = 0; i < repositories.Count; i++)
Providers\RawSearchResourceV3Provider.cs (1)
30if (endpoints.Count > 0)
RemoteRepositories\HttpFileSystemBasedFindPackageByIdResource.cs (3)
72if (baseUris.Count < 1) 493var maxTries = _maxRetries * _baseUris.Count; 500var baseUri = _baseUris[retry % _baseUris.Count].OriginalString;
RemoteRepositories\HttpFileSystemBasedFindPackageByIdResourceProvider.cs (1)
27&& packageBaseAddress.Count > 0)
Resources\PackageSearchResourceV3.cs (5)
44public override bool SupportsPackageTypeFiltering => _packageTypeCapableEndpoints?.Count > 0; 69List<IPackageSearchMetadata> searchResults = new(searchResultMetadata.Count); 112if (_packageTypeCapableEndpoints == null || _packageTypeCapableEndpoints.Count == 0) 124for (var i = 0; i < endpoints.Count; i++) 171catch when (i < endpoints.Count - 1)
Resources\RegistrationResourceV3.cs (1)
197for (int i = 0; i < ranges.Count; i++)
Resources\ServiceIndexResourceV3.cs (1)
111if (compatible.Count > 0)
Resources\VulnerabilityInfoResourceV3.cs (8)
138if (indexEntries.Count == 0) 145if (indexEntries.Count > maxPages) 147string message = string.Format(Strings.Vulnerability_TooManyPages, _sourceRepository.PackageSource.Name, indexEntries.Count, maxPages); 152var tasks = new Task<IReadOnlyDictionary<string, IReadOnlyList<PackageVulnerabilityInfo>>>[indexEntries.Count]; 172knownVulnerabilities = new(indexEntries.Count); 203List<V3VulnerabilityIndexEntry> validIndexEntries = new(indexEntries.Count); 208new(indexEntries.Count, StringComparer.InvariantCultureIgnoreCase); 211for (int i = 0; i < indexEntries.Count; i++)
SourceRepository.cs (1)
156for (int i = 0; i < possible.Count; i++)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
NuGet.Resolver (2)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
NuGet.Versioning (3)
src\nuget-client\build\Shared\HashCodeCombiner.cs (1)
122var count = list.Count;
src\nuget-client\build\Shared\NoAllocEnumerateExtensions.cs (1)
209if (source is ICollection<T> { Count: 0 } or IReadOnlyCollection<T> { Count: 0 })
src\nuget-client\build\Shared\SharedExtensions.cs (1)
171for (var index = 0; index < lst.Count; index++)
PresentationBuildTasks (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Parser\SpecialBracketCharacters.cs (1)
36if (attributeList is not null && attributeList.Count > 0)
PresentationCore (1)
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
360ArgumentOutOfRangeException.ThrowIfLessThan(readOnlyList.Count, count, nameof(count));
PresentationFramework (25)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (6)
131EnsureIndexInt32(index, _list.Count); 144public uint Size => (uint)_list.Count; 149int max = _list.Count; 174if (startIndex == _list.Count) 177EnsureIndexInt32(startIndex, _list.Count); 184uint itemCount = Math.Min((uint)items.Length, (uint)_list.Count - startIndex);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Parser\SpecialBracketCharacters.cs (1)
36if (attributeList is not null && attributeList.Count > 0)
System\Windows\Documents\NLGSpellerInterop.cs (6)
229segmentCount += sentence.Segments.Count; 234for (int i = 0; continueIteration && (i < sentence.Segments.Count); i++ ) 722for (int i = 0; result && (i < SubSegments.Count); i++) 844Invariant.Assert(_segments.Count == sentenceSegmentCount); 874if (Segments.Count > 0) 876ITextRange textRange = Segments[Segments.Count - 1].TextRange;
System\Windows\Documents\Speller.cs (3)
893if (textSegment.SubSegments.Count == 0) 896if(textSegment.Suggestions.Count > 0) 947if (textSegment.SubSegments.Count == 0)
System\Windows\Documents\WinRTSpellerInterop.cs (5)
382segmentCount += sentence.Segments.Count; 386for (int i = 0; continueIteration && (i < sentence.Segments.Count); i++) 1013for (int i = 0; result && (i < SubSegments.Count); i++) 1070if (Segments.Count > 0) 1072ITextRange textRange = Segments[Segments.Count - 1].TextRange;
System\Windows\Documents\WinRTSpellerInteropExtensions.cs (4)
60if (tokens.Count == 0) 68for (int i = 0; i < tokens.Count; i++) 110if (tokens.Count > 0 && 112spellChecker.HasErrors(tokens[tokens.Count - 1].Text) &&
Roslyn.Diagnostics.Analyzers (40)
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (1)
122while (index < existingMembers.Count)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (2)
102if (statementIndex + 1 < state.OutermostBlockStatements.Count && 149if (statementIndex + 1 < state.OutermostBlockStatements.Count)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
18if (changesInNextVersion.Count == 0) 27var newChange = changesInNextVersion.Count == 1
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (13)
198return readOnlyCollection.Count == 0; 226return source.Count == 0; 463if (source is null or { Count: 0 }) 466var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 475if (source is null or { Count: 0 }) 478var builder = new FixedSizeArrayBuilder<TResult>(source.Count); 509if (source is null or { Count: 0 }) 513var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 522if (source is null or { Count: 0 }) 526var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 535if (source is null or { Count: 0 }) 539var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 655for (int i = 0, length = list.Count; i < length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\IListExtensions.cs (2)
36switch (list.Count) 50for (int i = 0, n = list.Count; i < n; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IDictionaryExtensions.cs (2)
14=> dictionary.Count == other.Count &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
45if (spansToFormat.Count == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (3)
48Contract.ThrowIfFalse(spans.Count > 0); 50if (spans.Count == 1) 60for (var i = 1; i < spans.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyListExtensions.cs (2)
23=> list[list.Count - 1]; 27for (var index = startIndex; index < list.Count; index++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (1)
112var length = list.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
91var result = new FixedSizeArrayBuilder<TResult>(tasks.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamespaceOrTypeSymbolExtensions.cs (4)
45for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++) 72return names1.Count - names2.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (4)
38if (insertionIndex >= existingParameters.Count) 44syntaxFacts, existingParameters[existingParameters.Count - 1], includeLeadingNewLine: true); 154if (parameters.Count <= 1) 160for (int i = 1, n = parameters.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
78if (textChanges.Count > 1 || 79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
1587For i = 0 To nodes.Count - 1
rzc (2)
Json\JsonDataWriter.cs (1)
165var count = elements.Count;
RazorSourceGeneratorHost.cs (1)
80var builder = ImmutableArray.CreateBuilder<AdditionalText>(files.Count);
SelectTests (31)
GraphAffectedProjects.cs (1)
135if (changedPaths.Count == 0)
Program.cs (29)
682if (cause.Path is { Count: > 0 }) 762var fileWord = changedFiles.Count == 1 ? "changed file" : "changed files"; 764var advisoryWord = advisoryTargets.Count == 1 ? "target" : "targets"; 766$"**{prTests.Count} / {allPrTestProjects} PR test projects · {prJobs.Count} PR {jobWord} · {advisoryTargets.Count} advisory-only {advisoryWord}**, from {changedFiles.Count} {fileWord}."); 812sb.AppendLine(CultureInfo.InvariantCulture, $"### Advisory workflow impact ({targets.Count})"); 814if (targets.Count == 0) 886if (orderedGroups.Count > 0 && tests.Count >= 10 && orderedGroups[0].Value.Count >= 5) 890$"⚠️ {top.Value.Count} of the {tests.Count} selected test projects come from a single change — {CauseGroupDescriptor(top.Key)}."); 923if (jobs.Count == 0) 950return items.Count <= InlineLimit 951? $"**{items.Count}** {label}: {joined}" 952: $"**{items.Count}** {label}\n<details><summary>show {items.Count}</summary>\n\n{joined}\n</details>"; 959if (member.Value is { Kind: CauseKind.Layer1Graph, Path: { Count: > 0 } path }) 962var hops = path.Count - 2; 978CauseKind.Layer1Graph => $"file:{(cause.Path is { Count: > 0 } path ? path[0] : "(changed source)")}", 1043if (!causes.TryGetValue(key, out var list) || list.Count == 0) 1105sb.AppendLine(CultureInfo.InvariantCulture, $"- layer 1 (affected-projects graph): {(options.SkipLayer1 || options.ForceAll ? "skipped" : $"{layer1Affected.Count} affected project(s) (production + test)")}"); 1109sb.AppendLine(CultureInfo.InvariantCulture, $"### Changed files ({changedFiles.Count})"); 1124if (excludedFiles.Count > 0) 1126sb.AppendLine(CultureInfo.InvariantCulture, $"### Pre-filtered (excluded) files ({excludedFiles.Count})"); 1172$"- advisory-only targets: {(advisoryTargets.Count == 0 ? "(none)" : string.Join(", ", advisoryTargets.Select(target => target.Token)))}"); 1185$"- advisory-only targets: {(advisoryTargets.Count == 0 ? "(none)" : string.Join(", ", advisoryTargets.Select(target => target.Token)))}"); 1223builder.AppendLine(CultureInfo.InvariantCulture, $"<details><summary>{title} ({keys.Count})</summary>"); 1243builder.AppendLine(CultureInfo.InvariantCulture, $"<details><summary>{title} ({projects.Count})</summary>"); 1302if (cause.Path is not { Count: > 0 } path) 1308var hops = path.Count - 2; 1323CauseKind.Layer1Graph => cause.Path is { Count: > 0 } path
TestSelector.cs (1)
334var path = new List<string>(affectedPath.ProjectChain.Count + 1) { affectedPath.ChangedFile };
Shared (6)
EmptyCollections\EmptyCollectionExtensions.cs (4)
33=> collection == null || collection.Count == 0 ? EmptyReadOnlyList<T>.Instance : collection; 63=> list == null || list.Count == 0 ? EmptyReadOnlyList<T>.Instance : list; 106if (enumerable is IReadOnlyCollection<T> rc && rc.Count == 0) 133if (dictionary == null || dictionary.Count == 0)
LogBuffering\SerializedLogRecordFactory.cs (1)
30for (int i = 0; i < attributes.Count; i++)
Throw\Throw.cs (1)
275if (readOnlyCollection.Count == 0)
Shared.Tests (1)
JsonSchemaExporter\TestTypes.cs (1)
1176public int Count => _dictionary.Count;
Stress.AppHost (1)
CommandResources.cs (1)
1386if (arguments is { Count: > 0 })
System.Collections.Immutable (20)
System\Collections\Frozen\EmptyFrozenSet.cs (1)
45other is IReadOnlyCollection<T> s ? s.Count == 0 : // TODO https://github.com/dotnet/runtime/issues/42254: Remove if/when Any includes this check
System\Collections\Frozen\FrozenSetInternalBase.cs (2)
92return _thisSet.Count <= otherAsSet.Count && IsSubsetOfSetWithCompatibleComparer(otherAsSet); 152return _thisSet.Count == otherAsSet.Count && ContainsAllElements(otherAsSet);
System\Collections\Immutable\ImmutableEnumerableDebuggerProxy.cs (1)
50??= _dictionary.Select(kv => new DebugViewDictionaryItem<TKey, TValue>(kv)).ToArray(_dictionary.Count);
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (1)
49count = readOnlyCollection.Count;
System\Collections\Immutable\ImmutableList_1.cs (2)
1183if (list.Count == 0) 1188Node root = Node.NodeTreeFromList(list, 0, list.Count);
System\Collections\Immutable\ImmutableList_1.Node.cs (1)
1571return NodeTreeFromList(list, 0, list.Count);
System\Collections\Immutable\ImmutableList.cs (10)
149return list.IndexOf(item, 0, list.Count, EqualityComparer<T>.Default); 170return list.IndexOf(item, 0, list.Count, equalityComparer); 195return list.IndexOf(item, startIndex, list.Count - startIndex, EqualityComparer<T>.Default); 243if (list.Count == 0) 249return list.LastIndexOf(item, list.Count - 1, list.Count, EqualityComparer<T>.Default); 270if (list.Count == 0) 276return list.LastIndexOf(item, list.Count - 1, list.Count, equalityComparer); 301if (list.Count == 0 && startIndex == 0)
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (1)
236return NodeTreeFromList(list, 0, list.Count);
System\Collections\Immutable\KeysOrValuesCollectionAccessor.cs (1)
55get { return _dictionary.Count; }
System.CommandLine (36)
ArgumentArity.cs (1)
85int tokenCount = argumentResult.Tokens.Count;
ArgumentValidation.cs (4)
83for (var i = 0; i < result.Tokens.Count; i++) 108for (var i = 0; i < result.Tokens.Count; i++) 161for (var i = 0; i < argumentResult.Tokens.Count; i++) 183for (var i = 0; i < result.Tokens.Count; i++)
Binding\ArgumentConverter.cs (7)
27if (argumentResult.Tokens.Count == 0) 89var values = CreateEnumerable(type, itemType, tokens.Count); 92for (var i = 0; i < tokens.Count; i++) 117i = tokens.Count; 144convert(result.Tokens[result.Tokens.Count - 1].Value, out value); 223argumentResult.Tokens.Count > 0 224? argumentResult.Tokens[argumentResult.Tokens.Count - 1]
Completions\CompletionContext.cs (1)
82if (parseResult.UnmatchedTokens.Count > 0 ||
EnvironmentVariablesDirective.cs (1)
50for (int i = 0; i < directiveResult.Values.Count; i++)
Help\HelpBuilder.cs (2)
223if (items.Count == 0) 243for (var i = 0; i < items.Count; i++)
Invocation\InvocationPipeline.cs (3)
23for (int i = 0; i < parseResult.PreActions.Count; i++) 106for (var i = 0; i < parseResult.PreActions.Count; i++) 158if (parseResult.Errors.Count > 0)
Invocation\ParseErrorAction.cs (2)
92for (var i = 0; i < unmatchedTokens.Count; i++) 109if (unmatchedTokens.Count != 0)
LocalizationResources.cs (1)
20=> GetResourceString(Properties.Resources.OptionExpectsOneArgument, GetOptionName(optionResult), optionResult.Tokens.Count);
ParseResult.cs (2)
108=> _unmatchedTokens.Count == 0 ? Array.Empty<string>() : _unmatchedTokens.Select(t => t.Value).ToArray(); 310for (var i = 0; i < PreActions.Count; i++)
Parsing\ArgumentResult.cs (1)
225Tokens.Count > 0
Parsing\CommandResult.cs (1)
44=> argumentResult.Argument.HasDefaultValue && argumentResult.Tokens.Count == 0;
Parsing\OptionResult.cs (3)
58=> Option.Argument.Arity.MaximumNumberOfValues == (Implicit ? Tokens.Count - 1 : Tokens.Count); 70return Tokens.Count is 0 &&
Parsing\ParseDiagramAction.cs (3)
24return parseResult.Errors.Count == 0 ? 0 : _parseErrorReturnValue; 39if (unmatchedTokens.Count > 0) 43for (var i = 0; i < unmatchedTokens.Count; i++)
Parsing\StringExtensions.cs (4)
44var tokenList = new List<Token>(args.Count); 52for (; i < args.Count; i++) 114if (newTokens is not null && newTokens.Count > 0) 271if (args.Count > 0)
System.CommandLine.StaticCompletions (1)
CompletionsCommandDefinition.cs (1)
26if (argumentResult.Tokens.Count == 0)
System.Formats.Nrbf (3)
System\Formats\Nrbf\ArrayRectangularPrimitiveRecord.cs (2)
54for (int i = 0; i < _values.Count; i++) 77Debug.Assert(numElementsWritten == (uint)_values.Count, "We should have traversed the entirety of the source values collection.");
System\Formats\Nrbf\ClassRecord.cs (1)
38internal int ExpectedValuesCount => MemberTypeInfo.Infos.Count;
System.Linq.Expressions (41)
System\Dynamic\Utils\ExpressionUtils.cs (3)
253return current.Count == 0; 269return current.Count == 0; 286int count = current.Count;
System\Linq\Expressions\BlockExpression.cs (5)
471Debug.Assert(expressions.Count != 0); 481Debug.Assert(index >= 0 && index < _expressions.Count); 486internal override int ExpressionCount => _expressions.Count; 618internal override int ExpressionCount => _body.Count; 1090return expressions.Count switch
System\Linq\Expressions\Compiler\CompilerScope.cs (1)
102Definitions = new Dictionary<ParameterExpression, VariableStorageKind>(variables.Count);
System\Linq\Expressions\DebugViewWriter.cs (1)
262if (open == '{' || expressions.Count > 1)
System\Linq\Expressions\DynamicExpression.cs (2)
507int IArgumentProvider.ArgumentCount => _arguments.Count; 854switch (argumentList.Count)
System\Linq\Expressions\Expression.cs (1)
242for (int i = 0, n = items.Count; i < n; i++)
System\Linq\Expressions\IndexExpression.cs (3)
31Debug.Assert(instance.Type.GetArrayRank() == arguments.Count); 110public int ArgumentCount => _arguments.Count; 123Debug.Assert(arguments == null || arguments.Length == _arguments.Count);
System\Linq\Expressions\Interpreter\InstructionList.cs (1)
122for (int i = 0, n = instructions.Count; i < n; i++)
System\Linq\Expressions\InvocationExpression.cs (3)
142public override int ArgumentCount => _arguments.Count; 147Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 715switch (argumentList.Count)
System\Linq\Expressions\LambdaExpression.cs (3)
311return parameters.Count switch 573internal override int ParameterCount => _parameters.Count; 585Debug.Assert(parameters == null || parameters.Length == _parameters.Count);
System\Linq\Expressions\MethodCallExpression.cs (17)
179public override int ArgumentCount => _arguments.Count; 192Debug.Assert(args == null || args.Count == _arguments.Count); 210public override int ArgumentCount => _arguments.Count; 223Debug.Assert(args == null || args.Count == _arguments.Count); 254Debug.Assert(args == null || args.Count == 0); 301Debug.Assert(args == null || args.Count == 1); 367Debug.Assert(args == null || args.Count == 2); 438Debug.Assert(args == null || args.Count == 3); 515Debug.Assert(args == null || args.Count == 4); 598Debug.Assert(args == null || args.Count == 5); 634Debug.Assert(args == null || args.Count == 0); 683Debug.Assert(args == null || args.Count == 1); 748Debug.Assert(args == null || args.Count == 2); 819Debug.Assert(args == null || args.Count == 3); 1193int argCount = argumentList.Count;
System\Linq\Expressions\NewExpression.cs (1)
61public int ArgumentCount => _arguments.Count;
System.Net.Http (2)
System\Net\Http\DiagnosticsHandler.cs (2)
36if (autoRedirect && _propagator.Fields is IReadOnlyCollection<string> fields && fields.Count > 0) 38var fieldDescriptors = new List<HeaderDescriptor>(fields.Count);
System.Net.NameResolution (5)
System\Net\DnsResolver.cs (4)
476string[] answers = new string[records.Count]; 477for (int i = 0; i < records.Count; i++) 488if (a.Records.Count > 0 || b.Records.Count > 0)
System\Net\DnsResolverPal.Managed.cs (1)
395Debug.Assert(serverList.Count > 0);
System.Private.CoreLib (8)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (1)
289IReadOnlyCollection<KeyValuePair<TKey, TValue>> rc => Math.Max(DefaultCapacity, rc.Count),
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (7)
60MemoryHandle[] handles = new MemoryHandle[buffers.Count]; 61Span<Interop.Sys.IOVector> vectors = buffers.Count <= IovStackThreshold ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[buffers.Count]; 66int buffersCount = buffers.Count; 79result = Interop.Sys.PReadV(handle, pinnedVectors, buffers.Count, fileOffset); 89result = Interop.Sys.ReadV(handle, pinnedVectors, buffers.Count); 177int buffersCount = buffers.Count;
System.Private.Windows.Core (17)
System\Collections\Generic\CollectionExtensions.cs (1)
18ArgumentOutOfRangeException.ThrowIfLessThan(readOnlyList.Count, count, nameof(count));
System\IO\BinaryReaderExtensions.cs (2)
204if (values.Count == 0) 280for (int i = 0; i < values.Count; i++)
System\IO\BinaryWriterExtensions.cs (2)
32for (int i = 0; i < memberTypeInfo.Count; i++) 37for (int i = 0; i < memberTypeInfo.Count; i++)
System\Private\Windows\BinaryFormat\Serializer\ArrayRecord.cs (1)
64if (arrayInfo.Length != arrayObjects.Count)
System\Private\Windows\BinaryFormat\Serializer\ArraySingleObject.cs (1)
23: base(new ArrayInfo(objectId, arrayObjects.Count), arrayObjects)
System\Private\Windows\BinaryFormat\Serializer\ArraySinglePrimitive.cs (1)
29: base(new ArrayInfo(objectId, arrayObjects.Count), arrayObjects)
System\Private\Windows\BinaryFormat\Serializer\ArraySingleString.cs (1)
23: base(new ArrayInfo(objectId, arrayObjects.Count), new StringListAdapter(arrayObjects, recordMap))
System\Private\Windows\BinaryFormat\Serializer\ArraySingleString.StringListAdapter.cs (2)
30int IReadOnlyCollection<string?>.Count => _recordList.Count; 38for (int i = 0; i < _recordList.Count; i++)
System\Private\Windows\BinaryFormat\Serializer\ClassInfo.cs (1)
33writer.Write(MemberNames.Count);
System\Private\Windows\BinaryFormat\Serializer\ClassRecord.cs (2)
33for (int i = 0; i < ClassInfo.MemberNames.Count; i++) 64for (int i = 0; i < memberTypeInfo.Count; i++)
System\Private\Windows\BinaryFormat\Serializer\Record.cs (1)
91for (int i = 0; i < objects.Count; i++)
System\Private\Windows\Ole\DataFormatsCore.cs (2)
65for (int i = 0; i < formats.Count; i++) 128for (int i = 0; i < formats.Count; i++)
System.Reflection.Metadata (8)
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (8)
72if (baseTableRowCounts.Count != MetadataTokens.TableCount) 82if (baseHeapSizes.Count != MetadataTokens.HeapCount) 88if (deltaReaders == null || deltaReaders.Count == 0) 93for (int i = 0; i < deltaReaders.Count; i++) 140int generationCount = 1 + deltaReaders.Count; 152for (int r = 0; r < deltaReaders.Count; r++) 172var rowCounts = GetBaseRowCounts(baseRowCounts, generations: 1 + deltaReaders.Count); 174for (int generation = 1; generation <= deltaReaders.Count; generation++)
System.Text.Json (3)
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (2)
617Debug.Assert(entries.Count > 0, "Should not build a chained accessor for an empty entry list."); 635for (int i = 0; i < entries.Count; i++)
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (1)
238int count = entries.Count;
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Emitter.cs (1)
152if (experimentalDiagnosticIds is { Count: > 0 })
System.Windows.Forms (17)
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (1)
149if (index >= entries.Count)
System\Windows\Forms\Controls\ListView\ListView.ListViewAccessibleObject.cs (7)
100return index < visibleGroups.Count ? visibleGroups[index].AccessibilityObject : null; 113int count = owningListView.GroupsDisplayed ? GetVisibleGroups().Count : owningListView.Items.Count; 142for (int i = 0; i < visibleGroups.Count; i++) 216return visibleGroups.Count == 0 ? null : visibleGroups[visibleGroups.Count - 1].AccessibilityObject; 275&& listViewGroupAccessibleObject.GetVisibleItems().Count > 0) 297for (int i = 0; i < visibleGroups.Count; i++)
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (6)
139private bool IsEmpty => GetVisibleItems().Count == 0; 242return visibleItems.Count > 0 ? visibleItems[visibleItems.Count - 1].AccessibilityObject : null; 257if (index >= visibleItems.Count) 273for (int i = 0; i < visibleItems.Count; i++) 291return GetVisibleItems().Count;
System\Windows\Forms\Controls\PropertyGrid\GridItemCollection.cs (3)
25public int Count => _entries.Count; 54if (_entries.Count > 0) 56for (int i = 0; i < _entries.Count; i++)
System.Windows.Forms.Design (3)
System\Windows\Forms\Design\DesignerUtils.cs (2)
765List<IComponent> newObjects = new(objects.Count); 778Debug.Assert(newObjects.Count == objects.Count, "Why is the count of the copied objects not the same?");
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
1912for (int i = 0; i < components.Count; i++)
System.Xaml (2)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Parser\SpecialBracketCharacters.cs (1)
36if (attributeList is not null && attributeList.Count > 0)
System\Xaml\XamlSchemaContext.cs (1)
596SpecialBracketCharacters splBracketCharacters = markupExtensionBracketCharactersList is not null && markupExtensionBracketCharactersList.Count > 0
TypeScriptApiCompat (10)
ApiCompatReport.cs (7)
23if (result.SuppressedDiagnostics.Count > 0) 26builder.AppendLine(string.Format(CultureInfo.InvariantCulture, "Suppressed diagnostics: {0}", result.SuppressedDiagnostics.Count)); 32if (result.UnsuppressedDiagnostics.Count > 0) 44if (result.SuppressionErrors.Count > 0) 56if (result.UnusedSuppressions.Count > 0) 68if (result.SuppressedDiagnostics.Count > 0) 83if (result.ExcludedPackages.Count == 0)
ApiCompatResult.cs (3)
14UnsuppressedDiagnostics.Count > 0 || 15UnusedSuppressions.Count > 0 || 16SuppressionErrors.Count > 0;
vbc (2)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
467writer.Write(TelemetryEvents.Count);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
485if (environmentVariables.Count == 0)
VBCSCompiler (2)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
467writer.Write(TelemetryEvents.Count);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
485if (environmentVariables.Count == 0)