741 references to FirstOrDefault
ApplicationModelWebSite (2)
Aspire.Azure.Data.Tables.Tests (2)
Aspire.Azure.Storage.Blobs.Tests (1)
Aspire.Azure.Storage.Queues.Tests (1)
Aspire.Dashboard.Components.Tests (2)
Aspire.Dashboard.Tests (1)
Aspire.Hosting (1)
Aspire.Hosting.AWS (3)
Aspire.Hosting.Azure.Tests (3)
Aspire.Hosting.Testing.Tests (3)
Aspire.Hosting.Tests (1)
Aspire.Playground.Tests (1)
Aspire.Workload.Tests (1)
BasicTestApp (1)
BuildBoss (3)
ClientSample (1)
CodeGenerator (2)
ConfigurationSchemaGenerator (2)
Crossgen2Tasks (1)
dotnet-dev-certs (1)
dotnet-getdocument (1)
dotnet-openapi (1)
dotnet-sql-cache (1)
dotnet-svcutil-lib (18)
dotnet-svcutil-lib.Tests (1)
dotnet-user-jwts (2)
dotnet-user-secrets (2)
GetDocument.Insider (1)
IdeCoreBenchmarks (1)
Identity.DefaultUI.WebSite (1)
illink (5)
ILLink.RoslynAnalyzer (3)
InProcessWebSite (1)
Microsoft.Analyzers.Extra.Tests (4)
Microsoft.Analyzers.Local (3)
Microsoft.AspNetCore.App.Analyzers (8)
Microsoft.AspNetCore.App.UnitTests (1)
Microsoft.AspNetCore.Authentication.Test (2)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.WebAssembly (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.Cors.Test (4)
Microsoft.AspNetCore.DataProtection (3)
Microsoft.AspNetCore.Diagnostics (2)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Microsoft.AspNetCore.Grpc.Swagger (3)
Microsoft.AspNetCore.Hosting (3)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.Http.Connections.Tests (1)
Microsoft.AspNetCore.Http.Extensions (7)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
Microsoft.AspNetCore.Http.Tests (10)
Features\QueryFeatureTests.cs (10)
37Assert.Equal("value1", queryCollection["key1"].FirstOrDefault());
38Assert.Equal("value2", queryCollection["key2"].FirstOrDefault());
102Assert.Equal("valueB", queryCollection["key2"].FirstOrDefault());
117Assert.Equal("valueB", queryCollection["key2"].FirstOrDefault());
131Assert.Equal(string.Empty, queryCollection["key1"].FirstOrDefault());
132Assert.Equal(string.Empty, queryCollection["key2"].FirstOrDefault());
162Assert.Equal("", queryCollection["fields [todoItems]"].FirstOrDefault());
176Assert.Equal("fields [todoItems]", queryCollection[""].FirstOrDefault());
190Assert.Equal("", queryCollection["fields [todoItems]"].FirstOrDefault());
204Assert.Equal("[ 1 ]", queryCollection["fields [todoItems]"].FirstOrDefault());
Microsoft.AspNetCore.HttpLogging.Tests (2)
Microsoft.AspNetCore.HttpsPolicy.Tests (4)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (2)
Microsoft.AspNetCore.Identity.InMemory.Test (2)
Microsoft.AspNetCore.Identity.Specification.Tests (2)
Microsoft.AspNetCore.Identity.Test (1)
Microsoft.AspNetCore.InternalTesting (4)
Microsoft.AspNetCore.InternalTesting.Tests (1)
Microsoft.AspNetCore.Mvc.Abstractions (1)
Microsoft.AspNetCore.Mvc.Api.Analyzers (10)
Microsoft.AspNetCore.Mvc.ApiExplorer (5)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
Microsoft.AspNetCore.Mvc.Core (17)
Microsoft.AspNetCore.Mvc.Cors (4)
Microsoft.AspNetCore.Mvc.DataAnnotations (10)
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
Microsoft.AspNetCore.Mvc.Razor (1)
Microsoft.AspNetCore.Mvc.RazorPages (1)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (12)
ExpressionHelperTest.cs (12)
100(Expression<Func<IList<TestModel>, string>>)(model => model.FirstOrDefault().Name),
104(Expression<Func<IList<LowerModel>, string>>)(model => model.FirstOrDefault().name),
108(Expression<Func<IList<TestModel>, string>>)(model => model.FirstOrDefault().Model),
112(Expression<Func<IList<TestModel>, int>>)(model => model.FirstOrDefault().SelectedCategory.CategoryId),
116(Expression<Func<IList<TestModel>, string>>)(model => model.FirstOrDefault().SelectedCategory.CategoryName.MainCategory),
120(Expression<Func<IList<TestModel>, int>>)(model => model.FirstOrDefault().PreferredCategories.Count),
124(Expression<Func<IList<TestModel>, int>>)(model => model.FirstOrDefault().PreferredCategories.FirstOrDefault().CategoryId),
235(Expression<Func<IList<TestModel>, string>>)(model => model.FirstOrDefault().Name),
236(Expression<Func<IList<TestModel>, string>>)(model => model.FirstOrDefault().SelectedCategory.CategoryName.MainCategory),
237(Expression<Func<IList<TestModel>, int>>)(model => model.FirstOrDefault().PreferredCategories.FirstOrDefault().CategoryId),
Microsoft.AspNetCore.OpenApi (6)
Microsoft.AspNetCore.OpenApi.Tests (1)
Microsoft.AspNetCore.ResponseCompression (1)
Microsoft.AspNetCore.Rewrite (3)
Microsoft.AspNetCore.Rewrite.Tests (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Microsoft.AspNetCore.Shared.Tests (1)
Microsoft.AspNetCore.StaticFiles.Tests (2)
Microsoft.AspNetCore.TestHost (1)
Microsoft.AspNetCore.WebUtilities.Tests (11)
QueryHelpersTests.cs (11)
15Assert.Equal("value1", collection["key1"].FirstOrDefault());
16Assert.Equal("value2", collection["key2"].FirstOrDefault());
24Assert.Equal("value1", collection["key1"].FirstOrDefault());
25Assert.Equal("value2", collection["key2"].FirstOrDefault());
34Assert.Equal("valueB", collection["key2"].FirstOrDefault());
42Assert.Equal(string.Empty, collection["key1"].FirstOrDefault());
43Assert.Equal(string.Empty, collection["key2"].FirstOrDefault());
59Assert.Equal("", collection["fields [todoItems]"].FirstOrDefault());
67Assert.Equal("fields [todoItems]", collection[""].FirstOrDefault());
75Assert.Equal("", collection["fields [todoItems]"].FirstOrDefault());
83Assert.Equal("[ 1 ]", collection["fields [todoItems]"].FirstOrDefault());
Microsoft.Build (9)
Microsoft.Build.BuildCheck.UnitTests (1)
Microsoft.Build.CommandLine.UnitTests (1)
Microsoft.Build.Engine.OM.UnitTests (31)
Microsoft.Build.Engine.UnitTests (9)
Construction\SolutionProjectGenerator_Tests.cs (3)
2543ProjectInstance projectInstance = SolutionProjectGenerator.Generate(solutionFile, null, null, BuildEventContext.Invalid, CreateMockLoggingService(), new[] { "MyTarget" }).FirstOrDefault();
2604ProjectInstance projectInstance = SolutionProjectGenerator.Generate(solutionFile, null, null, BuildEventContext.Invalid, CreateMockLoggingService(), targetsToBuild).FirstOrDefault();
2721ProjectInstance projectInstance = SolutionProjectGenerator.Generate(solutionFile, globalProperties, null, BuildEventContext.Invalid, CreateMockLoggingService(), new[] { "Build" }).FirstOrDefault();
Microsoft.Build.Framework.UnitTests (1)
Microsoft.Build.Tasks.Core (4)
Microsoft.Build.Tasks.UnitTests (4)
Microsoft.Build.UnitTests.Shared (1)
Microsoft.Build.Utilities.Core (4)
Microsoft.Build.Utilities.UnitTests (1)
Microsoft.Cci.Extensions (12)
Microsoft.CodeAnalysis (3)
Microsoft.CodeAnalysis.CodeStyle (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (1)
70.FirstOrDefault();
Microsoft.CodeAnalysis.CodeStyle.Fixes (9)
Microsoft.CodeAnalysis.CSharp (8)
Microsoft.CodeAnalysis.CSharp.CodeStyle (8)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
73.FirstOrDefault();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (7)
Microsoft.CodeAnalysis.CSharp.Features (23)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
315.FirstOrDefault();
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
73.FirstOrDefault();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (29)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
Microsoft.CodeAnalysis.EditorFeatures (6)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (5)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
Microsoft.CodeAnalysis.Features (18)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Microsoft.CodeAnalysis.Rebuild (1)
Microsoft.CodeAnalysis.Scripting (3)
Microsoft.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (4)
Microsoft.CodeAnalysis.Workspaces (34)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (1)
70.FirstOrDefault();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (20)
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Microsoft.Data.Analysis.Tests (2)
Microsoft.DotNet.Arcade.Sdk (2)
Microsoft.DotNet.Arcade.Sdk.Tests (2)
Microsoft.DotNet.Build.Tasks.Packaging (2)
Microsoft.DotNet.Build.Tasks.Workloads (1)
Microsoft.DotNet.Build.Tasks.Workloads.Tests (13)
Microsoft.DotNet.Helix.Sdk (1)
Microsoft.DotNet.PackageTesting (1)
Microsoft.DotNet.RemoteExecutor (3)
Microsoft.DotNet.SignCheckLibrary (1)
Microsoft.DotNet.SignTool (4)
Microsoft.DotNet.SourceBuild.Tasks (2)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (4)
Microsoft.DotNet.VersionTools (2)
Microsoft.DotNet.XliffTasks (5)
Microsoft.DotNet.XUnitExtensions (4)
Microsoft.Extensions.AI (1)
Microsoft.Extensions.AI.Abstractions (5)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Microsoft.Gen.Logging (1)
Microsoft.ML.AutoML (1)
Microsoft.ML.CodeGenerator (4)
Microsoft.ML.Core (8)
Microsoft.ML.Data (4)
Microsoft.ML.EntryPoints (8)
Microsoft.ML.FastTree (1)
Microsoft.ML.TestFramework (2)
Microsoft.ML.Tests (1)
Microsoft.ML.TimeSeries (1)
Microsoft.TestUtilities (2)
Microsoft.VisualStudio.LanguageServices (12)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
Microsoft.VisualStudio.LanguageServices.Xaml (2)
MSBuild (1)
Mvc.RoutingWebSite (1)
RunTests (1)
ServerComparison.FunctionalTests (2)
Shared.Tests (1)
StaticFilesAuth (1)
Swaggatherer (1)
System.ComponentModel.Annotations (1)
System.ComponentModel.Composition (2)
System.ComponentModel.Composition.Registration (10)
System\ComponentModel\Composition\Registration\PartBuilder.cs (10)
256bool isConfigured = type.GetCustomAttributes(typeof(ExportAttribute), false).FirstOrDefault() != null || MemberHasExportMetadata(type);
275bool isConfigured = type.GetCustomAttributes(typeof(PartCreationPolicyAttribute), false).FirstOrDefault() != null;
289bool isConfigured = type.GetCustomAttributes(typeof(PartMetadataAttribute), false).FirstOrDefault() != null;
306bool isConfigured = type.GetCustomAttributes(typeof(PartMetadataAttribute), false).FirstOrDefault() != null;
326bool isConfigured = type.GetCustomAttributes(typeof(ExportAttribute), false).FirstOrDefault() != null || MemberHasExportMetadata(type);
424bool isConfigured = pi.GetCustomAttributes(typeof(ImportAttribute), false).FirstOrDefault() != null || pi.GetCustomAttributes(typeof(ImportManyAttribute), false).FirstOrDefault() != null;
472isConfigured = pi.GetCustomAttributes(typeof(ImportAttribute), false).FirstOrDefault() != null || pi.GetCustomAttributes(typeof(ImportManyAttribute), false).FirstOrDefault() != null;
512isConfigured = pi.GetCustomAttributes(typeof(ExportAttribute), false).FirstOrDefault() != null || MemberHasExportMetadata(pi);
System.Composition.Convention (11)
System.Linq.Parallel (1)
System.Private.DataContractSerialization (3)
System.Private.Windows.Core.TestUtilities (1)
System.Private.Xml.Linq (1)
System.Security.Cryptography.Pkcs (1)
System.ServiceModel.Federation.Tests (1)
System.Text.RegularExpressions.Generator (2)
System.Windows.Forms (1)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System.Windows.Forms.Primitives.TestUtilities (1)
System.Windows.Forms.Tests (3)
TaskUsageLogger (2)
Templates.Blazor.Tests (3)
Templates.Blazor.WebAssembly.Auth.Tests (3)
Templates.Blazor.WebAssembly.Tests (3)
Templates.Mvc.Tests (3)
Templates.Tests (3)
Wasm.Performance.ConsoleHost (1)
xunit.assert (1)