211 references to SingleOrDefault
Aspire.Dashboard.Tests (3)
Integration\FrontendBrowserTokenAuthTests.cs (1)
268return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
Integration\StartupTests.cs (2)
595return list?.SingleOrDefault(kvp => kvp.Key == key).Value; 677return list?.SingleOrDefault(kvp => kvp.Key == key).Value;
Aspire.Hosting (2)
ApplicationModel\EndpointReference.cs (1)
109_endpointAnnotation ??= Resource.Annotations.OfType<EndpointAnnotation>().SingleOrDefault(a => StringComparers.EndpointAnnotationName.Equals(a.Name, EndpointName));
ResourceBuilderExtensions.cs (1)
993var existingAnnotation = builder.Resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => a.Name == name);
Aspire.Hosting.Testing (1)
DistributedApplicationHostingTestingExtensions.cs (1)
69var resource = resources.SingleOrDefault(r => string.Equals(r.Name, resourceName, StringComparison.OrdinalIgnoreCase));
BoundTreeGenerator (1)
BoundNodeClassWriter.cs (1)
711if (FieldsIncludingOverrides(type).SingleOrDefault(f => f.Name == fieldName) is { } field)
BuildBoss (1)
ProjectUtil.cs (1)
164internal XElement FindSingleProperty(string localName) => GetAllPropertyGroupElements().SingleOrDefault(x => x.Name.LocalName == localName);
ClientSample (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
CodeGenerator (2)
src\Servers\Kestrel\shared\KnownHeaders.cs (2)
1508Header = headers.SingleOrDefault(knownHeader => string.Equals(knownHeader.Name, g.Key, StringComparison.OrdinalIgnoreCase)), 1529Header = headers.SingleOrDefault(knownHeader => string.Equals(knownHeader.Name, g.Key, StringComparison.OrdinalIgnoreCase)),
Crossgen2Tasks (1)
ResolveReadyToRunCompilers.cs (1)
200return packs.SingleOrDefault(
dotnet-dev-certs (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
dotnet-getdocument (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
dotnet-openapi (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
dotnet-sql-cache (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (1)
512MethodInfo matchingMethod = type.GetTypeInfo().DeclaredMethods.SingleOrDefault(m => MethodsMatch(m, methodInfo));
dotnet-user-jwts (7)
Helpers\SigningKeysHandler.cs (2)
41?.SingleOrDefault(key => key.Issuer == issuer); 85var toRemove = signingKeys.SingleOrDefault(key => key["Issuer"].GetValue<string>() == issuer);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
dotnet-user-secrets (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
GetDocument.Insider (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
Identity.DefaultUI.WebSite (4)
src\Identity\test\InMemory.Test\InMemoryUserStore.cs (4)
176user.Logins.SingleOrDefault( 348user.Tokens.SingleOrDefault( 372user.Tokens.SingleOrDefault( 386user.Tokens.SingleOrDefault(
IntegrationTestsWebsite (1)
Infrastructure\DynamicEndpointDataSource.cs (1)
43.SingleOrDefault(e => e.RoutePattern.RawText == routeEndpoint.RoutePattern.RawText);
InteropWebsite (1)
TestServiceImpl.cs (1)
137var encoding = context.GetHttpContext().Request.Headers.SingleOrDefault(h => string.Equals(h.Key, "grpc-encoding", StringComparison.OrdinalIgnoreCase)).Value.SingleOrDefault();
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
106var op = invocationOp.Arguments[LogLevelParamIndex].Descendants().SingleOrDefault(x => x.Kind == OperationKind.Literal || x.Kind == OperationKind.FieldReference);
Microsoft.AspNetCore.App.Analyzers.Test (1)
Http\HeaderDictionaryIndexerAnalyzerTests.cs (1)
183var mapping = propertyMapping.SingleOrDefault(kvp => kvp.Value == propertyName);
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerConfigureOptions.cs (1)
85.SingleOrDefault(key => key["Issuer"] == issuer);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (2)
UserJwtsTests.cs (2)
522Assert.NotNull(signingKeys.SingleOrDefault(signingKey => signingKey["Issuer"].GetValue<string>() == "test-issuer")); 523Assert.NotNull(signingKeys.SingleOrDefault(signingKey => signingKey["Issuer"].GetValue<string>() == "test-issuer-2"));
Microsoft.AspNetCore.Authentication.Test (6)
CookieTests.cs (2)
1754var claim = transaction.ResponseElement.Elements("claim").SingleOrDefault(elt => elt.Attribute("type").Value == claimType); 1764var property = transaction.ResponseElement.Elements("extra").SingleOrDefault(elt => elt.Attribute("type").Value == key);
OpenIdConnect\TestTransaction.cs (1)
27var authCookie = SetCookie.SingleOrDefault(c => c.Contains(".AspNetCore.Cookies="));
Transaction.cs (3)
25var authCookie = SetCookie.SingleOrDefault(c => c.Contains(".AspNetCore." + TestExtensions.CookieAuthenticationScheme + "=")); 39.SingleOrDefault(elt => elt.Attribute("type").Value == claimType && 51.SingleOrDefault(elt => elt.Attribute("name").Value == name);
Microsoft.AspNetCore.Authorization.Test (1)
TestObjects\TestAuthenticationService.cs (1)
24var identity = context.User.Identities.SingleOrDefault(i => i.AuthenticationType == scheme);
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
Microsoft.AspNetCore.CookiePolicy.Test (2)
Transaction.cs (2)
26var authCookie = SetCookie.SingleOrDefault(c => c.Contains(".AspNetCore." + TestExtensions.CookieAuthenticationScheme + "=")); 40.SingleOrDefault(elt => elt.Attribute("type").Value == claimType &&
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
444requestParameter = methodInfo.GetParameters().SingleOrDefault(p => p.Name == "request");
Microsoft.AspNetCore.Grpc.Swagger (3)
Internal\GrpcDataContractResolver.cs (1)
38var match = enumDescriptor.Values.SingleOrDefault(v => v.Number == (int)value);
Internal\GrpcJsonTranscodingDescriptionProvider.cs (1)
178var routeParameter = routeParameters.SingleOrDefault(kvp => kvp.Value.RouteVariable.StartSegment == i).Value;
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
444requestParameter = methodInfo.GetParameters().SingleOrDefault(p => p.Name == "request");
Microsoft.AspNetCore.Hosting.Tests (2)
WebHostBuilderTests.cs (2)
1684var heDescriptor = services.SingleOrDefault(s => s.ServiceType == typeof(IHostingEnvironment)); 1688var wheDescriptor = services.SingleOrDefault(s => s.ServiceType == typeof(IWebHostEnvironment));
Microsoft.AspNetCore.Http.Extensions (1)
src\Shared\ParameterBindingMethodCache.cs (1)
377var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0);
Microsoft.AspNetCore.Identity.InMemory.Test (9)
FunctionalTest.cs (1)
283var claim = transaction.ResponseElement.Elements("claim").SingleOrDefault(elt => elt.Attribute("type").Value == claimType);
InMemoryStore.cs (4)
20var roleEntity = _roles.Values.SingleOrDefault(r => r.NormalizedName == role); 31var roleObject = _roles.Values.SingleOrDefault(r => r.NormalizedName == role); 32var roleEntity = user.Roles.SingleOrDefault(ur => ur.RoleId == roleObject.Id); 52var roleObject = _roles.Values.SingleOrDefault(r => r.NormalizedName == role);
InMemoryUserStore.cs (4)
176user.Logins.SingleOrDefault( 348user.Tokens.SingleOrDefault( 372user.Tokens.SingleOrDefault( 386user.Tokens.SingleOrDefault(
Microsoft.AspNetCore.Mvc.Abstractions (1)
src\Shared\ParameterBindingMethodCache.cs (1)
377var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0);
Microsoft.AspNetCore.Mvc.Core.Test (2)
ApplicationModels\DefaultApplicationModelProviderTest.cs (2)
600var method = typeInfo.AsType().GetMethods().SingleOrDefault(m => (m == methodInfo)); 672var method = typeInfo.AsType().GetMethods().SingleOrDefault(m => (m == methodInfo));
Microsoft.AspNetCore.OpenApi (3)
Services\OpenApiDocumentService.cs (2)
553.SingleOrDefault(parameter => parameter.Name == description.Name)? 684.SingleOrDefault(metadata => metadata.Name == parameter.Name);
src\Shared\ParameterBindingMethodCache.cs (1)
377var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
ConnectionDispatcherTests.cs (1)
66var critical = TestSink.Writes.SingleOrDefault(m => m.LogLevel == LogLevel.Critical);
src\Servers\Kestrel\shared\KnownHeaders.cs (2)
1508Header = headers.SingleOrDefault(knownHeader => string.Equals(knownHeader.Name, g.Key, StringComparison.OrdinalIgnoreCase)), 1529Header = headers.SingleOrDefault(knownHeader => string.Equals(knownHeader.Name, g.Key, StringComparison.OrdinalIgnoreCase)),
Microsoft.AspNetCore.Shared.Tests (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
HubConnectionTests.cs (2)
1389var errorLog = server.GetLogs().SingleOrDefault(r => r.Write.EventId.Name == "FailedWritingMessage"); 1443var errorLog = server.GetLogs().SingleOrDefault(r => r.Write.EventId.Name == "FailedWritingMessage");
Microsoft.AspNetCore.SignalR.Client.Tests (3)
HubConnectionTests.Reconnect.cs (2)
361var attemptsLog = logs.SingleOrDefault(r => r.Write.EventId.Name == "ReconnectAttemptsExhausted"); 366var waitingLog = logs.SingleOrDefault(r => r.Write.EventId.Name == "AwaitingReconnectRetryDelay");
LongPollingTransportTests.cs (1)
692var deleteRequest = handler.ReceivedRequests.SingleOrDefault(r => r.Method == HttpMethod.Delete);
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
HubProtocolHelpers.cs (1)
28var protocol = AllProtocols.SingleOrDefault(p => p.Name == name);
Microsoft.Build.Engine.OM.UnitTests (8)
Definition\Project_Tests.cs (8)
3909ProjectImportedEventArgs eventArgs = logger.AllBuildEvents.SingleOrDefault(i => i is ProjectImportedEventArgs) as ProjectImportedEventArgs; 3950ProjectImportedEventArgs eventArgs = logger.AllBuildEvents.SingleOrDefault(i => i is ProjectImportedEventArgs) as ProjectImportedEventArgs; 3994ProjectImportedEventArgs eventArgs = logger.AllBuildEvents.SingleOrDefault(i => i is ProjectImportedEventArgs) as ProjectImportedEventArgs; 4041ProjectImportedEventArgs eventArgs = logger.AllBuildEvents.SingleOrDefault(i => i is ProjectImportedEventArgs) as ProjectImportedEventArgs; 4081ProjectImportedEventArgs eventArgs = logger.AllBuildEvents.SingleOrDefault(i => i is ProjectImportedEventArgs) as ProjectImportedEventArgs; 4124ProjectImportedEventArgs eventArgs = logger.AllBuildEvents.SingleOrDefault(i => i is ProjectImportedEventArgs) as ProjectImportedEventArgs; 4167ProjectImportedEventArgs eventArgs = logger.AllBuildEvents.SingleOrDefault(i => i is ProjectImportedEventArgs) as ProjectImportedEventArgs; 4213ProjectImportedEventArgs eventArgs = logger.AllBuildEvents.SingleOrDefault(i => i is ProjectImportedEventArgs) as ProjectImportedEventArgs;
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (10)
TargetTests.cs (10)
265var itemType = item.Metadata.SingleOrDefault(m => m.Name == "ItemType"); 269var metaName = item.Metadata.SingleOrDefault(m => m.Name == "MetadataName"); 273var customMeta = item.Metadata.SingleOrDefault(m => m.Name == metaName.EvaluatedValue); 307var itemType = item.Metadata.SingleOrDefault(m => m.Name == "ItemType"); 311var metaName = item.Metadata.SingleOrDefault(m => m.Name == "MetadataName"); 315var customMeta = item.Metadata.SingleOrDefault(m => m.Name == metaName.EvaluatedValue); 347var itemType = item.Metadata.SingleOrDefault(m => m.Name == "ItemType"); 351var metaName = item.Metadata.SingleOrDefault(m => m.Name == "MetadataName"); 382var itemType = item.Metadata.SingleOrDefault(m => m.Name == "ItemType"); 386var metaName = item.Metadata.SingleOrDefault(m => m.Name == "MetadataName");
Microsoft.CodeAnalysis (1)
InternalUtilities\EnumerableExtensions.cs (1)
268return source.Cast<T?>().SingleOrDefault(v => predicate(v!.Value));
Microsoft.CodeAnalysis.CodeStyle (1)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
268return source.Cast<T?>().SingleOrDefault(v => predicate(v!.Value));
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
115return compilation.SourceModule.GlobalNamespace.GetTypeMembers(WellKnownMemberNames.TopLevelStatementsEntryPointTypeName).OfType<SourceNamedTypeSymbol>().SingleOrDefault(s => s.IsSimpleProgram);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
RawStringLiteral\RawStringLiteralCommandHandlerTests.cs (1)
67var virtualSpaces = spans.SingleOrDefault(kvp => kvp.Key.StartsWith("VirtualSpaces#"));
StringCopyPaste\StringCopyPasteCommandHandlerTests.cs (1)
74var virtualSpaces = spans.SingleOrDefault(kvp => kvp.Key.StartsWith("VirtualSpaces#"));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Diagnostics\GenerateType\GenerateTypeTestState.cs (1)
34_testDocument = Workspace.Documents.SingleOrDefault(d => d.CursorPosition.HasValue);
ExtractInterface\ExtractInterfaceTestState.cs (1)
55_testDocument = Workspace.Documents.SingleOrDefault(d => d.CursorPosition.HasValue);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
Debugger\Engine\DkmClrType.cs (2)
275Name = (string)attributeData.NamedArguments.SingleOrDefault(arg => arg.MemberName == "Name").TypedValue.Value, 277TypeName = (string)attributeData.NamedArguments.SingleOrDefault(arg => arg.MemberName == "Type").TypedValue.Value,
Microsoft.CodeAnalysis.Test.Utilities (1)
CompilationVerifier.cs (1)
358var mscorlibModule = _allModuleData.SingleOrDefault(m => m.IsCorLib);
Microsoft.CodeAnalysis.UnitTests (1)
Collections\DebuggerAttributes.cs (1)
74.SingleOrDefault(a => a.AttributeType == typeof(DebuggerBrowsableAttribute));
Microsoft.CodeAnalysis.Workspaces (1)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
268return source.Cast<T?>().SingleOrDefault(v => predicate(v!.Value));
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
src\Workspaces\Core\MSBuild.BuildHost\Rpc\Contracts\MonoMSBuildDiscovery.cs (3)
150monoMSBuildDir.EnumerateDirectories().SingleOrDefault(d => d.Name == "Current") ?? 151monoMSBuildDir.EnumerateDirectories().SingleOrDefault(d => d.Name == "15.0"); 157s_monoMSBuildDirectory = versionDirectory.EnumerateDirectories().SingleOrDefault(d => string.Equals(d.Name, "bin", StringComparison.OrdinalIgnoreCase))?.FullName;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
Rpc\Contracts\MonoMSBuildDiscovery.cs (3)
150monoMSBuildDir.EnumerateDirectories().SingleOrDefault(d => d.Name == "Current") ?? 151monoMSBuildDir.EnumerateDirectories().SingleOrDefault(d => d.Name == "15.0"); 157s_monoMSBuildDirectory = versionDirectory.EnumerateDirectories().SingleOrDefault(d => string.Equals(d.Name, "bin", StringComparison.OrdinalIgnoreCase))?.FullName;
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
268return source.Cast<T?>().SingleOrDefault(v => predicate(v!.Value));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
185.SingleOrDefault(mr => mr.FilePath.Contains(name)); 190.SingleOrDefault(mr =>
Microsoft.DotNet.SignTool (1)
src\Configuration.cs (1)
206var wixPack = _wixPacks.SingleOrDefault(w => w.Moniker.Equals(file.FileName, StringComparison.OrdinalIgnoreCase));
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (1)
Modeler\MethodModel.cs (1)
70public ParameterModel BodyParameter => Parameters.SingleOrDefault(p => p.Location == null);
Microsoft.DotNet.VersionTools (1)
Dependencies\BuildOutput\FileRegexReleaseUpdater.cs (1)
20.SingleOrDefault(d => d.BuildInfo.Name == BuildInfoName);
Microsoft.Extensions.ApiDescription.Client.Tests (1)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\AcceptanceTests.cs (2)
118var enricher1 = sp.GetServices<IHttpClientLogEnricher>().SingleOrDefault(enn => enn is EnricherWithCounter) as EnricherWithCounter; 119var enricher2 = sp.GetServices<IHttpClientLogEnricher>().SingleOrDefault(enn => enn is TestEnricher) as TestEnricher;
Microsoft.VisualStudio.LanguageServices (4)
Venus\ContainedLanguageCodeSupport.cs (3)
115var nameAndId = GetCompatibleEventHandlers(document, className, objectTypeName, nameOfEvent, cancellationToken).SingleOrDefault(pair => pair.Item1 == eventHandlerName); 162var existingHandler = existingEventHandlers.SingleOrDefault(e => e.Item1 == eventHandlerName); 433ns = ns.GetNamespaceMembers().SingleOrDefault(n => n.Name == parts[i]);
Venus\VenusCommandFilter.cs (1)
85.SingleOrDefault(x => x.IntersectsWith(span));
Microsoft.VisualStudio.LanguageServices.LiveShare (2)
Client\RemoteLanguageServiceWorkspace.cs (2)
128=> _registeredExternalPaths.SingleOrDefault(externalPath => filePath.StartsWith(externalPath)); 131=> _remoteWorkspaceRootPaths.SingleOrDefault(remoteWorkspaceRoot => filePath.StartsWith(remoteWorkspaceRoot));
Mvc.RoutingWebSite (1)
RemoveControllerActionDescriptorProvider.cs (1)
30var controllerToRemove = _controllerTypes.SingleOrDefault(c => c.ControllerType == controllerActionDescriptor.ControllerTypeInfo);
RunTests (1)
TestHistoryManager.cs (1)
177var runForThisStage = runsInBuild.SingleOrDefault(r => r.Name.Contains(phaseName));
Swaggatherer (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
245.SingleOrDefault(m => string.Equals(m.Name, Method, StringComparison.Ordinal));
System.Composition.Hosting (2)
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (2)
28var dictionaryConstructor = ti.DeclaredConstructors.SingleOrDefault(ci => 43var parameterlessConstructor = ti.DeclaredConstructors.SingleOrDefault(ci => ci.IsPublic && ci.GetParameters().Length == 0);
System.Linq.Expressions (1)
System\Linq\Expressions\NewExpression.cs (1)
207ConstructorInfo? ci = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).SingleOrDefault(c => c.GetParametersCached().Length == 0);
System.Private.Windows.Core.TestUtilities (1)
DebuggerAttributes.cs (1)
61.SingleOrDefault(a => a.AttributeType == typeof(DebuggerBrowsableAttribute));
System.Windows.Forms.Design.Tests (1)
System\Drawing\Design\ColorEditorTests.CustomColorDialogTests.cs (1)
13Type? typeCustomColorDialog = typeof(ColorEditor).Assembly.GetTypes().SingleOrDefault(t => t.Name == "CustomColorDialog");
Templates.Blazor.Tests (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
Templates.Blazor.WebAssembly.Auth.Tests (6)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
src\Shared\E2ETesting\BrowserFixture.cs (1)
47.SingleOrDefault(a => a.Key == "Microsoft.AspNetCore.InternalTesting.Selenium.Supported");
Templates.Blazor.WebAssembly.Tests (6)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
src\Shared\E2ETesting\BrowserFixture.cs (1)
47.SingleOrDefault(a => a.Key == "Microsoft.AspNetCore.InternalTesting.Selenium.Supported");
Templates.Mvc.Tests (6)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
src\Shared\E2ETesting\BrowserFixture.cs (1)
47.SingleOrDefault(a => a.Key == "Microsoft.AspNetCore.InternalTesting.Selenium.Supported");
Templates.Tests (7)
BaselineTest.cs (1)
109.SingleOrDefault(line => line.StartsWith(namespaceDeclarationPrefix, StringComparison.Ordinal))
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
src\Shared\E2ETesting\BrowserFixture.cs (1)
47.SingleOrDefault(a => a.Key == "Microsoft.AspNetCore.InternalTesting.Selenium.Supported");
UnitTests.Common (1)
TestHelpers.cs (1)
233MessagePartDescription descPart = desc.SingleOrDefault((d) => String.Equals(dataPart.Name, d.Name));
Wasm.Performance.ConsoleHost (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
171option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal)); 250option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal)); 274option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal)); 455target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
51.SingleOrDefault(a => a.Key == "DotNetHostOverride")?.Value;
WinFormsControlsTest (1)
Dialogs.cs (1)
87Type? typeCustomColorDialog = typeof(ColorEditor).Assembly.GetTypes().SingleOrDefault(t => t.Name == "CustomColorDialog")