8255 references to Func
AnalyzerRunner (3)
aspire (4)
Aspire.Azure.Messaging.EventHubs.Tests (2)
Aspire.Azure.Security.KeyVault.Tests (2)
Aspire.Cli.Tests (26)
TestServices\TestAppHostBackchannel.cs (6)
12public Func<long, Task<long>>? PingAsyncCallback { get; set; }
18public Func<CancellationToken, Task<(string, string?)>>? GetDashboardUrlsAsyncCallback { get; set; }
21public Func<CancellationToken, IAsyncEnumerable<(string, string, string, string[])>>? GetResourceStatesAsyncCallback { get; set; }
27public Func<CancellationToken, Task<string[]>>? GetPublishersAsyncCallback { get; set; }
30public Func<CancellationToken, IAsyncEnumerable<(string, string, bool, bool)>>? GetPublishingActivitiesAsyncCallback { get; set; }
33public Func<CancellationToken, Task<string[]>>? GetCapabilitiesAsyncCallback { get; set; }
Utils\CliTestHelper.cs (10)
54public Func<IServiceProvider, IAnsiConsole> AnsiConsoleFactory { get; set; } = (IServiceProvider serviceProvider) =>
67public Func<IServiceProvider, INewCommandPrompter> NewCommandPrompterFactory { get; set; } = (IServiceProvider serviceProvider) =>
73public Func<IServiceProvider, IAddCommandPrompter> AddCommandPrompterFactory { get; set; } = (IServiceProvider serviceProvider) =>
79public Func<IServiceProvider, IPublishCommandPrompter> PublishCommandPrompterFactory { get; set; } = (IServiceProvider serviceProvider) =>
85public Func<IServiceProvider, IProjectLocator> ProjectLocatorFactory { get; set; } = (IServiceProvider serviceProvider) => {
91public Func<IServiceProvider, IInteractionService> InteractionServiceFactory { get; set; } = (IServiceProvider serviceProvider) => {
96public Func<IServiceProvider, ICertificateService> CertificateServiceFactory { get; set; } = (IServiceProvider serviceProvider) => {
101public Func<IServiceProvider, IDotNetCliRunner> DotNetCliRunnerFactory { get; set; } = (IServiceProvider serviceProvider) => {
106public Func<IServiceProvider, INuGetPackageCache> NuGetPackageCacheFactory { get; set; } = (IServiceProvider serviceProvider) => {
112public Func<IServiceProvider, IAppHostBackchannel> AppHostBackchannelFactory { get; set; } = (IServiceProvider serviceProvider) =>
Aspire.Confluent.Kafka (3)
Aspire.Dashboard (33)
Otlp\Model\OtlpHelpers.cs (2)
200public static KeyValuePair<string, string>[] ToKeyValuePairs(this RepeatedField<KeyValue> attributes, OtlpContext context, Func<KeyValue, bool> filter)
409public static PagedResult<TResult> GetItems<TSource, TResult>(IEnumerable<TSource> results, int startIndex, int count, bool isFull, Func<TSource, TResult>? select)
Telemetry\DashboardTelemetrySender.cs (4)
18private readonly Channel<(OperationContext, Func<HttpClient, Func<OperationContextProperty, object>, Task>)> _channel;
22internal Func<HttpClientHandler, HttpMessageHandler>? CreateHandler { get; set; }
38_channel = Channel.CreateBounded<(OperationContext, Func<HttpClient, Func<OperationContextProperty, object>, Task>)>(channelOptions);
162public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc)
Aspire.Dashboard.Components.Tests (13)
Aspire.Dashboard.Tests (15)
Aspire.Hosting (58)
ApplicationModel\ResourceNotificationService.cs (4)
407public async Task<ResourceEvent> WaitForResourceAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default)
416private async Task<ResourceEvent> WaitForResourceCoreAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default)
502public Task PublishUpdateAsync(IResource resource, string resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
662public async Task PublishUpdateAsync(IResource resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
Dcp\DcpExecutorEvents.cs (4)
13internal record OnResourceChangedContext(CancellationToken CancellationToken, string ResourceType, IResource Resource, string DcpResourceName, ResourceStatus Status, Func<CustomResourceSnapshot, CustomResourceSnapshot> UpdateSnapshot);
18private readonly ConcurrentDictionary<Type, Func<object, Task>> _eventSubscriptionListLookup = new();
20public void Subscribe<T>(Func<T, Task> callback) where T : notnull
31if (_eventSubscriptionListLookup.TryGetValue(typeof(T), out var callback))
ResourceBuilderExtensions.cs (9)
126public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, Func<EnvironmentCallbackContext, Task> callback) where T : IResourceWithEnvironment
262public static IResourceBuilder<T> WithArgs<T>(this IResourceBuilder<T> builder, Func<CommandLineArgsCallbackContext, Task> callback) where T : IResourceWithArgs
293public static IResourceBuilder<T> WithManifestPublishingCallback<T>(this IResourceBuilder<T> builder, Func<ManifestPublishingContext, Task> callback) where T : IResource
772public static IResourceBuilder<T> WithUrls<T>(this IResourceBuilder<T> builder, Func<ResourceUrlsCallbackContext, Task> callback)
864/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference, ResourceUrlAnnotation})"/>.
937public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference, ResourceUrlAnnotation> callback)
1369Func<ExecuteCommandContext, Task<ExecuteCommandResult>> executeCommand,
1430Func<ExecuteCommandContext, Task<ExecuteCommandResult>> executeCommand,
1431Func<UpdateCommandStateContext, ResourceCommandState>? updateState = null,
Aspire.Hosting.Analyzers (1)
Aspire.Hosting.Azure (3)
Aspire.Hosting.Azure.AppConfiguration (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.AppContainers (1)
Aspire.Hosting.Azure.CognitiveServices (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.EventHubs (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.Functions (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.KeyVault (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.Search (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.ServiceBus (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.SignalR (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.Storage (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.Tests (6)
Aspire.Hosting.Azure.WebPubSub (3)
src\Shared\AzureRoleAssignmentUtils.cs (3)
10internal static IResourceBuilder<T> WithRoleAssignments<T, TTarget, TBuiltInRole>(this IResourceBuilder<T> builder, IResourceBuilder<TTarget> target, Func<TBuiltInRole, string> getName, TBuiltInRole[] roles)
18internal static IResourceBuilder<T> WithDefaultRoleAssignments<T, TBuiltInRole>(this IResourceBuilder<T> builder, Func<TBuiltInRole, string> getName, params TBuiltInRole[] roles)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Testing.Tests (8)
Aspire.Hosting.Tests (17)
Aspire.Microsoft.Data.SqlClient (8)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (8)
Aspire.NATS.Net (5)
AspireNatsClientExtensions.cs (5)
33public static void AddNatsClient(this IHostApplicationBuilder builder, string connectionName, Func<NatsOpts, NatsOpts>? configureOptions)
41public static void AddNatsClient(this IHostApplicationBuilder builder, string connectionName, Action<NatsClientSettings>? configureSettings, Func<NatsOpts, NatsOpts>? configureOptions)
76public static void AddKeyedNatsClient(this IHostApplicationBuilder builder, string name, Func<NatsOpts, NatsOpts>? configureOptions)
92public static void AddKeyedNatsClient(this IHostApplicationBuilder builder, string name, Action<NatsClientSettings>? configureSettings, Func<NatsOpts, NatsOpts>? configureOptions)
206private static Func<IServiceProvider, NatsOpts, NatsOpts>? Wrap(Func<NatsOpts, NatsOpts>? func)
Aspire.NATS.Net.Tests (4)
Aspire.Playground.Tests (11)
Aspire.StackExchange.Redis (9)
Aspire.Templates.Tests (1)
Aspire.TestUtilities (2)
BasicWebSite (2)
BoundTreeGenerator (4)
BuildBoss (1)
CodeGenerator (2)
csc (2)
CustomEncryptorSample (1)
dotnet-svcutil-lib (10)
GenerateDocumentationAndConfigFiles (3)
GetDocument.Insider (11)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.4.25211.19\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (10)
41public static Func<string[], TWebHost>? ResolveWebHostFactory<TWebHost>(Assembly assembly)
46public static Func<string[], TWebHostBuilder>? ResolveWebHostBuilderFactory<TWebHostBuilder>(Assembly assembly)
51public static Func<string[], THostBuilder>? ResolveHostBuilderFactory<THostBuilder>(Assembly assembly)
62public static Func<string[], object>? ResolveHostFactory(Assembly assembly,
95private static Func<string[], T>? ResolveFactory<T>(Assembly assembly, string name)
122public static Func<string[], IServiceProvider?>? ResolveServiceProviderFactory(Assembly assembly, TimeSpan? waitTimeout = null)
125var webHostFactory = ResolveWebHostFactory<object>(assembly);
135var webHostBuilderFactory = ResolveWebHostBuilderFactory<object>(assembly);
146var hostBuilderFactory = ResolveHostBuilderFactory<object>(assembly);
157var hostFactory = ResolveHostFactory(assembly, waitTimeout: waitTimeout);
http2cat (5)
HttpStress (3)
IIS.FunctionalTests (7)
IIS.LongTests (15)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (8)
593private static Dictionary<string, Func<IISDeploymentParameters, string>> PortableConfigTransformations = InitPortableWebConfigTransformations();
600var action = PortableConfigTransformations[scenario];
607public static Dictionary<string, Func<IISDeploymentParameters, string>> InitPortableWebConfigTransformations()
609var dictionary = new Dictionary<string, Func<IISDeploymentParameters, string>>();
662private static Dictionary<string, Func<IISDeploymentParameters, string>> StandaloneConfigTransformations = InitStandaloneConfigTransformations();
670var action = StandaloneConfigTransformations[scenario];
678public static Dictionary<string, Func<IISDeploymentParameters, string>> InitStandaloneConfigTransformations()
680var dictionary = new Dictionary<string, Func<IISDeploymentParameters, string>>();
IIS.NewHandler.FunctionalTests (15)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (8)
593private static Dictionary<string, Func<IISDeploymentParameters, string>> PortableConfigTransformations = InitPortableWebConfigTransformations();
600var action = PortableConfigTransformations[scenario];
607public static Dictionary<string, Func<IISDeploymentParameters, string>> InitPortableWebConfigTransformations()
609var dictionary = new Dictionary<string, Func<IISDeploymentParameters, string>>();
662private static Dictionary<string, Func<IISDeploymentParameters, string>> StandaloneConfigTransformations = InitStandaloneConfigTransformations();
670var action = StandaloneConfigTransformations[scenario];
678public static Dictionary<string, Func<IISDeploymentParameters, string>> InitStandaloneConfigTransformations()
680var dictionary = new Dictionary<string, Func<IISDeploymentParameters, string>>();
IIS.NewShim.FunctionalTests (15)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (8)
593private static Dictionary<string, Func<IISDeploymentParameters, string>> PortableConfigTransformations = InitPortableWebConfigTransformations();
600var action = PortableConfigTransformations[scenario];
607public static Dictionary<string, Func<IISDeploymentParameters, string>> InitPortableWebConfigTransformations()
609var dictionary = new Dictionary<string, Func<IISDeploymentParameters, string>>();
662private static Dictionary<string, Func<IISDeploymentParameters, string>> StandaloneConfigTransformations = InitStandaloneConfigTransformations();
670var action = StandaloneConfigTransformations[scenario];
678public static Dictionary<string, Func<IISDeploymentParameters, string>> InitStandaloneConfigTransformations()
680var dictionary = new Dictionary<string, Func<IISDeploymentParameters, string>>();
IIS.ShadowCopy.Tests (5)
IISExpress.FunctionalTests (15)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (8)
593private static Dictionary<string, Func<IISDeploymentParameters, string>> PortableConfigTransformations = InitPortableWebConfigTransformations();
600var action = PortableConfigTransformations[scenario];
607public static Dictionary<string, Func<IISDeploymentParameters, string>> InitPortableWebConfigTransformations()
609var dictionary = new Dictionary<string, Func<IISDeploymentParameters, string>>();
662private static Dictionary<string, Func<IISDeploymentParameters, string>> StandaloneConfigTransformations = InitStandaloneConfigTransformations();
670var action = StandaloneConfigTransformations[scenario];
678public static Dictionary<string, Func<IISDeploymentParameters, string>> InitStandaloneConfigTransformations()
680var dictionary = new Dictionary<string, Func<IISDeploymentParameters, string>>();
illink (18)
Linker.Dataflow\DynamicallyAccessedMembersBinder.cs (7)
122 public static IEnumerable<MethodDefinition> GetConstructorsOnType (this TypeDefinition type, Func<MethodDefinition, bool>? filter, BindingFlags? bindingFlags = null)
147 public static IEnumerable<MethodDefinition> GetMethodsOnTypeHierarchy (this TypeReference thisType, LinkContext context, Func<MethodDefinition, bool>? filter, BindingFlags? bindingFlags = null)
191 public static IEnumerable<FieldDefinition> GetFieldsOnTypeHierarchy (this TypeDefinition thisType, LinkContext context, Func<FieldDefinition, bool>? filter, BindingFlags? bindingFlags = BindingFlags.Default)
231 public static IEnumerable<TypeDefinition> GetNestedTypesOnType (this TypeReference typeRef, LinkContext context, Func<TypeDefinition, bool>? filter, BindingFlags? bindingFlags = BindingFlags.Default)
254 public static IEnumerable<PropertyDefinition> GetPropertiesOnTypeHierarchy (this TypeDefinition thisType, LinkContext context, Func<PropertyDefinition, bool>? filter, BindingFlags? bindingFlags = BindingFlags.Default)
303 public static IEnumerable<EventDefinition> GetEventsOnTypeHierarchy (this TypeDefinition thisType, LinkContext context, Func<EventDefinition, bool>? filter, BindingFlags? bindingFlags = BindingFlags.Default)
435 private static IEnumerable<T> ApplyIncludeInherited<T> (this TypeDefinition thisType, LinkContext context, Func<TypeDefinition, IEnumerable<T>> selector, bool includeBases)
Linker.Dataflow\ReflectionMarker.cs (4)
157 internal void MarkConstructorsOnType (in MessageOrigin origin, TypeReference typeRef, Func<MethodDefinition, bool>? filter, BindingFlags? bindingFlags = null)
169 internal void MarkFieldsOnTypeHierarchy (in MessageOrigin origin, TypeReference typeRef, Func<FieldDefinition, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
181 internal void MarkPropertiesOnTypeHierarchy (in MessageOrigin origin, TypeReference typeRef, Func<PropertyDefinition, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
193 internal void MarkEventsOnTypeHierarchy (in MessageOrigin origin, TypeReference typeRef, Func<EventDefinition, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (3)
69 /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?)"/></item>
70 /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?, bool)"/></item>
71 /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?, bool, bool)"/></item>
ILLink.RoslynAnalyzer (10)
DataFlow\DynamicallyAccessedMembersBinder.cs (7)
120 public static IEnumerable<IMethodSymbol> GetConstructorsOnType (this ITypeSymbol type, Func<IMethodSymbol, bool>? filter, BindingFlags? bindingFlags = null)
146 public static IEnumerable<IMethodSymbol> GetMethodsOnTypeHierarchy (this ITypeSymbol thisType, Func<IMethodSymbol, bool>? filter, BindingFlags? bindingFlags = null)
189 public static IEnumerable<IFieldSymbol> GetFieldsOnTypeHierarchy (this ITypeSymbol thisType, Func<IFieldSymbol, bool>? filter, BindingFlags? bindingFlags = BindingFlags.Default)
228 public static IEnumerable<ITypeSymbol> GetNestedTypesOnType (this ITypeSymbol type, Func<ITypeSymbol, bool>? filter, BindingFlags? bindingFlags = BindingFlags.Default)
248 public static IEnumerable<IPropertySymbol> GetPropertiesOnTypeHierarchy (this ITypeSymbol thisType, Func<IPropertySymbol, bool>? filter, BindingFlags? bindingFlags = BindingFlags.Default)
297 public static IEnumerable<IEventSymbol> GetEventsOnTypeHierarchy (this ITypeSymbol thisType, Func<IEventSymbol, bool>? filter, BindingFlags? bindingFlags = BindingFlags.Default)
421 private static IEnumerable<T> ApplyIncludeInherited<T> (this ITypeSymbol thisType, Func<ITypeSymbol, IEnumerable<T>> selector, bool includeBases)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (3)
69 /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?)"/></item>
70 /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?, bool)"/></item>
71 /// <item><see cref="System.Type.GetType(string, System.Func{System.Reflection.AssemblyName, System.Reflection.Assembly?}?, System.Func{System.Reflection.Assembly?, string, bool, System.Type?}?, bool, bool)"/></item>
InMemory.FunctionalTests (10)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (3)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted)
22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
InteractiveHost32 (1)
InteractiveHost64 (1)
Interop.FunctionalTests (3)
InteropClient (1)
InteropWebsite (1)
Metrics (41)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
247public static TOperation? GetAncestor<TOperation>(this IOperation root, OperationKind ancestorKind, Func<TOperation, bool>? predicate = null)
282public static IOperation? GetAncestor(this IOperation root, ImmutableArray<OperationKind> ancestorKinds, Func<IOperation, bool>? predicate = null)
355public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate)
368public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate)
373public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(returnValue: true)] out IOperation? foundOperation)
725public static IOperation WalkDownConversion(this IOperation operation, Func<IConversionOperation, bool> predicate)
799public static bool HasAnyExplicitDescendant(this IOperation operation, Func<IOperation, bool>? descendIntoOperation = null)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (5)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty);
24private static readonly Func<IOperation, IOperation> TargetAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Target), fallbackResult: null!);
26private static readonly Func<IOperation, IMethodSymbol> GetFunctionPointerSignatureAccessor = CreateFunctionPointerSignatureAccessor(WrappedType);
28private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAccessor(Type? wrappedType)
44return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
Metrics.Legacy (41)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
247public static TOperation? GetAncestor<TOperation>(this IOperation root, OperationKind ancestorKind, Func<TOperation, bool>? predicate = null)
282public static IOperation? GetAncestor(this IOperation root, ImmutableArray<OperationKind> ancestorKinds, Func<IOperation, bool>? predicate = null)
355public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate)
368public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate)
373public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(returnValue: true)] out IOperation? foundOperation)
725public static IOperation WalkDownConversion(this IOperation operation, Func<IConversionOperation, bool> predicate)
799public static bool HasAnyExplicitDescendant(this IOperation operation, Func<IOperation, bool>? descendIntoOperation = null)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (5)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty);
24private static readonly Func<IOperation, IOperation> TargetAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Target), fallbackResult: null!);
26private static readonly Func<IOperation, IMethodSymbol> GetFunctionPointerSignatureAccessor = CreateFunctionPointerSignatureAccessor(WrappedType);
28private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAccessor(Type? wrappedType)
44return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
Microsoft.Arcade.Common (4)
Microsoft.Arcade.Test.Common (9)
AssertEx.cs (7)
182string itemSeparator = null, Func<T, string> itemInspector = null)
263public static void None<T>(IEnumerable<T> actual, Func<T, bool> predicate)
275public static void Any<T>(IEnumerable<T> actual, Func<T, bool> predicate)
281public static void All<T>(IEnumerable<T> actual, Func<T, bool> predicate)
297public static string ToString<T>(IEnumerable<T> list, string separator = ", ", Func<T, string> itemInspector = null)
425Func<T, string> itemInspector = escapeQuotes ? new Func<T, string>(t => t.ToString().Replace("\"", "\"\"")) : null;
433Func<T, string> itemInspector = null,
DiffUtil.cs (2)
52public IEnumerable<string> CalculateDiff(IList<T> sequenceA, IList<T> sequenceB, Func<T, string> toString)
74public static string DiffReport<T>(IEnumerable<T> expected, IEnumerable<T> actual, Func<T, T, bool> comparer = null, Func<T, string> toString = null, string separator = ",\r\n")
Microsoft.AspNetCore (4)
Microsoft.AspNetCore.App.Analyzers (6)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.Authentication (4)
Microsoft.AspNetCore.Authentication.BearerToken (1)
Microsoft.AspNetCore.Authentication.Certificate (3)
Microsoft.AspNetCore.Authentication.Cookies (11)
Microsoft.AspNetCore.Authentication.Google (1)
Microsoft.AspNetCore.Authentication.JwtBearer (7)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
Microsoft.AspNetCore.Authentication.Negotiate (4)
Microsoft.AspNetCore.Authentication.Negotiate.Test (2)
Microsoft.AspNetCore.Authentication.OAuth (6)
Microsoft.AspNetCore.Authentication.OpenIdConnect (14)
Events\OpenIdConnectEvents.cs (11)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask;
19public Func<AuthorizationCodeReceivedContext, Task> OnAuthorizationCodeReceived { get; set; } = context => Task.CompletedTask;
24public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask;
31public Func<RedirectContext, Task> OnRedirectToIdentityProvider { get; set; } = context => Task.CompletedTask;
36public Func<RedirectContext, Task> OnRedirectToIdentityProviderForSignOut { get; set; } = context => Task.CompletedTask;
41public Func<RemoteSignOutContext, Task> OnSignedOutCallbackRedirect { get; set; } = context => Task.CompletedTask;
46public Func<RemoteSignOutContext, Task> OnRemoteSignOut { get; set; } = context => Task.CompletedTask;
51public Func<TokenResponseReceivedContext, Task> OnTokenResponseReceived { get; set; } = context => Task.CompletedTask;
57public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => Task.CompletedTask;
62public Func<UserInformationReceivedContext, Task> OnUserInformationReceived { get; set; } = context => Task.CompletedTask;
67public Func<PushedAuthorizationContext, Task> OnPushAuthorization { get; set; } = context => Task.CompletedTask;
Microsoft.AspNetCore.Authentication.Test (12)
Microsoft.AspNetCore.Authentication.Twitter (2)
Microsoft.AspNetCore.Authentication.WsFederation (6)
Microsoft.AspNetCore.Authorization (5)
Microsoft.AspNetCore.Authorization.Policy (2)
Microsoft.AspNetCore.BrowserTesting (1)
Microsoft.AspNetCore.Components (66)
CascadingValueServiceCollectionExtensions.cs (6)
23this IServiceCollection serviceCollection, Func<IServiceProvider, TValue> initialValueFactory)
36this IServiceCollection serviceCollection, string name, Func<IServiceProvider, TValue> initialValueFactory)
52this IServiceCollection serviceCollection, Func<IServiceProvider, CascadingValueSource<TValue>> sourceFactory)
65this IServiceCollection serviceCollection, Func<IServiceProvider, TValue> valueFactory)
83this IServiceCollection serviceCollection, string name, Func<IServiceProvider, TValue> valueFactory)
104this IServiceCollection serviceCollection, Func<IServiceProvider, CascadingValueSource<TValue>> sourceFactory)
EventCallbackFactoryBinderExtensions.cs (36)
58Func<string?, Task> setter,
98Func<bool, Task> setter,
138Func<bool?, Task> setter,
178Func<int, Task> setter,
218Func<int?, Task> setter,
258Func<long, Task> setter,
298Func<short, Task> setter,
338Func<long?, Task> setter,
378Func<short?, Task> setter,
418Func<float, Task> setter,
458Func<float?, Task> setter,
498Func<double, Task> setter,
538Func<double?, Task> setter,
578Func<decimal, Task> setter,
618Func<decimal?, Task> setter,
658Func<DateTime, Task> setter,
701Func<DateTime, Task> setter,
742Func<DateTime?, Task> setter,
785Func<DateTime?, Task> setter,
826Func<DateTimeOffset, Task> setter,
869Func<DateTimeOffset, Task> setter,
910Func<DateTimeOffset?, Task> setter,
953Func<DateTimeOffset?, Task> setter,
994Func<DateOnly, Task> setter,
1037Func<DateOnly, Task> setter,
1078Func<DateOnly?, Task> setter,
1121Func<DateOnly?, Task> setter,
1162Func<TimeOnly, Task> setter,
1205Func<TimeOnly, Task> setter,
1246Func<TimeOnly?, Task> setter,
1289Func<TimeOnly?, Task> setter,
1332Func<T, Task> setter,
1385Func<T, Task> setter,
1389Func<ChangeEventArgs, Task> callback = async e =>
1472Func<T, Task> setter,
1477Func<ChangeEventArgs, Task> callback = async e =>
NavigationManager.cs (8)
34private readonly List<Func<LocationChangingContext, ValueTask>> _locationChangingHandlers = new();
406var locationChangingHandlersCopy = ArrayPool<Func<LocationChangingContext, ValueTask>>.Shared.Rent(handlerCount);
452ArrayPool<Func<LocationChangingContext, ValueTask>>.Shared.Return(locationChangingHandlersCopy);
481private async ValueTask InvokeLocationChangingHandlerAsync(Func<LocationChangingContext, ValueTask> handler, LocationChangingContext context)
519public IDisposable RegisterLocationChangingHandler(Func<LocationChangingContext, ValueTask> locationChangingHandler)
535private void RemoveLocationChangingHandler(Func<LocationChangingContext, ValueTask> locationChangingHandler)
602private readonly Func<LocationChangingContext, ValueTask> _handler;
605public LocationChangingRegistration(Func<LocationChangingContext, ValueTask> handler, NavigationManager navigationManager)
Microsoft.AspNetCore.Components.Analyzers (4)
Microsoft.AspNetCore.Components.Endpoints (14)
src\Shared\PropertyHelper\PropertyHelper.cs (11)
46private Func<object, object?>? _valueGetter;
71public Func<object, object?> ValueGetter
159public static Func<object, object?> MakeFastPropertyGetter(PropertyInfo propertyInfo)
179public static Func<object, object?> MakeNullSafeFastPropertyGetter(PropertyInfo propertyInfo)
190private static Func<object, object?> MakeFastPropertyGetter(
230typeof(Func<,>),
243private static Func<object, object?> MakeFastPropertyGetter(
256typeof(Func<object, object?>),
259return (Func<object, object?>)accessorDelegate;
344Func<TDeclaringType, TValue> getter,
361Func<TDeclaringType, TValue> getter,
Microsoft.AspNetCore.Components.Forms (12)
Microsoft.AspNetCore.Components.Forms.Tests (1)
Microsoft.AspNetCore.Components.QuickGrid (10)
Microsoft.AspNetCore.Components.SdkAnalyzers (4)
Microsoft.AspNetCore.Components.Server (8)
Microsoft.AspNetCore.Components.Server.Tests (10)
Circuits\CircuitHostTest.cs (10)
348.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>()))
349.Returns((Func<CircuitInboundActivityContext, Task> next) => async (CircuitInboundActivityContext context) =>
358.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>()))
359.Returns((Func<CircuitInboundActivityContext, Task> next) => next)
364.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>()))
365.Returns((Func<CircuitInboundActivityContext, Task> next) => async (CircuitInboundActivityContext context) =>
657.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>()))
658.Returns((Func<CircuitInboundActivityContext, Task> next) => next)
666.Setup(h => h.CreateInboundActivityHandler(It.IsAny<Func<CircuitInboundActivityContext, Task>>()))
667.Returns((Func<CircuitInboundActivityContext, Task> next) => next)
Microsoft.AspNetCore.Components.Tests (46)
EventCallbackFactoryTest.cs (16)
218var @delegate = (Func<string, Task>)component.SomeFuncTTask;
249var @delegate = (Func<string, Task>)component.SomeFuncTTask;
267var @delegate = (Func<string, Task>)((s) => Task.CompletedTask);
287var callback = EventCallback.Factory.Create(component, (Func<string, Task>)null);
520var @delegate = (Func<string, Task>)component.SomeFuncTTask;
536var @delegate = (Func<string, Task>)component.SomeFuncTTask;
554var @delegate = (Func<string, Task>)((s) => Task.CompletedTask);
574var callback = EventCallback.Factory.Create<string>(component, (Func<string, Task>)null);
603var @delegate = (Func<string, Task>)((s) => Task.CompletedTask);
EventCallbackTest.cs (6)
208var callback = new EventCallback(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
227var callback = new EventCallback(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
246var callback = new EventCallback(component, (Func<int, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
265var callback = new EventCallback(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
406var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
425var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
RendererTest.cs (22)
257[WhatToRenderName] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
416[WhatToRenderName] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
460[WhatToRenderName] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
518[WhatToRenderName] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
606OnArbitraryDelegateEvent = (Func<DerivedEventArgs, Task>)(args => Task.CompletedTask),
3565[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3598[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3631[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3669[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3779[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3835[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3890[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3946[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
4059[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
4093[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
4135[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
5280public Func<EventArgs, Task> OnTestAsync { get; set; }
5286public Func<DerivedEventArgs, Task> OnClickAsync { get; set; }
5673private Func<NestedAsyncComponent, RenderFragment> CreateRenderFactory(int[] childrenToRender)
5703[Parameter] public IDictionary<int, Func<NestedAsyncComponent, RenderFragment>> WhatToRender { get; set; }
5762var renderFactory = WhatToRender[TestId];
5866public Func<RenderBatch, Task> OnUpdateDisplayAsync { get; set; }
Microsoft.AspNetCore.Components.Web (17)
Web\WebEventCallbackFactoryEventArgsExtensions.cs (10)
36public static EventCallback<ClipboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ClipboardEventArgs, Task> callback)
68public static EventCallback<DragEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<DragEventArgs, Task> callback)
100public static EventCallback<ErrorEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ErrorEventArgs, Task> callback)
132public static EventCallback<FocusEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<FocusEventArgs, Task> callback)
164public static EventCallback<KeyboardEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<KeyboardEventArgs, Task> callback)
196public static EventCallback<MouseEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<MouseEventArgs, Task> callback)
227public static EventCallback<PointerEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<PointerEventArgs, Task> callback)
259public static EventCallback<ProgressEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ProgressEventArgs, Task> callback)
291public static EventCallback<TouchEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<TouchEventArgs, Task> callback)
323public static EventCallback<WheelEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<WheelEventArgs, Task> callback)
Microsoft.AspNetCore.Components.Web.Tests (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Components.WebView (1)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (3)
Microsoft.AspNetCore.Connections.Abstractions (15)
Microsoft.AspNetCore.CookiePolicy (1)
Microsoft.AspNetCore.CookiePolicy.Test (2)
Microsoft.AspNetCore.Cors (4)
Microsoft.AspNetCore.Cors.Test (2)
Microsoft.AspNetCore.DataProtection (3)
Microsoft.AspNetCore.DataProtection.Tests (1)
Microsoft.AspNetCore.Diagnostics (9)
Microsoft.AspNetCore.Diagnostics.Abstractions (1)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
Microsoft.AspNetCore.Diagnostics.HealthChecks (2)
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (7)
Latency\RequestLatencyTelemetryMiddlewareTests.cs (5)
191public override void OnStarting(Func<object, Task> callback, object state)
196public override void OnCompleted(Func<object, Task> callback, object state)
201private void ChainCallback(Func<object, Task> callback, object state)
219feature.Setup(m => m.OnCompleted(It.IsAny<Func<object, Task>>(), It.IsAny<object>()))
220.Callback<Func<object, Task>, object>((c, o) => c(o));
Microsoft.AspNetCore.Diagnostics.Tests (5)
DeveloperExceptionPageMiddlewareTest.cs (5)
651public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next)
659public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next)
667public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next)
675public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next)
683public Task HandleExceptionAsync(ErrorContext context, Func<ErrorContext, Task> next)
Microsoft.AspNetCore.FunctionalTests (1)
Microsoft.AspNetCore.Grpc.Swagger (1)
Microsoft.AspNetCore.HeaderPropagation (4)
Microsoft.AspNetCore.Hosting (22)
Microsoft.AspNetCore.Hosting.Tests (10)
Microsoft.AspNetCore.Http (30)
Microsoft.AspNetCore.Http.Abstractions (23)
src\Shared\PropertyHelper\PropertyHelper.cs (11)
46private Func<object, object?>? _valueGetter;
71public Func<object, object?> ValueGetter
159public static Func<object, object?> MakeFastPropertyGetter(PropertyInfo propertyInfo)
179public static Func<object, object?> MakeNullSafeFastPropertyGetter(PropertyInfo propertyInfo)
190private static Func<object, object?> MakeFastPropertyGetter(
230typeof(Func<,>),
243private static Func<object, object?> MakeFastPropertyGetter(
256typeof(Func<object, object?>),
259return (Func<object, object?>)accessorDelegate;
344Func<TDeclaringType, TValue> getter,
361Func<TDeclaringType, TValue> getter,
Microsoft.AspNetCore.Http.Abstractions.Tests (7)
Microsoft.AspNetCore.Http.Connections (4)
Microsoft.AspNetCore.Http.Connections.Client (4)
Microsoft.AspNetCore.Http.Connections.Tests (2)
Microsoft.AspNetCore.Http.Extensions (32)
RequestDelegateFactory.cs (8)
188Expression<Func<HttpContext, object?>> targetFactory = (httpContext) => handler.Target;
209public static RequestDelegateResult Create(MethodInfo methodInfo, Func<HttpContext, object>? targetFactory, RequestDelegateFactoryOptions? options)
228public static RequestDelegateResult Create(MethodInfo methodInfo, Func<HttpContext, object>? targetFactory = null, RequestDelegateFactoryOptions? options = null, RequestDelegateMetadataResult? metadataResult = null)
317Expression<Func<HttpContext, object?>>? targetFactory = null)
357Expression<Func<EndpointFilterInvocationContext, ValueTask<object?>>> invokePipeline = (context) => filterPipeline(context);
413private static EndpointFilterDelegate? CreateFilterPipeline(MethodInfo methodInfo, Expression? targetExpression, RequestDelegateFactoryContext factoryContext, Expression<Func<HttpContext, object?>>? targetFactory)
1992var bindAsyncDelegate = Expression.Lambda<Func<HttpContext, ValueTask<object?>>>(bindAsyncMethod.Expression, HttpContextExpr).Compile();
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
23typeof(Func<object, object>), // getAwaiterMethod
24typeof(Func<object, bool>), // isCompletedMethod
25typeof(Func<object, object>), // getResultMethod
282var getAwaiterFunc = Expression.Lambda<Func<object, object>>(
293var isCompletedFunc = Expression.Lambda<Func<object, bool>>(
300Func<object, object> getResultFunc;
308getResultFunc = Expression.Lambda<Func<object, object>>(
321getResultFunc = Expression.Lambda<Func<object, object>>(
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorAwaitable.cs (10)
19private readonly Func<object, object> _getAwaiterMethod;
20private readonly Func<object, bool> _isCompletedMethod;
21private readonly Func<object, object> _getResultMethod;
45Func<object, object> getAwaiterMethod,
46Func<object, bool> isCompletedMethod,
47Func<object, object> getResultMethod,
68private readonly Func<object, bool> _isCompletedMethod;
69private readonly Func<object, object> _getResultMethod;
75Func<object, bool> isCompletedMethod,
76Func<object, object> getResultMethod,
Microsoft.AspNetCore.Http.Extensions.Tests (78)
ParameterBindingMethodCacheTests.cs (16)
209var parseEnum = Expression.Lambda<Func<string, Choice>>(Expression.Block(new[] { parsedValue },
231var parseHttpContext = Expression.Lambda<Func<HttpContext, ValueTask<object>>>(
262var parseHttpContext = Expression.Lambda<Func<HttpContext, ValueTask<object>>>(
388var parseHttpContext = Expression.Lambda<Func<HttpContext, ValueTask<object?>>>(methodFound.Expression!,
406var parseHttpContext = Expression.Lambda<Func<HttpContext, ValueTask<object?>>>(methodFound.Expression!,
424var parseHttpContext = Expression.Lambda<Func<HttpContext, ValueTask<object>>>(methodFound.Expression!,
440var parseHttpContext = Expression.Lambda<Func<HttpContext, ValueTask<object>>>(methodFound.Expression!,
456var parseHttpContext = Expression.Lambda<Func<HttpContext, ValueTask<object>>>(methodFound.Expression!,
RequestDelegateFactoryTests.cs (43)
91new object[] { (Func<HttpContext, Task>)TaskTestAction },
92new object[] { (Func<HttpContext, ValueTask>)ValueTaskTestAction },
94new object[] { (Func<HttpContext, Task>)StaticTaskTestAction },
95new object[] { (Func<HttpContext, ValueTask>)StaticValueTaskTestAction },
1537new object?[] { (Func<string, string>)requiredRouteParam, "name", null, true, null},
1538new object?[] { (Func<string, string>)requiredRouteParam, "name", "TestName", false, "Hello TestName!" },
1539new object?[] { (Func<string, string>)defaultValueRouteParam, "name", null, false, "Hello DefaultName!" },
1540new object?[] { (Func<string, string>)defaultValueRouteParam, "name", "TestName", false, "Hello TestName!" },
1541new object?[] { (Func<string?, string>)nullableRouteParam, "name", null, false, "Hello !" },
1542new object?[] { (Func<string?, string>)nullableRouteParam, "name", "TestName", false, "Hello TestName!" },
1544new object?[] { (Func<int, string>)requiredParseableRouteParam, "age", null, true, null},
1545new object?[] { (Func<int, string>)requiredParseableRouteParam, "age", "42", false, "Age: 42" },
1546new object?[] { (Func<int, string>)defaultValueParseableRouteParam, "age", null, false, "Age: 12" },
1547new object?[] { (Func<int, string>)defaultValueParseableRouteParam, "age", "42", false, "Age: 42" },
1548new object?[] { (Func<int?, string>)nullableParseableRouteParam, "age", null, false, "Age: " },
1549new object?[] { (Func<int?, string>)nullableParseableRouteParam, "age", "42", false, "Age: 42"},
1718new object?[] { (Func<MyService, string>)requiredExplicitService, false, true},
1719new object?[] { (Func<MyService, string>)requiredExplicitService, true, false},
1721new object?[] { (Func<MyService, string>)defaultValueExplicitServiceParam, false, false},
1722new object?[] { (Func<MyService, string>)defaultValueExplicitServiceParam, true, false},
1724new object?[] { (Func<MyService?, string>)nullableExplicitServiceParam, false, false},
1725new object?[] { (Func<MyService?, string>)nullableExplicitServiceParam, true, false},
1889new object?[] { (Func<Uri, string>)uriParsing, "https://example.org", "Uri: https://example.org" },
1890new object?[] { (Func<Uri, string>)uriParsing, "https://example.org/path/to/file?name=value1&name=value2", "Uri: https://example.org/path/to/file?name=value1&name=value2" },
1891new object?[] { (Func<Uri, string>)uriParsing, "/path/to/file?name=value1&name=value2", "Uri: /path/to/file?name=value1&name=value2" },
1892new object?[] { (Func<Uri, string>)uriParsing, "?name=value1&name=value2", "Uri: ?name=value1&name=value2" },
2203Func<HttpContext, object> targetFactory = (context) =>
2763var @delegate = (AddsCustomParameterMetadata param1) => "Hello";
2784var @delegate = (AddsCustomParameterMetadata param1) => "Hello";
2805var @delegate = [Attribute1, Attribute2] (AddsCustomParameterMetadata param1) => new CountsDefaultEndpointMetadataPoco();
2861var @delegate = [Attribute1, Attribute2] (AddsCustomParameterMetadata param1) =>
2938var @delegate = (Todo todo) => new RemovesAcceptsMetadataResult();
2951var @delegate = (Todo todo) => Task.FromResult(new RemovesAcceptsMetadataResult());
2964var @delegate = (Todo todo) => ValueTask.FromResult(new RemovesAcceptsMetadataResult());
2977var @delegate = (Todo todo) => FSharp.Core.ExtraTopLevelOperators.DefaultAsyncBuilder.Return(new RemovesAcceptsMetadataResult());
2990var @delegate = (RemovesAcceptsParameterMetadata param1) => "Hello";
3003var @delegate = (RemovesAcceptsParameterMetadata param1) => "Hello";
3017var @delegate = (Todo todo) => new AccessesServicesMetadataResult();
3032var @delegate = (AccessesServicesMetadataBinder parameter1) => "Test";
3277var @delegate = (string task) => new Todo();
3297var @delegate = (string task) => new Todo();
3822public void OnStarting(Func<object, Task> callback, object state)
3826public void OnCompleted(Func<object, Task> callback, object state)
ValidationsGenerator\ValidationsGeneratorTestBase.cs (11)
175var factory = HostFactoryResolver.ResolveHostFactory(assembly,
243public static Func<string[], TWebHost> ResolveWebHostFactory<TWebHost>(Assembly assembly)
248public static Func<string[], TWebHostBuilder> ResolveWebHostBuilderFactory<TWebHostBuilder>(Assembly assembly)
253public static Func<string[], THostBuilder> ResolveHostBuilderFactory<THostBuilder>(Assembly assembly)
264public static Func<string[], object> ResolveHostFactory(Assembly assembly,
278private static Func<string[], T> ResolveFactory<T>(Assembly assembly, string name)
305public static Func<string[], IServiceProvider> ResolveServiceProviderFactory(Assembly assembly, TimeSpan waitTimeout = default)
308var webHostFactory = ResolveWebHostFactory<object>(assembly);
318var webHostBuilderFactory = ResolveWebHostBuilderFactory<object>(assembly);
329var hostBuilderFactory = ResolveHostBuilderFactory<object>(assembly);
340var hostFactory = ResolveHostFactory(assembly, waitTimeout: waitTimeout);
Microsoft.AspNetCore.Http.Features (3)
Microsoft.AspNetCore.Http.Microbenchmarks (3)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
Microsoft.AspNetCore.Http.Results (8)
Microsoft.AspNetCore.Http.Results.Tests (4)
Microsoft.AspNetCore.Http.Tests (14)
Microsoft.AspNetCore.Http.ValidationsGenerator (1)
Microsoft.AspNetCore.HttpOverrides (1)
Microsoft.AspNetCore.Identity (1)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (15)
Microsoft.AspNetCore.Identity.InMemory.Test (8)
Microsoft.AspNetCore.Identity.Specification.Tests (5)
Microsoft.AspNetCore.Identity.Test (1)
Microsoft.AspNetCore.InternalTesting (8)
Microsoft.AspNetCore.InternalTesting.Tests (4)
Microsoft.AspNetCore.JsonPatch (39)
JsonPatchDocumentOfT.cs (39)
53public JsonPatchDocument<TModel> Add<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
75Expression<Func<TModel, IList<TProp>>> path,
97public JsonPatchDocument<TModel> Add<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
116public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, TProp>> path)
132public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path, int position)
150public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path)
169public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
190public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path,
211public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
231public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
252public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path,
273public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
294Expression<Func<TModel, TProp>> from,
295Expression<Func<TModel, TProp>> path)
317Expression<Func<TModel, IList<TProp>>> from,
319Expression<Func<TModel, TProp>> path)
341Expression<Func<TModel, TProp>> from,
342Expression<Func<TModel, IList<TProp>>> path,
366Expression<Func<TModel, IList<TProp>>> from,
368Expression<Func<TModel, IList<TProp>>> path,
391Expression<Func<TModel, IList<TProp>>> from,
393Expression<Func<TModel, IList<TProp>>> path)
414Expression<Func<TModel, TProp>> from,
415Expression<Func<TModel, IList<TProp>>> path)
436Expression<Func<TModel, TProp>> from,
437Expression<Func<TModel, TProp>> path)
459Expression<Func<TModel, IList<TProp>>> from,
461Expression<Func<TModel, TProp>> path)
483Expression<Func<TModel, TProp>> from,
484Expression<Func<TModel, IList<TProp>>> path,
508Expression<Func<TModel, IList<TProp>>> from,
510Expression<Func<TModel, IList<TProp>>> path,
533Expression<Func<TModel, IList<TProp>>> from,
535Expression<Func<TModel, IList<TProp>>> path)
556Expression<Func<TModel, TProp>> from,
557Expression<Func<TModel, IList<TProp>>> path)
660internal string GetPath<TProp>(Expression<Func<TModel, TProp>> expr, string position)
733var lambda = Expression.Lambda<Func<object, object>>(converted, fakeParameter);
734var func = lambda.Compile();
Microsoft.AspNetCore.JsonPatch.SystemTextJson (39)
JsonPatchDocumentOfT.cs (39)
54public JsonPatchDocument<TModel> Add<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
76Expression<Func<TModel, IList<TProp>>> path,
98public JsonPatchDocument<TModel> Add<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
117public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, TProp>> path)
133public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path, int position)
151public JsonPatchDocument<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path)
170public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
191public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path,
212public JsonPatchDocument<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
232public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
253public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path,
274public JsonPatchDocument<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
295Expression<Func<TModel, TProp>> from,
296Expression<Func<TModel, TProp>> path)
318Expression<Func<TModel, IList<TProp>>> from,
320Expression<Func<TModel, TProp>> path)
342Expression<Func<TModel, TProp>> from,
343Expression<Func<TModel, IList<TProp>>> path,
367Expression<Func<TModel, IList<TProp>>> from,
369Expression<Func<TModel, IList<TProp>>> path,
392Expression<Func<TModel, IList<TProp>>> from,
394Expression<Func<TModel, IList<TProp>>> path)
415Expression<Func<TModel, TProp>> from,
416Expression<Func<TModel, IList<TProp>>> path)
437Expression<Func<TModel, TProp>> from,
438Expression<Func<TModel, TProp>> path)
460Expression<Func<TModel, IList<TProp>>> from,
462Expression<Func<TModel, TProp>> path)
484Expression<Func<TModel, TProp>> from,
485Expression<Func<TModel, IList<TProp>>> path,
509Expression<Func<TModel, IList<TProp>>> from,
511Expression<Func<TModel, IList<TProp>>> path,
534Expression<Func<TModel, IList<TProp>>> from,
536Expression<Func<TModel, IList<TProp>>> path)
557Expression<Func<TModel, TProp>> from,
558Expression<Func<TModel, IList<TProp>>> path)
661internal string GetPath<TProp>(Expression<Func<TModel, TProp>> expr, string position)
736var lambda = Expression.Lambda<Func<object, object>>(converted, fakeParameter);
737var func = lambda.Compile();
Microsoft.AspNetCore.Localization (2)
Microsoft.AspNetCore.MiddlewareAnalysis (1)
Microsoft.AspNetCore.Mvc.Abstractions (18)
Microsoft.AspNetCore.Mvc.Abstractions.Test (2)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
Microsoft.AspNetCore.Mvc.Core (124)
ModelBinding\Metadata\DefaultModelBindingMessageProvider.cs (18)
16private Func<string, string> _missingBindRequiredValueAccessor;
19private Func<string, string> _valueMustNotBeNullAccessor;
21private Func<string, string> _nonPropertyAttemptedValueIsInvalidAccessor;
22private Func<string, string> _unknownValueIsInvalidAccessor;
24private Func<string, string> _valueIsInvalidAccessor;
25private Func<string, string> _valueMustBeANumberAccessor;
69public override Func<string, string> MissingBindRequiredValueAccessor => _missingBindRequiredValueAccessor;
76public void SetMissingBindRequiredValueAccessor(Func<string, string> missingBindRequiredValueAccessor)
114public override Func<string, string> ValueMustNotBeNullAccessor => _valueMustNotBeNullAccessor;
121public void SetValueMustNotBeNullAccessor(Func<string, string> valueMustNotBeNullAccessor)
144public override Func<string, string> NonPropertyAttemptedValueIsInvalidAccessor => _nonPropertyAttemptedValueIsInvalidAccessor;
152Func<string, string> nonPropertyAttemptedValueIsInvalidAccessor)
160public override Func<string, string> UnknownValueIsInvalidAccessor => _unknownValueIsInvalidAccessor;
167public void SetUnknownValueIsInvalidAccessor(Func<string, string> unknownValueIsInvalidAccessor)
190public override Func<string, string> ValueIsInvalidAccessor => _valueIsInvalidAccessor;
197public void SetValueIsInvalidAccessor(Func<string, string> valueIsInvalidAccessor)
205public override Func<string, string> ValueMustBeANumberAccessor => _valueMustBeANumberAccessor;
212public void SetValueMustBeANumberAccessor(Func<string, string> valueMustBeANumberAccessor)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
23typeof(Func<object, object>), // getAwaiterMethod
24typeof(Func<object, bool>), // isCompletedMethod
25typeof(Func<object, object>), // getResultMethod
282var getAwaiterFunc = Expression.Lambda<Func<object, object>>(
293var isCompletedFunc = Expression.Lambda<Func<object, bool>>(
300Func<object, object> getResultFunc;
308getResultFunc = Expression.Lambda<Func<object, object>>(
321getResultFunc = Expression.Lambda<Func<object, object>>(
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorAwaitable.cs (10)
19private readonly Func<object, object> _getAwaiterMethod;
20private readonly Func<object, bool> _isCompletedMethod;
21private readonly Func<object, object> _getResultMethod;
45Func<object, object> getAwaiterMethod,
46Func<object, bool> isCompletedMethod,
47Func<object, object> getResultMethod,
68private readonly Func<object, bool> _isCompletedMethod;
69private readonly Func<object, object> _getResultMethod;
75Func<object, bool> isCompletedMethod,
76Func<object, object> getResultMethod,
src\Shared\PropertyHelper\PropertyHelper.cs (11)
46private Func<object, object?>? _valueGetter;
71public Func<object, object?> ValueGetter
159public static Func<object, object?> MakeFastPropertyGetter(PropertyInfo propertyInfo)
179public static Func<object, object?> MakeNullSafeFastPropertyGetter(PropertyInfo propertyInfo)
190private static Func<object, object?> MakeFastPropertyGetter(
230typeof(Func<,>),
243private static Func<object, object?> MakeFastPropertyGetter(
256typeof(Func<object, object?>),
259return (Func<object, object?>)accessorDelegate;
344Func<TDeclaringType, TValue> getter,
361Func<TDeclaringType, TValue> getter,
Microsoft.AspNetCore.Mvc.Core.Test (53)
Controllers\ControllerBinderDelegateProviderTest.cs (4)
903public static TheoryData<string, Type, Func<object, object>, object, object> SkippedPropertyData
907return new TheoryData<string, Type, Func<object, object>, object, object>
946Func<object, object> propertyAccessor,
1270Func<object, int> method = foo => 1;
ModelBinding\ModelBindingHelperTest.cs (12)
134Func<ModelMetadata, bool> propertyFilter = (m) => true;
183Func<ModelMetadata, bool> propertyFilter = (m) =>
339Expression<Func<User, object>> expression = m => m.Address;
352Expression<Func<User, object>> expression = m => m.Address.Street;
370Expression<Func<User, object>> expression = m => new Func<User>(() => m);
393public void GetPropertyName_ExpressionsOtherThanMemberAccess_Throws(Expression<Func<User, object>> expression)
412Expression<Func<User, object>> expression = m => someUser.Address;
428Expression<Func<List<User>, object>> expression = m => m[0];
444Expression<Func<User, object>> expression = m => m._userId;
463Func<ModelMetadata, bool> propertyFilter = (m) => true;
513Func<ModelMetadata, bool> propertyFilter = (m) =>
612Func<ModelMetadata, bool> propertyFilter = (m) => true;
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (10)
ModelMetadataProviderTest.cs (7)
32var propertyFilter = metadata.PropertyFilterProvider.PropertyFilter;
172public static TheoryData<object, Func<ModelMetadata, string>> ExpectedAttributeDataStrings
176return new TheoryData<object, Func<ModelMetadata, string>>
224public void AttributesOverrideMetadataStrings(object attribute, Func<ModelMetadata, string> accessor)
255public static TheoryData<Attribute, Func<ModelMetadata, bool>, bool> ExpectedAttributeDataBooleans
259return new TheoryData<Attribute, Func<ModelMetadata, bool>, bool>
342Func<ModelMetadata, bool> accessor,
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (11)
BsonTempDataSerializer.cs (10)
26private static readonly ConcurrentDictionary<Type, Func<JArray, object>> _arrayConverters =
27new ConcurrentDictionary<Type, Func<JArray, object>>();
28private static readonly ConcurrentDictionary<Type, Func<JObject, object>> _dictionaryConverters =
29new ConcurrentDictionary<Type, Func<JObject, object>>();
67var arrayConverter = _arrayConverters.GetOrAdd(returnType, type =>
69return (Func<JArray, object>)_convertArrayMethodInfo
71.CreateDelegate(typeof(Func<JArray, object>));
94var dictionaryConverter = _dictionaryConverters.GetOrAdd(valueType, type =>
96return (Func<JObject, object>)_convertDictionaryMethodInfo
98.CreateDelegate(typeof(Func<JObject, object>));
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
Microsoft.AspNetCore.Mvc.Razor (15)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
Microsoft.AspNetCore.Mvc.Razor.Test (3)
Microsoft.AspNetCore.Mvc.RazorPages (24)
Microsoft.AspNetCore.Mvc.RazorPages.Test (12)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (7)
Microsoft.AspNetCore.Mvc.Testing (18)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.4.25211.19\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (10)
41public static Func<string[], TWebHost>? ResolveWebHostFactory<TWebHost>(Assembly assembly)
46public static Func<string[], TWebHostBuilder>? ResolveWebHostBuilderFactory<TWebHostBuilder>(Assembly assembly)
51public static Func<string[], THostBuilder>? ResolveHostBuilderFactory<THostBuilder>(Assembly assembly)
62public static Func<string[], object>? ResolveHostFactory(Assembly assembly,
95private static Func<string[], T>? ResolveFactory<T>(Assembly assembly, string name)
122public static Func<string[], IServiceProvider?>? ResolveServiceProviderFactory(Assembly assembly, TimeSpan? waitTimeout = null)
125var webHostFactory = ResolveWebHostFactory<object>(assembly);
135var webHostBuilderFactory = ResolveWebHostBuilderFactory<object>(assembly);
146var hostBuilderFactory = ResolveHostBuilderFactory<object>(assembly);
157var hostFactory = ResolveHostFactory(assembly, waitTimeout: waitTimeout);
Microsoft.AspNetCore.Mvc.ViewFeatures (135)
CachedExpressionCompiler.cs (31)
22public static Func<TModel, object> Process<TModel, TResult>(
23Expression<Func<TModel, TResult>> expression)
32private static Func<TModel, object> _identityFunc;
34private static readonly ConcurrentDictionary<MemberInfo, Func<TModel, object>> _simpleMemberAccessCache =
35new ConcurrentDictionary<MemberInfo, Func<TModel, object>>();
37private static readonly ConcurrentDictionary<MemberExpressionCacheKey, Func<TModel, object>> _chainedMemberAccessCache =
38new ConcurrentDictionary<MemberExpressionCacheKey, Func<TModel, object>>(MemberExpressionCacheKeyComparer.Instance);
40private static readonly ConcurrentDictionary<MemberInfo, Func<object, TResult>> _constMemberAccessCache =
41new ConcurrentDictionary<MemberInfo, Func<object, TResult>>();
43public static Func<TModel, object> Compile(Expression<Func<TModel, TResult>> expression)
98private static Func<TModel, object> CompileFromConstLookup(
106private static Func<TModel, object> CompileFromIdentityFunc(
107Expression<Func<TModel, TResult>> expression)
113var identityFuncCore = expression.Compile();
120private static Func<TModel, object> CompileFromStaticMemberAccess(
121Expression<Func<TModel, TResult>> expression,
125if (_simpleMemberAccessCache.TryGetValue(memberExpression.Member, out var result))
130var func = expression.Compile();
137private static Func<TModel, object> CompileFromSimpleMemberAccess(
138Expression<Func<TModel, TResult>> expression,
143if (_simpleMemberAccessCache.TryGetValue(memberExpression.Member, out var result))
152private static Func<TModel, object> CompileForChainedMemberAccess(
153Expression<Func<TModel, TResult>> expression,
159if (_chainedMemberAccessCache.TryGetValue(key, out var result))
169private static Func<TModel, object> CompileCapturedConstant(MemberExpression memberExpression, ConstantExpression constantExpression)
172if (!_constMemberAccessCache.TryGetValue(memberExpression.Member, out var result))
179var replacementExpression = Expression.Lambda<Func<object, TResult>>(
191private static Func<TModel, object> Rewrite(
192Expression<Func<TModel, TResult>> expression,
230var rewrittenExpression = Expression.Lambda<Func<TModel, object>>(body, expression.Parameters);
HtmlHelperOfT.cs (21)
92Expression<Func<TModel, bool>> expression,
107Expression<Func<TModel, TResult>> expression,
125Expression<Func<TModel, TResult>> expression,
141public string DisplayNameFor<TResult>(Expression<Func<TModel, TResult>> expression)
151Expression<Func<TModelItem, TResult>> expression)
163public string DisplayTextFor<TResult>(Expression<Func<TModel, TResult>> expression)
172Expression<Func<TModel, TResult>> expression,
189Expression<Func<TModel, TResult>> expression,
204public string IdFor<TResult>(Expression<Func<TModel, TResult>> expression)
213Expression<Func<TModel, TResult>> expression,
225Expression<Func<TModel, TResult>> expression,
238public string NameFor<TResult>(Expression<Func<TModel, TResult>> expression)
248Expression<Func<TModel, TResult>> expression,
263Expression<Func<TModel, TResult>> expression,
281Expression<Func<TModel, TResult>> expression,
294Expression<Func<TModel, TResult>> expression,
309private ModelExpression GetModelExpression<TResult>(Expression<Func<TModel, TResult>> expression)
319protected string GetExpressionName<TResult>(Expression<Func<TModel, TResult>> expression)
332protected ModelExplorer GetModelExplorer<TResult>(Expression<Func<TModel, TResult>> expression)
342Expression<Func<TModel, TResult>> expression,
359public string ValueFor<TResult>(Expression<Func<TModel, TResult>> expression, string format)
ModelExplorer.cs (8)
19private Func<object, object> _modelAccessor;
52Func<object, object> modelAccessor)
260public ModelExplorer GetExplorerForProperty(string name, Func<object, object> modelAccessor)
357/// <see cref="GetExplorerForExpression(Type, Func{object, object})"/>
365public ModelExplorer GetExplorerForExpression(Type modelType, Func<object, object> modelAccessor)
382/// <see cref="GetExplorerForExpression(ModelMetadata, Func{object, object})"/>
390public ModelExplorer GetExplorerForExpression(ModelMetadata metadata, Func<object, object> modelAccessor)
419var modelAccessor = new Func<object, object>((c) =>
Rendering\HtmlHelperInputExtensions.cs (9)
118Expression<Func<TModel, bool>> expression)
196Expression<Func<TModel, TResult>> expression)
262Expression<Func<TModel, TResult>> expression)
403Expression<Func<TModel, TResult>> expression,
551Expression<Func<TModel, TResult>> expression)
582Expression<Func<TModel, TResult>> expression,
616Expression<Func<TModel, TResult>> expression,
762Expression<Func<TModel, TResult>> expression)
794Expression<Func<TModel, TResult>> expression,
Rendering\IHtmlHelperOfT.cs (18)
44IHtmlContent CheckBoxFor(Expression<Func<TModel, bool>> expression, object htmlAttributes);
77Expression<Func<TModel, TResult>> expression,
88string DisplayNameFor<TResult>(Expression<Func<TModel, TResult>> expression);
99Expression<Func<TModelItem, TResult>> expression);
111string DisplayTextFor<TResult>(Expression<Func<TModel, TResult>> expression);
143Expression<Func<TModel, TResult>> expression,
177Expression<Func<TModel, TResult>> expression,
208Expression<Func<TModel, TResult>> expression,
217string IdFor<TResult>(Expression<Func<TModel, TResult>> expression);
231Expression<Func<TModel, TResult>> expression,
262Expression<Func<TModel, TResult>> expression,
274string NameFor<TResult>(Expression<Func<TModel, TResult>> expression);
294Expression<Func<TModel, TResult>> expression,
327Expression<Func<TModel, TResult>> expression,
359Expression<Func<TModel, TResult>> expression,
389Expression<Func<TModel, TResult>> expression,
417Expression<Func<TModel, TResult>> expression,
441Expression<Func<TModel, TResult>> expression,
TemplateRenderer.cs (6)
22private static readonly Dictionary<string, Func<IHtmlHelper, IHtmlContent>> _defaultDisplayActions =
23new Dictionary<string, Func<IHtmlHelper, IHtmlContent>>(StringComparer.OrdinalIgnoreCase)
37private static readonly Dictionary<string, Func<IHtmlHelper, IHtmlContent>> _defaultEditorActions =
38new Dictionary<string, Func<IHtmlHelper, IHtmlContent>>(StringComparer.OrdinalIgnoreCase)
130if (defaultActions.TryGetValue(viewName, out var defaultAction))
140private Dictionary<string, Func<IHtmlHelper, IHtmlContent>> GetDefaultActions()
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (212)
ExpressionHelperTest.cs (102)
28(Expression<Func<TestModel, Category>>)(model => model.SelectedCategory),
32(Expression<Func<TestModel, CategoryName>>)(model => model.SelectedCategory.CategoryName),
36(Expression<Func<TestModel, int>>)(testModel => testModel.SelectedCategory.CategoryId),
40(Expression<Func<LowerModel, int>>)(testModel => testModel.selectedcategory.CategoryId),
44(Expression<Func<TestModel, string>>)(model => model.SelectedCategory.CategoryName.MainCategory),
48(Expression<Func<TestModel, TestModel>>)(model => model),
52(Expression<Func<TestModel, string>>)(model => value),
56(Expression<Func<TestModel, int>>)(model => models[0].SelectedCategory.CategoryId),
60(Expression<Func<TestModel, string>>)(model => modelTest.Name),
64(Expression<Func<TestModel, Type>>)(model => modelType),
68(Expression<Func<IList<TestModel>, Category>>)(model => model[2].SelectedCategory),
72(Expression<Func<IList<TestModel>, Category>>)(model => model[i].SelectedCategory),
76(Expression<Func<IList<LowerModel>, Category>>)(model => model[i].selectedcategory),
80(Expression<Func<IDictionary<string, TestModel>, string>>)(model => model[key].SelectedCategory.CategoryName.MainCategory),
84(Expression<Func<TestModel, int>>)(model => model.PreferredCategories[i].CategoryId),
88(Expression<Func<IList<TestModel>, Category>>)(model => myModels[i].SelectedCategory),
92(Expression<Func<IList<TestModel>, int>>)(model => model[2].PreferredCategories[i].CategoryId),
96(Expression<Func<IList<LowerModel>, int>>)(model => model[2].preferredcategories[i].CategoryId),
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),
130(Expression<Func<TestModel, int>>)(m => Microsoft.AspNetCore.Mvc.ViewFeatures.Model.Constants.WoodstockYear),
135(Expression<Func<TestModel, int>>)(m => Model.Constants.WoodstockYear),
142(Expression<Func<TestModel, string>>)(m => Model.Constants.Model.Name),
146(Expression<Func<TestModel, string>>)(m => AStaticClass.Model),
150(Expression<Func<TestModel, string>>)(m => AStaticClass.Test),
154(Expression<Func<TestModel, string>>)(m => AnotherStaticClass.Model.Name),
158(Expression<Func<TestModel, string>>)(m => AnotherStaticClass.Test.Name),
166data.Add((Expression<Func<TestModel, string>>)(m => model), string.Empty);
172data.Add((Expression<Func<TestModel, TestModel>>)(m => Model), string.Empty);
173data.Add((Expression<Func<TestModel, TestModel>>)(model => Model), string.Empty);
174data.Add((Expression<Func<TestModel, Category>>)(m => Model.SelectedCategory), "SelectedCategory");
190(Expression<Func<TestModel, Category>>)(model => model.SelectedCategory),
191(Expression<Func<TestModel, CategoryName>>)(model => model.SelectedCategory.CategoryName),
192(Expression<Func<TestModel, int>>)(testModel => testModel.SelectedCategory.CategoryId),
193(Expression<Func<TestModel, string>>)(model => model.SelectedCategory.CategoryName.MainCategory),
194(Expression<Func<TestModel, string>>)(testModel => key),
195(Expression<Func<TestModel, TestModel>>)(m => m),
196(Expression<Func<TestModel, Category>>)(m => myModel.SelectedCategory),
211(Expression<Func<IList<TestModel>, Category>>)(model => model[2].SelectedCategory),
212(Expression<Func<IList<TestModel>, Category>>)(model => myModels[i].SelectedCategory),
213(Expression<Func<IList<TestModel>, CategoryName>>)(testModel => testModel[i].SelectedCategory.CategoryName),
214(Expression<Func<TestModel, int>>)(model => model.PreferredCategories[i].CategoryId),
215(Expression<Func<IDictionary<string, TestModel>, string>>)(model => model[key].SelectedCategory.CategoryName.MainCategory),
230(Expression<Func<TestModel[][], string>>)(model => model[23][3].Name),
231(Expression<Func<TestModel[][], string>>)(model => model[i][3].Name),
232(Expression<Func<TestModel[][], string>>)(model => model[23][j].Name),
233(Expression<Func<TestModel[][], string>>)(model => model[i][j].Name),
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),
252(Expression<Func<TestModel, Category>>)(model => model.SelectedCategory),
253(Expression<Func<TestModel, Category>>)(model => model.SelectedCategory)
256(Expression<Func<TestModel, CategoryName>>)(model => model.SelectedCategory.CategoryName),
257(Expression<Func<TestModel, CategoryName>>)(model => model.SelectedCategory.CategoryName)
260(Expression<Func<TestModel, int>>)(testModel => testModel.SelectedCategory.CategoryId),
261(Expression<Func<TestModel, int>>)(testModel => testModel.SelectedCategory.CategoryId)
264(Expression<Func<TestModel, string>>)(model => model.SelectedCategory.CategoryName.MainCategory),
265(Expression<Func<TestModel, string>>)(model => model.SelectedCategory.CategoryName.MainCategory)
268(Expression<Func<TestModel, TestModel>>)(model => model),
269(Expression<Func<TestModel, TestModel>>)(m => m)
272(Expression<Func<TestModel, string>>)(model => value),
273(Expression<Func<TestModel, string>>)(m => value)
279(Expression<Func<TestModel, string>>)(m => Model),
280(Expression<Func<TestModel, TestModel>>)(m => m)
298(Expression<Func<TestModel, Category>>)(model => model.SelectedCategory),
299(Expression<Func<TestModel, CategoryName>>)(model => model.SelectedCategory.CategoryName)
302(Expression<Func<TestModel, CategoryName>>)(model => model.SelectedCategory.CategoryName),
303(Expression<Func<LowerModel, CategoryName>>)(model => model.selectedcategory.CategoryName)
306(Expression<Func<TestModel, string>>)(model => model.Model),
307(Expression<Func<TestModel, string>>)(model => model.Name)
310(Expression<Func<TestModel, string>>)(model => model.Model),
311(Expression<Func<LowerModel, string>>)(model => model.model)
314(Expression<Func<TestModel, string>>)(model => model.Name),
315(Expression<Func<LowerModel, string>>)(model => model.name)
318(Expression<Func<TestModel, CategoryName>>)(model => model.SelectedCategory.CategoryName),
319(Expression<Func<TestModel, string>>)(model => value)
322(Expression<Func<TestModel, string>>)(testModel => testModel.SelectedCategory.CategoryName.MainCategory),
323(Expression<Func<TestModel, string>>)(testModel => value)
326(Expression<Func<IList<TestModel>, Category>>)(model => model[2].SelectedCategory),
327(Expression<Func<TestModel, string>>)(model => model.SelectedCategory.CategoryName.MainCategory)
330(Expression<Func<IList<TestModel>, Category>>)(model => model[2].SelectedCategory),
331(Expression<Func<IList<LowerModel>, Category>>)(model => model[2].selectedcategory)
334(Expression<Func<TestModel, int>>)(testModel => testModel.SelectedCategory.CategoryId),
335(Expression<Func<TestModel, Category>>)(model => model.SelectedCategory)
338(Expression<Func<IDictionary<string, TestModel>, string>>)(model => model[key].SelectedCategory.CategoryName.MainCategory),
339(Expression<Func<TestModel, Category>>)(model => model.SelectedCategory)
342(Expression<Func<IDictionary<string, TestModel>, string>>)(model => model[key].SelectedCategory.CategoryName.MainCategory),
343(Expression<Func<IDictionary<string, LowerModel>, string>>)(model => model[key].selectedcategory.CategoryName.MainCategory)
346(Expression<Func<TestModel, string>>)(m => Model),
347(Expression<Func<TestModel, string>>)(m => m.Model)
350(Expression<Func<TestModel, TestModel>>)(m => m),
351(Expression<Func<TestModel, string>>)(m => m.Model)
354(Expression<Func<TestModel, string>>)(m => myModel.Name),
355(Expression<Func<TestModel, string>>)(m => m.Name)
358(Expression<Func<TestModel, string>>)(m => key),
359(Expression<Func<TestModel, string>>)(m => value)
448(Expression<Func<List<TestModel>, int>>)(m => collection[i].SelectedCategory.CategoryId),
Rendering\HtmlHelperHiddenTest.cs (6)
761public static TheoryData<Expression<Func<HiddenModel, string>>, string> HiddenFor_UsesPropertyValueIfModelStateDoesNotContainValueData
767return new TheoryData<Expression<Func<HiddenModel, string>>, string>
796Expression<Func<HiddenModel, string>> expression,
822public static TheoryData<Expression<Func<HiddenModel, string>>, string> HiddenFor_UsesModelStateValueForComplexExpressionsData
826return new TheoryData<Expression<Func<HiddenModel, string>>, string>
850Expression<Func<HiddenModel, string>> expression,
Rendering\HtmlHelperNameExtensionsTest.cs (4)
248public static TheoryData<Expression<Func<List<OuterClass>, string>>, string, string> StaticExpressionNamesData
259private TheoryData<Expression<Func<List<OuterClass>, string>>, string, string> ExpressionNamesData
269return new TheoryData<Expression<Func<List<OuterClass>, string>>, string, string>
307Expression<Func<List<OuterClass>, string>> expression,
Rendering\HtmlHelperPartialExtensionsTest.cs (11)
15public static TheoryData<Func<IHtmlHelper, IHtmlContent>, object, ViewDataDictionary> PartialExtensionMethods
21return new TheoryData<Func<IHtmlHelper, IHtmlContent>, object, ViewDataDictionary>
34Func<IHtmlHelper, IHtmlContent> partialMethod,
67Func<IHtmlHelper, IHtmlContent> partialMethod,
90public static TheoryData<Func<IHtmlHelper, Task<IHtmlContent>>, object, ViewDataDictionary> PartialAsyncExtensionMethods
96return new TheoryData<Func<IHtmlHelper, Task<IHtmlContent>>, object, ViewDataDictionary>
108Func<IHtmlHelper, Task<IHtmlContent>> partialAsyncMethod,
183Func<IHtmlHelper, Task> renderPartialAsyncMethod,
213public static TheoryData<Func<IHtmlHelper, Task>, object, ViewDataDictionary> RenderPartialAsyncExtensionMethods
219return new TheoryData<Func<IHtmlHelper, Task>, object, ViewDataDictionary>
231Func<IHtmlHelper, Task> renderPartialAsyncMethod,
Rendering\HtmlHelperPasswordTest.cs (6)
323public static TheoryData<Expression<Func<PasswordModel, string>>, string> PasswordFor_WithComplexExpressionsData
327return new TheoryData<Expression<Func<PasswordModel, string>>, string>
351Expression<Func<PasswordModel, string>> expression,
471public static TheoryData<Expression<Func<PasswordModel, string>>, string> PasswordFor_IgnoresExpressionValueForComplexExpressionsData
475return new TheoryData<Expression<Func<PasswordModel, string>>, string>
499Expression<Func<PasswordModel, string>> expression,
Rendering\HtmlHelperTextAreaTest.cs (6)
41public static TheoryData<Expression<Func<ComplexModel, string>>, string> TextAreaFor_UsesModelValueForComplexExpressionsData
45return new TheoryData<Expression<Func<ComplexModel, string>>, string>
69Expression<Func<ComplexModel, string>> expression,
88public static TheoryData<Expression<Func<ComplexModel, string>>, string> TextAreaFor_UsesModelStateValueForComplexExpressionsData
92return new TheoryData<Expression<Func<ComplexModel, string>>, string>
116Expression<Func<ComplexModel, string>> expression,
Rendering\HtmlHelperTextBoxTest.cs (6)
59public static TheoryData<Expression<Func<ComplexModel, string>>, string> TextBoxFor_UsesModelValueForComplexExpressionsData
63return new TheoryData<Expression<Func<ComplexModel, string>>, string>
87Expression<Func<ComplexModel, string>> expression,
106public static TheoryData<Expression<Func<ComplexModel, string>>, string> TextBoxFor_UsesModelStateValueForComplexExpressionsData
110return new TheoryData<Expression<Func<ComplexModel, string>>, string>
134Expression<Func<ComplexModel, string>> expression,
Microsoft.AspNetCore.OpenApi (31)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
23typeof(Func<object, object>), // getAwaiterMethod
24typeof(Func<object, bool>), // isCompletedMethod
25typeof(Func<object, object>), // getResultMethod
282var getAwaiterFunc = Expression.Lambda<Func<object, object>>(
293var isCompletedFunc = Expression.Lambda<Func<object, bool>>(
300Func<object, object> getResultFunc;
308getResultFunc = Expression.Lambda<Func<object, object>>(
321getResultFunc = Expression.Lambda<Func<object, object>>(
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorAwaitable.cs (10)
19private readonly Func<object, object> _getAwaiterMethod;
20private readonly Func<object, bool> _isCompletedMethod;
21private readonly Func<object, object> _getResultMethod;
45Func<object, object> getAwaiterMethod,
46Func<object, bool> isCompletedMethod,
47Func<object, object> getResultMethod,
68private readonly Func<object, bool> _isCompletedMethod;
69private readonly Func<object, object> _getResultMethod;
75Func<object, bool> isCompletedMethod,
76Func<object, object> getResultMethod,
Microsoft.AspNetCore.OpenApi.SourceGenerators (1)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (11)
SnapshotTestHelper.cs (11)
174var factory = HostFactoryResolver.ResolveHostFactory(assembly,
251public static Func<string[], TWebHost> ResolveWebHostFactory<TWebHost>(Assembly assembly)
256public static Func<string[], TWebHostBuilder> ResolveWebHostBuilderFactory<TWebHostBuilder>(Assembly assembly)
261public static Func<string[], THostBuilder> ResolveHostBuilderFactory<THostBuilder>(Assembly assembly)
272public static Func<string[], object> ResolveHostFactory(Assembly assembly,
286private static Func<string[], T> ResolveFactory<T>(Assembly assembly, string name)
313public static Func<string[], IServiceProvider> ResolveServiceProviderFactory(Assembly assembly, TimeSpan waitTimeout = default)
316var webHostFactory = ResolveWebHostFactory<object>(assembly);
326var webHostBuilderFactory = ResolveWebHostBuilderFactory<object>(assembly);
337var hostBuilderFactory = ResolveHostBuilderFactory<object>(assembly);
348var hostFactory = ResolveHostFactory(assembly, waitTimeout: waitTimeout);
Microsoft.AspNetCore.OutputCaching (6)
Microsoft.AspNetCore.OutputCaching.Tests (1)
Microsoft.AspNetCore.Owin (45)
OwinEnvironment.cs (12)
20Func
318public FeatureMap(Type featureInterface, Func<object, object> getter)
329public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory)
340public FeatureMap(Type featureInterface, Func<object, object> getter, Action<object, object> setter)
352public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter)
365public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter, Func<object> featureFactory)
375private Func<object, object> Getter { get; set; }
433public FeatureMap(Func<TFeature, object> getter)
443public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory)
453public FeatureMap(Func<TFeature, object> getter, Action<TFeature, object> setter)
464public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory, Action<TFeature, object> setter)
476public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory, Action<TFeature, object> setter, Func<TFeature> featureFactory)
OwinExtensions.cs (13)
10using AddMiddleware = Action<Func<
11Func<IDictionary<string, object>, Task>,
12Func<IDictionary<string, object>, Task>
14using AppFunc = Func<IDictionary<string, object>, Task>;
15using CreateMiddleware = Func<
16Func<IDictionary<string, object>, Task>,
17Func<IDictionary<string, object>, Task>
36Func<RequestDelegate, RequestDelegate> middleware1 = next1 =>
38AppFunc exitMiddleware = env =>
42var app = middleware(exitMiddleware);
113var middleware = CreateMiddlewareFactory(exit =>
123private static CreateMiddleware CreateMiddlewareFactory(Func<RequestDelegate, RequestDelegate> middleware, IServiceProvider services)
Microsoft.AspNetCore.Owin.Tests (11)
OwinExtensionTests.cs (11)
10using AddMiddleware = Action<Func<
11Func<IDictionary<string, object>, Task>,
12Func<IDictionary<string, object>, Task>
14using AppFunc = Func<IDictionary<string, object>, Task>;
15using CreateMiddleware = Func<
16Func<IDictionary<string, object>, Task>,
17Func<IDictionary<string, object>, Task>
22static readonly AppFunc notFound = env => new Task(() => { env["owin.ResponseStatusCode"] = 404; });
27var list = new List<CreateMiddleware>();
56var list = new List<CreateMiddleware>();
91var list = new List<CreateMiddleware>();
Microsoft.AspNetCore.RateLimiting (9)
RateLimiterOptions.cs (7)
19internal Dictionary<string, Func<IServiceProvider, DefaultRateLimiterPolicy>> UnactivatedPolicyMap { get; }
20= new Dictionary<string, Func<IServiceProvider, DefaultRateLimiterPolicy>>(StringComparer.Ordinal);
48public RateLimiterOptions AddPolicy<TPartitionKey>(string policyName, Func<HttpContext, RateLimitPartition<TPartitionKey>> partitioner)
76Func<IServiceProvider, DefaultRateLimiterPolicy> policyFunc = serviceProvider =>
109internal static Func<HttpContext, RateLimitPartition<DefaultKeyType>> ConvertPartitioner<TPartitionKey>(string? policyName, Func<HttpContext, RateLimitPartition<TPartitionKey>> partitioner)
115return new RateLimitPartition<DefaultKeyType>(partitionKey, static key => ((Func<TPartitionKey, RateLimiter>)key.Factory!)((TPartitionKey)key.Key!));
Microsoft.AspNetCore.RequestDecompression.Tests (1)
Microsoft.AspNetCore.ResponseCaching.Tests (1)
Microsoft.AspNetCore.Rewrite (1)
Microsoft.AspNetCore.Routing (16)
src\Shared\PropertyHelper\PropertyHelper.cs (11)
46private Func<object, object?>? _valueGetter;
71public Func<object, object?> ValueGetter
159public static Func<object, object?> MakeFastPropertyGetter(PropertyInfo propertyInfo)
179public static Func<object, object?> MakeNullSafeFastPropertyGetter(PropertyInfo propertyInfo)
190private static Func<object, object?> MakeFastPropertyGetter(
230typeof(Func<,>),
243private static Func<object, object?> MakeFastPropertyGetter(
256typeof(Func<object, object?>),
259return (Func<object, object?>)accessorDelegate;
344Func<TDeclaringType, TValue> getter,
361Func<TDeclaringType, TValue> getter,
Microsoft.AspNetCore.Routing.Abstractions (11)
src\Shared\PropertyHelper\PropertyHelper.cs (11)
46private Func<object, object?>? _valueGetter;
71public Func<object, object?> ValueGetter
159public static Func<object, object?> MakeFastPropertyGetter(PropertyInfo propertyInfo)
179public static Func<object, object?> MakeNullSafeFastPropertyGetter(PropertyInfo propertyInfo)
190private static Func<object, object?> MakeFastPropertyGetter(
230typeof(Func<,>),
243private static Func<object, object?> MakeFastPropertyGetter(
256typeof(Func<object, object?>),
259return (Func<object, object?>)accessorDelegate;
344Func<TDeclaringType, TValue> getter,
361Func<TDeclaringType, TValue> getter,
Microsoft.AspNetCore.Routing.FunctionalTests (1)
Microsoft.AspNetCore.Routing.Tests (5)
Microsoft.AspNetCore.Server.HttpSys (11)
RequestProcessing\RequestContext.FeatureCollection.cs (8)
71private List<Tuple<Func<object, Task>, object>>? _onStartingActions = new List<Tuple<Func<object, Task>, object>>();
72private List<Tuple<Func<object, Task>, object>>? _onCompletedActions = new List<Tuple<Func<object, Task>, object>>();
453void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state)
461_onStartingActions.Add(new Tuple<Func<object, Task>, object>(callback, state));
464void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state)
472_onCompletedActions.Add(new Tuple<Func<object, Task>, object>(callback, state));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (5)
Microsoft.AspNetCore.Server.IIS (15)
Core\IISHttpContext.cs (10)
48protected Stack<KeyValuePair<Func<object, Task>, object>>? _onStarting;
49protected Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted;
673public void OnStarting(Func<object, Task> callback, object state)
684_onStarting = new Stack<KeyValuePair<Func<object, Task>, object>>();
686_onStarting.Push(new KeyValuePair<Func<object, Task>, object>(callback, state));
690public void OnCompleted(Func<object, Task> callback, object state)
696_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>();
698_onCompleted.Push(new KeyValuePair<Func<object, Task>, object>(callback, state));
704Stack<KeyValuePair<Func<object, Task>, object>>? onStarting = null;
728Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted = null;
Microsoft.AspNetCore.Server.IISIntegration (1)
Microsoft.AspNetCore.Server.IntegrationTesting (4)
Microsoft.AspNetCore.Server.Kestrel.Core (66)
Internal\AddressBinder.cs (5)
19public static Task BindAsync(ListenOptions[] listenOptions, AddressBindContext context, Func<ListenOptions, ListenOptions> useHttps, CancellationToken cancellationToken)
35private static IStrategy CreateStrategy(ListenOptions[] listenOptions, string[] addresses, bool preferAddresses, Func<ListenOptions, ListenOptions> useHttps)
168public OverrideWithAddressesStrategy(IReadOnlyCollection<string> addresses, Func<ListenOptions, ListenOptions> useHttps)
227private readonly Func<ListenOptions, ListenOptions> _useHttps;
229public AddressesStrategy(IReadOnlyCollection<string> addresses, Func<ListenOptions, ListenOptions> useHttps)
Internal\Http\HttpProtocol.cs (10)
43private Stack<KeyValuePair<Func<object, Task>, object>>? _onStarting;
44private Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted;
788public void OnStarting(Func<object, Task> callback, object state)
797_onStarting = new Stack<KeyValuePair<Func<object, Task>, object>>();
799_onStarting.Push(new KeyValuePair<Func<object, Task>, object>(callback, state));
802public void OnCompleted(Func<object, Task> callback, object state)
806_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>();
808_onCompleted.Push(new KeyValuePair<Func<object, Task>, object>(callback, state));
821static async Task ProcessEvents(HttpProtocol protocol, Stack<KeyValuePair<Func<object, Task>, object>> events)
849static async Task ProcessEvents(HttpProtocol protocol, Stack<KeyValuePair<Func<object, Task>, object>> events)
Internal\Infrastructure\KestrelConnection.cs (6)
15private Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted;
75void IConnectionCompleteFeature.OnCompleted(Func<object, Task> callback, object state)
84_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>();
86_onCompleted.Push(new KeyValuePair<Func<object, Task>, object>(callback, state));
107private Task CompleteAsyncMayAwait(Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
128private async Task CompleteAsyncAwaited(Task currentTask, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (15)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (12)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (3)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted)
22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (3)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted)
22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (4)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Microsoft.AspNetCore.Shared.Tests (44)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
23typeof(Func<object, object>), // getAwaiterMethod
24typeof(Func<object, bool>), // isCompletedMethod
25typeof(Func<object, object>), // getResultMethod
282var getAwaiterFunc = Expression.Lambda<Func<object, object>>(
293var isCompletedFunc = Expression.Lambda<Func<object, bool>>(
300Func<object, object> getResultFunc;
308getResultFunc = Expression.Lambda<Func<object, object>>(
321getResultFunc = Expression.Lambda<Func<object, object>>(
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorAwaitable.cs (10)
19private readonly Func<object, object> _getAwaiterMethod;
20private readonly Func<object, bool> _isCompletedMethod;
21private readonly Func<object, object> _getResultMethod;
45Func<object, object> getAwaiterMethod,
46Func<object, bool> isCompletedMethod,
47Func<object, object> getResultMethod,
68private readonly Func<object, bool> _isCompletedMethod;
69private readonly Func<object, object> _getResultMethod;
75Func<object, bool> isCompletedMethod,
76Func<object, object> getResultMethod,
src\Shared\PropertyHelper\PropertyHelper.cs (11)
46private Func<object, object?>? _valueGetter;
71public Func<object, object?> ValueGetter
159public static Func<object, object?> MakeFastPropertyGetter(PropertyInfo propertyInfo)
179public static Func<object, object?> MakeNullSafeFastPropertyGetter(PropertyInfo propertyInfo)
190private static Func<object, object?> MakeFastPropertyGetter(
230typeof(Func<,>),
243private static Func<object, object?> MakeFastPropertyGetter(
256typeof(Func<object, object?>),
259return (Func<object, object?>)accessorDelegate;
344Func<TDeclaringType, TValue> getter,
361Func<TDeclaringType, TValue> getter,
Microsoft.AspNetCore.SignalR.Client.Core (18)
HubConnectionExtensions.OnResult.cs (8)
18private static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Func<object?[], TResult> handler)
22var currentHandler = (Func<object?[], TResult>)state;
37public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Func<object?[], Task<TResult>> handler)
41var currentHandler = (Func<object?[], Task<TResult>>)state;
88public static IDisposable On<T1, TResult>(this HubConnection hubConnection, string methodName, Func<T1, TResult> handler)
268public static IDisposable On<T1, TResult>(this HubConnection hubConnection, string methodName, Func<T1, Task<TResult>> handler)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
Microsoft.AspNetCore.SignalR.Client.Tests (17)
Microsoft.AspNetCore.SignalR.Core (36)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (10)
23typeof(Func<object, object>), // getAwaiterMethod
24typeof(Func<object, bool>), // isCompletedMethod
25typeof(Func<object, object>), // getResultMethod
282var getAwaiterFunc = Expression.Lambda<Func<object, object>>(
293var isCompletedFunc = Expression.Lambda<Func<object, bool>>(
300Func<object, object> getResultFunc;
308getResultFunc = Expression.Lambda<Func<object, object>>(
321getResultFunc = Expression.Lambda<Func<object, object>>(
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorAwaitable.cs (10)
19private readonly Func<object, object> _getAwaiterMethod;
20private readonly Func<object, bool> _isCompletedMethod;
21private readonly Func<object, object> _getResultMethod;
45Func<object, object> getAwaiterMethod,
46Func<object, bool> isCompletedMethod,
47Func<object, object> getResultMethod,
68private readonly Func<object, bool> _isCompletedMethod;
69private readonly Func<object, object> _getResultMethod;
75Func<object, bool> isCompletedMethod,
76Func<object, object> getResultMethod,
Microsoft.AspNetCore.SignalR.StackExchangeRedis (2)
Microsoft.AspNetCore.SignalR.Tests (19)
TestFilters.cs (13)
19public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next)
26public async ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
52public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next)
58public async ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
91public Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next)
103public ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
112public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next)
130public async ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
155public Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next)
175public ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
200public ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
221public ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
229public ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
Microsoft.AspNetCore.SignalR.Tests.Utils (10)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (2)
Microsoft.AspNetCore.StaticFiles (2)
Microsoft.AspNetCore.TestHost (15)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.4.25211.19\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (10)
41public static Func<string[], TWebHost>? ResolveWebHostFactory<TWebHost>(Assembly assembly)
46public static Func<string[], TWebHostBuilder>? ResolveWebHostBuilderFactory<TWebHostBuilder>(Assembly assembly)
51public static Func<string[], THostBuilder>? ResolveHostBuilderFactory<THostBuilder>(Assembly assembly)
62public static Func<string[], object>? ResolveHostFactory(Assembly assembly,
95private static Func<string[], T>? ResolveFactory<T>(Assembly assembly, string name)
122public static Func<string[], IServiceProvider?>? ResolveServiceProviderFactory(Assembly assembly, TimeSpan? waitTimeout = null)
125var webHostFactory = ResolveWebHostFactory<object>(assembly);
135var webHostBuilderFactory = ResolveWebHostBuilderFactory<object>(assembly);
146var hostBuilderFactory = ResolveHostBuilderFactory<object>(assembly);
157var hostFactory = ResolveHostFactory(assembly, waitTimeout: waitTimeout);
Microsoft.AspNetCore.TestHost.Tests (2)
Microsoft.AspNetCore.Testing (2)
Microsoft.AspNetCore.WebSockets.Tests (1)
Microsoft.AspNetCore.WebUtilities.Tests (8)
Microsoft.Build (61)
Instance\ImmutableProjectCollections\ImmutableItemDictionary.cs (7)
23private readonly Func<TCached, T?> _getInstance;
24private readonly Func<T, string?> _getItemType;
29Func<TCached, T?> getInstance,
30Func<T, string?> getItemType)
109public IEnumerable<TResult> GetCopyOnReadEnumerable<TResult>(Func<T, TResult> selector)
179private readonly Func<TCached, T?> _getInstance;
181public ListConverter(string itemType, ICollection<TCached> list, Func<TCached, T?> getInstance)
Microsoft.Build.BuildCheck.UnitTests (1)
Microsoft.Build.Engine.OM.UnitTests (23)
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (10)
129public ICollection<ElementLinkPair<CT>> QueryChildrenWithValidation<CT>(Func<CT, bool> matcher, int expectedCount)
137public ICollection<ElementLinkPair<CT>> QueryChildrenWithValidation<CT>(Func<T, IEnumerable> getter, Func<CT, bool> matcher, int expectedCount)
145public ICollection<ElementLinkPair<CT>> QueryChildrenWithValidation<CT>(Func<T, IEnumerable> getter, Func<CT, bool> matcher)
184public ICollection<ElementLinkPair<CT>> QueryChildrenWithValidation<CT>(Func<CT, bool> matcher)
193public ElementLinkPair<CT> QuerySingleChildrenWithValidation<CT>(Func<CT, bool> matcher)
200public ElementLinkPair<CT> QuerySingleChildrenWithValidation<CT>(Func<T, IEnumerable> getter, Func<CT, bool> matcher)
214public ElementLinkPair<CT> CreateWithVerify<CT>(Func<ProjectRootElement, CT> creator)
ObjectModelRemoting\Helpers\ViewValidation.cs (4)
47public void VerifySetter(bool finalValue, Func<T, bool> getter, Action<T, bool> setter)
69public void VerifySetter(string newValue, Func<T, string> getter, Action<T, string> setter)
278public static void VerifyMetadata(IEnumerable<KeyValuePair<string, string>> expected, Func<string, string> getMetadata, Func<string, bool> hasMetadata = null)
Microsoft.Build.Engine.UnitTests (21)
Graph\IsolateProjects_Tests.cs (11)
448Func<string, string> Preserve = path => path;
450Func<string, string> FullToRelative = path =>
458Func<string, string> ToForwardSlash = path => path.ToSlash();
460Func<string, string> ToBackSlash = path => path.ToBackslash();
462Func<string, string> ToDuplicateSlashes = path => path.Replace("/", "//").Replace(@"\", @"\\");
468foreach (var projectReferenceModifier in functions)
470foreach (var msbuildProjectModifier in functions)
488public void UndeclaredReferenceEnforcementShouldNormalizeFilePaths(Func<string, string> projectReferenceModifier, Func<string, string> msbuildProjectModifier, string targetName)
512Func<string, string> projectReferenceModifier = null,
513Func<string, string> msbuildOnDeclaredReferenceModifier = null)
Microsoft.Build.Framework (19)
ImmutableSegmentedDictionary.cs (6)
66public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector)
70public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer)
84public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
88public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
RoslynImmutableInterlocked.cs (6)
30public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer)
152public static bool Update<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, ImmutableSegmentedDictionary<TKey, TValue>> transformer)
286/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/>
287public static TValue GetOrAdd<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory)
334/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/>
335public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
Microsoft.Build.Tasks.CodeAnalysis (2)
Microsoft.Build.Tasks.Core (6)
Microsoft.Build.Tasks.UnitTests (3)
Microsoft.Build.UnitTests.Shared (5)
Microsoft.Build.Utilities.Core (6)
Microsoft.Cci.Extensions (13)
Microsoft.CodeAnalysis (357)
Binding\BindingDiagnosticBag.cs (4)
223internal bool AddDiagnostics<TData>(CompoundUseSiteInfo<TAssemblySymbol> useSiteInfo, Func<TData, Location> getLocation, TData data)
259internal bool Add<TData>(CompoundUseSiteInfo<TAssemblySymbol> useSiteInfo, Func<TData, Location> getLocation, TData data)
282internal bool Add<TData>(UseSiteInfo<TAssemblySymbol> info, Func<TData, Location> getLocation, TData data)
296internal bool ReportUseSiteDiagnostic<TData>(DiagnosticInfo? info, Func<TData, Location> getLocation, TData data)
Collections\CachingFactory.cs (8)
45private readonly Func<TKey, TValue> _valueFactory;
46private readonly Func<TKey, int> _keyHash;
50Func<TKey, TValue> valueFactory,
51Func<TKey, int> keyHash,
131private readonly Func<TKey, TValue> _valueFactory;
140public CachingIdentityFactory(int size, Func<TKey, TValue> valueFactory) :
146public CachingIdentityFactory(int size, Func<TKey, TValue> valueFactory, ObjectPool<CachingIdentityFactory<TKey, TValue>> pool) :
196public static ObjectPool<CachingIdentityFactory<TKey, TValue>> CreatePool(int size, Func<TKey, TValue> valueFactory)
Collections\ImmutableArrayExtensions.cs (18)
141public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ImmutableArray<TItem> items, Func<TItem, TResult> map)
210public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, TResult> selector)
267public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, IEnumerable<TResult>> selector)
287public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, ImmutableArray<TResult>> selector)
307public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, OneOrMany<TResult>> selector)
330public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, IEnumerable<TResult>> selector)
354public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, ImmutableArray<TResult>> selector)
378public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, OneOrMany<TResult>> selector)
537public static ImmutableArray<T> WhereAsArray<T>(this ImmutableArray<T> array, Func<T, bool> predicate)
548private static ImmutableArray<T> WhereAsArrayImpl<T, TArg>(ImmutableArray<T> array, Func<T, bool>? predicateWithoutArg, Func<T, TArg, bool>? predicateWithArg, TArg arg)
649public static async Task<bool> AnyAsync<T>(this ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
681public static async ValueTask<T?> FirstOrDefaultAsync<T>(this ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
1110public static int Count<T>(this ImmutableArray<T> items, Func<T, bool> predicate)
1129public static int Sum<T>(this ImmutableArray<T> items, Func<T, int> selector)
Compilation\Compilation.cs (10)
3066Func<ISymbol, bool> isAddedSymbol,
3093Func<ISymbol, bool> isAddedSymbol,
3139Func<ISymbol, bool> isAddedSymbol,
3214Func<ISymWriterMetadataProvider, SymUnmanagedWriter>? testSymWriterFactory,
3433Func<ISymWriterMetadataProvider, SymUnmanagedWriter>? testSymWriterFactory,
3555private static readonly Func<SyntaxTree, SmallConcurrentSetOfInts> s_createSetCallback = t => new SmallConcurrentSetOfInts();
3696public abstract bool ContainsSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default(CancellationToken));
3701public abstract IEnumerable<ISymbol> GetSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default(CancellationToken));
3706/// This may be faster than <see cref="ContainsSymbolsWithName(Func{string, bool},
3714/// faster than <see cref="GetSymbolsWithName(Func{string, bool}, SymbolFilter,
DiagnosticAnalyzer\AnalysisResultBuilder.cs (5)
187public void ApplySuppressionsAndStoreAnalysisResult(AnalysisScope analysisScope, AnalyzerDriver driver, Compilation compilation, Func<DiagnosticAnalyzer, AnalyzerActionCounts> getAnalyzerActionCounts, CancellationToken cancellationToken)
330Func<Diagnostic, TKey?> getKeyFunc,
509Func<Diagnostic, bool> shouldInclude = analysisScope.ShouldInclude;
525Func<Diagnostic, bool> shouldInclude,
561Func<Diagnostic, bool> shouldInclude,
DiagnosticAnalyzer\AnalyzerDriver.cs (8)
37private static readonly Func<DiagnosticAnalyzer, bool> s_IsCompilerAnalyzerFunc = IsCompilerAnalyzer;
371protected AnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter, Func<SyntaxTrivia, bool> isComment)
827Func<Exception, bool>? nullFilter = null;
838Func<Exception, bool>? analyzerExceptionFilter,
2405private readonly Func<SyntaxNode, TLanguageKindEnum> _getKind;
2416internal AnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, Func<SyntaxNode, TLanguageKindEnum> getKind, AnalyzerManager analyzerManager, SeverityFilter severityFilter, Func<SyntaxTrivia, bool> isComment)
2905Func<SyntaxNode, bool>? additionalFilter = semanticModel.GetSyntaxNodesToAnalyzeFilter(declaredNode, declaredSymbol);
DiagnosticAnalyzer\AnalyzerExecutor.cs (23)
38private readonly Func<Exception, bool>? _analyzerExceptionFilter;
40private readonly Func<DiagnosticAnalyzer, bool> _isCompilerAnalyzer;
41private readonly Func<DiagnosticAnalyzer, object?> _getAnalyzerGate;
42private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel;
43private readonly Func<DiagnosticAnalyzer, bool> _shouldSkipAnalysisOnGeneratedCode;
54private Func<IOperation, ControlFlowGraph>? _lazyGetControlFlowGraph;
58private Func<IOperation, ControlFlowGraph> GetControlFlowGraph
103Func<Exception, bool>? analyzerExceptionFilter,
104Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer,
106Func<DiagnosticAnalyzer, bool> shouldSkipAnalysisOnGeneratedCode,
110Func<DiagnosticAnalyzer, object?> getAnalyzerGate,
111Func<SyntaxTree, SemanticModel> getSemanticModel,
135Func<Exception, bool>? analyzerExceptionFilter,
136Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer,
138Func<DiagnosticAnalyzer, bool> shouldSkipAnalysisOnGeneratedCode,
142Func<DiagnosticAnalyzer, object?> getAnalyzerGate,
143Func<SyntaxTree, SemanticModel> getSemanticModel,
301out Func<SuppressionDescriptor, bool> isSupportedSuppression);
741Func<SyntaxNode, TLanguageKindEnum> getKind,
1000Func<SyntaxNode, TLanguageKindEnum> getKind,
1034Func<SyntaxNode, TLanguageKindEnum> getKind,
1253Func<Exception, bool>? analyzerExceptionFilter,
1274static bool exceptionFilter(Exception ex, Func<Exception, bool>? analyzerExceptionFilter, CancellationToken cancellationToken)
DiagnosticAnalyzer\AnalyzerFileReference.cs (4)
190internal void AddAnalyzers(ImmutableArray<DiagnosticAnalyzer>.Builder builder, string language, Func<DiagnosticAnalyzer, bool>? shouldInclude = null)
376private readonly Func<object?, TExtension?>? _coerceFunction;
381internal Extensions(AnalyzerFileReference reference, Type attributeType, AttributeLanguagesFunc languagesFunc, bool allowNetFramework, Func<object?, TExtension?>? coerceFunction = null)
513internal void AddExtensions(ImmutableArray<TExtension>.Builder builder, string language, Func<TExtension, bool>? shouldInclude = null)
DiagnosticAnalyzer\AnalyzerManager.cs (8)
273internal bool IsSupportedDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken)
301Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer,
307Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnosticDescriptors =
309Func<DiagnosticSuppressor, ImmutableArray<SuppressionDescriptor>> getSupportedSuppressionDescriptors =
343Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer,
345Func<DiagnosticDescriptor, bool> isEnabledWithAnalyzerConfigOptions,
346Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnosticDescriptors,
347Func<DiagnosticSuppressor, ImmutableArray<SuppressionDescriptor>> getSupportedSuppressionDescriptors,
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (19)
583public CompilationAnalysisContext(Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken)
722public SemanticModelAnalysisContext(SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken)
815public SymbolAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken)
1179public CodeBlockAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken)
1240private readonly Func<IOperation, ControlFlowGraph>? _getControlFlowGraph;
1305Func<IOperation, ControlFlowGraph>? getControlFlowGraph,
1382private readonly Func<IOperation, ControlFlowGraph>? _getControlFlowGraph;
1437Func<Diagnostic, bool> isSupportedDiagnostic,
1451Func<IOperation, ControlFlowGraph>? getControlFlowGraph,
1546public SyntaxTreeAnalysisContext(SyntaxTree tree, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken)
1716public SyntaxNodeAnalysisContext(SyntaxNode node, ISymbol? containingSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken)
1722public SyntaxNodeAnalysisContext(SyntaxNode node, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken)
1776private readonly Func<IOperation, ControlFlowGraph>? _getControlFlowGraph;
1828Func<Diagnostic, bool> isSupportedDiagnostic,
1841Func<IOperation, ControlFlowGraph>? getControlFlowGraph,
1884private readonly Func<SuppressionDescriptor, bool> _isSupportedSuppressionDescriptor;
1885private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel;
1919Func<SuppressionDescriptor, bool> isSupportedSuppressionDescriptor,
1920Func<SyntaxTree, SemanticModel> getSemanticModel,
Emit\EditAndContinue\EmitBaseline.cs (11)
84public static EmitBaseline CreateInitialBaseline(ModuleMetadata module, Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> debugInformationProvider)
91Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> debugInformationProvider,
92Func<MethodDefinitionHandle, StandaloneSignatureHandle> localSignatureProvider,
141Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> debugInformationProvider,
142Func<MethodDefinitionHandle, StandaloneSignatureHandle> localSignatureProvider,
269internal readonly Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> DebugInformationProvider;
278internal readonly Func<MethodDefinitionHandle, StandaloneSignatureHandle> LocalSignatureProvider;
317Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> debugInformationProvider,
318Func<MethodDefinitionHandle, StandaloneSignatureHandle> localSignatureProvider,
416Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> debugInformationProvider,
417Func<MethodDefinitionHandle, StandaloneSignatureHandle> localSignatureProvider)
Emit\SemanticEdit.cs (7)
47public Func<SyntaxNode, SyntaxNode?>? SyntaxMap { get; }
53public Func<SyntaxNode, RuntimeRudeEdit?>? RuntimeRudeEdit { get; }
65public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap, bool preserveLocalVariables)
74public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap, bool preserveLocalVariables, MethodInstrumentation instrumentation)
104public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap = null, Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdit = null, MethodInstrumentation instrumentation = default)
215internal static SemanticEdit Create(SemanticEditKind kind, ISymbolInternal oldSymbol, ISymbolInternal newSymbol, Func<SyntaxNode, SyntaxNode>? syntaxMap = null)
FileSystem\FileUtilities.cs (4)
47Func<string, bool> fileExists)
322public static T RethrowExceptionsAsIOException<T, TArg>(Func<TArg, T> operation, TArg arg)
339public static async Task<T> RethrowExceptionsAsIOExceptionAsync<T, TArg>(Func<TArg, Task<T>> operation, TArg arg)
355internal static Stream CreateFileStreamChecked(Func<string, Stream> factory, string path, string? paramName = null)
InternalUtilities\EnumerableExtensions.cs (14)
217public static T? FirstOrNull<T>(this IEnumerable<T> source, Func<T, bool> predicate)
260public static T? SingleOrNull<T>(this IEnumerable<T> source, Func<T, bool> predicate)
338private static readonly Func<object, bool> s_notNullTest = x => x != null;
348return source.Where((Func<T?, bool>)s_notNullTest)!;
354public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, TResult> selector)
384public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IReadOnlyCollection<TSource>? source, Func<TSource, TResult> selector)
416public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, IEnumerable<TResult>> selector)
440public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this IReadOnlyCollection<TItem>? source, Func<TItem, IEnumerable<TResult>> selector)
466public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, OneOrMany<TResult>> selector)
481public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this IEnumerable<TItem> source, Func<TItem, ValueTask<TResult>> selector)
687public static bool Contains<T>(this IEnumerable<T> sequence, Func<T, bool> predicate)
787internal static Dictionary<K, ImmutableArray<T>> ToMultiDictionary<K, T>(this IEnumerable<T> data, Func<T, K> keySelector, IEqualityComparer<K>? comparer = null)
839public static readonly Func<T, T> Identity = t => t;
840public static readonly Func<T, bool> True = t => true;
InternalUtilities\InterlockedOperations.cs (5)
46public static T Initialize<T, TArg>([NotNull] ref T? target, Func<TArg, T> valueFactory, TArg arg)
66public static int Initialize<TArg>(ref int target, int uninitializedValue, Func<TArg, int> valueFactory, TArg arg)
103public static T? Initialize<T, TArg>([NotNull] ref StrongBox<T?>? target, Func<TArg, T?> valueFactory, TArg arg)
183public static ImmutableArray<T> Initialize<T, TArg>(ref ImmutableArray<T> target, Func<TArg, ImmutableArray<T>> createArray, TArg arg)
193private static ImmutableArray<T> Initialize_Slow<T, TArg>(ref ImmutableArray<T> target, Func<TArg, ImmutableArray<T>> createArray, TArg arg)
SourceGeneration\GeneratedCodeUtilities.cs (4)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
55internal static bool IsGeneratedCode(string? filePath, SyntaxNode root, Func<SyntaxTrivia, bool> isComment)
88private static bool BeginsWithAutoGeneratedComment(SyntaxNode root, Func<SyntaxTrivia, bool> isComment)
118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (6)
66public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector)
70public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer)
84public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
88public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (7)
31public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer)
152public static bool Update<T>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, ImmutableSegmentedHashSet<T>> transformer)
274public static bool Update<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, ImmutableSegmentedDictionary<TKey, TValue>> transformer)
408/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/>
409public static TValue GetOrAdd<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory)
456/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/>
457public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\PooledDelegates.cs (9)
198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction)
199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction);
202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>,
214/// Gets a <see cref="Func{T, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the
244public static Releaser GetPooledFunction<T1, TArg, TResult>(Func<T1, TArg, TResult> unboundFunction, TArg argument, out Func<T1, TResult> boundFunction)
245=> GetPooledDelegate<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>(unboundFunction, argument, out boundFunction);
410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>
430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>
432protected override Func<T1, TResult> Bind()
Syntax\SyntaxNavigator.cs (39)
31private static readonly Func<SyntaxTrivia, bool>?[] s_stepIntoFunctions = new Func<SyntaxTrivia, bool>?[]
43private static Func<SyntaxTrivia, bool>? GetStepIntoFunction(
52private static Func<SyntaxToken, bool> GetPredicateFunction(bool includeZeroWidth)
57private static bool Matches(Func<SyntaxToken, bool>? predicate, SyntaxToken token)
82internal SyntaxToken GetPreviousToken(in SyntaxToken current, Func<SyntaxToken, bool> predicate, Func<SyntaxTrivia, bool>? stepInto)
87internal SyntaxToken GetNextToken(in SyntaxToken current, Func<SyntaxToken, bool> predicate, Func<SyntaxTrivia, bool>? stepInto)
95internal SyntaxToken GetFirstToken(SyntaxNode current, Func<SyntaxToken, bool>? predicate, Func<SyntaxTrivia, bool>? stepInto)
141internal SyntaxToken GetLastToken(SyntaxNode current, Func<SyntaxToken, bool> predicate, Func<SyntaxTrivia, bool>? stepInto)
187Func<SyntaxToken, bool>? predicate,
188Func<SyntaxTrivia, bool> stepInto)
208Func<SyntaxToken, bool> predicate,
209Func<SyntaxTrivia, bool> stepInto)
227Func<SyntaxToken, bool> predicate,
228Func<SyntaxTrivia, bool>? stepInto,
245Func<SyntaxToken, bool>? predicate,
246Func<SyntaxTrivia, bool>? stepInto)
279Func<SyntaxToken, bool> predicate,
280Func<SyntaxTrivia, bool>? stepInto)
313Func<SyntaxToken, bool>? predicate,
314Func<SyntaxTrivia, bool>? stepInto)
345Func<SyntaxToken, bool> predicate,
346Func<SyntaxTrivia, bool>? stepInto)
378Func<SyntaxToken, bool>? predicate,
379Func<SyntaxTrivia, bool>? stepInto,
407Func<SyntaxToken, bool> predicate,
408Func<SyntaxTrivia, bool>? stepInto,
432Func<SyntaxToken, bool>? predicate,
433Func<SyntaxTrivia, bool>? stepInto)
482Func<SyntaxToken, bool> predicate,
483Func<SyntaxTrivia, bool>? stepInto)
530internal SyntaxToken GetNextToken(in SyntaxToken current, Func<SyntaxToken, bool>? predicate, bool searchInsideCurrentTokenTrailingTrivia, Func<SyntaxTrivia, bool>? stepInto)
583internal SyntaxToken GetPreviousToken(in SyntaxToken current, Func<SyntaxToken, bool> predicate, bool searchInsideCurrentTokenLeadingTrivia,
584Func<SyntaxTrivia, bool>? stepInto)
Syntax\SyntaxNode.cs (17)
835public TNode? FirstAncestorOrSelf<TNode>(Func<TNode, bool>? predicate = null, bool ascendOutOfTrivia = true)
873public IEnumerable<SyntaxNode> DescendantNodes(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
884public IEnumerable<SyntaxNode> DescendantNodes(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
894public IEnumerable<SyntaxNode> DescendantNodesAndSelf(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
905public IEnumerable<SyntaxNode> DescendantNodesAndSelf(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
915public IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokens(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
926public IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokens(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
936public IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensAndSelf(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
947public IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensAndSelf(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
1044public IEnumerable<SyntaxToken> DescendantTokens(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
1052public IEnumerable<SyntaxToken> DescendantTokens(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
1100public SyntaxTrivia FindTrivia(int position, Func<SyntaxTrivia, bool>? stepInto)
1110internal static SyntaxTrivia FindTriviaByOffset(SyntaxNode node, int textOffset, Func<SyntaxTrivia, bool>? stepInto = null)
1181public IEnumerable<SyntaxTrivia> DescendantTrivia(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
1189public IEnumerable<SyntaxTrivia> DescendantTrivia(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
1502private SyntaxToken FindToken(int position, Func<SyntaxTrivia, bool> findInsideTrivia)
1515protected virtual SyntaxToken FindTokenCore(int position, Func<SyntaxTrivia, bool> stepInto)
Syntax\SyntaxNode.Iterators.cs (14)
17private IEnumerable<SyntaxNode> DescendantNodesImpl(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool descendIntoTrivia, bool includeSelf)
24private IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensImpl(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool descendIntoTrivia, bool includeSelf)
31private IEnumerable<SyntaxTrivia> DescendantTriviaImpl(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false)
52public ChildSyntaxListEnumeratorStack(SyntaxNode startingNode, Func<SyntaxNode, bool>? descendIntoChildren)
112public void PushChildren(SyntaxNode node, Func<SyntaxNode, bool>? descendIntoChildren)
199public TwoEnumeratorListStack(SyntaxNode startingNode, Func<SyntaxNode, bool>? descendIntoChildren)
246public void PushChildren(SyntaxNode node, Func<SyntaxNode, bool>? descendIntoChildren)
292public ThreeEnumeratorListStack(SyntaxNode startingNode, Func<SyntaxNode, bool>? descendIntoChildren)
349public void PushChildren(SyntaxNode node, Func<SyntaxNode, bool>? descendIntoChildren)
390private IEnumerable<SyntaxNode> DescendantNodesOnly(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool includeSelf)
415private IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensOnly(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool includeSelf)
444private IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensIntoTrivia(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool includeSelf)
532private IEnumerable<SyntaxTrivia> DescendantTriviaOnly(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren)
570private IEnumerable<SyntaxTrivia> DescendantTriviaIntoTrivia(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren)
Syntax\SyntaxNodeOrToken.cs (4)
841internal IList<TDirective> GetDirectives<TDirective>(Func<TDirective, bool>? filter = null)
848private static void GetDirectives<TDirective>(in SyntaxNodeOrToken node, Func<TDirective, bool>? filter, out IList<TDirective> directives)
868private static void GetDirectives<TDirective>(SyntaxNode node, Func<TDirective, bool>? filter, ref List<TDirective>? directives)
877private static void GetDirectivesInTrivia<TDirective>(in SyntaxTrivia trivia, Func<TDirective, bool>? filter, ref List<TDirective>? directives)
Microsoft.CodeAnalysis.Analyzers (41)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
247public static TOperation? GetAncestor<TOperation>(this IOperation root, OperationKind ancestorKind, Func<TOperation, bool>? predicate = null)
282public static IOperation? GetAncestor(this IOperation root, ImmutableArray<OperationKind> ancestorKinds, Func<IOperation, bool>? predicate = null)
355public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate)
368public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate)
373public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(returnValue: true)] out IOperation? foundOperation)
725public static IOperation WalkDownConversion(this IOperation operation, Func<IConversionOperation, bool> predicate)
799public static bool HasAnyExplicitDescendant(this IOperation operation, Func<IOperation, bool>? descendIntoOperation = null)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (5)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty);
24private static readonly Func<IOperation, IOperation> TargetAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Target), fallbackResult: null!);
26private static readonly Func<IOperation, IMethodSymbol> GetFunctionPointerSignatureAccessor = CreateFunctionPointerSignatureAccessor(WrappedType);
28private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAccessor(Type? wrappedType)
44return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
Microsoft.CodeAnalysis.AnalyzerUtilities (139)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
247public static TOperation? GetAncestor<TOperation>(this IOperation root, OperationKind ancestorKind, Func<TOperation, bool>? predicate = null)
282public static IOperation? GetAncestor(this IOperation root, ImmutableArray<OperationKind> ancestorKinds, Func<IOperation, bool>? predicate = null)
355public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate)
368public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate)
373public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(returnValue: true)] out IOperation? foundOperation)
725public static IOperation WalkDownConversion(this IOperation operation, Func<IConversionOperation, bool> predicate)
799public static bool HasAnyExplicitDescendant(this IOperation operation, Func<IOperation, bool>? descendIntoOperation = null)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (5)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty);
24private static readonly Func<IOperation, IOperation> TargetAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Target), fallbackResult: null!);
26private static readonly Func<IOperation, IMethodSymbol> GetFunctionPointerSignatureAccessor = CreateFunctionPointerSignatureAccessor(WrappedType);
28private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAccessor(Type? wrappedType)
44return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisData.cs (6)
20private readonly Func<ITypeSymbol?, bool> _isDisposable;
22internal PointsToAnalysisData(Func<ITypeSymbol?, bool> isDisposable)
27internal PointsToAnalysisData(IDictionary<AnalysisEntity, PointsToAbstractValue> fromData, Func<ITypeSymbol?, bool> isDisposable)
41Func<ITypeSymbol?, bool> isDisposable)
122internal static void AssertValidPointsToAnalysisData(IDictionary<AnalysisEntity, PointsToAbstractValue> map, Func<ITypeSymbol?, bool> isDisposable)
139Func<ITypeSymbol?, bool> isDisposable)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (8)
34private readonly Func<IOperation, PointsToAbstractValue>? _getPointsToAbstractValue;
36private readonly Func<IFlowCaptureOperation, bool> _getIsLValueFlowCapture;
39private readonly Func<IOperation, AnalysisEntity?>? _interproceduralGetAnalysisEntityForFlowCapture;
40private readonly Func<ISymbol, ImmutableStack<IOperation>?> _getInterproceduralCallStackForOwningSymbol;
45Func<IOperation, PointsToAbstractValue>? getPointsToAbstractValue,
47Func<IFlowCaptureOperation, bool> getIsLValueFlowCapture,
53Func<IOperation, AnalysisEntity?>? interproceduralGetAnalysisEntityForFlowCapture,
54Func<ISymbol, ImmutableStack<IOperation>?> getInterproceduralCallStackForOwningSymbol)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\InterproceduralAnalysisData.cs (8)
38Func<IOperation, TAbstractAnalysisValue> getCachedAbstractValueFromCaller,
39Func<IMethodSymbol, ControlFlowGraph?> getInterproceduralControlFlowGraph,
40Func<IOperation, AnalysisEntity?> getAnalysisEntityForFlowCapture,
41Func<ISymbol, ImmutableStack<IOperation>?> getInterproceduralCallStackForOwningSymbol)
65public Func<IOperation, TAbstractAnalysisValue> GetCachedAbstractValueFromCaller { get; }
66public Func<IMethodSymbol, ControlFlowGraph?> GetInterproceduralControlFlowGraph { get; }
67public Func<IOperation, AnalysisEntity?> GetAnalysisEntityForFlowCapture { get; }
68public Func<ISymbol, ImmutableStack<IOperation>?> GetInterproceduralCallStackForOwningSymbol { get; }
Microsoft.CodeAnalysis.BannedApiAnalyzers (41)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
247public static TOperation? GetAncestor<TOperation>(this IOperation root, OperationKind ancestorKind, Func<TOperation, bool>? predicate = null)
282public static IOperation? GetAncestor(this IOperation root, ImmutableArray<OperationKind> ancestorKinds, Func<IOperation, bool>? predicate = null)
355public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate)
368public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate)
373public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(returnValue: true)] out IOperation? foundOperation)
725public static IOperation WalkDownConversion(this IOperation operation, Func<IConversionOperation, bool> predicate)
799public static bool HasAnyExplicitDescendant(this IOperation operation, Func<IOperation, bool>? descendIntoOperation = null)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (5)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty);
24private static readonly Func<IOperation, IOperation> TargetAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Target), fallbackResult: null!);
26private static readonly Func<IOperation, IMethodSymbol> GetFunctionPointerSignatureAccessor = CreateFunctionPointerSignatureAccessor(WrappedType);
28private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAccessor(Type? wrappedType)
44return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
Microsoft.CodeAnalysis.CodeStyle (355)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (18)
141public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ImmutableArray<TItem> items, Func<TItem, TResult> map)
210public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, TResult> selector)
267public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, IEnumerable<TResult>> selector)
287public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, ImmutableArray<TResult>> selector)
307public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, OneOrMany<TResult>> selector)
330public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, IEnumerable<TResult>> selector)
354public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, ImmutableArray<TResult>> selector)
378public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, OneOrMany<TResult>> selector)
537public static ImmutableArray<T> WhereAsArray<T>(this ImmutableArray<T> array, Func<T, bool> predicate)
548private static ImmutableArray<T> WhereAsArrayImpl<T, TArg>(ImmutableArray<T> array, Func<T, bool>? predicateWithoutArg, Func<T, TArg, bool>? predicateWithArg, TArg arg)
649public static async Task<bool> AnyAsync<T>(this ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
681public static async ValueTask<T?> FirstOrDefaultAsync<T>(this ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
1110public static int Count<T>(this ImmutableArray<T> items, Func<T, bool> predicate)
1129public static int Sum<T>(this ImmutableArray<T> items, Func<T, int> selector)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (4)
47Func<string, bool> fileExists)
322public static T RethrowExceptionsAsIOException<T, TArg>(Func<TArg, T> operation, TArg arg)
339public static async Task<T> RethrowExceptionsAsIOExceptionAsync<T, TArg>(Func<TArg, Task<T>> operation, TArg arg)
355internal static Stream CreateFileStreamChecked(Func<string, Stream> factory, string path, string? paramName = null)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (14)
217public static T? FirstOrNull<T>(this IEnumerable<T> source, Func<T, bool> predicate)
260public static T? SingleOrNull<T>(this IEnumerable<T> source, Func<T, bool> predicate)
338private static readonly Func<object, bool> s_notNullTest = x => x != null;
348return source.Where((Func<T?, bool>)s_notNullTest)!;
354public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, TResult> selector)
384public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IReadOnlyCollection<TSource>? source, Func<TSource, TResult> selector)
416public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, IEnumerable<TResult>> selector)
440public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this IReadOnlyCollection<TItem>? source, Func<TItem, IEnumerable<TResult>> selector)
466public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, OneOrMany<TResult>> selector)
481public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this IEnumerable<TItem> source, Func<TItem, ValueTask<TResult>> selector)
687public static bool Contains<T>(this IEnumerable<T> sequence, Func<T, bool> predicate)
787internal static Dictionary<K, ImmutableArray<T>> ToMultiDictionary<K, T>(this IEnumerable<T> data, Func<T, K> keySelector, IEqualityComparer<K>? comparer = null)
839public static readonly Func<T, T> Identity = t => t;
840public static readonly Func<T, bool> True = t => true;
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
46public static T Initialize<T, TArg>([NotNull] ref T? target, Func<TArg, T> valueFactory, TArg arg)
66public static int Initialize<TArg>(ref int target, int uninitializedValue, Func<TArg, int> valueFactory, TArg arg)
103public static T? Initialize<T, TArg>([NotNull] ref StrongBox<T?>? target, Func<TArg, T?> valueFactory, TArg arg)
183public static ImmutableArray<T> Initialize<T, TArg>(ref ImmutableArray<T> target, Func<TArg, ImmutableArray<T>> createArray, TArg arg)
193private static ImmutableArray<T> Initialize_Slow<T, TArg>(ref ImmutableArray<T> target, Func<TArg, ImmutableArray<T>> createArray, TArg arg)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (4)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
55internal static bool IsGeneratedCode(string? filePath, SyntaxNode root, Func<SyntaxTrivia, bool> isComment)
88private static bool BeginsWithAutoGeneratedComment(SyntaxNode root, Func<SyntaxTrivia, bool> isComment)
118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (6)
66public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector)
70public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer)
84public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
88public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (7)
31public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer)
152public static bool Update<T>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, ImmutableSegmentedHashSet<T>> transformer)
274public static bool Update<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, ImmutableSegmentedDictionary<TKey, TValue>> transformer)
408/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/>
409public static TValue GetOrAdd<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory)
456/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/>
457public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\PooledDelegates.cs (9)
198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction)
199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction);
202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>,
214/// Gets a <see cref="Func{T, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the
244public static Releaser GetPooledFunction<T1, TArg, TResult>(Func<T1, TArg, TResult> unboundFunction, TArg argument, out Func<T1, TResult> boundFunction)
245=> GetPooledDelegate<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>(unboundFunction, argument, out boundFunction);
410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>
430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>
432protected override Func<T1, TResult> Bind()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ObjectExtensions.TypeSwitch.cs (161)
11public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TBaseType, TResult>? defaultFunc = null)
25public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TBaseType, TResult>? defaultFunc = null)
41public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TBaseType, TResult>? defaultFunc = null)
59public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TBaseType, TResult>? defaultFunc = null)
79public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TBaseType, TResult>? defaultFunc = null)
119public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TBaseType, TResult>? defaultFunc = null)
161public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TBaseType, TResult>? defaultFunc = null)
213public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TDerivedType36, TDerivedType37, TDerivedType38, TDerivedType39, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TDerivedType36, TResult> matchFunc36, Func<TDerivedType37, TResult> matchFunc37, Func<TDerivedType38, TResult> matchFunc38, Func<TDerivedType39, TResult> matchFunc39, Func<TBaseType, TResult>? defaultFunc = null)
299public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TDerivedType36, TDerivedType37, TDerivedType38, TDerivedType39, TDerivedType40, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TDerivedType36, TResult> matchFunc36, Func<TDerivedType37, TResult> matchFunc37, Func<TDerivedType38, TResult> matchFunc38, Func<TDerivedType39, TResult> matchFunc39, Func<TDerivedType40, TResult> matchFunc40, Func<TBaseType, TResult>? defaultFunc = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (6)
104this SyntaxNode node, TextSpan searchSpan, Func<SyntaxNode, bool> predicate)
129public static bool CheckParent<T>([NotNullWhen(returnValue: true)] this SyntaxNode? node, Func<T, bool> valueChecker) where T : SyntaxNode
145public static bool IsChildNode<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode?> childGetter)
162public static bool IsFoundUnder<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode?> childGetter)
201public static SyntaxNode? FindInnermostCommonNode(this IEnumerable<SyntaxNode> nodes, Func<SyntaxNode, bool> predicate)
806public static TNode? FirstAncestorOrSelfUntil<TNode>(this SyntaxNode? node, Func<SyntaxNode, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (5)
15public static SyntaxNode? GetAncestor(this SyntaxToken token, Func<SyntaxNode, bool>? predicate)
18public static T? GetAncestor<T>(this SyntaxToken token, Func<T, bool>? predicate = null) where T : SyntaxNode
21public static T GetRequiredAncestor<T>(this SyntaxToken token, Func<T, bool>? predicate = null) where T : SyntaxNode
32public static IEnumerable<SyntaxNode> GetAncestors(this SyntaxToken token, Func<SyntaxNode, bool> predicate)
42public static bool CheckParent<T>(this SyntaxToken token, Func<T, bool> valueChecker) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PublicOptionFactory.cs (4)
17public static Option2<T> WithPublicOption<T, TPublicValue>(this Option2<T> option, string feature, string name, Func<T, TPublicValue> toPublicValue, Func<TPublicValue, T> toInternalValue)
20public static PerLanguageOption2<T> WithPublicOption<T, TPublicValue>(this PerLanguageOption2<T> option, string feature, string name, Func<T, TPublicValue> toPublicValue, Func<TPublicValue, T> toInternalValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (7)
126Func<object, Task> taskBody = static async o =>
291Func<object, Task> taskBody = static async o =>
399private readonly Func<object, Task> _taskBody;
422protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body)
588IEnumerable<TSource> source, Func<object, Task> taskBody,
614IAsyncEnumerable<TSource> source, Func<object, Task> taskBody,
641T fromExclusive, T toExclusive, Func<object, Task> taskBody,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (8)
13public static IEnumerable<T> TopologicalSort<T>(this IEnumerable<T> items, Func<T, IEnumerable<T>> itemsBefore)
26public static IEnumerable<T> TopologicalSort<T>(this IEnumerable<T> items, Func<T, IEnumerable<T>> itemsBefore, Func<T, IEnumerable<T>> itemsAfter)
29var combinedItemsBefore = CreateCombinedItemsBefore(items, itemsBefore, itemsAfter);
35Func<T, IEnumerable<T>> itemsBefore,
50private static Func<T, IEnumerable<T>> CreateCombinedItemsBefore<T>(IEnumerable<T> items, Func<T, IEnumerable<T>> itemsBefore, Func<T, IEnumerable<T>> itemsAfter)
Microsoft.CodeAnalysis.CodeStyle.Fixes (45)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (4)
29Func<TType, (TNode semanticNode, IEnumerable<TNode> additionalNodes)> selector,
52Func<TType, TNode> selector,
96Func<TType, (TNode semanticNode, IEnumerable<TNode> additionalNodes)> selector,
153Func<TType, (TNode semanticNode, IEnumerable<TNode> additionalNodes)> selector,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (6)
35protected static readonly Func<SyntaxNode, bool> s_containsAnnotations = n => n.ContainsAnnotations;
36protected static readonly Func<SyntaxNodeOrToken, bool> s_hasSimplifierAnnotation = n => n.HasAnnotation(Simplifier.Annotation);
40protected abstract ImmutableArray<NodeOrTokenToReduce> GetNodesAndTokensToReduce(SyntaxNode root, Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpans);
51public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken);
52public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken);
275Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpan)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (6)
43Func<string, bool>? canUse = null,
63Func<string, bool>? canUse = null,
86Func<string, bool>? canUse = null,
134public static string GenerateUniqueName(string baseName, Func<string, bool> canUse)
140public static string GenerateUniqueName(string baseName, string extension, Func<string, bool> canUse)
160public static string GenerateUniqueName(IEnumerable<string> baseNames, Func<string, bool> canUse)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (2)
Microsoft.CodeAnalysis.Collections.Package (19)
ImmutableSegmentedDictionary.cs (6)
66public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector)
70public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer)
84public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
88public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
RoslynImmutableInterlocked.cs (7)
31public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer)
152public static bool Update<T>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, ImmutableSegmentedHashSet<T>> transformer)
274public static bool Update<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, ImmutableSegmentedDictionary<TKey, TValue>> transformer)
408/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/>
409public static TValue GetOrAdd<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory)
456/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/>
457public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
Microsoft.CodeAnalysis.CSharp (137)
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (9)
436private static int? MostSpecificConversionOperator(Func<UserDefinedConversionAnalysis, bool> constraint, ImmutableArray<UserDefinedConversionAnalysis> u)
547private static BestIndex UniqueIndex<T>(ImmutableArray<T> items, Func<T, bool> predicate)
691Func<T, TypeSymbol> extract,
699Func<T, bool> valid,
700Func<T, TypeSymbol> extract,
753Func<T, TypeSymbol> extract,
761Func<T, bool> valid,
762Func<T, TypeSymbol> extract,
804private static int? UniqueBestValidIndex<T>(ImmutableArray<T> items, Func<T, bool> valid, Func<T, T, BetterResult> better)
Compilation\CSharpCompilation.cs (10)
3025private static void AppendLoadDirectiveDiagnostics(DiagnosticBag builder, SyntaxAndDeclarationManager syntaxAndDeclarations, SyntaxTree syntaxTree, Func<IEnumerable<Diagnostic>, IEnumerable<Diagnostic>>? locationFilterOpt = null)
3777Func<ISymbol, bool> isAddedSymbol,
4603public override bool ContainsSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default)
4621public override IEnumerable<ISymbol> GetSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default)
4639/// This will be faster than <see cref="ContainsSymbolsWithName(Func{string, bool}, SymbolFilter, CancellationToken)"/>
4659/// faster than <see cref="GetSymbolsWithName(Func{string, bool}, SymbolFilter,
4778Func<SyntaxNode, SyntaxKind> getKind = node => node.Kind();
4779Func<SyntaxTrivia, bool> isComment = trivia => trivia.Kind() == SyntaxKind.SingleLineCommentTrivia || trivia.Kind() == SyntaxKind.MultiLineCommentTrivia;
5048private readonly Func<string, bool> _predicate;
5051CSharpCompilation compilation, SymbolFilter filter, Func<string, bool> predicate, CancellationToken cancellationToken)
FlowAnalysis\NullableWalker.cs (13)
248private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>? _targetTypedAnalysisCompletionOpt;
255private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>> TargetTypedAnalysisCompletion
256=> _targetTypedAnalysisCompletionOpt ??= PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>.GetInstance();
3853var elementConversionCompletions = ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>>.GetInstance();
3876var completion = VisitOptionalImplicitConversion(iteratorBody, targetElementType,
3891var completion = VisitOptionalImplicitConversion(elementExpr, targetElementType,
3924TypeWithState convertCollection(BoundCollectionExpression node, TypeWithAnnotations targetCollectionType, ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>> completions)
4411Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations, TypeWithState>? conversionCompletion = null)
4444Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations, TypeWithState> conversionCompletion)
8619private (TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) VisitOptionalImplicitConversion(
8633(TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) visitConversion(
8670Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType)
9099if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations, TypeWithState>? completion))
Parser\LanguageParser.cs (17)
207internal TNode ParseWithStackGuard<TNode>(Func<LanguageParser, TNode> parseFunc, Func<LanguageParser, TNode> createEmptyNodeFunc) where TNode : CSharpSyntaxNode
4296Func<LanguageParser, bool> isNotExpectedFunction,
4317Func<LanguageParser, bool> isNotExpectedFunction,
4318Func<LanguageParser, bool> abortFunction,
4338Func<LanguageParser, bool> isNotExpectedFunction,
4363Func<LanguageParser, bool> isNotExpectedFunction,
4364Func<LanguageParser, bool> abortFunction,
4386Func<LanguageParser, bool> isNotExpectedFunction,
4413Func<LanguageParser, bool> isNotExpectedFunction,
4414Func<LanguageParser, bool> abortFunction,
4646Func<LanguageParser, ParameterSyntax> parseElement = forExtension
14021Func<LanguageParser, bool> isPossibleElement,
14022Func<LanguageParser, TNode> parseElement,
14043Func<LanguageParser, bool> isPossibleElement,
14044Func<LanguageParser, TNode> parseElement,
14045Func<TNode, bool>? immediatelyAbort,
Syntax\SyntaxEquivalence.cs (5)
19internal static bool AreEquivalent(SyntaxTree? before, SyntaxTree? after, Func<SyntaxKind, bool>? ignoreChildNode, bool topLevel)
34public static bool AreEquivalent(SyntaxNode? before, SyntaxNode? after, Func<SyntaxKind, bool>? ignoreChildNode, bool topLevel)
56private static bool AreTokensEquivalent(GreenNode? before, GreenNode? after, Func<SyntaxKind, bool>? ignoreChildNode)
105private static bool AreEquivalentRecursive(GreenNode? before, GreenNode? after, Func<SyntaxKind, bool>? ignoreChildNode, bool topLevel)
254private static bool AreNullableDirectivesEquivalent(GreenNode before, GreenNode after, Func<SyntaxKind, bool>? ignoreChildNode)
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (17)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (5)
38Func<TParentExpression, InitializerExpressionSyntax?> getInitializer,
797ExpressionSyntax expression, Func<ExpressionSyntax, ExpressionSyntax>? indent)
804ExpressionSyntax expression, Func<ExpressionSyntax, ExpressionSyntax>? indent)
820AssignmentExpressionSyntax assignment, Func<ExpressionSyntax, ExpressionSyntax> indent)
826InvocationExpressionSyntax invocation, Func<ExpressionSyntax, ExpressionSyntax> indent)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (4)
CommandLineTests.cs (4)
478Func<string, string> prependBasePath = fileName => Path.Combine(basePath, fileName);
11411Func<string, CSharpCommandLineArguments> parse = (x) => FullParse(x, baseDirectory);
12393private void VerifyQuotedValid<T>(string name, string value, T expected, Func<CSharpCommandLineArguments, T> getValue)
12404private void VerifyQuotedInvalid<T>(string name, string value, T expected, Func<CSharpCommandLineArguments, T> getValue)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (32)
CodeActions\ApplyChangesOperationTests.cs (9)
23=> new MyCodeRefactoringProvider((Func<Solution, Solution>)parameters.fixProviderData);
27private readonly Func<Solution, Solution> _changeSolution;
29public MyCodeRefactoringProvider(Func<Solution, Solution> changeSolution)
218Func<Solution, Solution> codeActionTransform,
219Func<Solution, Solution> intermediaryTransform)
226Func<Solution, Solution> codeActionTransform,
227Func<Solution, Solution> intermediaryTransform)
234Func<Solution, Solution> codeActionTransform,
235Func<Solution, Solution> intermediaryTransform,
Formatting\CodeCleanupTests.cs (3)
611Func<string, bool> enabledFixIdsFilter = id =>
858private static Task AssertCodeCleanupResult(string expected, string code, bool systemUsingsFirst = true, bool separateUsingGroups = false, Func<string, bool> enabledFixIdsFilter = null, (string, DiagnosticSeverity)[] diagnosticIdsWithSeverity = null)
872private static async Task AssertCodeCleanupResult(string expected, string code, CodeStyleOption2<AddImportPlacement> preferredImportPlacement, bool systemUsingsFirst = true, bool separateUsingGroups = false, Func<string, bool> enabledFixIdsFilter = null, (string, DiagnosticSeverity)[] diagnosticIdsWithSeverity = null)
NavigateTo\NavigateToSearcherTests.cs (10)
47It.IsAny<Func<ImmutableArray<INavigateToSearchResult>, Task>>(),
56Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound,
70It.IsAny<Func<ImmutableArray<INavigateToSearchResult>, Task>>(),
78Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound,
97It.IsAny<Func<ImmutableArray<INavigateToSearchResult>, Task>>(),
106Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound2,
515public Task SearchCachedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
521public Task SearchDocumentAsync(Document document, string searchPattern, IImmutableSet<string> kinds, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, CancellationToken cancellationToken)
527public Task SearchGeneratedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
533public Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (12)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (13)
Emit\EditAndContinue\EditAndContinueTestBase.cs (8)
35internal static readonly Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> EmptyLocalsProvider = handle => default(EditAndContinueMethodDebugInformation);
44public static EmitBaseline CreateInitialBaseline(Compilation compilation, ModuleMetadata module, Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> debugInformationProvider)
54internal static Func<SyntaxNode, SyntaxNode> GetSyntaxMapFromMarkers(SourceWithMarkedNodes source0, SourceWithMarkedNodes source1)
68internal static Func<SyntaxNode, SyntaxNode> GetSyntaxMapByKind(MethodSymbol method0, params SyntaxKind[] kinds)
84internal static Func<SyntaxNode, SyntaxNode> GetEquivalentNodesMap(MethodSymbol method1, MethodSymbol method0)
141Func<Compilation, ISymbol> symbolProvider,
142Func<Compilation, ISymbol>? newSymbolProvider = null,
144Func<SyntaxNode, RuntimeRudeEdit?>? rudeEdits = null)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (15)
Microsoft.CodeAnalysis.CSharp.Features (97)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (10)
221Func<TSyntaxNode, SyntaxNode?> typeSyntaxGetter,
222Func<TSyntaxNode, SyntaxTokenList?> modifierGetter,
223Func<DeclarationModifiers, ImmutableArray<SymbolKindOrTypeKind>> possibleDeclarationComputer,
270Func<TSyntaxNode, SyntaxNode?> typeSyntaxGetter,
271Func<TSyntaxNode, SyntaxTokenList> modifierGetter,
272Func<DeclarationModifiers, ImmutableArray<SymbolKindOrTypeKind>> possibleDeclarationComputer,
281Func<TSyntaxNode, SyntaxNode?> typeSyntaxGetter,
282Func<TSyntaxNode, SyntaxTokenList> modifierGetter,
283Func<DeclarationModifiers, ImmutableArray<SymbolKindOrTypeKind>> possibleDeclarationComputer,
347? (Func<DeclarationModifiers, ImmutableArray<SymbolKindOrTypeKind>>)
EditAndContinue\BreakpointSpans.cs (8)
475internal static IEnumerable<SyntaxToken> GetActiveTokensForImplicitConstructorInitializer(ConstructorDeclarationSyntax constructor, Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
481internal static IEnumerable<SyntaxToken> GetActiveTokensForExplicitConstructorInitializer(ConstructorInitializerSyntax constructorInitializer, Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
490internal static IEnumerable<SyntaxToken> GetActiveTokensForImplicitPrimaryConstructorInitializer(TypeDeclarationSyntax typeDeclaration, Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
509internal static IEnumerable<SyntaxToken> GetActiveTokensForExplicitPrimaryConstructorInitializer(PrimaryConstructorBaseTypeSyntax baseTypeSyntax, Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
517internal static IEnumerable<SyntaxToken> GetActiveTokensForCopyConstructor(RecordDeclarationSyntax recordDeclaration, Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
531internal static IEnumerable<SyntaxToken> GetActiveTokensForRecordParameter(ParameterSyntax parameter, Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
548internal static IEnumerable<SyntaxToken> GetActiveTokensForAutoPropertyAccessor(AccessorDeclarationSyntax accessor, Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
853VariableDeclaratorSyntax variableDeclarator, SyntaxTokenList modifiers, SyntaxToken semicolon, Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
SignatureHelp\SignatureHelpUtilities.cs (16)
19private static readonly Func<BaseArgumentListSyntax, SyntaxToken> s_getBaseArgumentListOpenToken = list => list.GetOpenToken();
20private static readonly Func<TypeArgumentListSyntax, SyntaxToken> s_getTypeArgumentListOpenToken = list => list.LessThanToken;
21private static readonly Func<InitializerExpressionSyntax, SyntaxToken> s_getInitializerExpressionOpenToken = e => e.OpenBraceToken;
22private static readonly Func<AttributeArgumentListSyntax, SyntaxToken> s_getAttributeArgumentListOpenToken = list => list.OpenParenToken;
24private static readonly Func<BaseArgumentListSyntax, SyntaxToken> s_getBaseArgumentListCloseToken = list => list.GetCloseToken();
25private static readonly Func<TypeArgumentListSyntax, SyntaxToken> s_getTypeArgumentListCloseToken = list => list.GreaterThanToken;
26private static readonly Func<InitializerExpressionSyntax, SyntaxToken> s_getInitializerExpressionCloseToken = e => e.CloseBraceToken;
27private static readonly Func<AttributeArgumentListSyntax, SyntaxToken> s_getAttributeArgumentListCloseToken = list => list.CloseParenToken;
29private static readonly Func<BaseArgumentListSyntax, SyntaxNodeOrTokenList> s_getBaseArgumentListArgumentsWithSeparators =
31private static readonly Func<TypeArgumentListSyntax, SyntaxNodeOrTokenList> s_getTypeArgumentListArgumentsWithSeparators =
33private static readonly Func<InitializerExpressionSyntax, SyntaxNodeOrTokenList> s_getInitializerExpressionArgumentsWithSeparators =
35private static readonly Func<AttributeArgumentListSyntax, SyntaxNodeOrTokenList> s_getAttributeArgumentListArgumentsWithSeparators =
38private static readonly Func<BaseArgumentListSyntax, IEnumerable<string?>> s_getBaseArgumentListNames =
40private static readonly Func<TypeArgumentListSyntax, IEnumerable<string?>> s_getTypeArgumentListNames =
42private static readonly Func<InitializerExpressionSyntax, IEnumerable<string?>> s_getInitializerExpressionNames =
44private static readonly Func<AttributeArgumentListSyntax, IEnumerable<string?>> s_getAttributeArgumentListNames =
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (5)
38Func<TParentExpression, InitializerExpressionSyntax?> getInitializer,
797ExpressionSyntax expression, Func<ExpressionSyntax, ExpressionSyntax>? indent)
804ExpressionSyntax expression, Func<ExpressionSyntax, ExpressionSyntax>? indent)
820AssignmentExpressionSyntax assignment, Func<ExpressionSyntax, ExpressionSyntax> indent)
826InvocationExpressionSyntax invocation, Func<ExpressionSyntax, ExpressionSyntax> indent)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (6)
EditAndContinue\Helpers\EditingTestBase.cs (4)
113internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, SyntaxMapDescription.Mapping? syntaxMap, IEnumerable<RuntimeRudeEditDescription>? rudeEdits = null, string? partialType = null)
116internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, IEnumerable<(TextSpan, TextSpan)>? syntaxMap, IEnumerable<RuntimeRudeEditDescription>? rudeEdits = null, string? partialType = null)
119internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, string? partialType = null, bool preserveLocalVariables = false, Func<Compilation, ISymbol>? deletedSymbolContainerProvider = null)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (28)
Semantics\AmbiguousOverrideTests.cs (16)
519Func<int, Func<MethodSymbol, bool>> hasCustomModifierCount = c => m => m.CustomModifierCount() == c;
574Func<int, Func<MethodSymbol, bool>> hasCustomModifierCount = c => m => m.CustomModifierCount() == c;
639Func<int, Func<PropertySymbol, bool>> hasCustomModifierCount = c => p => p.CustomModifierCount() == c;
707Func<int, Func<PropertySymbol, bool>> hasCustomModifierCount = c => p => p.CustomModifierCount() == c;
773Func<int, Func<PropertySymbol, bool>> hasCustomModifierCount = c => p => p.CustomModifierCount() == c;
847Func<int, Func<PropertySymbol, bool>> hasCustomModifierCount = c => p => p.CustomModifierCount() == c;
931Func<int, Func<EventSymbol, bool>> hasCustomModifierCount = c => e => e.Type.CustomModifierCount() == c;
1014Func<int, Func<EventSymbol, bool>> hasCustomModifierCount = c => e => e.Type.CustomModifierCount() == c;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (137)
SymbolDisplay\SymbolDisplayTests.cs (123)
29Func<NamespaceSymbol, Symbol> findSymbol = global =>
48Func<NamespaceSymbol, Symbol> findSymbol = global =>
72Func<NamespaceSymbol, Symbol> findSymbol = global =>
100Func<NamespaceSymbol, Symbol> findSymbol = global =>
128Func<NamespaceSymbol, Symbol> findSymbol = global =>
153Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("A", 0).Single();
176Func<NamespaceSymbol, Symbol> findSymbol = global =>
204Func<NamespaceSymbol, Symbol> findSymbol = global =>
229Func<NamespaceSymbol, Symbol> findSymbol = global =>
255Func<NamespaceSymbol, Symbol> findSymbol = global =>
289Func<NamespaceSymbol, Symbol> findSymbol = global =>
338Func<NamespaceSymbol, Symbol> findSymbol = global =>
403Func<NamespaceSymbol, Symbol> findSymbol = global =>
459Func<NamespaceSymbol, Symbol> findSymbol = global =>
524Func<NamespaceSymbol, Symbol> findSymbol = global =>
589Func<NamespaceSymbol, Symbol> findSymbol = global =>
645Func<NamespaceSymbol, Symbol> findSymbol = global =>
697Func<NamespaceSymbol, Symbol> findSymbol = global =>
735Func<NamespaceSymbol, Symbol> findSymbol = global =>
759Func<NamespaceSymbol, Symbol> findSymbol = global =>
797Func<NamespaceSymbol, Symbol> findSymbol = global =>
830Func<NamespaceSymbol, Symbol> findSymbol = global =>
869Func<NamespaceSymbol, Symbol> findSymbol = global =>
904Func<NamespaceSymbol, Symbol> findSymbol = global =>
939Func<NamespaceSymbol, Symbol> findSymbol = global =>
974Func<NamespaceSymbol, Symbol> findSymbol = global =>
1009Func<NamespaceSymbol, Symbol> findSymbol = global =>
1063Func<NamespaceSymbol, Symbol> findSymbol = global =>
1104Func<NamespaceSymbol, Symbol> findSymbol = global =>
1150Func<NamespaceSymbol, Symbol> findSymbol = global =>
1179Func<NamespaceSymbol, Symbol> findSymbol = global =>
1211Func<NamespaceSymbol, Symbol> findSymbol = global =>
1254Func<NamespaceSymbol, Symbol> findSymbol = global =>
1279Func<NamespaceSymbol, Symbol> findSymbol = global =>
1306Func<NamespaceSymbol, Symbol> findSymbol = global =>
1332Func<NamespaceSymbol, Symbol> findSymbol = global =>
1356Func<NamespaceSymbol, Symbol> findSymbol = global =>
1379Func<NamespaceSymbol, Symbol> findSymbol = global =>
1405Func<NamespaceSymbol, Symbol> findSymbol = global =>
1445Func<NamespaceSymbol, Symbol> findSymbol = global =>
1468Func<NamespaceSymbol, Symbol> findSymbol = global =>
1603Func<NamespaceSymbol, Symbol> findSymbol = global =>
1633Func<NamespaceSymbol, Symbol> findSymbol = global =>
1667Func<NamespaceSymbol, Symbol> findType = global =>
1670Func<NamespaceSymbol, Symbol> findTypeParameter = global =>
1709Func<NamespaceSymbol, Symbol> findSymbol = global =>
1741Func<NamespaceSymbol, Symbol> findSymbol = global =>
1774Func<NamespaceSymbol, Symbol> findSymbol = global =>
1816Func<NamespaceSymbol, Symbol> findSymbol = global =>
1839Func<NamespaceSymbol, Symbol> findSymbol = global =>
1876Func<NamespaceSymbol, Symbol> findSymbol = global =>
1899Func<NamespaceSymbol, Symbol> findSymbol = global =>
1934Func<NamespaceSymbol, Symbol> findSymbol = global =>
1957Func<NamespaceSymbol, Symbol> findSymbol = global =>
2062Func<NamespaceSymbol, Symbol> findSymbol = global =>
2100Func<NamespaceSymbol, Symbol> findSymbol = global =>
2138Func<NamespaceSymbol, Symbol> findSymbol = global =>
2176Func<NamespaceSymbol, Symbol> findSymbol = global =>
2208Func<NamespaceSymbol, Symbol> findSymbol = global =>
2242Func<NamespaceSymbol, Symbol> findSymbol = global =>
2268Func<NamespaceSymbol, Symbol> findSymbol = global =>
2323Func<NamespaceSymbol, Symbol> findSymbol = global =>
2422Func<NamespaceSymbol, Symbol> findSymbol1 = global =>
2426Func<NamespaceSymbol, Symbol> findSymbol2 = global =>
2475Func<NamespaceSymbol, Symbol> findSymbol1 = global =>
2479Func<NamespaceSymbol, Symbol> findSymbol2 = global =>
2514Func<NamespaceSymbol, Symbol> findSymbol = global =>
2551Func<NamespaceSymbol, Symbol> findSymbol = global =>
2588Func<NamespaceSymbol, Symbol> findSymbol = global =>
2614Func<NamespaceSymbol, Symbol> findSymbol = global =>
2644Func<NamespaceSymbol, Symbol> findSymbol = global =>
2672Func<NamespaceSymbol, Symbol> findSymbol = global =>
2763Func<NamespaceSymbol, Symbol> findSymbol = global =>
2824Func<NamespaceSymbol, Symbol> findSymbol = global =>
2916Func<NamespaceSymbol, Symbol> findSymbol = global =>
2946Func<NamespaceSymbol, Symbol> findSymbol = global =>
2980Func<NamespaceSymbol, Symbol> findSymbol = global =>
3011Func<NamespaceSymbol, Symbol> findSymbol = global =>
3045Func<NamespaceSymbol, Symbol> findSymbol = global =>
3072Func<NamespaceSymbol, Symbol> findSymbol = global =>
3317Func<NamespaceSymbol, Symbol> findSymbol = global =>
3340Func<NamespaceSymbol, Symbol> findSymbol = global =>
3361Func<NamespaceSymbol, Symbol> findSymbol = global =>
3386Func<NamespaceSymbol, Symbol> findSymbol = global =>
3696Func<NamespaceSymbol, Symbol> findSymbol,
3718Func<NamespaceSymbol, Symbol> findSymbol,
3728Func<NamespaceSymbol, Symbol> findSymbol,
3756Func<NamespaceSymbol, Symbol> findSymbol = global =>
3807Func<NamespaceSymbol, Symbol> findSymbol = global =>
3861Func<NamespaceSymbol, Symbol> findSymbol = global =>
3913Func<NamespaceSymbol, Symbol> findSymbol = global =>
3964Func<NamespaceSymbol, Symbol> findSymbol = global =>
4045Func<NamespaceSymbol, Symbol> findSymbol = global =>
4115Func<NamespaceSymbol, Symbol> findSymbol1 = global =>
4117Func<NamespaceSymbol, Symbol> findSymbol2 = global =>
4119Func<NamespaceSymbol, Symbol> findSymbol3 = global =>
4227Func<NamespaceSymbol, Symbol> findSymbol1 = global =>
4229Func<NamespaceSymbol, Symbol> findSymbol2 = global =>
4231Func<NamespaceSymbol, Symbol> findSymbol3 = global =>
4341Func<NamespaceSymbol, Symbol> findSymbol = global =>
4445Func<NamespaceSymbol, Symbol> findSymbol = global =>
4549Func<NamespaceSymbol, Symbol> findSymbol = global =>
4593Func<NamespaceSymbol, Symbol> findSymbol = global =>
4640Func<NamespaceSymbol, Symbol> findSymbol = global =>
4682Func<NamespaceSymbol, Symbol> findSymbol = global =>
4717Func<NamespaceSymbol, Symbol> findSymbol = global =>
4765Func<NamespaceSymbol, Symbol> findSymbol = global =>
4806Func<NamespaceSymbol, Symbol> findSymbol = global =>
4876Func<NamespaceSymbol, Symbol> findSymbol = global =>
5456Func<NamespaceSymbol, Symbol> findSymbol = global =>
5488Func<NamespaceSymbol, Symbol> findSymbol = global =>
5519Func<NamespaceSymbol, Symbol> findSymbol = global =>
5550Func<NamespaceSymbol, Symbol> findSymbol = global =>
5587Func<NamespaceSymbol, Symbol> findSymbol = global =>
5638Func<NamespaceSymbol, Symbol> findSymbol = global =>
8322Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("Person").Single();
8343Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("Person").Single();
8364Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("Person").Single();
8387Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("Person").Single();
8414Func<NamespaceSymbol, Symbol> findSymbol = global =>
8435Func<NamespaceSymbol, Symbol> findSymbol = global =>
8456Func<NamespaceSymbol, Symbol> findSymbol = global =>
8477Func<NamespaceSymbol, Symbol> findSymbol = global =>
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (14)
Syntax\SyntaxRewriterTests.cs (10)
727private readonly Func<InternalSyntax.CSharpSyntaxNode, InternalSyntax.CSharpSyntaxNode> _rewriteNode;
728private readonly Func<InternalSyntax.SyntaxToken, InternalSyntax.SyntaxToken> _rewriteToken;
731Func<InternalSyntax.CSharpSyntaxNode, InternalSyntax.CSharpSyntaxNode> rewriteNode = null,
732Func<InternalSyntax.SyntaxToken, InternalSyntax.SyntaxToken> rewriteToken = null)
756private readonly Func<SyntaxNode, SyntaxNode> _rewriteNode;
757private readonly Func<SyntaxToken, SyntaxToken> _rewriteToken;
758private readonly Func<SyntaxTrivia, SyntaxTrivia> _rewriteTrivia;
761Func<SyntaxNode, SyntaxNode> rewriteNode = null,
762Func<SyntaxToken, SyntaxToken> rewriteToken = null,
763Func<SyntaxTrivia, SyntaxTrivia> rewriteTrivia = null)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (26)
Simplification\CSharpSimplificationService.cs (3)
52public override SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken)
77public override SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken)
177protected override ImmutableArray<NodeOrTokenToReduce> GetNodesAndTokensToReduce(SyntaxNode root, Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpans)
Microsoft.CodeAnalysis.EditorFeatures (26)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (8)
NavigateTo\AbstractNavigateToTests.cs (5)
86protected async Task TestAsync(TestHost testHost, Composition composition, string content, Func<EditorTestWorkspace, Task> body)
99protected async Task TestAsync(TestHost testHost, Composition composition, XElement content, Func<EditorTestWorkspace, Task> body)
113string content, Func<EditorTestWorkspace, Task> body, TestHost testHost,
121XElement content, Func<EditorTestWorkspace, Task> body, TestHost testHost,
225private static readonly ImmutableArray<Func<NavigateToItem, IComparable>> s_comparisonComponents =
RefactoringHelpers\RefactoringHelpersTestBase.cs (3)
32protected async Task TestAsync<TNode>(string text, Func<TNode, bool> predicate, bool allowEmptyNodes = false) where TNode : SyntaxNode
63protected async Task TestMissingAsync<TNode>(string text, Func<TNode, bool> predicate, bool allowEmptyNodes = false) where TNode : SyntaxNode
102private async Task<TNode?> GetNodeForSelectionAsync<TNode>(string text, TextSpan selection, Func<TNode, bool> predicate, bool allowEmptyNodes = false) where TNode : SyntaxNode
Microsoft.CodeAnalysis.EditorFeatures.Text (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (34)
CodeGeneration\CodeGenerationTests.cs (30)
58Func<SemanticModel, ITypeSymbol> type = null,
104ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default,
138Func<SemanticModel, ImmutableArray<IMethodSymbol>> getExplicitInterfaces = null,
140ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default,
183ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default,
223ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default,
265Func<SemanticModel, IParameterSymbol> fromType,
321ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters,
342ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default,
373ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default,
375Func<SemanticModel, ImmutableArray<IEventSymbol>> getExplicitInterfaceImplementations = null,
417ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default,
510ImmutableArray<Func<SemanticModel, ISymbol>> members = default,
544Func<TestContext, AttributeData> attributeToGenerate,
584Func<SemanticModel, ITypeSymbol> getType = null,
585ImmutableArray<Func<SemanticModel, ISymbol>> getNewMembers = default,
669internal static Func<SemanticModel, IParameterSymbol> Parameter(Type type, string name, bool hasDefaultValue = false, object defaultValue = null, bool isParams = false)
676internal static Func<SemanticModel, IParameterSymbol> Parameter(string typeFullName, string parameterName, bool hasDefaultValue = false, object defaultValue = null, bool isParams = false, int typeArrayRank = 0)
692internal static ImmutableArray<Func<SemanticModel, IParameterSymbol>> Parameters(params ReadOnlySpan<Func<SemanticModel, IParameterSymbol>> p)
695internal static ImmutableArray<Func<SemanticModel, ISymbol>> Members(params ReadOnlySpan<Func<SemanticModel, ISymbol>> m)
698internal static Func<SemanticModel, ITypeSymbol> CreateArrayType(Type type, int rank = 1)
701private static ImmutableArray<IParameterSymbol> GetParameterSymbols(ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters, TestContext context)
707Func<SemanticModel, ImmutableArray<IMethodSymbol>> explicitInterface, TestContext context)
712private static ImmutableArray<ISymbol> GetSymbols(ImmutableArray<Func<SemanticModel, ISymbol>> members, TestContext context)
719private static Func<SemanticModel, ISymbol> CreateEnumField(string name, object value)
726internal static Func<SemanticModel, ISymbol> CreateField(Accessibility accessibility, Editing.DeclarationModifiers modifiers, Type type, string name)
733private static Func<SemanticModel, INamedTypeSymbol> GetTypeSymbol(Type type)
736private static Func<SemanticModel, INamedTypeSymbol> GetTypeSymbol(string typeMetadataName)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (28)
Lightup\ISmartRenameSessionWrapper.cs (10)
25private static readonly Func<object, TimeSpan> s_automaticFetchDelayAccessor;
26private static readonly Func<object, bool> s_isAvailableAccessor;
27private static readonly Func<object, bool> s_hasSuggestionsAccessor;
28private static readonly Func<object, bool> s_isInProgressAccessor;
29private static readonly Func<object, string> s_statusMessageAccessor;
30private static readonly Func<object, bool> s_statusMessageVisibilityAccessor;
31private static readonly Func<object, IReadOnlyList<string>> s_suggestedNamesAccessor;
32private static readonly Func<object, Guid> s_correlationIdAccessor;
33private static readonly Func<object?, object?>? s_renameContextImmutableListCreateBuilderAccessor;
35private static readonly Func<object, object>? s_renameContextImmutableListBuilderToArrayAccessor;
Lightup\LightupHelpers.cs (8)
58public static Func<T, TResult> CreatePropertyAccessor<T, TResult>(Type? type, string propertyName, TResult defaultValue)
93Expression.Lambda<Func<T, TResult>>(
239public static Func<T, TResult> CreateGenericFunctionAccessor<T, TResult>(Type? type, string methodName, Type genericArgumentType, TResult defaultValue)
273Expression.Lambda<Func<T, TResult>>(
294public static Func<T, TResult> CreateFunctionAccessor<T, TResult>(Type? type, string methodName, TResult defaultValue)
329Expression.Lambda<Func<T, TResult>>(
506private static Func<T, TResult> CreateFallbackAccessor<T, TResult>(TResult defaultValue)
553private static Func<T, TResult> CreateFallbackFunction<T, TResult>(TResult defaultValue)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (4)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (10)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (2)
Microsoft.CodeAnalysis.Features (148)
Common\AbstractProjectExtensionProvider.cs (4)
80public static ImmutableArray<TExtension> GetExtensions(TextDocument document, Func<TExportAttribute, ExtensionInfo>? getExtensionInfoForFiltering)
88public static ImmutableArray<TExtension> FilterExtensions(TextDocument document, ImmutableArray<TExtension> extensions, Func<TExportAttribute, ExtensionInfo> getExtensionInfoForFiltering)
92static bool ShouldIncludeExtension(TExtension extension, (TextDocument, Func<TExportAttribute, ExtensionInfo>) args)
114static ExtensionInfo? GetOrCreateExtensionInfo(TExtension extension, Func<TExportAttribute, ExtensionInfo> getExtensionInfoForFiltering)
Completion\CommonCompletionUtilities.cs (6)
28Func<char, bool> isWordStartCharacter, Func<char, bool> isWordCharacter)
34Func<char, bool> isWordStartCharacter, Func<char, bool> isWordCharacter, bool alwaysExtendEndSpan = false)
60public static bool IsStartingNewWord(SourceText text, int characterPosition, Func<char, bool> isWordStartCharacter, Func<char, bool> isWordCharacter)
Diagnostics\IDiagnosticAnalyzerService.cs (4)
52Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
69Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Project project, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
80TextDocument document, TextSpan? range, Func<string, bool>? shouldIncludeDiagnostic,
118Func<string, bool>? shouldIncludeDiagnostic = diagnosticId != null ? id => id == diagnosticId : null;
Diagnostics\Service\DiagnosticAnalyzerService.cs (3)
83Func<string, bool>? shouldIncludeDiagnostic,
105Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
113Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer,
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (3)
21public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
38Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer,
54Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer,
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (15)
433internal abstract Func<SyntaxNode, bool> IsLambda { get; }
434internal abstract Func<SyntaxNode, bool> IsNotLambda { get; }
435internal abstract Func<SyntaxNode, IEnumerable<SyntaxToken>> DescendantTokensIgnoringLambdaBodies { get; }
456var isLambda = IsLambda;
1118out var runtimeRudeEdits,
1145var matchingNodes =
1853Func<SyntaxNode, bool> nodeSelector,
1854Func<TSyntaxNode, OneOrMany<SyntaxNode>> getTypedNodes,
1922Func<TSyntaxNode, OneOrMany<SyntaxNode>> getTypedNodes,
2028private static List<SyntaxNode?>? GetAncestors(SyntaxNode? root, SyntaxNode node, Func<SyntaxNode, bool> nodeSelector)
5221private static Func<SyntaxNode, SyntaxNode?> CreateSyntaxMapForEquivalentNodes(MemberBody oldBody, MemberBody newBody)
5229private static Func<SyntaxNode, SyntaxNode?> CreateSyntaxMap(DeclarationBodyMap bodyMap)
5518private bool AnyMemberInitializerBody(INamedTypeSymbol type, Func<MemberBody, bool> predicate, bool isStatic, CancellationToken cancellationToken)
5586out Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdits,
6161protected abstract SyntaxNode? GetSymbolDeclarationSyntax(ISymbol symbol, Func<ImmutableArray<SyntaxReference>, SyntaxReference?> selector, CancellationToken cancellationToken);
NavigateTo\NavigateToSearcher.cs (3)
349Func<INavigateToSearchService, ImmutableArray<Project>, Func<ImmutableArray<INavigateToSearchResult>, Task>, Func<Task>, Task> processProjectAsync,
531public Task SearchDocumentAsync(Document document, string searchPattern, IImmutableSet<string> kinds, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, CancellationToken cancellationToken)
534public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
SignatureHelp\CommonSignatureHelpUtilities.cs (10)
26Func<TArgumentList, SyntaxToken> getOpenToken,
27Func<TArgumentList, SyntaxToken> getCloseToken,
28Func<TArgumentList, SyntaxNodeOrTokenList> getArgumentsWithSeparators,
29Func<TArgumentList, IEnumerable<string?>> getArgumentNames)
50Func<TArgumentList, SyntaxToken> getOpenToken,
51Func<TArgumentList, SyntaxToken> getCloseToken,
52Func<TArgumentList, SyntaxNodeOrTokenList> getArgumentsWithSeparators,
74Func<TArgumentList, SyntaxToken> getCloseToken)
83Func<TArgumentList, SyntaxToken> getCloseToken)
108Func<SyntaxToken, bool> isTriggerToken,
SignatureHelp\SignatureHelpParameter.cs (7)
23Func<CancellationToken, IEnumerable<TaggedText>>? documentationFactory,
38public Func<CancellationToken, IEnumerable<TaggedText>> DocumentationFactory { get; } = documentationFactory ?? s_emptyDocumentationFactory;
68private static readonly Func<CancellationToken, IEnumerable<TaggedText>> s_emptyDocumentationFactory = _ => [];
91Func<CancellationToken, IEnumerable<TaggedText>>? documentationFactory,
106public Func<CancellationToken, IEnumerable<TaggedText>> DocumentationFactory { get; } = documentationFactory ?? s_emptyDocumentationFactory;
136private static readonly Func<CancellationToken, IEnumerable<TaggedText>> s_emptyDocumentationFactory = _ => [];
142Func<CancellationToken, IEnumerable<SymbolDisplayPart>>? documentationFactory,
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
Microsoft.CodeAnalysis.Features.UnitTests (1)
Microsoft.CodeAnalysis.InteractiveHost (40)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (4)
47Func<string, bool> fileExists)
322public static T RethrowExceptionsAsIOException<T, TArg>(Func<TArg, T> operation, TArg arg)
339public static async Task<T> RethrowExceptionsAsIOExceptionAsync<T, TArg>(Func<TArg, Task<T>> operation, TArg arg)
355internal static Stream CreateFileStreamChecked(Func<string, Stream> factory, string path, string? paramName = null)
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (6)
66public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector)
70public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer)
84public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
88public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (7)
31public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer)
152public static bool Update<T>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, ImmutableSegmentedHashSet<T>> transformer)
274public static bool Update<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, ImmutableSegmentedDictionary<TKey, TValue>> transformer)
408/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/>
409public static TValue GetOrAdd<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory)
456/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/>
457public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
Microsoft.CodeAnalysis.LanguageServer.Protocol (34)
Protocol\SumType.cs (9)
154public TResult Match<TResult>(Func<T1, TResult> firstMatch, Func<T2, TResult> secondMatch, Func<TResult>? defaultMatch = null)
427public TResult Match<TResult>(Func<T1, TResult> firstMatch, Func<T2, TResult> secondMatch, Func<T3, TResult> thirdMatch, Func<TResult>? defaultMatch = null)
798public TResult Match<TResult>(Func<T1, TResult> firstMatch, Func<T2, TResult> secondMatch, Func<T3, TResult> thirdMatch, Func<T4, TResult> fourthMatch, Func<TResult>? defaultMatch = null)
Microsoft.CodeAnalysis.PooledObjects.Package (13)
PooledDelegates.cs (9)
198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction)
199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction);
202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>,
214/// Gets a <see cref="Func{T, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the
244public static Releaser GetPooledFunction<T1, TArg, TResult>(Func<T1, TArg, TResult> unboundFunction, TArg argument, out Func<T1, TResult> boundFunction)
245=> GetPooledDelegate<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>(unboundFunction, argument, out boundFunction);
410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>
430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>
432protected override Func<T1, TResult> Bind()
Microsoft.CodeAnalysis.PublicApiAnalyzers (22)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (2)
Microsoft.CodeAnalysis.Rebuild.UnitTests (4)
Microsoft.CodeAnalysis.Remote.ServiceHub (28)
Services\BrokeredServiceBase.cs (7)
86Func<Solution, ValueTask<T>> implementation,
100protected static ValueTask<T> RunServiceAsync<T>(Func<CancellationToken, ValueTask<T>> implementation, CancellationToken cancellationToken)
106Checksum solutionChecksum, Func<Solution, ValueTask<T>> implementation, CancellationToken cancellationToken)
112internal static async ValueTask<T> RunServiceImplAsync<T>(Func<CancellationToken, ValueTask<T>> implementation, CancellationToken cancellationToken)
124protected static ValueTask RunServiceAsync(Func<CancellationToken, ValueTask> implementation, CancellationToken cancellationToken)
130Checksum solutionChecksum, Func<Solution, ValueTask> implementation, CancellationToken cancellationToken)
161internal static async ValueTask RunServiceImplAsync(Func<CancellationToken, ValueTask> implementation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Remote.Workspaces (9)
ServiceDescriptor.cs (4)
34private readonly Func<string, string> _featureDisplayNameProvider;
42Func<string, string> displayNameProvider,
61public static ServiceDescriptor CreateRemoteServiceDescriptor(string componentName, string simpleName, string suffix, RemoteSerializationOptions options, Func<string, string> featureDisplayNameProvider, Type? clientInterface)
64public static ServiceDescriptor CreateInProcServiceDescriptor(string componentName, string simpleName, string suffix, Func<string, string> featureDisplayNameProvider)
Microsoft.CodeAnalysis.ResxSourceGenerator (41)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
247public static TOperation? GetAncestor<TOperation>(this IOperation root, OperationKind ancestorKind, Func<TOperation, bool>? predicate = null)
282public static IOperation? GetAncestor(this IOperation root, ImmutableArray<OperationKind> ancestorKinds, Func<IOperation, bool>? predicate = null)
355public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate)
368public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate)
373public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(returnValue: true)] out IOperation? foundOperation)
725public static IOperation WalkDownConversion(this IOperation operation, Func<IConversionOperation, bool> predicate)
799public static bool HasAnyExplicitDescendant(this IOperation operation, Func<IOperation, bool>? descendIntoOperation = null)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (5)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty);
24private static readonly Func<IOperation, IOperation> TargetAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Target), fallbackResult: null!);
26private static readonly Func<IOperation, IMethodSymbol> GetFunctionPointerSignatureAccessor = CreateFunctionPointerSignatureAccessor(WrappedType);
28private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAccessor(Type? wrappedType)
44return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
Microsoft.CodeAnalysis.Scripting (34)
Script.cs (24)
195public Task<ScriptState> RunAsync(object globals = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
198internal abstract Task<ScriptState> CommonRunAsync(object globals, Func<Exception, bool> catchException, CancellationToken cancellationToken);
223public Task<ScriptState> RunFromAsync(ScriptState previousState, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
226internal abstract Task<ScriptState> CommonRunFromAsync(ScriptState previousState, Func<Exception, bool> catchException, CancellationToken cancellationToken);
236internal abstract Func<object[], Task> CommonGetExecutor(CancellationToken cancellationToken);
342private ImmutableArray<Func<object[], Task>> _lazyPrecedingExecutors;
343private Func<object[], Task<T>> _lazyExecutor;
375internal override Func<object[], Task> CommonGetExecutor(CancellationToken cancellationToken)
381internal override Task<ScriptState> CommonRunAsync(object globals, Func<Exception, bool> catchException, CancellationToken cancellationToken)
384internal override Task<ScriptState> CommonRunFromAsync(ScriptState previousState, Func<Exception, bool> catchException, CancellationToken cancellationToken)
388private Func<object[], Task<T>> GetExecutor(CancellationToken cancellationToken)
399private ImmutableArray<Func<object[], Task>> GetPrecedingExecutors(CancellationToken cancellationToken)
412private ImmutableArray<Func<object[], Task>> TryGetPrecedingExecutors(Script lastExecutedScriptInChainOpt, CancellationToken cancellationToken)
417return ImmutableArray<Func<object[], Task>>.Empty;
431return default(ImmutableArray<Func<object[], Task>>);
434var executors = ArrayBuilder<Func<object[], Task>>.GetInstance(scriptsReversed.Count);
487public new Task<ScriptState<T>> RunAsync(object globals = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
496var currentExecutor = GetExecutor(cancellationToken);
510var currentExecutor = GetExecutor(cancellationToken);
547public new Task<ScriptState<T>> RunFromAsync(ScriptState previousState, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
569var currentExecutor = GetExecutor(cancellationToken);
577ImmutableArray<Func<object[], Task>> precedingExecutors,
578Func<object[], Task> currentExecutor,
579Func<Exception, bool> catchExceptionOpt,
Microsoft.CodeAnalysis.Test.Utilities (53)
Assert\AssertEx.cs (14)
228Func<T, string> itemInspector = null,
255Func<T, string> itemInspector = null,
382public static void SetEqual(IEnumerable<string> expected, IEnumerable<string> actual, IEqualityComparer<string> comparer = null, string message = null, string itemSeparator = "\r\n", Func<string, string> itemInspector = null)
477public static void SetEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual, IEqualityComparer<T> comparer = null, string message = null, string itemSeparator = "\r\n", Func<T, string> itemInspector = null)
505public static void None<T>(IEnumerable<T> actual, Func<T, bool> predicate)
517public static void Any<T>(IEnumerable<T> actual, Func<T, bool> predicate)
523public static void All<T>(IEnumerable<T> actual, Func<T, bool> predicate)
539public static string ToString<T>(IEnumerable<T> list, string separator = ", ", Func<T, string> itemInspector = null)
648Func<T, string> itemInspector = escapeQuotes ? new Func<T, string>(t => t.ToString().Replace("\"", "\"\"")) : null;
659Func<T, string> itemInspector = null,
764Func<T, string> itemInspector = null,
824static string join(string itemSeparator, ReadOnlySpan<T> items, Func<T, string> itemInspector)
917public static void Equal<T>(T[,] expected, Func<int, int, T> getResult, Func<T, T, bool> valuesEqual, Func<T, string> printValue, string format, int size)
1016public static void Contains<T>(IEnumerable<T> collection, Predicate<T> filter, Func<T, string>? itemInspector = null, string? itemSeparator = null)
MarkedSource\SourceWithMarkedNodes.cs (4)
41public SourceWithMarkedNodes(string markedSource, Func<string, SyntaxTree> parser, Func<string, int> getSyntaxKind, bool removeTags = false)
52private static IEnumerable<MarkedSpan> GetSpansRecursive(string markedSource, int offset, Func<string, int> getSyntaxKind)
133public static Func<SyntaxNode, SyntaxNode> GetSyntaxMap(SourceWithMarkedNodes source0, SourceWithMarkedNodes source1, List<SyntaxNode> unmappedNodes = null)
Microsoft.CodeAnalysis.Threading.Package (34)
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (6)
66public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector)
70public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer)
84public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
88public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (7)
31public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer)
152public static bool Update<T>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, ImmutableSegmentedHashSet<T>> transformer)
274public static bool Update<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, ImmutableSegmentedDictionary<TKey, TValue>> transformer)
408/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/>
409public static TValue GetOrAdd<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory)
456/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/>
457public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\PooledDelegates.cs (9)
198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction)
199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction);
202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>,
214/// Gets a <see cref="Func{T, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the
244public static Releaser GetPooledFunction<T1, TArg, TResult>(Func<T1, TArg, TResult> unboundFunction, TArg argument, out Func<T1, TResult> boundFunction)
245=> GetPooledDelegate<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>(unboundFunction, argument, out boundFunction);
410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>
430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>
432protected override Func<T1, TResult> Bind()
Microsoft.CodeAnalysis.UnitTests (31)
Collections\List\SegmentedList.Generic.Tests.Misc.cs (6)
27public Func<T?[], IEnumerable<T?>>[] CollectionGenerators { get; }
31CollectionGenerators = new Func<T?[], IEnumerable<T?>>[]
125public void InsertRangeIEnumerable(T?[] itemsX, T?[] itemsY, int index, int repeat, Func<T?[], IEnumerable<T?>> constructIEnumerable)
181public void InsertRangeValidations(T?[] items, Func<T?[], IEnumerable<T?>> constructIEnumerable)
821foreach (Func<int[], IEnumerable<int>> collectionGenerator in IntDriver.CollectionGenerators)
839foreach (Func<string?[], IEnumerable<string?>> collectionGenerator in StringDriver.CollectionGenerators)
Microsoft.CodeAnalysis.VisualBasic (4)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (6)
ExpressionTrees\Sources\QueryHelper.vb (5)
59Public Function [Select](Of T, S)(ByVal i As QueryHelper(Of T), ByVal func As Expression(Of Func(Of T, S))) As QueryHelper(Of S)
65Public Function [SelectMany](Of TSource, TCollection, TResult)(ByVal source As QueryHelper(Of TSource), ByVal collectionSelector As Expression(Of Func(Of TSource, IEnumerable(Of TCollection))), ByVal resultSelector As Expression(Of Func(Of TSource, TCollection, TResult))) As QueryHelper(Of TResult)
72Public Function [Where](Of T)(ByVal source As QueryHelper(Of T), ByVal predicate As Expression(Of Func(Of T, Boolean))) As QueryHelper(Of T)
82Public Function GroupJoin(Of TOuter, TInner, TKey, TResult)(outer As System.Linq.IQueryable(Of TOuter), inner As System.Linq.IQueryable(Of TInner), outerKeySelector As Expression(Of Func(Of TOuter, TKey)), innerKeySelector As Expression(Of Func(Of TInner, TKey)), resultSelector As Expression(Of Func(Of TOuter, System.Linq.IQueryable(Of TInner), TResult))) As System.Linq.IQueryable(Of TResult)
Microsoft.CodeAnalysis.Workspaces (497)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (6)
25private readonly Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> _getNodeClassifiers;
26private readonly Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>> _getTokenClassifiers;
38Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers,
39Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>> getTokenClassifiers,
60Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers,
61Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>> getTokenClassifiers,
CodeActions\CodeAction.cs (8)
105private bool IsNonProgressApiOverridden(Dictionary<Type, bool> dictionary, Func<CodeAction, bool> computeResult)
497public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey)
504/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?)"/>
507public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
510/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?, CodeActionPriority)"/>
531public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey)
542public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
545/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Solution}}, string?, CodeActionPriority)"/>
ExtensionManager\IExtensionManagerExtensions.cs (5)
69Func<CancellationToken, Task<T>?> function,
90public static Func<SyntaxNode, ImmutableArray<TExtension>> CreateNodeExtensionGetter<TExtension>(
91this IExtensionManager extensionManager, IEnumerable<TExtension> extensions, Func<TExtension, ImmutableArray<Type>> nodeTypeGetter)
114public static Func<SyntaxToken, ImmutableArray<TExtension>> CreateTokenExtensionGetter<TExtension>(
115this IExtensionManager extensionManager, IEnumerable<TExtension> extensions, Func<TExtension, ImmutableArray<int>> tokenKindGetter)
FindSymbols\FindReferences\DependentTypeFinder.cs (10)
42private static readonly Func<Location, bool> s_isInMetadata = static loc => loc.IsInMetadata;
43private static readonly Func<Location, bool> s_isInSource = static loc => loc.IsInSource;
45private static readonly Func<INamedTypeSymbol, bool> s_isInterface = static t => t is { TypeKind: TypeKind.Interface };
46private static readonly Func<INamedTypeSymbol, bool> s_isNonSealedClass = static t => t is { TypeKind: TypeKind.Class, IsSealed: false };
47private static readonly Func<INamedTypeSymbol, bool> s_isInterfaceOrNonSealedClass = static t => s_isInterface(t) || s_isNonSealedClass(t);
65Func<INamedTypeSymbol, bool> shouldContinueSearching,
254Func<INamedTypeSymbol, bool>? predicate)
375SymbolSet foundTypes, Func<Location, bool> assert, string message)
388private static void AddRange(SymbolSet foundTypes, SymbolSet currentTypes, Func<INamedTypeSymbol, bool> shouldContinueSearching)
539Func<INamedTypeSymbol, bool> shouldContinueSearching)
FindSymbols\SymbolFinder_Declarations_CustomQueries.cs (4)
28public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, CancellationToken cancellationToken = default)
34public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default)
73public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, CancellationToken cancellationToken = default)
79public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default)
Simplification\Simplifier.cs (6)
62public static async Task<TNode> ExpandAsync<TNode>(TNode node, Document document, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode
81public static TNode Expand<TNode>(TNode node, SemanticModel semanticModel, Workspace workspace, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode
92internal static TNode Expand<TNode>(TNode node, SemanticModel semanticModel, SolutionServices services, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode
112public static async Task<SyntaxToken> ExpandAsync(SyntaxToken token, Document document, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default)
126public static SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Workspace workspace, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default)
137internal static SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, SolutionServices services, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (18)
141public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ImmutableArray<TItem> items, Func<TItem, TResult> map)
210public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, TResult> selector)
267public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, IEnumerable<TResult>> selector)
287public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, ImmutableArray<TResult>> selector)
307public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, OneOrMany<TResult>> selector)
330public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, IEnumerable<TResult>> selector)
354public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, ImmutableArray<TResult>> selector)
378public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, OneOrMany<TResult>> selector)
537public static ImmutableArray<T> WhereAsArray<T>(this ImmutableArray<T> array, Func<T, bool> predicate)
548private static ImmutableArray<T> WhereAsArrayImpl<T, TArg>(ImmutableArray<T> array, Func<T, bool>? predicateWithoutArg, Func<T, TArg, bool>? predicateWithArg, TArg arg)
649public static async Task<bool> AnyAsync<T>(this ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
681public static async ValueTask<T?> FirstOrDefaultAsync<T>(this ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
1110public static int Count<T>(this ImmutableArray<T> items, Func<T, bool> predicate)
1129public static int Sum<T>(this ImmutableArray<T> items, Func<T, int> selector)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (4)
47Func<string, bool> fileExists)
322public static T RethrowExceptionsAsIOException<T, TArg>(Func<TArg, T> operation, TArg arg)
339public static async Task<T> RethrowExceptionsAsIOExceptionAsync<T, TArg>(Func<TArg, Task<T>> operation, TArg arg)
355internal static Stream CreateFileStreamChecked(Func<string, Stream> factory, string path, string? paramName = null)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (14)
217public static T? FirstOrNull<T>(this IEnumerable<T> source, Func<T, bool> predicate)
260public static T? SingleOrNull<T>(this IEnumerable<T> source, Func<T, bool> predicate)
338private static readonly Func<object, bool> s_notNullTest = x => x != null;
348return source.Where((Func<T?, bool>)s_notNullTest)!;
354public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, TResult> selector)
384public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IReadOnlyCollection<TSource>? source, Func<TSource, TResult> selector)
416public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, IEnumerable<TResult>> selector)
440public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this IReadOnlyCollection<TItem>? source, Func<TItem, IEnumerable<TResult>> selector)
466public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, OneOrMany<TResult>> selector)
481public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this IEnumerable<TItem> source, Func<TItem, ValueTask<TResult>> selector)
687public static bool Contains<T>(this IEnumerable<T> sequence, Func<T, bool> predicate)
787internal static Dictionary<K, ImmutableArray<T>> ToMultiDictionary<K, T>(this IEnumerable<T> data, Func<T, K> keySelector, IEqualityComparer<K>? comparer = null)
839public static readonly Func<T, T> Identity = t => t;
840public static readonly Func<T, bool> True = t => true;
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
46public static T Initialize<T, TArg>([NotNull] ref T? target, Func<TArg, T> valueFactory, TArg arg)
66public static int Initialize<TArg>(ref int target, int uninitializedValue, Func<TArg, int> valueFactory, TArg arg)
103public static T? Initialize<T, TArg>([NotNull] ref StrongBox<T?>? target, Func<TArg, T?> valueFactory, TArg arg)
183public static ImmutableArray<T> Initialize<T, TArg>(ref ImmutableArray<T> target, Func<TArg, ImmutableArray<T>> createArray, TArg arg)
193private static ImmutableArray<T> Initialize_Slow<T, TArg>(ref ImmutableArray<T> target, Func<TArg, ImmutableArray<T>> createArray, TArg arg)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (4)
49SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
55internal static bool IsGeneratedCode(string? filePath, SyntaxNode root, Func<SyntaxTrivia, bool> isComment)
88private static bool BeginsWithAutoGeneratedComment(SyntaxNode root, Func<SyntaxTrivia, bool> isComment)
118SyntaxTree tree, Func<SyntaxTrivia, bool> isComment, CancellationToken cancellationToken)
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (6)
66public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector)
70public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer)
84public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
88public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (7)
31public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer)
152public static bool Update<T>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, ImmutableSegmentedHashSet<T>> transformer)
274public static bool Update<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, ImmutableSegmentedDictionary<TKey, TValue>> transformer)
408/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/>
409public static TValue GetOrAdd<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory)
456/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/>
457public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\PooledDelegates.cs (9)
198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction)
199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction);
202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>,
214/// Gets a <see cref="Func{T, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the
244public static Releaser GetPooledFunction<T1, TArg, TResult>(Func<T1, TArg, TResult> unboundFunction, TArg argument, out Func<T1, TResult> boundFunction)
245=> GetPooledDelegate<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>(unboundFunction, argument, out boundFunction);
410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>
430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>
432protected override Func<T1, TResult> Bind()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ObjectExtensions.TypeSwitch.cs (161)
11public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TBaseType, TResult>? defaultFunc = null)
25public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TBaseType, TResult>? defaultFunc = null)
41public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TBaseType, TResult>? defaultFunc = null)
59public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TBaseType, TResult>? defaultFunc = null)
79public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TBaseType, TResult>? defaultFunc = null)
119public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TBaseType, TResult>? defaultFunc = null)
161public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TBaseType, TResult>? defaultFunc = null)
213public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TDerivedType36, TDerivedType37, TDerivedType38, TDerivedType39, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TDerivedType36, TResult> matchFunc36, Func<TDerivedType37, TResult> matchFunc37, Func<TDerivedType38, TResult> matchFunc38, Func<TDerivedType39, TResult> matchFunc39, Func<TBaseType, TResult>? defaultFunc = null)
299public static TResult? TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TDerivedType36, TDerivedType37, TDerivedType38, TDerivedType39, TDerivedType40, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TDerivedType36, TResult> matchFunc36, Func<TDerivedType37, TResult> matchFunc37, Func<TDerivedType38, TResult> matchFunc38, Func<TDerivedType39, TResult> matchFunc39, Func<TDerivedType40, TResult> matchFunc40, Func<TBaseType, TResult>? defaultFunc = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (6)
104this SyntaxNode node, TextSpan searchSpan, Func<SyntaxNode, bool> predicate)
129public static bool CheckParent<T>([NotNullWhen(returnValue: true)] this SyntaxNode? node, Func<T, bool> valueChecker) where T : SyntaxNode
145public static bool IsChildNode<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode?> childGetter)
162public static bool IsFoundUnder<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode?> childGetter)
201public static SyntaxNode? FindInnermostCommonNode(this IEnumerable<SyntaxNode> nodes, Func<SyntaxNode, bool> predicate)
806public static TNode? FirstAncestorOrSelfUntil<TNode>(this SyntaxNode? node, Func<SyntaxNode, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (5)
15public static SyntaxNode? GetAncestor(this SyntaxToken token, Func<SyntaxNode, bool>? predicate)
18public static T? GetAncestor<T>(this SyntaxToken token, Func<T, bool>? predicate = null) where T : SyntaxNode
21public static T GetRequiredAncestor<T>(this SyntaxToken token, Func<T, bool>? predicate = null) where T : SyntaxNode
32public static IEnumerable<SyntaxNode> GetAncestors(this SyntaxToken token, Func<SyntaxNode, bool> predicate)
42public static bool CheckParent<T>(this SyntaxToken token, Func<T, bool> valueChecker) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PublicOptionFactory.cs (8)
38private sealed class StorageMapping(IOption2 internalOption, Func<object?, object?> toPublicValue, Func<object?, object?> toInternalValue) : OptionStorageMapping(internalOption)
47private static OptionDefinition<TPublicValue> ToPublicOptionDefinition<T, TPublicValue>(this OptionDefinition<T> definition, IOption2 internalOption, Func<T, TPublicValue> toPublicValue, Func<TPublicValue, T> toInternalValue)
56public static Option2<T> WithPublicOption<T, TPublicValue>(this Option2<T> option, string feature, string name, Func<T, TPublicValue> toPublicValue, Func<TPublicValue, T> toInternalValue)
66public static PerLanguageOption2<T> WithPublicOption<T, TPublicValue>(this PerLanguageOption2<T> option, string feature, string name, Func<T, TPublicValue> toPublicValue, Func<TPublicValue, T> toInternalValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (8)
13public static IEnumerable<T> TopologicalSort<T>(this IEnumerable<T> items, Func<T, IEnumerable<T>> itemsBefore)
26public static IEnumerable<T> TopologicalSort<T>(this IEnumerable<T> items, Func<T, IEnumerable<T>> itemsBefore, Func<T, IEnumerable<T>> itemsAfter)
29var combinedItemsBefore = CreateCombinedItemsBefore(items, itemsBefore, itemsAfter);
35Func<T, IEnumerable<T>> itemsBefore,
50private static Func<T, IEnumerable<T>> CreateCombinedItemsBefore<T>(IEnumerable<T> items, Func<T, IEnumerable<T>> itemsBefore, Func<T, IEnumerable<T>> itemsAfter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (4)
29Func<TType, (TNode semanticNode, IEnumerable<TNode> additionalNodes)> selector,
52Func<TType, TNode> selector,
96Func<TType, (TNode semanticNode, IEnumerable<TNode> additionalNodes)> selector,
153Func<TType, (TNode semanticNode, IEnumerable<TNode> additionalNodes)> selector,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (6)
35protected static readonly Func<SyntaxNode, bool> s_containsAnnotations = n => n.ContainsAnnotations;
36protected static readonly Func<SyntaxNodeOrToken, bool> s_hasSimplifierAnnotation = n => n.HasAnnotation(Simplifier.Annotation);
40protected abstract ImmutableArray<NodeOrTokenToReduce> GetNodesAndTokensToReduce(SyntaxNode root, Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpans);
51public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken);
52public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken);
275Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpan)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (6)
43Func<string, bool>? canUse = null,
63Func<string, bool>? canUse = null,
86Func<string, bool>? canUse = null,
134public static string GenerateUniqueName(string baseName, Func<string, bool> canUse)
140public static string GenerateUniqueName(string baseName, string extension, Func<string, bool> canUse)
160public static string GenerateUniqueName(IEnumerable<string> baseNames, Func<string, bool> canUse)
Storage\SQLite\v2\SQLitePersistentStorage_Threading.cs (3)
16Func<TArg, TResult> func, TArg arg,
31private Task<TResult> PerformReadAsync<TArg, TResult>(Func<TArg, TResult> func, TArg arg, CancellationToken cancellationToken) where TArg : struct
46public Task<TResult> PerformWriteAsync<TArg, TResult>(Func<TArg, TResult> func, TArg arg, CancellationToken cancellationToken) where TArg : struct
Workspace\Workspace.cs (4)
199/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/>
201Func<Solution, Solution> transformation,
230Func<Solution, Solution> transformation,
250Func<Solution, Solution> transformation,
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (88)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (18)
141public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ImmutableArray<TItem> items, Func<TItem, TResult> map)
210public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, TResult> selector)
267public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, IEnumerable<TResult>> selector)
287public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, ImmutableArray<TResult>> selector)
307public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, OneOrMany<TResult>> selector)
330public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, IEnumerable<TResult>> selector)
354public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, ImmutableArray<TResult>> selector)
378public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, OneOrMany<TResult>> selector)
537public static ImmutableArray<T> WhereAsArray<T>(this ImmutableArray<T> array, Func<T, bool> predicate)
548private static ImmutableArray<T> WhereAsArrayImpl<T, TArg>(ImmutableArray<T> array, Func<T, bool>? predicateWithoutArg, Func<T, TArg, bool>? predicateWithArg, TArg arg)
649public static async Task<bool> AnyAsync<T>(this ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
681public static async ValueTask<T?> FirstOrDefaultAsync<T>(this ImmutableArray<T> array, Func<T, Task<bool>> predicateAsync)
1110public static int Count<T>(this ImmutableArray<T> items, Func<T, bool> predicate)
1129public static int Sum<T>(this ImmutableArray<T> items, Func<T, int> selector)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (4)
47Func<string, bool> fileExists)
322public static T RethrowExceptionsAsIOException<T, TArg>(Func<TArg, T> operation, TArg arg)
339public static async Task<T> RethrowExceptionsAsIOExceptionAsync<T, TArg>(Func<TArg, Task<T>> operation, TArg arg)
355internal static Stream CreateFileStreamChecked(Func<string, Stream> factory, string path, string? paramName = null)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (14)
217public static T? FirstOrNull<T>(this IEnumerable<T> source, Func<T, bool> predicate)
260public static T? SingleOrNull<T>(this IEnumerable<T> source, Func<T, bool> predicate)
338private static readonly Func<object, bool> s_notNullTest = x => x != null;
348return source.Where((Func<T?, bool>)s_notNullTest)!;
354public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, TResult> selector)
384public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IReadOnlyCollection<TSource>? source, Func<TSource, TResult> selector)
416public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, IEnumerable<TResult>> selector)
440public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this IReadOnlyCollection<TItem>? source, Func<TItem, IEnumerable<TResult>> selector)
466public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, OneOrMany<TResult>> selector)
481public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this IEnumerable<TItem> source, Func<TItem, ValueTask<TResult>> selector)
687public static bool Contains<T>(this IEnumerable<T> sequence, Func<T, bool> predicate)
787internal static Dictionary<K, ImmutableArray<T>> ToMultiDictionary<K, T>(this IEnumerable<T> data, Func<T, K> keySelector, IEqualityComparer<K>? comparer = null)
839public static readonly Func<T, T> Identity = t => t;
840public static readonly Func<T, bool> True = t => true;
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
46public static T Initialize<T, TArg>([NotNull] ref T? target, Func<TArg, T> valueFactory, TArg arg)
66public static int Initialize<TArg>(ref int target, int uninitializedValue, Func<TArg, int> valueFactory, TArg arg)
103public static T? Initialize<T, TArg>([NotNull] ref StrongBox<T?>? target, Func<TArg, T?> valueFactory, TArg arg)
183public static ImmutableArray<T> Initialize<T, TArg>(ref ImmutableArray<T> target, Func<TArg, ImmutableArray<T>> createArray, TArg arg)
193private static ImmutableArray<T> Initialize_Slow<T, TArg>(ref ImmutableArray<T> target, Func<TArg, ImmutableArray<T>> createArray, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary.cs (6)
66public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector)
70public static ImmutableSegmentedDictionary<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer)
84public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
88public static ImmutableSegmentedDictionary<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (7)
31public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer)
152public static bool Update<T>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, ImmutableSegmentedHashSet<T>> transformer)
274public static bool Update<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, ImmutableSegmentedDictionary<TKey, TValue>> transformer)
408/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/>
409public static TValue GetOrAdd<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory)
456/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/>
457public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\PooledDelegates.cs (9)
198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction)
199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction);
202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>,
214/// Gets a <see cref="Func{T, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the
244public static Releaser GetPooledFunction<T1, TArg, TResult>(Func<T1, TArg, TResult> unboundFunction, TArg argument, out Func<T1, TResult> boundFunction)
245=> GetPooledDelegate<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>(unboundFunction, argument, out boundFunction);
410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>
430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>>
432protected override Func<T1, TResult> Bind()
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (9)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (17)
ObjectSerializationTests.cs (3)
55private static T RoundTrip<T>(T value, Action<ObjectWriter, T> writeAction, Func<ObjectReader, T> readAction, bool recursive)
69private static void TestRoundTrip<T>(T value, Action<ObjectWriter, T> writeAction, Func<ObjectReader, T> readAction, bool recursive)
75private static void TestRoundTrip<T>(T value, Action<ObjectWriter, T> writeAction, Func<ObjectReader, T> readAction)
SolutionTests\SolutionTestHelpers.cs (2)
24public static void TestProperty<T, TValue>(T instance, Func<T, TValue, T> factory, Func<T, TValue> getter, TValue validNonDefaultValue, bool defaultThrows = false)
46public static void TestListProperty<T, TValue>(T instance, Func<T, IEnumerable<TValue>, T> factory, Func<T, IEnumerable<TValue>> getter, TValue item, bool allowDuplicates)
SymbolKeyTests.cs (4)
1438IEnumerable<ISymbol> symbols, Compilation compilation, Func<ISymbol, object> fnId = null, bool useSymbolEquivalence = false)
1445ISymbol symbol, Compilation compilation, Func<ISymbol, object> fnId = null, bool useSymbolEquivalence = false)
1494SemanticModel model, Func<SyntaxNode, bool> predicate = null)
1503List<ISymbol> list, Func<SyntaxNode, bool> predicate)
Microsoft.CSharp (1)
Microsoft.Data.Analysis (11)
Microsoft.DotNet.AsmDiff (1)
Microsoft.DotNet.Build.Tasks.Feed.Tests (2)
Microsoft.DotNet.Build.Tasks.Packaging (7)
Microsoft.DotNet.Build.Tasks.Packaging.Tests (1)
Microsoft.DotNet.GenFacades (1)
Microsoft.DotNet.Helix.Sdk (1)
Microsoft.DotNet.Internal.SymbolHelper (1)
Microsoft.DotNet.NuGetRepack.Tests (9)
TestHelpers\AssertEx.cs (7)
198string itemSeparator = null, Func<T, string> itemInspector = null)
279public static void None<T>(IEnumerable<T> actual, Func<T, bool> predicate)
291public static void Any<T>(IEnumerable<T> actual, Func<T, bool> predicate)
297public static void All<T>(IEnumerable<T> actual, Func<T, bool> predicate)
313public static string ToString<T>(IEnumerable<T> list, string separator = ", ", Func<T, string> itemInspector = null)
424Func<T, string> itemInspector = escapeQuotes ? new Func<T, string>(t => t.ToString().Replace("\"", "\"\"")) : null;
432Func<T, string> itemInspector = null,
Microsoft.DotNet.RemoteExecutor (3)
Microsoft.DotNet.SourceBuild.Tasks (2)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (1)
Microsoft.DotNet.XliffTasks (1)
Microsoft.DotNet.XUnitAssert.Tests (2)
Microsoft.Extensions.AI (17)
Microsoft.Extensions.AI.Abstractions (8)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Microsoft.Extensions.AI.Evaluation (5)
Microsoft.Extensions.AI.Evaluation.Console (5)
Utilities\LoggerExtensions.cs (5)
86Func<TArgument, TResult> action,
147Func<TArgument, Task> action,
167Func<TArgument, ValueTask> action,
231Func<TArgument, Task<TResult>> action,
254Func<TArgument, ValueTask<TResult>> action,
Microsoft.Extensions.AI.Evaluation.Reporting (6)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Microsoft.Extensions.AI.Ollama (1)
Microsoft.Extensions.AI.Tests (16)
ChatCompletion\FunctionInvokingChatClientTests.cs (12)
114Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(
162Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(
215Func<ChatClientBuilder, ChatClientBuilder> configurePipeline = pipeline => pipeline
257Func<ChatClientBuilder, ChatClientBuilder> configurePipeline = pipeline => pipeline
338Func<ChatClientBuilder, ChatClientBuilder> configurePipeline = pipeline => pipeline
449Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(
476Func<ChatClientBuilder, ChatClientBuilder> configure = b =>
483async Task InvokeAsync(Func<IServiceProvider, Task> work)
532Func<ChatClientBuilder, ChatClientBuilder> configure = b => b.Use(c =>
908Func<ChatClientBuilder, ChatClientBuilder> configurePipeline = builder => builder
937Func<ChatClientBuilder, ChatClientBuilder>? configurePipeline = null,
1037Func<ChatClientBuilder, ChatClientBuilder>? configurePipeline = null,
Microsoft.Extensions.Caching.Abstractions (6)
MemoryCacheExtensions.cs (4)
170public static TItem? GetOrCreate<TItem>(this IMemoryCache cache, object key, Func<ICacheEntry, TItem> factory)
184public static TItem? GetOrCreate<TItem>(this IMemoryCache cache, object key, Func<ICacheEntry, TItem> factory, MemoryCacheEntryOptions? createOptions)
210public static Task<TItem?> GetOrCreateAsync<TItem>(this IMemoryCache cache, object key, Func<ICacheEntry, Task<TItem>> factory)
224public static async Task<TItem?> GetOrCreateAsync<TItem>(this IMemoryCache cache, object key, Func<ICacheEntry, Task<TItem>> factory, MemoryCacheEntryOptions? createOptions)
Microsoft.Extensions.Caching.Hybrid.Tests (3)
Microsoft.Extensions.Caching.Memory (2)
Microsoft.Extensions.Configuration.Abstractions (1)
Microsoft.Extensions.Configuration.KeyPerFile (1)
Microsoft.Extensions.Configuration.Xml (2)
Microsoft.Extensions.DependencyInjection (35)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (11)
35delegateType: typeof(Func<object?, object?>),
45private readonly ConcurrentDictionary<ServiceCacheKey, Func<ServiceProviderEngineScope, object>> _scopeResolverCache;
47private readonly Func<ServiceCacheKey, ServiceCallSite, Func<ServiceProviderEngineScope, object>> _buildTypeDelegate;
52_scopeResolverCache = new ConcurrentDictionary<ServiceCacheKey, Func<ServiceProviderEngineScope, object>>();
56public Func<ServiceProviderEngineScope, object> Build(ServiceCallSite callSite)
71public Func<ServiceProviderEngineScope, object> BuildNoCache(ServiceCallSite callSite)
73Expression<Func<ServiceProviderEngineScope, object>> expression = BuildExpression(callSite);
78private Expression<Func<ServiceProviderEngineScope, object>> BuildExpression(ServiceCallSite callSite)
82return Expression.Lambda<Func<ServiceProviderEngineScope, object>>(
91return Expression.Lambda<Func<ServiceProviderEngineScope, object>>(
209Func<ServiceProviderEngineScope, object> lambda = Build(callSite);
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (7)
42public Func<IServiceProvider, object>[]? Factories;
47public Func<ServiceProviderEngineScope, object?> Lambda;
66public Func<ServiceProviderEngineScope, object?> Build(ServiceCallSite callSite)
128Lambda = (Func<ServiceProviderEngineScope, object?>)dynamicMethod.CreateDelegate(typeof(Func<ServiceProviderEngineScope, object?>), runtimeContext),
248argument.Factories ??= new List<Func<IServiceProvider, object>>();
255argument.Generator.Emit(OpCodes.Ldelem, typeof(Func<IServiceProvider, object>));
Microsoft.Extensions.DependencyInjection.Abstractions (30)
ServiceCollectionServiceExtensions.cs (10)
49Func<IServiceProvider, object> implementationFactory)
123Func<IServiceProvider, TService> implementationFactory)
146Func<IServiceProvider, TImplementation> implementationFactory)
191Func<IServiceProvider, object> implementationFactory)
265Func<IServiceProvider, TService> implementationFactory)
288Func<IServiceProvider, TImplementation> implementationFactory)
334Func<IServiceProvider, object> implementationFactory)
408Func<IServiceProvider, TService> implementationFactory)
431Func<IServiceProvider, TImplementation> implementationFactory)
499Func<IServiceProvider, object> implementationFactory,
ServiceDescriptor.cs (14)
91Func<IServiceProvider, object> factory,
121Func<IServiceProvider, object> nullKeyedFactory = sp => factory(sp, null);
224public Func<IServiceProvider, object>? ImplementationFactory => IsKeyedService ? null : (Func<IServiceProvider, object>?) _implementationFactory;
432Func<IServiceProvider, TImplementation> implementationFactory)
471public static ServiceDescriptor Transient<TService>(Func<IServiceProvider, TService> implementationFactory)
504public static ServiceDescriptor Transient(Type service, Func<IServiceProvider, object> implementationFactory)
603Func<IServiceProvider, TImplementation> implementationFactory)
642public static ServiceDescriptor Scoped<TService>(Func<IServiceProvider, TService> implementationFactory)
675public static ServiceDescriptor Scoped(Type service, Func<IServiceProvider, object> implementationFactory)
781Func<IServiceProvider, TImplementation> implementationFactory)
820public static ServiceDescriptor Singleton<TService>(Func<IServiceProvider, TService> implementationFactory)
857Func<IServiceProvider, object> implementationFactory)
1016public static ServiceDescriptor Describe(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime)
Microsoft.Extensions.DependencyInjection.AutoActivation (5)
AutoActivationExtensions.cs (5)
98public static IServiceCollection AddActivatedSingleton<TService, TImplementation>(this IServiceCollection services, Func<IServiceProvider, TImplementation> implementationFactory)
135public static IServiceCollection AddActivatedSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)
191Func<IServiceProvider, object> implementationFactory)
262public static void TryAddActivatedSingleton(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory)
305public static void TryAddActivatedSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)
Microsoft.Extensions.Diagnostics.HealthChecks (10)
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (4)
Microsoft.Extensions.Diagnostics.Probes (4)
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
Microsoft.Extensions.Diagnostics.Testing (2)
Microsoft.Extensions.Features (3)
Microsoft.Extensions.Hosting (4)
Microsoft.Extensions.Hosting.Abstractions (2)
Microsoft.Extensions.Hosting.Testing (1)
Microsoft.Extensions.Hosting.Testing.Tests (1)
Microsoft.Extensions.Http (23)
DependencyInjection\HttpClientBuilderExtensions.cs (8)
103public static IHttpClientBuilder AddHttpMessageHandler(this IHttpClientBuilder builder, Func<IServiceProvider, DelegatingHandler> configureHandler)
184public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler(this IHttpClientBuilder builder, Func<IServiceProvider, HttpMessageHandler> configureHandler)
472/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(IHttpClientBuilder,Func{HttpClient,TClient})"/>
476public static IHttpClientBuilder AddTypedClient<TClient>(this IHttpClientBuilder builder, Func<HttpClient, TClient> factory)
485internal static IHttpClientBuilder AddTypedClientCore<TClient>(this IHttpClientBuilder builder, Func<HttpClient, TClient> factory, bool validateSingleType)
551/// Sets the <see cref="Func{T, R}"/> which determines whether to redact the HTTP header value given its corresponding header name before logging.
554/// <param name="shouldRedactHeaderValue">The <see cref="Func{T, R}"/> which determines whether to redact the HTTP header value given its corresponding header name before logging.</param>
558public static IHttpClientBuilder RedactLoggedHeaders(this IHttpClientBuilder builder, Func<string, bool> shouldRedactHeaderValue)
Logging\LogHelper.cs (5)
33public static readonly Func<string, bool> ShouldRedactHeaderValue = (header) => true;
68public static void LogRequestStart(this ILogger logger, HttpRequestMessage request, Func<string, bool> shouldRedactHeaderValue)
87public static void LogRequestEnd(this ILogger logger, HttpResponseMessage response, TimeSpan duration, Func<string, bool> shouldRedactHeaderValue)
111public static void LogRequestPipelineStart(this ILogger logger, HttpRequestMessage request, string? formattedUri, Func<string, bool> shouldRedactHeaderValue)
126public static void LogRequestPipelineEnd(this ILogger logger, HttpResponseMessage response, TimeSpan duration, Func<string, bool> shouldRedactHeaderValue)
Microsoft.Extensions.Http.Polly (6)
Microsoft.Extensions.Http.Polly.Tests (4)
Microsoft.Extensions.Http.Resilience (23)
Resilience\Internal\PipelineKeyProviderHelper.cs (5)
21public static void SelectPipelineBy(IServiceCollection services, string pipelineName, Func<IServiceProvider, Func<HttpRequestMessage, string>> selectorFactory)
26public static Func<HttpRequestMessage, string>? GetPipelineKeyProvider(this IServiceProvider provider, string pipelineName)
31private static void UsePipelineKeyProvider(IServiceCollection services, string pipelineName, Func<IServiceProvider, Func<HttpRequestMessage, string>> factory)
Microsoft.Extensions.Http.Resilience.Tests (2)
Microsoft.Extensions.Localization (2)
Microsoft.Extensions.Logging (8)
FilterLoggingBuilderExtensions.cs (8)
48public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, Func<LogLevel, bool> levelFilter) =>
58public static ILoggingBuilder AddFilter<T>(this ILoggingBuilder builder, Func<LogLevel, bool> levelFilter) where T : ILoggerProvider =>
89public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, string? category, Func<LogLevel, bool> levelFilter) =>
100public static ILoggingBuilder AddFilter<T>(this ILoggingBuilder builder, string? category, Func<LogLevel, bool> levelFilter) where T : ILoggerProvider =>
137public static LoggerFilterOptions AddFilter(this LoggerFilterOptions builder, Func<LogLevel, bool> levelFilter) =>
147public static LoggerFilterOptions AddFilter<T>(this LoggerFilterOptions builder, Func<LogLevel, bool> levelFilter) where T : ILoggerProvider =>
178public static LoggerFilterOptions AddFilter(this LoggerFilterOptions builder, string? category, Func<LogLevel, bool> levelFilter) =>
189public static LoggerFilterOptions AddFilter<T>(this LoggerFilterOptions builder, string? category, Func<LogLevel, bool> levelFilter) where T : ILoggerProvider =>
Microsoft.Extensions.Logging.Abstractions (1)
Microsoft.Extensions.Logging.AzureAppServices (3)
Microsoft.Extensions.ML (1)
Microsoft.Extensions.ObjectPool (1)
Microsoft.Extensions.Options (4)
Microsoft.Extensions.ServiceDiscovery (1)
Microsoft.Extensions.ServiceDiscovery.Dns (2)
Microsoft.Extensions.ServiceDiscovery.Tests (1)
Microsoft.Extensions.Telemetry (10)
Microsoft.Extensions.WebEncoders (2)
Microsoft.Gen.ComplianceReports (2)
Microsoft.Gen.ContextualOptions (2)
Microsoft.Gen.Logging (3)
Microsoft.Gen.MetadataExtractor (2)
Microsoft.Gen.Metrics (2)
Microsoft.Gen.MetricsReports (2)
Microsoft.Interop.ComInterfaceGenerator (11)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (11)
34List<Func<ITypeSymbol, bool>> sourceGeneratedComRecognizers = new();
53var methodsOfInterest = new Dictionary<ISymbol, ImmutableArray<Func<IInvocationOperation, (ITypeSymbol, Location)?>>>(SymbolEqualityComparer.Default);
55var firstArgumentTypeLookup = CreateArgumentTypeLookup(0);
108if (methodsOfInterest.TryGetValue(operation.TargetMethod.OriginalDefinition, out ImmutableArray<Func<IInvocationOperation, (ITypeSymbol, Location)?>> discoverers))
110foreach (Func<IInvocationOperation, (ITypeSymbol, Location)?> discoverer in discoverers)
115foreach (var recognizer in sourceGeneratedComRecognizers)
156foreach (var recognizer in sourceGeneratedComRecognizers)
169foreach (var recognizer in sourceGeneratedComRecognizers)
200static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateArgumentTypeLookup(int ordinal) => invocation => invocation.GetArgumentByOrdinal(ordinal).Value switch
206static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateTypeArgumentTypeLookup(int ordinal) => invocation =>
235static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateTypeOfArgumentTypeLookup(int ordinal) => invocation => invocation.GetArgumentByOrdinal(ordinal).Value switch
Microsoft.Interop.SourceGeneration (12)
ManualTypeMarshallingHelper.cs (6)
117Func<ITypeSymbol, MarshallingInfo> getMarshallingInfo,
127Func<ITypeSymbol, MarshallingInfo> getMarshallingInfo,
150Func<ITypeSymbol, MarshallingInfo> getMarshallingInfoForElement,
410Func<ITypeSymbol, MarshallingInfo> getMarshallingInfo)
453private static CustomTypeMarshallerData? GetStatelessMarshallerDataForType(ITypeSymbol marshallerType, MarshalMode mode, ITypeSymbol managedType, bool isLinearCollectionMarshaller, Compilation compilation, Func<ITypeSymbol, MarshallingInfo>? getMarshallingInfo)
553Func<ITypeSymbol, MarshallingInfo>? getMarshallingInfo)
Microsoft.JSInterop (3)
Microsoft.Maui (15)
Microsoft.Maui.Controls (64)
AnimationExtensions.cs (4)
85 public static int Insert(this IAnimationManager animationManager, Func<long, bool> step)
170 public static void Animate<T>(this IAnimatable self, string name, Func<double, T> transform, Action<T> callback,
208 public static Func<double, double> Interpolate(double start, double end = 1.0f, double reverseVal = 0.0f, bool reverse = false)
255 static void AnimateInternal<T>(IAnimatable self, IAnimationManager animationManager, string name, Func<double, T> transform, Action<T> callback,
EnumerableExtensions.cs (5)
8 public static bool HasChildGesturesFor<T>(this IEnumerable<GestureElement>? elements, Func<T, bool>? predicate = null) where T : GestureRecognizer
29 public static IEnumerable<T> GetChildGesturesFor<T>(this IEnumerable<GestureElement>? elements, Func<T, bool>? predicate = null) where T : GestureRecognizer
49 public static IEnumerable<T> GetGesturesFor<T>(this IEnumerable<IGestureRecognizer>? gestures, Func<T, bool>? predicate = null) where T : GestureRecognizer
65 internal static bool HasAnyGesturesFor<T>(this IEnumerable<IGestureRecognizer>? gestures, Func<T, bool>? predicate = null) where T : GestureRecognizer
68 internal static T? FirstGestureOrDefault<T>(this IEnumerable<IGestureRecognizer>? gestures, Func<T, bool>? predicate = null) where T : GestureRecognizer
PointerGestureRecognizer.cs (5)
189 internal void SendPointerEntered(View sender, Func<IElement?, Point?>? getPosition, PlatformPointerEventArgs? platformArgs = null)
202 internal void SendPointerExited(View sender, Func<IElement?, Point?>? getPosition, PlatformPointerEventArgs? platformArgs = null)
215 internal void SendPointerMoved(View sender, Func<IElement?, Point?>? getPosition, PlatformPointerEventArgs? platformArgs = null)
228 internal void SendPointerPressed(View sender, Func<IElement?, Point?>? getPosition, PlatformPointerEventArgs? platformArgs = null)
241 internal void SendPointerReleased(View sender, Func<IElement?, Point?>? getPosition, PlatformPointerEventArgs? platformArgs = null)
TypedBinding.cs (10)
96 Func<TSource, TProperty> getter,
106 handlers: new Tuple<Func<TSource, object>, string>[]
122 readonly Func<TSource, (TProperty value, bool success)> _getter;
126 public TypedBinding(Func<TSource, (TProperty value, bool success)> getter, Action<TSource, TProperty> setter, Tuple<Func<TSource, object>, string>[] handlers)
213 Tuple<Func<TSource, object>, string>[] handlers = _handlers == null ? null : new Tuple<Func<TSource, object>, string>[_handlers.Length];
220 handlers[i] = new Tuple<Func<TSource, object>, string>(_handlers[i].PartGetter, _handlers[i].PropertyName);
459 public Func<TSource, object> PartGetter { get; }
490 public PropertyChangedProxy(Func<TSource, object> partGetter, string propertyName, BindingBase binding)
Microsoft.Maui.Controls.Build.Tasks (19)
ModuleDefinitionExtensions.cs (5)
25 static MethodReference ImportCtorReference(this ModuleDefinition module, XamlCache cache, TypeReference type, TypeReference[] classArguments, Func<MethodDefinition, bool> predicate)
102 static MethodReference ImportPropertyGetterReference(this ModuleDefinition module, XamlCache cache, TypeReference type, string propertyName, Func<PropertyDefinition, bool> predicate = null, bool flatten = false, bool caseSensitive = true)
123 static MethodReference ImportPropertySetterReference(this ModuleDefinition module, XamlCache cache, TypeReference type, string propertyName, Func<PropertyDefinition, bool> predicate = null)
143 static MethodReference ImportMethodReference(this ModuleDefinition module, XamlCache cache, TypeReference type, string methodName, Func<MethodDefinition, bool> predicate = null, TypeReference[] classArguments = null)
235 static FieldReference ImportFieldReference(this ModuleDefinition module, XamlCache cache, TypeReference type, string fieldName, Func<FieldDefinition, bool> predicate = null, bool caseSensitive = true)
NodeILExtensions.cs (4)
101 Func<TypeReference[], IEnumerable<Instruction>> pushServiceProvider, bool boxValueTypes, bool unboxValueTypes)
122 Func<TypeReference[], IEnumerable<Instruction>> pushServiceProvider, bool boxValueTypes, bool unboxValueTypes)
136 static T TryFormat<T>(Func<string, T> func, IXmlLineInfo lineInfo, string str)
149 TypeReference targetTypeRef, TypeReference typeConverter, Func<TypeReference[], IEnumerable<Instruction>> pushServiceProvider,
TypeReferenceExtensions.cs (4)
62 public static PropertyDefinition GetProperty(this TypeReference typeRef, XamlCache cache, Func<PropertyDefinition, bool> predicate,
87 public static EventDefinition GetEvent(this TypeReference typeRef, XamlCache cache, Func<EventDefinition, bool> predicate,
124 public static FieldDefinition GetField(this TypeReference typeRef, XamlCache cache, Func<FieldDefinition, bool> predicate,
269 Func<MethodDefinition, bool> predicate, ModuleDefinition module)
XamlCache.cs (6)
23 static TValue GetOrAdd<TKey, TValue>(Dictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TValue> valueFactory)
32 public IList<XmlnsDefinitionAttribute> GetXmlsDefinitions(ModuleDefinition module, Func<ModuleDefinition, IList<XmlnsDefinitionAttribute>> valueFactory) =>
38 public FieldReference GetOrAddFieldReference((ModuleDefinition module, string fieldRefKey) key, Func<(ModuleDefinition module, string fieldRefKey), FieldReference> valueFactory) =>
44 public TypeReference GetOrAddTypeReference(ModuleDefinition module, string typeKey, Func<(ModuleDefinition module, string typeKey), TypeReference> valueFactory) =>
47 public MethodReference GetOrAddMethodReference(ModuleDefinition module, string methodRefKey, Func<(ModuleDefinition module, string methodRefKey), MethodReference> valueFactory) =>
50 public TypeDefinition GetOrAddTypeDefinition(ModuleDefinition module, (string assemblyName, string clrNamespace, string typeName) type, Func<(ModuleDefinition module, (string assemblyName, string clrNamespace, string typeName)), TypeDefinition> valueFactory) =>
Microsoft.Maui.Controls.Compatibility (1)
Microsoft.Maui.Controls.SourceGen (1)
Microsoft.Maui.Controls.Xaml (3)
Microsoft.ML.AutoML (4)
Microsoft.ML.Core (32)
Utilities\FuncInstanceMethodInfo1`3.cs (5)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T, TResult}"/>,
32public FuncInstanceMethodInfo1(Func<T, TResult> function)
57public static FuncInstanceMethodInfo1<TTarget, T, TResult> Create(Expression<Func<TTarget, Func<T, TResult>>> expression)
75Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T, TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`3.cs (5)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T, TResult}"/>,
32public FuncInstanceMethodInfo3(Func<T, TResult> function)
57public static FuncInstanceMethodInfo3<TTarget, T, TResult> Create(Expression<Func<TTarget, Func<T, TResult>>> expression)
75Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T, TResult>), nameof(expression), "Unexpected expression form");
Utilities\Utils.cs (6)
390public static int FindIndexSorted<T>(this T[] input, int min, int lim, Func<T, bool> func)
742public static T[] BuildArray<T>(int length, Func<int, T> func)
767public static void BuildSubsetMaps(DataViewSchema schema, Func<DataViewSchema.Column, bool> pred, out int[] map, out int[] invMap)
802public static void BuildSubsetMaps(int lim, Func<int, bool> pred, out int[] map, out int[] invMap)
1267public static int Count<TSource>(this ReadOnlySpan<TSource> source, Func<TSource, bool> predicate)
1280public static bool All<TSource>(this ReadOnlySpan<TSource> source, Func<TSource, bool> predicate)
Microsoft.ML.Data (268)
DataLoadSave\LegacyCompositeDataLoader.cs (3)
322ILegacyDataLoader srcLoader, Func<string, bool> isTransformTagAccepted)
347public static IDataView LoadSelectedTransforms(ModelLoadContext ctx, IDataView srcView, IHostEnvironment env, Func<string, bool> isTransformTagAccepted)
450private static ILegacyDataLoader LoadTransforms(ModelLoadContext ctx, ILegacyDataLoader srcLoader, IHost host, Func<string, bool> isTransformTagAccepted)
DataLoadSave\Text\TextLoaderParser.cs (21)
28private static readonly FuncInstanceMethodInfo1<ValueCreatorCache, PrimitiveDataViewType, Func<RowSet, ColumnPipe>> _getCreatorOneCoreMethodInfo
29= FuncInstanceMethodInfo1<ValueCreatorCache, PrimitiveDataViewType, Func<RowSet, ColumnPipe>>.Create(target => target.GetCreatorOneCore<int>);
31private static readonly FuncInstanceMethodInfo1<ValueCreatorCache, PrimitiveDataViewType, Func<RowSet, ColumnPipe>> _getCreatorVecCoreMethodInfo
32= FuncInstanceMethodInfo1<ValueCreatorCache, PrimitiveDataViewType, Func<RowSet, ColumnPipe>>.Create(target => target.GetCreatorVecCore<int>);
59private readonly Func<RowSet, ColumnPipe>[] _creatorsOne;
60private readonly Func<RowSet, ColumnPipe>[] _creatorsVec;
69_creatorsOne = new Func<RowSet, ColumnPipe>[InternalDataKindExtensions.KindCount];
70_creatorsVec = new Func<RowSet, ColumnPipe>[InternalDataKindExtensions.KindCount];
79private Func<RowSet, ColumnPipe> GetCreatorOneCore(PrimitiveDataViewType type)
84private Func<RowSet, ColumnPipe> GetCreatorOneCore<T>(PrimitiveDataViewType type)
92private Func<RowSet, ColumnPipe> GetCreatorVecCore(PrimitiveDataViewType type)
97private Func<RowSet, ColumnPipe> GetCreatorVecCore<T>(PrimitiveDataViewType type)
105public Func<RowSet, ColumnPipe> GetCreatorOne(KeyDataViewType key)
111public Func<RowSet, ColumnPipe> GetCreatorVec(KeyDataViewType key)
117public Func<RowSet, ColumnPipe> GetCreatorOne(InternalDataKind kind)
124public Func<RowSet, ColumnPipe> GetCreatorVec(InternalDataKind kind)
666private readonly Func<RowSet, ColumnPipe>[] _creator;
678_creator = new Func<RowSet, ColumnPipe>[_infos.Length];
693var mapOne = new Dictionary<InternalDataKind, Func<RowSet, ColumnPipe>>();
694var mapVec = new Dictionary<InternalDataKind, Func<RowSet, ColumnPipe>>();
717var fn = vectorType != null ?
DataView\ArrayDataViewBuilder.cs (5)
237var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema);
245var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema);
265public Cursor(IChannelProvider provider, DataView view, Func<int, bool> predicate, Random rand)
453public VectorColumn(PrimitiveDataViewType itemType, TIn[] values, Func<TIn, int> lengthFunc)
462private static DataViewType InferType(PrimitiveDataViewType itemType, TIn[] values, Func<TIn, int> lengthFunc)
DataView\CacheDataView.cs (12)
213var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema);
243private DataViewRowCursor GetRowCursorWaiterCore<TWaiter>(TWaiter waiter, Func<int, bool> predicate, Random rand)
259var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema);
272private DataViewRowCursor[] GetRowCursorSetWaiterCore<TWaiter>(TWaiter waiter, Func<int, bool> predicate, int n, Random rand)
293private DataViewRowCursor CreateCursor<TIndex>(Func<int, bool> predicate, TIndex index)
300public RowSeeker GetSeeker(Func<int, bool> predicate)
313private RowSeeker GetSeeker<TWaiter>(Func<int, bool> predicate, TWaiter waiter)
460public RowCursor(CacheDataView parent, Func<int, bool> predicate, TIndex index)
550public RowSeekerCore(CacheDataView parent, Func<int, bool> predicate, TWaiter waiter)
657private WaiterWaiter(CacheDataView parent, Func<int, bool> pred)
695public static Wrapper Create(CacheDataView parent, Func<int, bool> pred)
1155protected RowCursorSeekerBase(CacheDataView parent, Func<int, bool> predicate)
DataView\DataViewConstructionUtils.cs (10)
215public InputRowBase(IHostEnvironment env, DataViewSchema schema, InternalSchemaDefinition schemaDef, Delegate[] peeks, Func<int, bool> predicate)
308private Delegate CreateConvertingArrayGetterDelegate<TSrc, TDst>(Delegate peekDel, Func<TSrc, TDst> convert)
324private Delegate CreateConvertingGetterDelegate<TSrc, TDst>(Delegate peekDel, Func<TSrc, TDst> convert)
543Func<int, bool> predicate)
622var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema);
637Func<int, bool> predicate, Random rand)
705var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema);
714public Cursor(IHostEnvironment env, StreamingDataView<TRow> dataView, Func<int, bool> predicate)
775var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema);
783public Cursor(IHostEnvironment env, SingleRowLoopDataView<TRow> dataView, Func<int, bool> predicate)
DataView\LambdaFilter.cs (7)
104protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
114var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
117Func<int, bool> inputPred = GetActive(predicate, out active);
128var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
131Func<int, bool> inputPred = GetActive(predicate, out active);
143private Func<int, bool> GetActive(Func<int, bool> predicate, out bool[] active)
DataView\RowToRowMapperTransform.cs (15)
34Func<int, bool> GetDependencies(Func<int, bool> activeOutput);
43Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer);
74private readonly Func<DataViewSchema, IRowMapper> _mapperFactory;
95public RowToRowMapperTransform(IHostEnvironment env, IDataView input, IRowMapper mapper, Func<DataViewSchema, IRowMapper> mapperFactory)
147private bool[] GetActive(Func<int, bool> predicate, out IEnumerable<DataViewSchema.Column> inputColumns)
157var predicateOut = GetActiveOutputColumns(active);
160var predicateIn = _mapper.GetDependencies(predicateOut);
168private Func<int, bool> GetActiveOutputColumns(bool[] active)
181protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
191var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
201var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
242var predicate = RowCursorUtils.FromColumnsToPredicate(dependingColumns, OutputSchema);
263var pred = GetActiveOutputColumns(activeArr);
371var pred = parent.GetActiveOutputColumns(active);
DataView\Transposer.cs (12)
833var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema);
836var srcPred = CreateInputPredicate(predicate, out activeSplitters);
846var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema);
849var srcPred = CreateInputPredicate(predicate, out activeSplitters);
866private Func<int, bool> CreateInputPredicate(Func<int, bool> pred, out bool[] activeSplitters)
962public abstract DataViewRow Bind(DataViewRow row, Func<int, bool> pred);
1022public override DataViewRow Bind(DataViewRow row, Func<int, bool> pred)
1116public override DataViewRow Bind(DataViewRow row, Func<int, bool> pred)
1140public RowImpl(ColumnSplitter<T> parent, DataViewRow input, Func<int, bool> pred)
1269public Cursor(IChannelProvider provider, DataViewSlicer slicer, DataViewRowCursor input, Func<int, bool> pred, bool[] activeSplitters)
1281Func<int, bool> defaultPred = null;
DataView\TypedCursor.cs (7)
178public RowCursor<TRow> GetCursor(Func<int, bool> additionalColumnsPredicate, int? randomSeed = null)
184var deps = GetDependencies(additionalColumnsPredicate);
191public Func<int, bool> GetDependencies(Func<int, bool> additionalColumnsPredicate)
203public RowCursor<TRow>[] GetCursorSet(Func<int, bool> additionalColumnsPredicate, int n, Random rand)
424private Action<TRow> CreateConvertingVBufferSetter<TSrc, TDst>(DataViewRow input, int col, Delegate poke, Delegate peek, Func<TSrc, TDst> convert)
484private static Action<TRow> CreateConvertingActionSetter<TSrc, TDst>(DataViewRow input, int col, Delegate poke, Func<TSrc, TDst> convert)
Evaluators\EvaluatorBase.cs (17)
34Func<int, bool> activeCols = GetActiveCols(data.Schema);
76private Func<int, bool> GetActiveCols(RoleMappedSchema schema)
78Func<int, bool> pred = GetActiveColsCore(schema);
91private protected virtual Func<int, bool> GetActiveColsCore(RoleMappedSchema schema)
116Func<string, TAgg> createAgg = stratName => GetAggregatorCore(schema, stratName);
131Func<int, bool> activeColsIndices, TAgg aggregator, AggregatorDictionaryBase[] dictionaries)
341private protected readonly Func<string, TAgg> CreateAgg;
348private protected AggregatorDictionaryBase(RoleMappedSchema schema, string stratCol, Func<string, TAgg> createAgg)
365Func<string, TAgg> createAgg)
379DataViewType stratType, Func<string, TAgg> createAgg)
406public GenericAggregatorDictionary(RoleMappedSchema schema, string stratCol, DataViewType stratType, Func<string, TAgg> createAgg)
525Func<int, bool> IRowMapper.GetDependencies(Func<int, bool> activeOutput)
529private protected abstract Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput);
537Delegate[] IRowMapper.CreateGetters(DataViewRow input, Func<int, bool> activeCols, out Action disposer)
541private protected abstract Delegate[] CreateGettersCore(DataViewRow input, Func<int, bool> activeCols, out Action disposer);
Evaluators\EvaluatorUtils.cs (7)
30private static volatile Dictionary<string, Func<IHostEnvironment, IMamlEvaluator>> _knownEvaluatorFactories;
32public static Dictionary<string, Func<IHostEnvironment, IMamlEvaluator>> Instance
36Dictionary<string, Func<IHostEnvironment, IMamlEvaluator>> result = _knownEvaluatorFactories;
39var tmp = new Dictionary<string, Func<IHostEnvironment, IMamlEvaluator>>
164int colScore, string valueKind, Func<DataViewType, bool> testType)
923Func<IDataView, IDataView> selectDropNonVarLenthCol =
991private static List<string> GetMetricNames(IChannel ch, DataViewSchema schema, DataViewRow row, Func<int, bool> ignoreCol,
Scorers\PredictedLabelScorerBase.cs (7)
121Func<DataViewType, bool> outputTypeMatches, Func<DataViewType, ISchemaBoundRowMapper, DataViewType> getPredColType)
253public override Func<int, bool> GetActiveMapperColumns(bool[] active)
260var pred = base.GetActiveMapperColumns(active);
278Func<DataViewType, bool> outputTypeMatches, Func<DataViewType, ISchemaBoundRowMapper, DataViewType> getPredColType, string predictedLabelColumnName = DefaultColumnNames.PredictedLabel)
312Func<DataViewType, bool> outputTypeMatches, Func<DataViewType, ISchemaBoundRowMapper, DataViewType> getPredColType)
390protected override bool WantParallelCursors(Func<int, bool> predicate)
398protected override Delegate[] GetGetters(DataViewRow output, Func<int, bool> predicate)
Scorers\RowToRowScorerBase.cs (9)
97var predicateMapper = bindings.GetActiveMapperColumns(active);
98Func<int, bool> localMapper = predicateMapper;
115protected sealed override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
127protected abstract bool WantParallelCursors(Func<int, bool> predicate);
146var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
172Func<int, bool> activeInfos = iinfo => activeIndices.Contains(bindings.MapIinfoToCol(iinfo));
188protected abstract Delegate[] GetGetters(DataViewRow output, Func<int, bool> predicate);
190protected static Delegate[] GetGettersFromRow(DataViewRow row, Func<int, bool> predicate)
475public virtual Func<int, bool> GetActiveMapperColumns(bool[] active)
Transforms\NAFilter.cs (7)
200protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
210var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
212Func<int, bool> inputPred = GetActive(predicate, out bool[] active);
222var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
224Func<int, bool> inputPred = GetActive(predicate, out bool[] active);
237private Func<int, bool> GetActive(Func<int, bool> predicate, out bool[] active)
Transforms\RangeFilter.cs (12)
201protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
212var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
213Func<int, bool> inputPred = GetActive(predicate, out bool[] active);
225var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
226Func<int, bool> inputPred = GetActive(predicate, out bool[] active);
249private Func<int, bool> GetActive(Func<int, bool> predicate, out bool[] active)
270protected readonly Func<Double, bool> CheckBounds;
283CheckBounds = Parent._complement ? (Func<Double, bool>)TestNotCC : TestCC;
285CheckBounds = Parent._complement ? (Func<Double, bool>)TestNotCO : TestCO;
290CheckBounds = Parent._complement ? (Func<Double, bool>)TestNotOC : TestOC;
292CheckBounds = Parent._complement ? (Func<Double, bool>)TestNotOO : TestOO;
Transforms\RowToRowTransformerBase.cs (6)
78public virtual Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
107protected abstract Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer);
109Func<int, bool> IRowMapper.GetDependencies(Func<int, bool> activeOutput)
113private protected abstract Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput);
Transforms\TransformBase.cs (13)
69var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
94protected abstract bool? ShouldUseParallelCursors(Func<int, bool> predicate);
328ITransposeDataView transposedInput, Func<DataViewType, string> testType)
365ITransposeDataView transposeInput, Func<DataViewType, string> testType)
499IDataView input, Func<DataViewType, string> testType)
513IDataView input, Func<DataViewType, string> testType)
527IDataView input, Func<DataViewType, string> testType)
544IDataView newInput, Func<DataViewType, string> checkType)
716protected sealed override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
728protected virtual bool WantParallelCursors(Func<int, bool> predicate)
738Func<int, bool> needCol = c => columnsNeeded == null ? false : columnsNeeded.Any(x => x.Index == c);
750var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
821Func<int, bool> activeInfos =
Utilities\ColumnCursor.cs (6)
65Delegate convert = (Func<ReadOnlyMemory<char>, string>)((ReadOnlyMemory<char> txt) => txt.ToString());
66Func<IDataView, int, Func<int, T>, IEnumerable<T>> del = GetColumnConvert;
86Delegate convert = (Func<ReadOnlyMemory<char>, string>)((ReadOnlyMemory<char> txt) => txt.ToString());
87Func<IDataView, int, Func<int, long>, IEnumerable<long[]>> del = GetColumnArrayConvert;
116private static IEnumerable<TOut> GetColumnConvert<TOut, TData>(IDataView data, int col, Func<TData, TOut> convert)
156private static IEnumerable<TOut[]> GetColumnArrayConvert<TOut, TData>(IDataView data, int col, Func<TData, TOut> convert)
Microsoft.ML.DataView (1)
Microsoft.ML.Ensemble (1)
Microsoft.ML.GenAI.Samples (1)
Microsoft.ML.ImageAnalytics (7)
ImageLoader.cs (3)
206protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
216private Delegate MakeGetterImageDataViewType(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
263private Delegate MakeGetterVectorDataViewByteType(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.ML.Mkl.Components (1)
Microsoft.ML.OnnxConverter (1)
Microsoft.ML.OnnxTransformer (23)
Microsoft.ML.Parquet (1)
Microsoft.ML.PCA (1)
Microsoft.ML.StandardTrainers (10)
Microsoft.ML.TensorFlow (5)
TensorflowTransform.cs (5)
641private Delegate CreateGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, OutputCache outputCache)
653public override Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
698protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
779private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
Microsoft.ML.TestFramework (2)
Microsoft.ML.Tests (6)
Microsoft.ML.TimeSeries (35)
SequentialTransformerBase.cs (16)
573protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
612var active = RowCursorUtils.FromColumnsToPredicate(activeColumns, OutputSchema);
810private bool[] GetActive(Func<int, bool> predicate, out Func<int, bool> predicateInput)
820var predicateOut = GetActiveOutputColumns(active);
837private IEnumerable<DataViewSchema.Column> GetActive(Func<int, bool> predicate)
839Func<int, bool> predicateInput;
845private Func<int, bool> GetActiveOutputColumns(bool[] active)
858protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
868Func<int, bool> predicateInput;
869var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
879Func<int, bool> predicateInput;
880var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema);
922var predicate = RowCursorUtils.FromColumnsToPredicate(dependingColumns, OutputSchema);
937var pred = GetActiveOutputColumns(activeArr);
1030var pred = parent.GetActiveOutputColumns(active);
Microsoft.ML.Tokenizers (1)
Microsoft.ML.Tokenizers.Data.Tests (3)
src\Common\tests\RetryHelper.cs (3)
15private static readonly Func<int, int> _defaultBackoffFunc = i => Math.Min(i * 100, 60_000);
24public static void Execute(Action test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null)
Microsoft.ML.Tokenizers.Tests (3)
src\Common\tests\RetryHelper.cs (3)
15private static readonly Func<int, int> _defaultBackoffFunc = i => Math.Min(i * 100, 60_000);
24public static void Execute(Action test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null)
Microsoft.ML.TorchSharp (17)
Microsoft.ML.Transforms (81)
Microsoft.ML.Vision (3)
Microsoft.VisualBasic.Tests (1)
Microsoft.VisualStudio.LanguageServices (37)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (7)
128private static Func<Project, bool> GetShouldFixInProjectDelegate(IVsHierarchyItemManager vsHierarchyItemManager, IHierarchyItemToProjectIdMap projectMap, IVsHierarchy? projectHierarchy)
174Func<Project, bool> shouldFixInProject,
185private bool ApplySuppressionFix(IEnumerable<DiagnosticData>? diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, bool isAddSuppression, bool isSuppressionInSource, bool onlyCompilerDiagnostics, bool showPreviewChangesDialog)
193Func<Project, bool> shouldFixInProject,
389Func<CancellationToken, Task> action, string waitDialogTitle, string waitDialogMessage)
450private async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken)
542private async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken)
Workspace\VisualStudioDocumentNavigationService.cs (8)
159Func<Document, Task<TextSpan>> getTextSpanForMappingAsync,
160Func<SourceText, VsTextSpan> getVsTextSpan,
180private async Task<Func<CancellationToken, Task<bool>>?> GetNavigationCallbackAsync(
183Func<Document, Task<TextSpan>> getTextSpanForMappingAsync,
184Func<SourceText, VsTextSpan> getVsTextSpan,
242private Func<CancellationToken, Task<bool>>? GetNavigationCallback(
245Func<SourceText, VsTextSpan> getVsTextSpan)
294private async Task<Func<CancellationToken, Task<bool>>?> GetNavigableLocationForMappedFileAsync(
Microsoft.VisualStudio.LanguageServices.CSharp (5)
CodeModel\CSharpCodeModelService.cs (5)
3070protected override int GetAttributeIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate)
3100protected override int GetAttributeArgumentIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate)
3115protected override int GetImportIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate)
3130protected override int GetParameterIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate)
3145protected override int GetMemberIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
MSBuild (6)
MSBuildTaskHost (5)
mscorlib (1)
netstandard (1)
OpenIdConnectSample (1)
PresentationCore (14)
PresentationFramework (52)
MS\Internal\Data\ViewManager.cs (3)
493internal ViewRecord GetViewRecord(object collection, CollectionViewSource cvs, Type collectionViewType, bool createView, Func<object, object> GetSourceItem)
619private CollectionRecord EnsureCollectionRecord(object collection, Func<object, object> GetSourceItem = null)
680private ViewRecord GetExistingView(object collection, CollectionViewSource cvs, Type collectionViewType, Func<object, object> GetSourceItem)
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (32)
356public static readonly Func<T, object> CreateMarshaler;
357private static Func<T, object> BindCreateMarshaler()
360return Expression.Lambda<Func<T, object>>(
365public static readonly Func<object, object> GetAbi;
366private static Func<object, object> BindGetAbi()
369return Expression.Lambda<Func<object, object>>(
386public static readonly Func<object, T> FromAbi;
387private static Func<object, T> BindFromAbi()
390return Expression.Lambda<Func<object, T>>(
395public static readonly Func<T, object> FromManaged;
396private static Func<T, object> BindFromManaged()
399return Expression.Lambda<Func<T, object>>(
629public static unsafe MarshalerArray CreateMarshalerArray(T[] array, Func<T, IObjectReference> createMarshaler)
664public static unsafe T[] FromAbiArray(object box, Func<IntPtr, T> fromAbi)
680public static unsafe (int length, IntPtr data) FromManagedArray(T[] array, Func<T, IntPtr> fromManaged)
780private static Func<T, IObjectReference> _ToAbi;
781private static Func<IntPtr, T> _FromAbi;
782private static Func<IObjectReference, IObjectReference> _As;
870private static Func<IntPtr, T> BindFromAbi()
875return Expression.Lambda<Func<IntPtr, T>>(
880private static Func<T, IObjectReference> BindToAbi()
883return Expression.Lambda<Func<T, IObjectReference>>(
889private static Func<IObjectReference, IObjectReference> BindAs()
893return Expression.Lambda<Func<IObjectReference, IObjectReference>>(
1103public static readonly Func<T, object> CreateMarshaler;
1104public static readonly Func<object, object> GetAbi;
1106public static readonly Func<object, T> FromAbi;
1107public static readonly Func<T, object> FromManaged;
1111public static readonly Func<T[], object> CreateMarshalerArray;
1112public static readonly Func<object, (int, IntPtr)> GetAbiArray;
1113public static readonly Func<object, T[]> FromAbiArray;
1114public static readonly Func<T[], (int, IntPtr)> FromManagedArray;
Roslyn.Diagnostics.Analyzers (44)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
247public static TOperation? GetAncestor<TOperation>(this IOperation root, OperationKind ancestorKind, Func<TOperation, bool>? predicate = null)
282public static IOperation? GetAncestor(this IOperation root, ImmutableArray<OperationKind> ancestorKinds, Func<IOperation, bool>? predicate = null)
355public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate)
368public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate)
373public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(returnValue: true)] out IOperation? foundOperation)
725public static IOperation WalkDownConversion(this IOperation operation, Func<IConversionOperation, bool> predicate)
799public static bool HasAnyExplicitDescendant(this IOperation operation, Func<IOperation, bool>? descendIntoOperation = null)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (5)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty);
24private static readonly Func<IOperation, IOperation> TargetAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Target), fallbackResult: null!);
26private static readonly Func<IOperation, IMethodSymbol> GetFunctionPointerSignatureAccessor = CreateFunctionPointerSignatureAccessor(WrappedType);
28private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAccessor(Type? wrappedType)
44return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
Roslyn.Test.PdbUtilities (15)
EditAndContinue\EditAndContinueTest.cs (5)
34protected abstract Func<SyntaxNode, SyntaxNode> GetEquivalentNodesMap(ISymbol left, ISymbol right);
38internal TSelf AddBaseline(string source, Action<GenerationVerifier>? validator = null, Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation>? debugInformationProvider = null)
76internal TSelf AddGeneration(string source, Func<SourceWithMarkedNodes, SemanticEditDescription[]> edits, Action<GenerationVerifier> validator)
82private TSelf AddGeneration(string source, Func<SourceWithMarkedNodes, SemanticEditDescription[]> edits, Action<GenerationVerifier> validator, DiagnosticDescription[] expectedErrors)
189Func<SyntaxNode, SyntaxNode?>? syntaxMap;
Roslyn.VisualStudio.DiagnosticsWindow (3)
Roslyn.VisualStudio.Next.UnitTests (4)
RunTests (1)
SemanticSearch.BuildTask (1)
Shared (4)
Shared.Tests (4)
Sockets.BindTests (4)
Sockets.FunctionalTests (3)
System.Collections.Concurrent (2)
System.Collections.Immutable (44)
System\Collections\Immutable\ImmutableDictionary.cs (8)
142public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull
175public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer) where TKey : notnull
188public static ImmutableDictionary<TKey, TSource> ToImmutableDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) where TKey : notnull
202public static ImmutableDictionary<TKey, TSource> ToImmutableDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer) where TKey : notnull
217public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector) where TKey : notnull
System\Collections\Immutable\ImmutableSortedDictionary.cs (6)
138public static ImmutableSortedDictionary<TKey, TValue> ToImmutableSortedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull
171public static ImmutableSortedDictionary<TKey, TValue> ToImmutableSortedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IComparer<TKey>? keyComparer) where TKey : notnull
186public static ImmutableSortedDictionary<TKey, TValue> ToImmutableSortedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector) where TKey : notnull
System\Linq\ImmutableArrayExtensions.cs (19)
24public static IEnumerable<TResult> Select<T, TResult>(this ImmutableArray<T> immutableArray, Func<T, TResult> selector)
53Func<TSource, IEnumerable<TCollection>> collectionSelector,
82public static IEnumerable<T> Where<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
109public static bool Any<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
135public static bool All<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
296public static TResult Aggregate<TAccumulate, TResult, T>(this ImmutableArray<T> immutableArray, TAccumulate seed, Func<TAccumulate, T, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)
330public static T First<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
375public static T? FirstOrDefault<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
408public static T Last<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
439public static T? LastOrDefault<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
471public static T Single<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
514public static T? SingleOrDefault<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
545public static Dictionary<TKey, T> ToDictionary<TKey, T>(this ImmutableArray<T> immutableArray, Func<T, TKey> keySelector) where TKey : notnull
560public static Dictionary<TKey, TElement> ToDictionary<TKey, TElement, T>(this ImmutableArray<T> immutableArray, Func<T, TKey> keySelector, Func<T, TElement> elementSelector) where TKey : notnull
574public static Dictionary<TKey, T> ToDictionary<TKey, T>(this ImmutableArray<T> immutableArray, Func<T, TKey> keySelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
598public static Dictionary<TKey, TElement> ToDictionary<TKey, TElement, T>(this ImmutableArray<T> immutableArray, Func<T, TKey> keySelector, Func<T, TElement> elementSelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
700Func<TSource, IEnumerable<TCollection>> collectionSelector,
System.ComponentModel.Annotations (6)
System.ComponentModel.Composition (47)
System\ComponentModel\Composition\ConstraintServices.cs (7)
23public static Expression<Func<ExportDefinition, bool>> CreateConstraint(string contractName, string? requiredTypeIdentity, IEnumerable<KeyValuePair<string, Type>> requiredMetadata, CreationPolicy requiredCreationPolicy)
52Expression<Func<ExportDefinition, bool>> constraint = Expression.Lambda<Func<ExportDefinition, bool>>(constraintBody, parameter);
186public static Expression<Func<ExportDefinition, bool>> CreatePartCreatorConstraint(Expression<Func<ExportDefinition, bool>> baseConstraint, ImportDefinition productImportDefinition)
213Expression<Func<ExportDefinition, bool>> constraint =
214Expression.Lambda<Func<ExportDefinition, bool>>(
System\ComponentModel\Composition\ExportServices.cs (6)
47internal static Func<Export, object> CreateStronglyTypedLazyFactory(Type? exportType, Type? metadataViewType)
61return (Func<Export, object>)Delegate.CreateDelegate(typeof(Func<Export, object>), genericMethod);
64internal static Func<Export, Lazy<object, object>> CreateSemiStronglyTypedLazyFactory(Type? exportType, Type? metadataViewType)
70return (Func<Export, Lazy<object, object>>)Delegate.CreateDelegate(typeof(Func<Export, Lazy<object, object>>), genericMethod);
System\ComponentModel\Composition\Primitives\ImportDefinition.cs (7)
19private readonly Expression<Func<ExportDefinition, bool>>? _constraint;
24private Func<ExportDefinition, bool>? _compiledConstraint;
49/// A <see cref="Expression{TDelegate}"/> containing a <see cref="Func{T, TResult}"/>
81public ImportDefinition(Expression<Func<ExportDefinition, bool>> constraint, string? contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite)
89public ImportDefinition(Expression<Func<ExportDefinition, bool>> constraint, string? contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, IDictionary<string, object?>? metadata)
188/// A <see cref="Expression{TDelegate}"/> containing a <see cref="Func{T, TResult}"/>
200public virtual Expression<Func<ExportDefinition, bool>> Constraint
System\ComponentModel\Composition\ReflectionModel\ImportType.cs (6)
21private Func<Export, object>? _castSingleValue;
25internal static Dictionary<Type, Func<Export, object>?>? _castSingleValueCache;
27private static Dictionary<Type, Func<Export, object>?> CastSingleValueCache
31return _castSingleValueCache ??= new Dictionary<Type, Func<Export, object>?>();
69public Func<Export, object>? CastExport
163private static bool TryGetCastFunction(Type genericType, bool isOpenGeneric, Type[] arguments, out Func<Export, object>? castFunction)
System.ComponentModel.Composition.Registration (29)
System\ComponentModel\Composition\Registration\PartBuilder.cs (7)
21private List<Tuple<string, Func<Type, object>>> _metadataItemFuncs;
24private Func<ConstructorInfo[], ConstructorInfo> _constructorFilter;
74public PartBuilder SelectConstructor(Func<ConstructorInfo[], ConstructorInfo> constructorFilter)
79public PartBuilder SelectConstructor(Func<ConstructorInfo[], ConstructorInfo> constructorFilter,
194public PartBuilder AddMetadata(string name, Func<Type, object> itemFunc)
196_metadataItemFuncs ??= new List<Tuple<string, Func<Type, object>>>();
286foreach (Tuple<string, Func<Type, object>> item in _metadataItemFuncs)
System\ComponentModel\Composition\Registration\PartBuilderOfT.cs (18)
18public PropertyExpressionAdapter(Expression<Func<T, object>> propertyFilter,
42private static PropertyInfo SelectProperties(Expression<Func<T, object>> propertyFilter)
60private static Expression<Func<T, object>> Reduce(Expression<Func<T, object>> expr)
64expr = (Expression<Func<T, object>>)expr.Reduce();
75public ConstructorExpressionAdapter(Expression<Func<ParameterImportBuilder, T>> selectConstructor)
94private void ParseSelectConstructor(Expression<Func<ParameterImportBuilder, T>> constructorFilter)
133private static Expression<Func<ParameterImportBuilder, T>> Reduce(Expression<Func<ParameterImportBuilder, T>> expr)
148public PartBuilder<T> SelectConstructor(Expression<Func<ParameterImportBuilder, T>> constructorFilter)
159public PartBuilder<T> ExportProperty(Expression<Func<T, object>> propertyFilter)
165Expression<Func<T, object>> propertyFilter,
176public PartBuilder<T> ExportProperty<TContract>(Expression<Func<T, object>> propertyFilter)
181public PartBuilder<T> ExportProperty<TContract>(Expression<Func<T, object>> propertyFilter,
192public PartBuilder<T> ImportProperty(Expression<Func<T, object>> propertyFilter)
197public PartBuilder<T> ImportProperty(Expression<Func<T, object>> propertyFilter,
208public PartBuilder<T> ImportProperty<TContract>(Expression<Func<T, object>> propertyFilter)
213public PartBuilder<T> ImportProperty<TContract>(Expression<Func<T, object>> propertyFilter,
System.ComponentModel.TypeConverter (2)
System.Composition.Convention (40)
System\Composition\Convention\ExportConventionBuilder.cs (6)
21private List<Tuple<string, Func<Type, object>>> _metadataItemFuncs;
22private Func<Type, string> _getContractNameFromPartType;
71public ExportConventionBuilder AsContractName(Func<Type, string> getContractNameFromPartType)
105public ExportConventionBuilder AddMetadata(string name, Func<Type, object> getValueFromPartType)
115_metadataItemFuncs ??= new List<Tuple<string, Func<Type, object>>>();
139foreach (Tuple<string, Func<Type, object>> item in _metadataItemFuncs)
System\Composition\Convention\ImportConventionBuilder.cs (6)
20private Func<Type, string> _getContractNameFromPartType;
22private List<Tuple<string, Func<Type, object>>> _metadataConstraintItemFuncs;
48public ImportConventionBuilder AsContractName(Func<Type, string> getContractNameFromPartType)
113public ImportConventionBuilder AddMetadataConstraint(string name, Func<Type, object> getConstraintValueFromPartType)
123_metadataConstraintItemFuncs ??= new List<Tuple<string, Func<Type, object>>>();
163foreach (Tuple<string, Func<Type, object>> item in _metadataConstraintItemFuncs)
System\Composition\Convention\PartConventionBuilder.cs (7)
26private List<Tuple<string, Func<Type, object>>> _metadataItemFuncs;
29private Func<IEnumerable<ConstructorInfo>, ConstructorInfo> _constructorFilter;
107public PartConventionBuilder SelectConstructor(Func<IEnumerable<ConstructorInfo>, ConstructorInfo> constructorSelector)
121public PartConventionBuilder SelectConstructor(Func<IEnumerable<ConstructorInfo>, ConstructorInfo> constructorSelector,
384public PartConventionBuilder AddPartMetadata(string name, Func<Type, object> getValueFromPartType)
394_metadataItemFuncs ??= new List<Tuple<string, Func<Type, object>>>();
484foreach (Tuple<string, Func<Type, object>> item in _metadataItemFuncs)
System\Composition\Convention\PartConventionBuilderOfT.cs (21)
48private static Expression<Func<T, object>> Reduce(Expression<Func<T, object>> expr)
52expr = (Expression<Func<T, object>>)expr.Reduce();
74Expression<Func<T, object>> propertySelector,
98private static PropertyInfo SelectProperties(Expression<Func<T, object>> propertySelector)
116private static Expression<Func<T, object>> Reduce(Expression<Func<T, object>> expr)
120expr = (Expression<Func<T, object>>)expr.Reduce();
131public ConstructorExpressionAdapter(Expression<Func<ParameterImportConventionBuilder, T>> selectConstructor)
154private void ParseSelectConstructor(Expression<Func<ParameterImportConventionBuilder, T>> constructorSelector)
190private static Expression<Func<ParameterImportConventionBuilder, T>> Reduce(Expression<Func<ParameterImportConventionBuilder, T>> expr)
209public PartConventionBuilder<T> SelectConstructor(Expression<Func<ParameterImportConventionBuilder, T>> constructorSelector)
223public PartConventionBuilder<T> ExportProperty(Expression<Func<T, object>> propertySelector)
235Expression<Func<T, object>> propertySelector,
252public PartConventionBuilder<T> ExportProperty<TContract>(Expression<Func<T, object>> propertySelector)
265Expression<Func<T, object>> propertySelector,
280public PartConventionBuilder<T> ImportProperty(Expression<Func<T, object>> propertySelector)
292Expression<Func<T, object>> propertySelector,
308public PartConventionBuilder<T> ImportProperty<TContract>(Expression<Func<T, object>> propertySelector)
321Expression<Func<T, object>> propertySelector,
System.Composition.Hosting (6)
System.Configuration.ConfigurationManager (6)
System.Core (1)
System.Data.Common (42)
System\Data\EnumerableRowCollection.cs (13)
38private readonly List<Func<TRow, bool>> _listOfPredicates;
43private readonly Func<TRow, TRow>? _selector;
83_listOfPredicates = new List<Func<TRow, bool>>();
94_listOfPredicates = new List<Func<TRow, bool>>();
102internal EnumerableRowCollection(EnumerableRowCollection<TRow>? source, IEnumerable<TRow> enumerableRows, Func<TRow, TRow>? selector)
114_listOfPredicates = new List<Func<TRow, bool>>(source._listOfPredicates);
120_listOfPredicates = new List<Func<TRow, bool>>();
156Func<DataRow, bool>? finalPredicate = null; // Conjunction of all .Where(..) predicates
170foreach (Func<TRow, bool> pred in _listOfPredicates)
197foreach (Func<TRow, bool> pred in _listOfPredicates)
278internal void AddPredicate(Func<TRow, bool> pred)
287internal void AddSortExpression<TKey>(Func<TRow, TKey> keySelector, bool isDescending, bool isOrderBy)
295internal void AddSortExpression<TKey>(Func<TRow, TKey> keySelector, IComparer<TKey> comparer, bool isDescending, bool isOrderBy)
System\Data\EnumerableRowCollectionExtensions.cs (11)
19public static EnumerableRowCollection<TRow> Where<TRow>(this EnumerableRowCollection<TRow> source, Func<TRow, bool> predicate)
30public static OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this EnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector)
42public static OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this EnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector, IComparer<TKey> comparer)
53public static OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this EnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector)
65public static OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this EnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector, IComparer<TKey> comparer)
77public static OrderedEnumerableRowCollection<TRow> ThenBy<TRow, TKey>(this OrderedEnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector)
89public static OrderedEnumerableRowCollection<TRow> ThenBy<TRow, TKey>(this OrderedEnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector, IComparer<TKey> comparer)
101public static OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow, TKey>(this OrderedEnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector)
113public static OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow, TKey>(this OrderedEnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector, IComparer<TKey> comparer)
127public static EnumerableRowCollection<S> Select<TRow, S>(this EnumerableRowCollection<TRow> source, Func<TRow, S> selector)
134return new EnumerableRowCollection<S>(((object)source) as EnumerableRowCollection<S>, typedEnumerable, ((object)selector) as Func<S, S>);
System\Data\TypedTableBaseExtensions.cs (6)
18public static EnumerableRowCollection<TRow> Where<TRow>(this TypedTableBase<TRow> source, Func<TRow, bool> predicate) where TRow : DataRow
28public static OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this TypedTableBase<TRow> source, Func<TRow, TKey> keySelector) where TRow : DataRow
40Func<TRow, TKey> keySelector,
51public static OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this TypedTableBase<TRow> source, Func<TRow, TKey> keySelector) where TRow : DataRow
63Func<TRow, TKey> keySelector,
77public static EnumerableRowCollection<S> Select<TRow, S>(this TypedTableBase<TRow> source, Func<TRow, S> selector) where TRow : DataRow
System.Data.Odbc (1)
System.Diagnostics.DiagnosticSource (7)
System.Formats.Asn1 (1)
System.Linq (315)
System\Linq\AggregateBy.cs (11)
24/// This method is comparable to the <see cref="GroupBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey})"/> methods
29Func<TSource, TKey> keySelector,
68/// This method is comparable to the <see cref="GroupBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey})"/> methods
73Func<TSource, TKey> keySelector,
74Func<TKey, TAccumulate> seedSelector,
103private static IEnumerable<KeyValuePair<TKey, TAccumulate>> AggregateByIterator<TSource, TKey, TAccumulate>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, IEqualityComparer<TKey>? keyComparer) where TKey : notnull
117static Dictionary<TKey, TAccumulate> PopulateDictionary(IEnumerator<TSource> enumerator, Func<TSource, TKey> keySelector, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, IEqualityComparer<TKey>? keyComparer)
135private static IEnumerable<KeyValuePair<TKey, TAccumulate>> AggregateByIterator<TSource, TKey, TAccumulate>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, TAccumulate> seedSelector, Func<TAccumulate, TSource, TAccumulate> func, IEqualityComparer<TKey>? keyComparer) where TKey : notnull
149static Dictionary<TKey, TAccumulate> PopulateDictionary(IEnumerator<TSource> enumerator, Func<TSource, TKey> keySelector, Func<TKey, TAccumulate> seedSelector, Func<TAccumulate, TSource, TAccumulate> func, IEqualityComparer<TKey>? keyComparer)
System\Linq\Average.cs (12)
169public static double Average<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector) => Average<TSource, int, long, double>(source, selector);
171public static double Average<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector) => Average<TSource, long, long, double>(source, selector);
173public static float Average<TSource>(this IEnumerable<TSource> source, Func<TSource, float> selector) => (float)Average<TSource, float, double, double>(source, selector);
175public static double Average<TSource>(this IEnumerable<TSource> source, Func<TSource, double> selector) => Average<TSource, double, double, double>(source, selector);
177public static decimal Average<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal> selector) => Average<TSource, decimal, decimal, decimal>(source, selector);
179private static TResult Average<TSource, TSelector, TAccumulator, TResult>(this IEnumerable<TSource> source, Func<TSource, TSelector> selector)
213public static double? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector) => Average<TSource, int, long, double>(source, selector);
215public static double? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, long?> selector) => Average<TSource, long, long, double>(source, selector);
217public static float? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, float?> selector) => Average<TSource, float, double, double>(source, selector) is double result ? (float)result : null;
219public static double? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, double?> selector) => Average<TSource, double, double, double>(source, selector);
221public static decimal? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal?> selector) => Average<TSource, decimal, decimal, decimal>(source, selector);
223private static TResult? Average<TSource, TSelector, TAccumulator, TResult>(this IEnumerable<TSource> source, Func<TSource, TSelector?> selector)
System\Linq\CountBy.cs (3)
20public static IEnumerable<KeyValuePair<TKey, int>> CountBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer = null) where TKey : notnull
39private static IEnumerable<KeyValuePair<TKey, int>> CountByIterator<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer) where TKey : notnull
54private static Dictionary<TKey, int> BuildCountDictionary<TSource, TKey>(IEnumerator<TSource> enumerator, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer) where TKey : notnull
System\Linq\Distinct.cs (5)
37/// <para>The <see cref="DistinctBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey})" /> method returns an unordered sequence that contains no duplicate values. The default equality comparer, <see cref="EqualityComparer{T}.Default" />, is used to compare values.</para>
39public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) => DistinctBy(source, keySelector, null);
51/// <para>The <see cref="DistinctBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IEqualityComparer{TKey}?)" /> method returns an unordered sequence that contains no duplicate values. If <paramref name="comparer" /> is <see langword="null" />, the default equality comparer, <see cref="EqualityComparer{T}.Default" />, is used to compare values.</para>
53public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
72private static IEnumerable<TSource> DistinctByIterator<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
System\Linq\Except.cs (3)
49public static IEnumerable<TSource> ExceptBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TKey> second, Func<TSource, TKey> keySelector) => ExceptBy(first, second, keySelector, null);
61public static IEnumerable<TSource> ExceptBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TKey> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
92private static IEnumerable<TSource> ExceptByIterator<TSource, TKey>(IEnumerable<TSource> first, IEnumerable<TKey> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
System\Linq\First.cs (4)
22public static TSource First<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
48public static TSource? FirstOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) =>
58public static TSource FirstOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate, TSource defaultValue)
101private static TSource? TryGetFirst<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate, out bool found)
System\Linq\Grouping.cs (24)
12public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) =>
15public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
35public static IEnumerable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) =>
38public static IEnumerable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer)
63public static IEnumerable<TResult> GroupBy<TSource, TKey, TResult>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector) =>
66public static IEnumerable<TResult> GroupBy<TSource, TKey, TResult>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
91public static IEnumerable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector) =>
94public static IEnumerable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
127private readonly Func<TSource, TKey> _keySelector;
128private readonly Func<TSource, TElement> _elementSelector;
135public GroupByResultIterator(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
185private readonly Func<TSource, TKey> _keySelector;
192public GroupByResultIterator(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
241private readonly Func<TSource, TKey> _keySelector;
242private readonly Func<TSource, TElement> _elementSelector;
248public GroupByIterator(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer)
296private readonly Func<TSource, TKey> _keySelector;
302public GroupByIterator(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
System\Linq\GroupJoin.cs (6)
10public static IEnumerable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, IEnumerable<TInner>, TResult> resultSelector) =>
13public static IEnumerable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, IEnumerable<TInner>, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
48private static IEnumerable<TResult> GroupJoinIterator<TOuter, TInner, TKey, TResult>(IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, IEnumerable<TInner>, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
System\Linq\Intersect.cs (3)
41public static IEnumerable<TSource> IntersectBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TKey> second, Func<TSource, TKey> keySelector) => IntersectBy(first, second, keySelector, null);
58public static IEnumerable<TSource> IntersectBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TKey> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
89private static IEnumerable<TSource> IntersectByIterator<TSource, TKey>(IEnumerable<TSource> first, IEnumerable<TKey> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
System\Linq\Join.cs (6)
10public static IEnumerable<TResult> Join<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector) =>
13public static IEnumerable<TResult> Join<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
48private static IEnumerable<TResult> JoinIterator<TOuter, TInner, TKey, TResult>(IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
System\Linq\Last.cs (4)
22public static TSource Last<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
48public static TSource? LastOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
58public static TSource LastOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate, TSource defaultValue)
108private static TSource? TryGetLast<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate, out bool found)
System\Linq\LeftJoin.cs (6)
10public static IEnumerable<TResult> LeftJoin<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner?, TResult> resultSelector) =>
13public static IEnumerable<TResult> LeftJoin<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner?, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
48private static IEnumerable<TResult> LeftJoinIterator<TOuter, TInner, TKey, TResult>(IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner?, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
System\Linq\Lookup.cs (10)
12public static ILookup<TKey, TSource> ToLookup<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) =>
15public static ILookup<TKey, TSource> ToLookup<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
35public static ILookup<TKey, TElement> ToLookup<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) =>
38public static ILookup<TKey, TElement> ToLookup<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer)
82internal static Lookup<TKey, TElement> Create<TSource>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer)
97internal static Lookup<TKey, TElement> Create(IEnumerable<TElement> source, Func<TElement, TKey> keySelector, IEqualityComparer<TKey>? comparer)
111internal static Lookup<TKey, TElement> CreateForJoin(IEnumerable<TElement> source, Func<TElement, TKey> keySelector, IEqualityComparer<TKey>? comparer)
System\Linq\Max.cs (17)
407public static TSource? MaxBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) => MaxBy(source, keySelector, null);
421public static TSource? MaxBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
516public static int Max<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector) => MaxInteger(source, selector);
518public static int? Max<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector) => MaxInteger(source, selector);
520public static long Max<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector) => MaxInteger(source, selector);
522public static long? Max<TSource>(this IEnumerable<TSource> source, Func<TSource, long?> selector) => MaxInteger(source, selector);
524private static TResult MaxInteger<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector) where TResult : struct, IBinaryInteger<TResult>
556private static TResult? MaxInteger<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult?> selector) where TResult : struct, IBinaryInteger<TResult>
621public static float Max<TSource>(this IEnumerable<TSource> source, Func<TSource, float> selector) => MaxFloat(source, selector);
623public static float? Max<TSource>(this IEnumerable<TSource> source, Func<TSource, float?> selector) => MaxFloat(source, selector);
625public static double Max<TSource>(this IEnumerable<TSource> source, Func<TSource, double> selector) => MaxFloat(source, selector);
627public static double? Max<TSource>(this IEnumerable<TSource> source, Func<TSource, double?> selector) => MaxFloat(source, selector);
629private static TResult MaxFloat<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector) where TResult : struct, IFloatingPointIeee754<TResult>
671private static TResult? MaxFloat<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult?> selector) where TResult : struct, IFloatingPointIeee754<TResult>
728public static decimal Max<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal> selector)
760public static decimal? Max<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal?> selector)
800public static TResult? Max<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)
System\Linq\Min.cs (17)
386public static TSource? MinBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) => MinBy(source, keySelector, comparer: null);
400public static TSource? MinBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
495public static int Min<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector) => MinInteger(source, selector);
497public static int? Min<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector) => MinInteger(source, selector);
499public static long Min<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector) => MinInteger(source, selector);
501public static long? Min<TSource>(this IEnumerable<TSource> source, Func<TSource, long?> selector) => MinInteger(source, selector);
503private static TResult MinInteger<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector) where TResult : struct, IBinaryInteger<TResult>
535private static TResult? MinInteger<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult?> selector) where TResult : struct, IBinaryInteger<TResult>
582public static float Min<TSource>(this IEnumerable<TSource> source, Func<TSource, float> selector) => MinFloat(source, selector);
584public static float? Min<TSource>(this IEnumerable<TSource> source, Func<TSource, float?> selector) => MinFloat(source, selector);
586public static double Min<TSource>(this IEnumerable<TSource> source, Func<TSource, double> selector) => MinFloat(source, selector);
588public static double? Min<TSource>(this IEnumerable<TSource> source, Func<TSource, double?> selector) => MinFloat(source, selector);
590private static TResult MinFloat<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector) where TResult : struct, IFloatingPointIeee754<TResult>
640private static TResult? MinFloat<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult?> selector) where TResult : struct, IFloatingPointIeee754<TResult>
692public static decimal Min<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal> selector)
724public static decimal? Min<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal?> selector)
764public static TResult? Min<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)
System\Linq\OrderBy.cs (9)
50public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
53public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
95public static IOrderedEnumerable<TSource> OrderByDescending<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) =>
98public static IOrderedEnumerable<TSource> OrderByDescending<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer) =>
101public static IOrderedEnumerable<TSource> ThenBy<TSource, TKey>(this IOrderedEnumerable<TSource> source, Func<TSource, TKey> keySelector)
111public static IOrderedEnumerable<TSource> ThenBy<TSource, TKey>(this IOrderedEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
121public static IOrderedEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedEnumerable<TSource> source, Func<TSource, TKey> keySelector)
131public static IOrderedEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
168IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey>(Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending);
System\Linq\OrderedEnumerable.cs (11)
29IOrderedEnumerable<TElement> IOrderedEnumerable<TElement>.CreateOrderedEnumerable<TKey>(Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending) =>
32public TElement? TryGetLast(Func<TElement, bool> predicate, out bool found)
67private readonly Func<TElement, TKey> _keySelector;
73internal OrderedIterator(IEnumerable<TElement> source, Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending, OrderedIterator<TElement>? parent) :
259protected readonly Func<TElement, TKey> _keySelector;
264public CachingComparer(Func<TElement, TKey> keySelector, IComparer<TKey> comparer, bool descending)
293public CachingComparerWithChild(Func<TElement, TKey> keySelector, IComparer<TKey> comparer, bool descending, CachingComparer<TElement> child)
331internal static readonly Func<TElement, TElement> IdentityFunc = e => e;
383private readonly Func<TElement, TKey> _keySelector;
389internal EnumerableSorter(Func<TElement, TKey> keySelector, IComparer<TKey> comparer, bool descending, EnumerableSorter<TElement>? next)
399Func<TElement, TKey> keySelector = _keySelector;
System\Linq\RightJoin.cs (6)
10public static IEnumerable<TResult> RightJoin<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter?, TInner, TResult> resultSelector) =>
13public static IEnumerable<TResult> RightJoin<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter?, TInner, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
48private static IEnumerable<TResult> RightJoinIterator<TOuter, TInner, TKey, TResult>(IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter?, TInner, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
System\Linq\Select.cs (13)
14this IEnumerable<TSource> source, Func<TSource, TResult> selector)
108private readonly Func<TSource, TResult> _selector;
111public IEnumerableSelectIterator(IEnumerable<TSource> source, Func<TSource, TResult> selector)
156public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
169private readonly Func<TSource, TResult> _selector;
171public ArraySelectIterator(TSource[] source, Func<TSource, TResult> selector)
199public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
212private readonly Func<TSource, TResult> _selector;
215public ListSelectIterator(List<TSource> source, Func<TSource, TResult> selector)
249public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
262private readonly Func<TSource, TResult> _selector;
265public IListSelectIterator(IList<TSource> source, Func<TSource, TResult> selector)
311public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
System\Linq\Select.SpeedOpt.cs (19)
21Func<TSource, TResult> selector = _selector;
38Func<TSource, TResult> selector = _selector;
163private static void Fill(ReadOnlySpan<TSource> source, Span<TResult> destination, Func<TSource, TResult> func)
253private readonly Func<int, TResult> _selector;
255public RangeSelectIterator(int start, int end, Func<int, TResult> selector)
283public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
302private static void Fill(Span<TResult> results, int start, Func<int, TResult> func)
415private static void Fill(ReadOnlySpan<TSource> source, Span<TResult> destination, Func<TSource, TResult> func)
533private static void Fill(IList<TSource> source, Span<TResult> results, Func<TSource, TResult> func)
632private readonly Func<TSource, TResult> _selector;
635public IteratorSelectIterator(Iterator<TSource> source, Func<TSource, TResult> selector)
680public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
728Func<TSource, TResult> selector = _selector;
768Func<TSource, TResult> selector = _selector;
801private static void Fill(Iterator<TSource> source, Span<TResult> results, Func<TSource, TResult> func)
844private readonly Func<TSource, TResult> _selector;
848public IListSkipTakeSelectIterator(IList<TSource> source, Func<TSource, TResult> selector, int minIndexInclusive, int maxIndexInclusive)
880public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
976private static void Fill(IList<TSource> source, Span<TResult> destination, Func<TSource, TResult> func, int sourceIndex)
System\Linq\SelectMany.cs (5)
11public static IEnumerable<TResult> SelectMany<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> selector)
110public static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult>(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
135private static IEnumerable<TResult> SelectManyIterator<TSource, TCollection, TResult>(IEnumerable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
149private readonly Func<TSource, IEnumerable<TResult>> _selector;
153internal SelectManySingleSelectorIterator(IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> selector)
System\Linq\Single.cs (4)
21public static TSource Single<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
48public static TSource? SingleOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
59public static TSource SingleOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate, TSource defaultValue)
106private static TSource? TryGetSingle<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate, out bool found)
System\Linq\Sum.cs (12)
225public static int Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector) => Sum<TSource, int, int>(source, selector);
227public static long Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector) => Sum<TSource, long, long>(source, selector);
229public static float Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, float> selector) => Sum<TSource, float, double>(source, selector);
231public static double Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, double> selector) => Sum<TSource, double, double>(source, selector);
233public static decimal Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal> selector) => Sum<TSource, decimal, decimal>(source, selector);
235private static TResult Sum<TSource, TResult, TAccumulator>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)
259public static int? Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector) => Sum<TSource, int, int>(source, selector);
261public static long? Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, long?> selector) => Sum<TSource, long, long>(source, selector);
263public static float? Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, float?> selector) => Sum<TSource, float, double>(source, selector);
265public static double? Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, double?> selector) => Sum<TSource, double, double>(source, selector);
267public static decimal? Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal?> selector) => Sum<TSource, decimal, decimal>(source, selector);
269private static TResult? Sum<TSource, TResult, TAccumulator>(this IEnumerable<TSource> source, Func<TSource, TResult?> selector)
System\Linq\ToCollection.cs (9)
136public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) where TKey : notnull =>
139public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
179private static Dictionary<TKey, TSource> SpanToDictionary<TSource, TKey>(ReadOnlySpan<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
189public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) where TKey : notnull =>
192public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
237private static Dictionary<TKey, TElement> SpanToDictionary<TSource, TKey, TElement>(ReadOnlySpan<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
System\Linq\Union.cs (3)
42public static IEnumerable<TSource> UnionBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TSource> second, Func<TSource, TKey> keySelector) => UnionBy(first, second, keySelector, null);
58public static IEnumerable<TSource> UnionBy<TSource, TKey>(this IEnumerable<TSource> first, IEnumerable<TSource> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
76private static IEnumerable<TSource> UnionByIterator<TSource, TKey>(IEnumerable<TSource> first, IEnumerable<TSource> second, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
System\Linq\Utilities.cs (6)
56public static Func<TSource, bool> CombinePredicates<TSource>(Func<TSource, bool> predicate1, Func<TSource, bool> predicate2) =>
70public static Func<TSource, TResult> CombineSelectors<TSource, TMiddle, TResult>(Func<TSource, TMiddle> selector1, Func<TMiddle, TResult> selector2) =>
System\Linq\Where.cs (28)
12public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
91private readonly Func<TSource, bool> _predicate;
94public IEnumerableWhereIterator(IEnumerable<TSource> source, Func<TSource, bool> predicate)
142public override IEnumerable<TResult> Select<TResult>(Func<TSource, TResult> selector) =>
145public override IEnumerable<TSource> Where(Func<TSource, bool> predicate) =>
156private readonly Func<TSource, bool> _predicate;
158public ArrayWhereIterator(TSource[] source, Func<TSource, bool> predicate)
189public override IEnumerable<TResult> Select<TResult>(Func<TSource, TResult> selector) =>
192public override IEnumerable<TSource> Where(Func<TSource, bool> predicate) =>
203private readonly Func<TSource, bool> _predicate;
206public ListWhereIterator(List<TSource> source, Func<TSource, bool> predicate)
243public override IEnumerable<TResult> Select<TResult>(Func<TSource, TResult> selector) =>
246public override IEnumerable<TSource> Where(Func<TSource, bool> predicate) =>
258private readonly Func<TSource, bool> _predicate;
259private readonly Func<TSource, TResult> _selector;
261public ArrayWhereSelectIterator(TSource[] source, Func<TSource, bool> predicate, Func<TSource, TResult> selector)
294public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
306private readonly Func<TSource, bool> _predicate;
307private readonly Func<TSource, TResult> _selector;
310public ListWhereSelectIterator(List<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> selector)
349public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
361private readonly Func<TSource, bool> _predicate;
362private readonly Func<TSource, TResult> _selector;
365public IEnumerableWhereSelectIterator(IEnumerable<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> selector)
416public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) =>
System\Linq\Where.SpeedOpt.cs (39)
41Func<TSource, bool> predicate = _predicate;
61Func<TSource, bool> predicate = _predicate;
78Func<TSource, bool> predicate = _predicate;
99Func<TSource, bool> predicate = _predicate;
132Func<TSource, bool> predicate = _predicate;
155Func<TSource, bool> predicate = _predicate;
173public static int GetCount(bool onlyIfCheap, ReadOnlySpan<TSource> source, Func<TSource, bool> predicate)
198public static TSource[] ToArray(ReadOnlySpan<TSource> source, Func<TSource, bool> predicate)
219public static List<TSource> ToList(ReadOnlySpan<TSource> source, Func<TSource, bool> predicate)
240Func<TSource, bool> predicate = _predicate;
258Func<TSource, bool> predicate = _predicate;
277Func<TSource, bool> predicate = _predicate;
300Func<TSource, bool> predicate = _predicate;
324Func<TSource, bool> predicate = _predicate;
342Func<TSource, bool> predicate = _predicate;
361Func<TSource, bool> predicate = _predicate;
384Func<TSource, bool> predicate = _predicate;
402public static int GetCount(bool onlyIfCheap, ReadOnlySpan<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> selector)
431public static TResult[] ToArray(ReadOnlySpan<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> selector)
452public static List<TResult> ToList(ReadOnlySpan<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> selector)
473public static TResult? TryGetFirst(ReadOnlySpan<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> selector, out bool found)
490public static TResult? TryGetLast(ReadOnlySpan<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> selector, out bool found)
507public static TResult? TryGetElementAt(ReadOnlySpan<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> selector, int index, out bool found)
532public static bool Contains(ReadOnlySpan<TSource> source, Func<TSource, bool> predicate, Func<TSource, TResult> selector, TResult value)
597Func<TSource, bool> predicate = _predicate;
598Func<TSource, TResult> selector = _selector;
618Func<TSource, bool> predicate = _predicate;
619Func<TSource, TResult> selector = _selector;
636Func<TSource, bool> predicate = _predicate;
657Func<TSource, bool> predicate = _predicate;
690Func<TSource, bool> predicate = _predicate;
713Func<TSource, bool> predicate = _predicate;
System.Linq.AsyncEnumerable (115)
System\Linq\AggregateBy.cs (6)
35Func<TSource, TKey> keySelector,
51Func<TSource, TKey> keySelector,
173Func<TSource, TKey> keySelector,
174Func<TKey, TAccumulate> seedSelector,
189Func<TSource, TKey> keySelector,
190Func<TKey, TAccumulate> seedSelector,
System\Linq\DistinctBy.cs (3)
23/// <para>The <see cref="DistinctBy{TSource, TKey}(IAsyncEnumerable{TSource}, Func{TSource, TKey}, IEqualityComparer{TKey}?)" /> method returns an unordered sequence that contains no duplicate values. If <paramref name="comparer" /> is <see langword="null" />, the default equality comparer, <see cref="EqualityComparer{T}.Default" />, is used to compare values.</para>
29Func<TSource, TKey> keySelector,
41Func<TSource, TKey> keySelector,
System\Linq\GroupBy.cs (12)
29Func<TSource, TKey> keySelector,
41Func<TSource, TKey> keySelector,
110Func<TSource, TKey> keySelector,
111Func<TSource, TElement> elementSelector,
124Func<TSource, TKey> keySelector,
125Func<TSource, TElement> elementSelector,
203Func<TSource, TKey> keySelector,
217Func<TSource, TKey> keySelector,
303Func<TSource, TKey> keySelector,
304Func<TSource, TElement> elementSelector,
319Func<TSource, TKey> keySelector,
320Func<TSource, TElement> elementSelector,
System\Linq\LastAsync.cs (5)
63Func<TSource, bool> predicate,
73Func<TSource, bool> predicate,
216Func<TSource, bool> predicate,
245Func<TSource, bool> predicate,
256Func<TSource, bool> predicate,
System\Linq\OrderBy.cs (9)
35Func<TSource, TKey> keySelector,
90Func<TSource, TKey> keySelector,
134Func<TSource, TKey> keySelector,
172Func<TSource, TKey> keySelector,
210public IOrderedAsyncEnumerable<TElement> CreateOrderedAsyncEnumerable<TKey>(Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending) =>
229Debug.Assert(keySelector is Func<TElement, TKey> or Func<TElement, CancellationToken, ValueTask<TKey>>);
278internal static readonly Func<TElement, TElement> IdentityFunc = e => e;
333if (keySelector is Func<TElement, TKey> syncSelector)
443IOrderedAsyncEnumerable<TElement> CreateOrderedAsyncEnumerable<TKey>(Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending);
System\Linq\SelectMany.cs (10)
29Func<TSource, IEnumerable<TResult>> selector)
40Func<TSource, IEnumerable<TResult>> selector,
109Func<TSource, IAsyncEnumerable<TResult>> selector)
120Func<TSource, IAsyncEnumerable<TResult>> selector,
282Func<TSource, IEnumerable<TCollection>> collectionSelector,
295Func<TSource, IEnumerable<TCollection>> collectionSelector,
382Func<TSource, IAsyncEnumerable<TCollection>> collectionSelector,
395Func<TSource, IAsyncEnumerable<TCollection>> collectionSelector,
432Func<TSource, IAsyncEnumerable<TCollection>> collectionSelector,
445Func<TSource, IAsyncEnumerable<TCollection>> collectionSelector,
System\Linq\SingleAsync.cs (5)
67Func<TSource, bool> predicate,
77Func<TSource, bool> predicate,
232Func<TSource, bool> predicate,
270Func<TSource, bool> predicate,
281Func<TSource, bool> predicate,
System\Linq\ToDictionaryAsync.cs (6)
78Func<TSource, TKey> keySelector,
89Func<TSource, TKey> keySelector,
160Func<TSource, TKey> keySelector,
161Func<TSource, TElement> elementSelector,
173Func<TSource, TKey> keySelector,
174Func<TSource, TElement> elementSelector,
System\Linq\ToLookupAsync.cs (7)
30Func<TSource, TKey> keySelector,
41Func<TSource, TKey> keySelector,
129Func<TSource, TKey> keySelector,
130Func<TSource, TElement> elementSelector,
142Func<TSource, TKey> keySelector,
143Func<TSource, TElement> elementSelector,
282Func<TElement, TKey> keySelector,
System.Linq.Expressions (37)
System\Dynamic\Utils\DelegateHelpers.cs (14)
23public static Func<Type, Func<object?[], object?>, Delegate> CreateObjectArrayDelegate { get; }
26private static Func<Type, Func<object?[], object?>, Delegate> CreateObjectArrayDelegateInternal()
35.CreateDelegate<Func<Type, Func<object?[], object?>, Delegate>>();
39return new Func<Type, Func<object?[], object?>, Delegate>((_x, _y) => throw new NotImplementedException());
55internal static Delegate CreateObjectArrayDelegate(Type delegateType, Func<object?[], object?> handler)
71private static readonly MethodInfo s_FuncInvoke = typeof(Func<object?[], object?>).GetMethod("Invoke")!;
77public static void ActionThunk(Func<object?[], object?> handler)
82public static void ActionThunk1<T1>(Func<object?[], object?> handler, T1 t1)
87public static void ActionThunk2<T1, T2>(Func<object?[], object?> handler, T1 t1, T2 t2)
92public static TReturn FuncThunk<TReturn>(Func<object?[], object> handler)
97public static TReturn FuncThunk1<T1, TReturn>(Func<object?[], object> handler, T1 t1)
102public static TReturn FuncThunk2<T1, T2, TReturn>(Func<object?[], object> handler, T1 t1, T2 t2)
201private static Delegate CreateObjectArrayDelegateRefEmit(Type delegateType, Func<object?[], object?> handler)
235paramTypes[0] = typeof(Func<object[], object>);
System\Runtime\CompilerServices\CallSite.cs (6)
54private static volatile CacheDict<Type, Func<CallSiteBinder, CallSite>>? s_siteCtors;
93CacheDict<Type, Func<CallSiteBinder, CallSite>>? ctors = s_siteCtors;
97s_siteCtors = ctors = new CacheDict<Type, Func<CallSiteBinder, CallSite>>(100);
100if (!ctors.TryGetValue(delegateType, out Func<CallSiteBinder, CallSite>? ctor))
110ctor = (Func<CallSiteBinder, CallSite>)method.CreateDelegate(typeof(Func<CallSiteBinder, CallSite>));
System.Linq.Parallel (180)
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (12)
32private readonly Func<TSource, TGroupKey> _keySelector; // Key selection function.
33private readonly Func<TSource, TElement>? _elementSelector; // Optional element selection function.
51Func<TSource, TGroupKey> keySelector,
52Func<TSource, TElement>? elementSelector,
363private readonly Func<TSource, TElement> _elementSelector; // Function to select elements.
371IEqualityComparer<TGroupKey>? keyComparer, Func<TSource, TElement> elementSelector, CancellationToken cancellationToken) :
426private readonly Func<TSource, TGroupKey> _keySelector; // The key selection routine.
443Func<TSource, TGroupKey> keySelector, IEqualityComparer<TGroupKey>? keyComparer, IComparer<TOrderKey> orderComparer,
539Func<TSource, TGroupKey> keySelector, IEqualityComparer<TGroupKey>? keyComparer, IComparer<TOrderKey> orderComparer,
605private readonly Func<TSource, TElement> _elementSelector; // Function to select elements.
612Func<TSource, TGroupKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TGroupKey>? keyComparer, IComparer<TOrderKey> orderComparer,
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (6)
25private readonly Func<TInputOutput, TSortKey> _keySelector; // Key selector used when sorting.
32internal SortQueryOperator(IEnumerable<TInputOutput> source, Func<TInputOutput, TSortKey> keySelector,
55Func<TInputOutput, TKey2> key2Selector, IComparer<TKey2>? key2Comparer, bool descending)
65Func<TInputOutput, Pair<TSortKey, TKey2>> pairKeySelector =
171private readonly Func<TInputOutput, TSortKey> _keySelector; // Key selector used when sorting.
178Func<TInputOutput, TSortKey> keySelector)
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (4)
45private readonly Func<TResult, bool>? _predicate;
67Func<TResult, bool>? predicate,
208private readonly Func<TResult, bool>? _predicate; // The actual predicate function.
229QueryOperatorEnumerator<TResult, TKey> source, Func<TResult, bool>? predicate, Func<TResult, TKey, bool>? indexedPredicate, bool take,
System\Linq\Parallel\Utils\ExchangeUtilities.cs (2)
90PartitionedStream<TElement, TIgnoreKey> source, Func<TElement, THashKey>? keySelector, IEqualityComparer<THashKey>? keyComparer,
98PartitionedStream<TElement, TOrderKey> source, Func<TElement, THashKey>? keySelector, IEqualityComparer<THashKey>? keyComparer,
System\Linq\ParallelEnumerable.cs (109)
527public static ParallelQuery<TSource> Where<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
571this ParallelQuery<TSource> source, Func<TSource, TResult> selector)
684Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,
714Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,
744Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,
781Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,
816Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,
847Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,
878Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,
916Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,
942this ParallelQuery<TSource> source, Func<TSource, IEnumerable<TResult>> selector)
994this ParallelQuery<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector,
1065this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector)
1093this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
1120this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector)
1147this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
1177this OrderedParallelQuery<TSource> source, Func<TSource, TKey> keySelector)
1208this OrderedParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
1238this OrderedParallelQuery<TSource> source, Func<TSource, TKey> keySelector)
1269this OrderedParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
1297this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector)
1316this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
1343this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector)
1369this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer)
1408this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector)
1436this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
1466this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector)
1497this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
1701Func<TAccumulate, TResult> resultSelector)
1757Func<TAccumulate, TAccumulate, TAccumulate> combineAccumulatorsFunc, Func<TAccumulate, TResult> resultSelector)
1813Func<TAccumulate, TResult> resultSelector)
1890public static int Count<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
1957public static long LongCount<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
2210public static int Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, int> selector)
2234public static int? Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, int?> selector)
2258public static long Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, long> selector)
2282public static long? Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, long?> selector)
2304public static float Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, float> selector)
2326public static float? Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, float?> selector)
2348public static double Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, double> selector)
2370public static double? Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, double?> selector)
2394public static decimal Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, decimal> selector)
2418public static decimal? Sum<TSource>(this ParallelQuery<TSource> source, Func<TSource, decimal?> selector)
2707public static int Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, int> selector)
2729public static int? Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, int?> selector)
2754public static long Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, long> selector)
2776public static long? Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, long?> selector)
2801public static float Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, float> selector)
2823public static float? Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, float?> selector)
2848public static double Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, double> selector)
2870public static double? Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, double?> selector)
2895public static decimal Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, decimal> selector)
2917public static decimal? Min<TSource>(this ParallelQuery<TSource> source, Func<TSource, decimal?> selector)
2943public static TResult? Min<TSource, TResult>(this ParallelQuery<TSource> source, Func<TSource, TResult> selector)
3221public static int Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, int> selector)
3243public static int? Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, int?> selector)
3268public static long Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, long> selector)
3290public static long? Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, long?> selector)
3315public static float Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, float> selector)
3337public static float? Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, float?> selector)
3362public static double Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, double> selector)
3384public static double? Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, double?> selector)
3409public static decimal Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, decimal> selector)
3431public static decimal? Max<TSource>(this ParallelQuery<TSource> source, Func<TSource, decimal?> selector)
3457public static TResult? Max<TSource, TResult>(this ParallelQuery<TSource> source, Func<TSource, TResult> selector)
3721public static double Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, int> selector)
3745public static double? Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, int?> selector)
3772public static double Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, long> selector)
3796public static double? Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, long?> selector)
3821public static float Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, float> selector)
3843public static float? Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, float?> selector)
3868public static double Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, double> selector)
3890public static double? Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, double?> selector)
3915public static decimal Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, decimal> selector)
3937public static decimal? Average<TSource>(this ParallelQuery<TSource> source, Func<TSource, decimal?> selector)
3964public static bool Any<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
4016public static bool All<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
4133public static ParallelQuery<TSource> TakeWhile<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
4215public static ParallelQuery<TSource> SkipWhile<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
4930this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector) where TKey : notnull
4959this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
5021this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) where TKey : notnull
5056this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
5113this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector) where TKey : notnull
5138this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
5192this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) where TKey : notnull
5224this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer) where TKey : notnull
5438public static TSource First<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
5523public static TSource? FirstOrDefault<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
5614public static TSource Last<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
5697public static TSource? LastOrDefault<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
5774public static TSource Single<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
5831public static TSource? SingleOrDefault<TSource>(this ParallelQuery<TSource> source, Func<TSource, bool> predicate)
System.Linq.Queryable (198)
System\Linq\Queryable.cs (198)
48public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
56new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, IQueryable<TSource>>(Where).Method,
98public static IQueryable<TResult> Select<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
106new Func<IQueryable<TSource>, Expression<Func<TSource, TResult>>, IQueryable<TResult>>(Select).Method,
124public static IQueryable<TResult> SelectMany<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector)
132new Func<IQueryable<TSource>, Expression<Func<TSource, IEnumerable<TResult>>>, IQueryable<TResult>>(SelectMany).Method,
164public static IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
173new Func<IQueryable<TSource>, Expression<Func<TSource, IEnumerable<TCollection>>>, Expression<Func<TSource, TCollection, TResult>>, IQueryable<TResult>>(SelectMany).Method,
184public static IQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector)
195new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>, IQueryable<TResult>>(Join).Method,
200public static IQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
211new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(Join).Method,
216public static IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector)
227new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>, IQueryable<TResult>>(GroupJoin).Method,
232public static IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
243new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(GroupJoin).Method,
248public static IQueryable<TResult> LeftJoin<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner?, TResult>> resultSelector)
259new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner?, TResult>>, IQueryable<TResult>>(LeftJoin).Method,
264public static IQueryable<TResult> LeftJoin<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner?, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
275new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner?, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(LeftJoin).Method,
288/// of the <see cref="Func{T,TResult}"/> types.
325/// of the <see cref="Func{T,TResult}"/> types.
353public static IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
361new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IOrderedQueryable<TSource>>(OrderBy).Method,
366public static IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
374new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(OrderBy).Method,
387/// of the <see cref="Func{T,TResult}"/> types.
424/// of the <see cref="Func{T,TResult}"/> types.
452public static IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
460new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IOrderedQueryable<TSource>>(OrderByDescending).Method,
465public static IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
473new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(OrderByDescending).Method,
478public static IQueryable<TResult> RightJoin<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter?, TInner, TResult>> resultSelector)
489new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter?, TInner, TResult>>, IQueryable<TResult>>(RightJoin).Method,
494public static IQueryable<TResult> RightJoin<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter?, TInner, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
505new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter?, TInner, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(RightJoin).Method,
510public static IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
518new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IOrderedQueryable<TSource>>(ThenBy).Method,
523public static IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
531new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(ThenBy).Method,
536public static IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
544new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IOrderedQueryable<TSource>>(ThenByDescending).Method,
549public static IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
557new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(ThenByDescending).Method,
592public static IQueryable<TSource> TakeWhile<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
600new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, IQueryable<TSource>>(TakeWhile).Method,
630public static IQueryable<TSource> SkipWhile<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
638new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, IQueryable<TSource>>(SkipWhile).Method,
656public static IQueryable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
664new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IQueryable<IGrouping<TKey, TSource>>>(GroupBy).Method,
669public static IQueryable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
678new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, IQueryable<IGrouping<TKey, TElement>>>(GroupBy).Method,
683public static IQueryable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
691new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<IGrouping<TKey, TSource>>>(GroupBy).Method,
696public static IQueryable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey>? comparer)
705new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, IEqualityComparer<TKey>, IQueryable<IGrouping<TKey, TElement>>>(GroupBy).Method,
710public static IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector)
720new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, Expression<Func<TKey, IEnumerable<TElement>, TResult>>, IQueryable<TResult>>(GroupBy).Method,
725public static IQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector)
734new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>, IQueryable<TResult>>(GroupBy).Method,
739public static IQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
748new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(GroupBy).Method,
753public static IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
763new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, Expression<Func<TKey, IEnumerable<TElement>, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(GroupBy).Method,
799public static IQueryable<TSource> DistinctBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
807new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(DistinctBy).Method,
820public static IQueryable<TSource> DistinctBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
828new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(DistinctBy).Method,
956public static IQueryable<TSource> UnionBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TSource> source2, Expression<Func<TSource, TKey>> keySelector)
965new Func<IQueryable<TSource>, IEnumerable<TSource>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(UnionBy).Method,
979public static IQueryable<TSource> UnionBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TSource> source2, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
988new Func<IQueryable<TSource>, IEnumerable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(UnionBy).Method,
1049public static IQueryable<TSource> IntersectBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TKey> source2, Expression<Func<TSource, TKey>> keySelector)
1058new Func<IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(IntersectBy).Method,
1074public static IQueryable<TSource> IntersectBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TKey> source2, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
1083new Func<IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(IntersectBy).Method,
1128public static IQueryable<TSource> ExceptBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TKey> source2, Expression<Func<TSource, TKey>> keySelector)
1137new Func<IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(ExceptBy).Method,
1154public static IQueryable<TSource> ExceptBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TKey> source2, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
1163new Func<IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(ExceptBy).Method,
1183public static TSource First<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1191new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource>(First).Method,
1226public static TSource? FirstOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1234new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource?>(FirstOrDefault).Method,
1246public static TSource FirstOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, TSource defaultValue)
1254new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource, TSource>(FirstOrDefault).Method,
1271public static TSource Last<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1279new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource>(Last).Method,
1314public static TSource? LastOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1322new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource?>(LastOrDefault).Method,
1334public static TSource LastOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, TSource defaultValue)
1342new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource, TSource>(LastOrDefault).Method,
1360public static TSource Single<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1368new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource>(Single).Method,
1404public static TSource? SingleOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1412new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource?>(SingleOrDefault).Method,
1425public static TSource SingleOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, TSource defaultValue)
1433new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource, TSource>(SingleOrDefault).Method,
1617public static bool Any<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1625new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, bool>(Any).Method,
1630public static bool All<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1638new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, bool>(All).Method,
1655public static int Count<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1663new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, int>(Count).Method,
1676public static IQueryable<KeyValuePair<TKey, int>> CountBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer = null) where TKey : notnull
1684new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<KeyValuePair<TKey, int>>>(CountBy).Method,
1701public static long LongCount<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
1709new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, long>(LongCount).Method,
1746public static TResult? Min<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
1754new Func<IQueryable<TSource>, Expression<Func<TSource, TResult>>, TResult?>(Min).Method,
1767public static TSource? MinBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
1775new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, TSource?>(MinBy).Method,
1793public static TSource? MinBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TSource>? comparer)
1801new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TSource>, TSource?>(MinBy).Method,
1817public static TSource? MinBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
1825new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, TSource?>(MinBy).Method,
1863public static TResult? Max<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
1871new Func<IQueryable<TSource>, Expression<Func<TSource, TResult>>, TResult?>(Max).Method,
1884public static TSource? MaxBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
1892new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, TSource?>(MaxBy).Method,
1910public static TSource? MaxBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TSource>? comparer)
1918new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TSource>, TSource?>(MaxBy).Method,
1934public static TSource? MaxBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
1942new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, TSource?>(MaxBy).Method,
2069public static int Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int>> selector)
2077new Func<IQueryable<TSource>, Expression<Func<TSource, int>>, int>(Sum).Method,
2082public static int? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
2090new Func<IQueryable<TSource>, Expression<Func<TSource, int?>>, int?>(Sum).Method,
2095public static long Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long>> selector)
2103new Func<IQueryable<TSource>, Expression<Func<TSource, long>>, long>(Sum).Method,
2108public static long? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
2116new Func<IQueryable<TSource>, Expression<Func<TSource, long?>>, long?>(Sum).Method,
2121public static float Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float>> selector)
2129new Func<IQueryable<TSource>, Expression<Func<TSource, float>>, float>(Sum).Method,
2134public static float? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
2142new Func<IQueryable<TSource>, Expression<Func<TSource, float?>>, float?>(Sum).Method,
2147public static double Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double>> selector)
2155new Func<IQueryable<TSource>, Expression<Func<TSource, double>>, double>(Sum).Method,
2160public static double? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
2168new Func<IQueryable<TSource>, Expression<Func<TSource, double?>>, double?>(Sum).Method,
2173public static decimal Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
2181new Func<IQueryable<TSource>, Expression<Func<TSource, decimal>>, decimal>(Sum).Method,
2186public static decimal? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
2194new Func<IQueryable<TSource>, Expression<Func<TSource, decimal?>>, decimal?>(Sum).Method,
2319public static double Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int>> selector)
2327new Func<IQueryable<TSource>, Expression<Func<TSource, int>>, double>(Average).Method,
2332public static double? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
2340new Func<IQueryable<TSource>, Expression<Func<TSource, int?>>, double?>(Average).Method,
2345public static float Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float>> selector)
2353new Func<IQueryable<TSource>, Expression<Func<TSource, float>>, float>(Average).Method,
2358public static float? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
2366new Func<IQueryable<TSource>, Expression<Func<TSource, float?>>, float?>(Average).Method,
2371public static double Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long>> selector)
2379new Func<IQueryable<TSource>, Expression<Func<TSource, long>>, double>(Average).Method,
2384public static double? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
2392new Func<IQueryable<TSource>, Expression<Func<TSource, long?>>, double?>(Average).Method,
2397public static double Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double>> selector)
2405new Func<IQueryable<TSource>, Expression<Func<TSource, double>>, double>(Average).Method,
2410public static double? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
2418new Func<IQueryable<TSource>, Expression<Func<TSource, double?>>, double?>(Average).Method,
2423public static decimal Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
2431new Func<IQueryable<TSource>, Expression<Func<TSource, decimal>>, decimal>(Average).Method,
2436public static decimal? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
2444new Func<IQueryable<TSource>, Expression<Func<TSource, decimal?>>, decimal?>(Average).Method,
2475public static TResult Aggregate<TSource, TAccumulate, TResult>(this IQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> func, Expression<Func<TAccumulate, TResult>> selector)
2484new Func<IQueryable<TSource>, TAccumulate, Expression<Func<TAccumulate, TSource, TAccumulate>>, Expression<Func<TAccumulate, TResult>>, TResult>(Aggregate).Method,
2501/// This method is comparable to the <see cref="GroupBy{TSource, TKey}(IQueryable{TSource}, Expression{Func{TSource, TKey}})"/> methods
2505public static IQueryable<KeyValuePair<TKey, TAccumulate>> AggregateBy<TSource, TKey, TAccumulate>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> func, IEqualityComparer<TKey>? keyComparer = null) where TKey : notnull
2514new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, TAccumulate, Expression<Func<TAccumulate, TSource, TAccumulate>>, IEqualityComparer<TKey>, IQueryable<KeyValuePair<TKey, TAccumulate>>>(AggregateBy).Method,
2531/// This method is comparable to the <see cref="GroupBy{TSource, TKey}(IQueryable{TSource}, Expression{Func{TSource, TKey}})"/> methods
2535public static IQueryable<KeyValuePair<TKey, TAccumulate>> AggregateBy<TSource, TKey, TAccumulate>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, TAccumulate>> seedSelector, Expression<Func<TAccumulate, TSource, TAccumulate>> func, IEqualityComparer<TKey>? keyComparer = null) where TKey : notnull
2545new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TKey, TAccumulate>>, Expression<Func<TAccumulate, TSource, TAccumulate>>, IEqualityComparer<TKey>, IQueryable<KeyValuePair<TKey, TAccumulate>>>(AggregateBy).Method,
System.Net.Http (3)
System.Net.HttpListener (9)
System\Net\Windows\CookieExtensions.cs (9)
13private static Func<Cookie, string>? s_toServerStringFunc;
17s_toServerStringFunc ??= (Func<Cookie, string>)typeof(Cookie).GetMethod("ToServerString", BindingFlags.Instance | BindingFlags.NonPublic)?.CreateDelegate(typeof(Func<Cookie, string>))!;
22private static Func<Cookie, Cookie>? s_cloneFunc;
26s_cloneFunc ??= (Func<Cookie, Cookie>)typeof(Cookie).GetMethod("Clone", BindingFlags.Instance | BindingFlags.NonPublic)?.CreateDelegate(typeof(Func<Cookie, Cookie>))!;
40private static Func<Cookie, CookieVariant>? s_getVariantFunc;
44s_getVariantFunc ??= (Func<Cookie, CookieVariant>)typeof(Cookie).GetProperty("Variant", BindingFlags.Instance | BindingFlags.NonPublic)?.GetGetMethod(true)?.CreateDelegate(typeof(Func<Cookie, CookieVariant>))!;
System.Net.Quic (3)
System.Net.Security (2)
System.Net.WebClient (1)
System.Net.WebHeaderCollection (5)
System.Private.CoreLib (158)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (31)
103public static Func<object?, PropertyValue> GetFactory(Type type)
158public static Func<PropertyValue, PropertyValue> GetPropertyGetter(PropertyInfo property)
172private static Func<PropertyValue, PropertyValue> GetBoxedValueTypePropertyGetter(PropertyInfo property)
179Func<object?, PropertyValue> factory = GetFactory(type);
193private static Func<PropertyValue, PropertyValue> GetReferenceTypePropertyGetter(PropertyInfo property)
201public abstract Func<PropertyValue, PropertyValue> GetPropertyGetter(PropertyInfo property);
207return property.GetMethod!.CreateDelegate(typeof(Func<,>).MakeGenericType(property.DeclaringType!, propertyType));
213private static Func<TContainer, TProperty> GetGetMethod<TProperty>(PropertyInfo property) where TProperty : struct =>
214property.GetMethod!.CreateDelegate<Func<TContainer, TProperty>>();
216public override Func<PropertyValue, PropertyValue> GetPropertyGetter(PropertyInfo property)
222var getter = (Func<TContainer, object?>)GetGetMethod(property, type);
230if (type == typeof(bool)) { var f = GetGetMethod<bool>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
231if (type == typeof(byte)) { var f = GetGetMethod<byte>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
232if (type == typeof(sbyte)) { var f = GetGetMethod<sbyte>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
233if (type == typeof(char)) { var f = GetGetMethod<char>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
234if (type == typeof(short)) { var f = GetGetMethod<short>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
235if (type == typeof(ushort)) { var f = GetGetMethod<ushort>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
236if (type == typeof(int)) { var f = GetGetMethod<int>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
237if (type == typeof(uint)) { var f = GetGetMethod<uint>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
238if (type == typeof(long)) { var f = GetGetMethod<long>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
239if (type == typeof(ulong)) { var f = GetGetMethod<ulong>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
240if (type == typeof(IntPtr)) { var f = GetGetMethod<IntPtr>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
241if (type == typeof(UIntPtr)) { var f = GetGetMethod<UIntPtr>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
242if (type == typeof(float)) { var f = GetGetMethod<float>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
243if (type == typeof(double)) { var f = GetGetMethod<double>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
244if (type == typeof(Guid)) { var f = GetGetMethod<Guid>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
245if (type == typeof(DateTime)) { var f = GetGetMethod<DateTime>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
246if (type == typeof(DateTimeOffset)) { var f = GetGetMethod<DateTimeOffset>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
247if (type == typeof(TimeSpan)) { var f = GetGetMethod<TimeSpan>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
248if (type == typeof(decimal)) { var f = GetGetMethod<decimal>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (12)
195public Task(Func<object?, TResult> function, object? state)
216public Task(Func<object?, TResult> function, object? state, CancellationToken cancellationToken)
241public Task(Func<object?, TResult> function, object? state, TaskCreationOptions creationOptions)
271public Task(Func<object?, TResult> function, object? state, CancellationToken cancellationToken, TaskCreationOptions creationOptions)
330internal static Task<TResult> StartNew(Task? parent, Func<object?, TResult> function, object? state, CancellationToken cancellationToken,
494if (m_action is Func<object?, TResult> funcWithState)
998public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction)
1027public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, CancellationToken cancellationToken)
1057public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler)
1099public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskContinuationOptions continuationOptions)
1152public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, CancellationToken cancellationToken,
1159internal Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler,
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (47)
377public Task<TResult> StartNew(Func<object?, TResult> function, object? state)
406public Task<TResult> StartNew(Func<object?, TResult> function, object? state, CancellationToken cancellationToken)
437public Task<TResult> StartNew(Func<object?, TResult> function, object? state, TaskCreationOptions creationOptions)
479public Task<TResult> StartNew(Func<object?, TResult> function, object? state, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
492Func<IAsyncResult, TResult>? endFunction,
560public Task<TResult> FromAsync(IAsyncResult asyncResult, Func<IAsyncResult, TResult> endMethod)
586Func<IAsyncResult, TResult> endMethod,
619Func<IAsyncResult, TResult> endMethod,
630Func<IAsyncResult, TResult>? endFunction,
715Func<IAsyncResult, TResult> endMethod, object? state)
744Func<IAsyncResult, TResult> endMethod, object? state, TaskCreationOptions creationOptions)
752Func<IAsyncResult, TResult>? endFunction, Action<IAsyncResult>? endAction,
826Func<IAsyncResult, TResult> endMethod,
860Func<IAsyncResult, TResult> endMethod,
869Func<IAsyncResult, TResult>? endFunction, Action<IAsyncResult>? endAction,
947Func<IAsyncResult, TResult> endMethod,
985Func<IAsyncResult, TResult> endMethod,
994Func<IAsyncResult, TResult>? endFunction, Action<IAsyncResult>? endAction,
1076Func<IAsyncResult, TResult> endMethod,
1118Func<IAsyncResult, TResult> endMethod,
1127Func<IAsyncResult, TResult>? endFunction, Action<IAsyncResult>? endAction,
1348public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction)
1376public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken)
1410public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions)
1454public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction,
1479public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction)
1508public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1544public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1590public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1602Func<Task<TAntecedentResult>[], TResult>? continuationFunction, Action<Task<TAntecedentResult>[]>? continuationAction,
1629static (starter, continuationFunction) => ((Func<Task<TAntecedentResult>[], TResult>)continuationFunction!)(starter.Result),
1649Func<Task[], TResult>? continuationFunction, Action<Task[]>? continuationAction,
1679Debug.Assert(state is Func<Task[], TResult>);
1680return ((Func<Task[], TResult>)state)(completedTasks.Result);
1718public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction)
1746public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
1780public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
1824public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction,
1849public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction)
1878public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1914public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1960public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1971Func<Task, TResult>? continuationFunction, Action<Task>? continuationAction,
1999Debug.Assert(state is Func<Task, TResult>);
2000return ((Func<Task, TResult>)state)(completedTask.Result);
2022Func<Task<TAntecedentResult>, TResult>? continuationFunction, Action<Task<TAntecedentResult>>? continuationAction,
2047static (starter, continuationFunction) => ((Func<Task<TAntecedentResult>, TResult>)continuationFunction!)(starter.Result),
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (6)
4003public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction)
4032public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
4062public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler)
4098public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
4144public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken,
4151private Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler,
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (4)
64Debug.Assert(function is Func<Task, TResult> || function is Func<Task, object?, TResult>,
86if (m_action is Func<Task, TResult> func)
156Debug.Assert(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object?, TResult>,
178if (m_action is Func<Task<TAntecedentResult>, TResult> func)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (31)
654public Task<TResult> StartNew<TResult>(Func<object?, TResult> function, object? state)
687public Task<TResult> StartNew<TResult>(Func<object?, TResult> function, object? state, CancellationToken cancellationToken)
721public Task<TResult> StartNew<TResult>(Func<object?, TResult> function, object? state, TaskCreationOptions creationOptions)
766public Task<TResult> StartNew<TResult>(Func<object?, TResult> function, object? state, CancellationToken cancellationToken,
1154IAsyncResult asyncResult, Func<IAsyncResult, TResult> endMethod)
1182IAsyncResult asyncResult, Func<IAsyncResult, TResult> endMethod, TaskCreationOptions creationOptions)
1214IAsyncResult asyncResult, Func<IAsyncResult, TResult> endMethod, TaskCreationOptions creationOptions, TaskScheduler scheduler)
1241Func<IAsyncResult, TResult> endMethod, object? state)
1273Func<IAsyncResult, TResult> endMethod, object? state, TaskCreationOptions creationOptions)
1304Func<IAsyncResult, TResult> endMethod, TArg1 arg1, object? state)
1339Func<IAsyncResult, TResult> endMethod, TArg1 arg1, object? state, TaskCreationOptions creationOptions)
1373Func<IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state)
1413Func<IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state, TaskCreationOptions creationOptions)
1452Func<IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state)
1496Func<IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state, TaskCreationOptions creationOptions)
1969public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction)
2002public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken)
2040public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions)
2088public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken,
2118public Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction)
2151public Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
2191public Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
2241public Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
2549public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction)
2581public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
2619public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
2667public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken,
2696public Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction)
2729public Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
2769public Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
2819public Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
System.Private.DataContractSerialization (11)
System.Private.Windows.Core (15)
System\Private\Windows\Ole\IDataObjectInternal.cs (4)
96/// <inheritdoc cref="TryGetData{T}(string, Func{TypeName, Type}, bool, out T)"/>
103/// <inheritdoc cref="TryGetData{T}(string, Func{TypeName, Type}, bool, out T)"/>
112/// <inheritdoc cref="TryGetData{T}(string, Func{TypeName, Type}, bool, out T)"/>
151Func<TypeName, Type?> resolver,
Windows\Win32\System\Com\WinFormsComWrappers.cs (3)
59internal static HRESULT UnwrapAndInvoke<TThis, TInterface>(TThis* @this, Func<TInterface, HRESULT> func)
74internal static TReturnType UnwrapAndInvoke<TThis, TInterface, TReturnType>(TThis* @this, Func<TInterface, TReturnType> func)
95/// <inheritdoc cref="UnwrapAndInvoke{TThis, TInterface}(TThis*, Func{TInterface, HRESULT})"/>
System.Private.Windows.Core.Tests (9)
System\Private\Windows\Ole\BinaryFormatUtilitesTestsBase.cs (5)
46Func<TypeName, Type>? resolver,
64protected bool ReadObjectFromStream<T>(bool restrictDeserialization, Func<TypeName, Type>? resolver, out T? @object)
76protected bool TryReadObjectFromStream<T>(Func<TypeName, Type>? resolver, out T? @object)
82protected bool ReadPredefinedObjectFromStream<T>(Func<TypeName, Type>? resolver, out T? @object)
119protected bool RoundTripOfType<T>(object value, Func<TypeName, Type>? resolver, out T? @object)
System.Private.Xml (15)
System\Xml\AsyncHelper.cs (6)
53public static Task CallTaskFuncWhenFinishAsync<TArg>(this Task task, Func<TArg, Task> func, TArg arg)
60private static async Task CallTaskFuncWhenFinishCoreAsync<TArg>(Task task, Func<TArg, Task> func, TArg arg)
66public static Task<bool> CallBoolTaskFuncWhenFinishAsync<TArg>(this Task task, Func<TArg, Task<bool>> func, TArg arg)
73private static async Task<bool> CallBoolTaskFuncWhenFinishCoreAsync<TArg>(this Task task, Func<TArg, Task<bool>> func, TArg arg)
79public static Task<bool> ContinueBoolTaskFuncWhenFalseAsync<TArg>(this Task<bool> task, Func<TArg, Task<bool>> func, TArg arg)
91private static async Task<bool> ContinueBoolTaskFuncWhenFalseCoreAsync<TArg>(Task<bool> task, Func<TArg, Task<bool>> func, TArg arg)
System.Reflection.Context (9)
System.Reflection.Metadata (12)
System.Reflection.MetadataLoadContext (9)
System.Resources.Writer (1)
System.Runtime (1)
System.Runtime.InteropServices.JavaScript (2)
System.Security.Claims (2)
System.Security.Cryptography (11)
System.Security.Cryptography.Xml (3)
System.ServiceModel.Federation (2)
System.Text.Json (76)
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (12)
147public Func<TFSharpOption, T> CreateFSharpOptionValueGetter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TFSharpOption, T>()
151return CreateDelegate<Func<TFSharpOption, T>>(valueGetter);
156public Func<TElement?, TFSharpOption> CreateFSharpOptionSomeConstructor<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TFSharpOption, TElement>()
160return CreateDelegate<Func<TElement?, TFSharpOption>>(methodInfo);
175public Func<TElement?, TFSharpOption> CreateFSharpValueOptionSomeConstructor<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TFSharpOption, TElement>()
179return CreateDelegate<Func<TElement?, TFSharpOption>>(methodInfo);
184public Func<IEnumerable<TElement>, TFSharpList> CreateFSharpListConstructor<TFSharpList, TElement>()
187return CreateDelegate<Func<IEnumerable<TElement>, TFSharpList>>(EnsureMemberExists(_fsharpListCtor, "Microsoft.FSharp.Collections.ListModule.OfSeq<T>(IEnumerable<T> source)").MakeGenericMethod(typeof(TElement)));
192public Func<IEnumerable<TElement>, TFSharpSet> CreateFSharpSetConstructor<TFSharpSet, TElement>()
195return CreateDelegate<Func<IEnumerable<TElement>, TFSharpSet>>(EnsureMemberExists(_fsharpSetCtor, "Microsoft.FSharp.Collections.SetModule.OfSeq<T>(IEnumerable<T> source)").MakeGenericMethod(typeof(TElement)));
200public Func<IEnumerable<Tuple<TKey, TValue>>, TFSharpMap> CreateFSharpMapConstructor<TFSharpMap, TKey, TValue>()
203return CreateDelegate<Func<IEnumerable<Tuple<TKey, TValue>>, TFSharpMap>>(EnsureMemberExists(_fsharpMapCtor, "Microsoft.FSharp.Collections.MapModule.OfSeq<TKey, TValue>(IEnumerable<Tuple<TKey, TValue>> source)").MakeGenericMethod(typeof(TKey), typeof(TValue)));
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (10)
71public override Func<object[], T> CreateParameterizedConstructor<T>(ConstructorInfo constructor) =>
72CreateDelegate<Func<object[], T>>(CreateParameterizedConstructor(constructor));
182public override Func<IEnumerable<TElement>, TCollection> CreateImmutableEnumerableCreateRangeDelegate<TCollection, TElement>() =>
183CreateDelegate<Func<IEnumerable<TElement>, TCollection>>(
206public override Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection> CreateImmutableDictionaryCreateRangeDelegate<TCollection, TKey, TValue>() =>
207CreateDelegate<Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection>>(
230public override Func<object, TProperty> CreatePropertyGetter<TProperty>(PropertyInfo propertyInfo) =>
231CreateDelegate<Func<object, TProperty>>(CreatePropertyGetter(propertyInfo, typeof(TProperty)));
314public override Func<object, TProperty> CreateFieldGetter<TProperty>(FieldInfo fieldInfo) =>
315CreateDelegate<Func<object, TProperty>>(CreateFieldGetter(fieldInfo, typeof(TProperty)));
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (9)
39public override Func<object[], T> CreateParameterizedConstructor<T>(ConstructorInfo constructor)
129public override Func<IEnumerable<TElement>, TCollection> CreateImmutableEnumerableCreateRangeDelegate<TCollection, TElement>()
132return (Func<IEnumerable<TElement>, TCollection>)createRange.CreateDelegate(
133typeof(Func<IEnumerable<TElement>, TCollection>));
136public override Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection> CreateImmutableDictionaryCreateRangeDelegate<TCollection, TKey, TValue>()
139return (Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection>)createRange.CreateDelegate(
140typeof(Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection>));
143public override Func<object, TProperty> CreatePropertyGetter<TProperty>(PropertyInfo propertyInfo)
163public override Func<object, TProperty> CreateFieldGetter<TProperty>(FieldInfo fieldInfo) =>
System.Text.Json.SourceGeneration (2)
System.Text.RegularExpressions (1)
System.Text.RegularExpressions.Generator (1)
System.Threading.RateLimiting (14)
System.Threading.Tasks.Dataflow (40)
Blocks\TransformBlock.cs (14)
20/// <summary>Provides a dataflow block that invokes a provided <see cref="System.Func{TInput,TOutput}"/> delegate for every data element received.</summary>
44/// <summary>Initializes the <see cref="TransformBlock{TInput,TOutput}"/> with the specified <see cref="System.Func{TInput,TOutput}"/>.</summary>
47public TransformBlock(Func<TInput, TOutput> transform) :
52/// Initializes the <see cref="TransformBlock{TInput,TOutput}"/> with the specified <see cref="System.Func{TInput,TOutput}"/> and
59public TransformBlock(Func<TInput, TOutput> transform, ExecutionDataflowBlockOptions dataflowBlockOptions) :
63/// <summary>Initializes the <see cref="TransformBlock{TInput,TOutput}"/> with the specified <see cref="System.Func{TInput,TOutput}"/>.</summary>
66public TransformBlock(Func<TInput, Task<TOutput>> transform) :
71/// Initializes the <see cref="TransformBlock{TInput,TOutput}"/> with the specified <see cref="System.Func{TInput,TOutput}"/>
78public TransformBlock(Func<TInput, Task<TOutput>> transform, ExecutionDataflowBlockOptions dataflowBlockOptions) :
83/// Initializes the <see cref="TransformBlock{TInput,TOutput}"/> with the specified <see cref="System.Func{TInput,TOutput}"/>
91private TransformBlock(Func<TInput, TOutput>? transformSync, Func<TInput, Task<TOutput>>? transformAsync, ExecutionDataflowBlockOptions dataflowBlockOptions)
171private void ProcessMessage(Func<TInput, TOutput> transform, KeyValuePair<TInput, long> messageWithId)
223private void ProcessMessageWithTask(Func<TInput, Task<TOutput>> transform, KeyValuePair<TInput, long> messageWithId)
Blocks\TransformManyBlock.cs (7)
22/// <summary>Provides a dataflow block that invokes a provided <see cref="System.Func{T,TResult}"/> delegate for every data element received.</summary>
55public TransformManyBlock(Func<TInput, IEnumerable<TOutput>> transform) :
68public TransformManyBlock(Func<TInput, IEnumerable<TOutput>> transform, ExecutionDataflowBlockOptions dataflowBlockOptions)
80public TransformManyBlock(Func<TInput, Task<IEnumerable<TOutput>>> transform) :
92public TransformManyBlock(Func<TInput, Task<IEnumerable<TOutput>>> transform, ExecutionDataflowBlockOptions dataflowBlockOptions)
170private void ProcessMessage(Func<TInput, IEnumerable<TOutput>> transformFunction, KeyValuePair<TInput, long> messageWithId)
195private void ProcessMessageWithTask(Func<TInput, Task<IEnumerable<TOutput>>> function, KeyValuePair<TInput, long> messageWithId)
System.Threading.Tasks.Parallel (8)
System\Threading\Tasks\Parallel.ForEachAsync.cs (8)
96Func<object, Task> taskBody = static async o =>
260Func<object, Task> taskBody = static async o =>
415Func<object, Task> taskBody = static async o =>
519private readonly Func<object, Task> _taskBody;
540protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body)
691IEnumerable<TSource> source, Func<object, Task> taskBody,
713IAsyncEnumerable<TSource> source, Func<object, Task> taskBody,
736T fromExclusive, T toExclusive, Func<object, Task> taskBody,
System.Windows.Controls.Ribbon (5)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (3)
541internal static bool NavigateToFirstItem(ItemsControl itemsControl, Action<int> bringIntoViewCallback, Func<FrameworkElement, bool> additionalCheck)
552internal static bool NavigateToLastItem(ItemsControl itemsControl, Action<int> bringIntoViewCallback, Func<FrameworkElement, bool> additionalCheck)
563internal static FrameworkElement FindContainer(ItemsControl itemsControl, int startIndex, int direction, Action<int> bringIntoViewCallback, Func<FrameworkElement, bool> additionalCheck)
System.Windows.Forms (32)
System.Windows.Forms.Primitives.TestUtilities (1)
System.Windows.Forms.Tests (42)
System.Windows.Forms.TestUtilities (9)
System.Windows.Forms.UI.IntegrationTests (5)
System.Xaml (15)
System\Xaml\XamlTypeName.cs (6)
150internal static string ConvertListToStringInternal(IList<XamlTypeName> typeNameList, Func<string, string> prefixGenerator)
157internal static void ConvertListToStringInternal(StringBuilder result, IList<XamlTypeName> typeNameList, Func<string, string> prefixGenerator)
175internal static XamlTypeName ParseInternal(string typeName, Func<string, string> prefixResolver, out string error)
188internal static IList<XamlTypeName> ParseListInternal(string typeNameList, Func<string, string> prefixResolver, out string error)
195internal string ConvertToStringInternal(Func<string, string> prefixGenerator)
202internal void ConvertToStringInternal(StringBuilder result, Func<string, string> prefixGenerator)
System.Xaml.Tests (23)
Templates.Blazor.Tests (1)
Test.Utilities (37)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
247public static TOperation? GetAncestor<TOperation>(this IOperation root, OperationKind ancestorKind, Func<TOperation, bool>? predicate = null)
282public static IOperation? GetAncestor(this IOperation root, ImmutableArray<OperationKind> ancestorKinds, Func<IOperation, bool>? predicate = null)
355public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate)
368public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate)
373public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(returnValue: true)] out IOperation? foundOperation)
725public static IOperation WalkDownConversion(this IOperation operation, Func<IConversionOperation, bool> predicate)
799public static bool HasAnyExplicitDescendant(this IOperation operation, Func<IOperation, bool>? descendIntoOperation = null)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (5)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty);
24private static readonly Func<IOperation, IOperation> TargetAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Target), fallbackResult: null!);
26private static readonly Func<IOperation, IMethodSymbol> GetFunctionPointerSignatureAccessor = CreateFunctionPointerSignatureAccessor(WrappedType);
28private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAccessor(Type? wrappedType)
44return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
TestProject.IntegrationServiceA (1)
Text.Analyzers (41)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
247public static TOperation? GetAncestor<TOperation>(this IOperation root, OperationKind ancestorKind, Func<TOperation, bool>? predicate = null)
282public static IOperation? GetAncestor(this IOperation root, ImmutableArray<OperationKind> ancestorKinds, Func<IOperation, bool>? predicate = null)
355public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate)
368public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate)
373public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(returnValue: true)] out IOperation? foundOperation)
725public static IOperation WalkDownConversion(this IOperation operation, Func<IConversionOperation, bool> predicate)
799public static bool HasAnyExplicitDescendant(this IOperation operation, Func<IOperation, bool>? descendIntoOperation = null)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (5)
23private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty);
24private static readonly Func<IOperation, IOperation> TargetAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Target), fallbackResult: null!);
26private static readonly Func<IOperation, IMethodSymbol> GetFunctionPointerSignatureAccessor = CreateFunctionPointerSignatureAccessor(WrappedType);
28private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAccessor(Type? wrappedType)
44return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (6)
46internal static Func<TOperation, TProperty> CreateOperationPropertyAccessor<TOperation, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
50internal static Func<TSyntax, TProperty> CreateSyntaxPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
54internal static Func<TSymbol, TProperty> CreateSymbolPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult)
58private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult)
77Expression<Func<T, TProperty>> expression = Expression.Lambda<Func<T, TProperty>>(result, parameter);
UnitTests.Common (1)
vbc (2)
VBCSCompiler (2)
VBCSCompiler.UnitTests (2)
WindowsBase.Tests (1)
WsFedSample (1)
xunit.assert (11)
Sdk\AssertHelper.cs (6)
63 static readonly ConcurrentDictionary<Type, Dictionary<string, Func<object?, object?>>> gettersByType = new ConcurrentDictionary<Type, Dictionary<string, Func<object?, object?>>>();
119 static Dictionary<string, Func<object?, object?>> GetGettersForType([DynamicallyAccessedMembers(
143 .Select(f => new { name = f.Name, getter = (Func<object?, object?>)f.GetValue });
161 .Select(p => new { name = p.Name, getter = (Func<object?, object?>)p.GetValue });
707 Func<object?, object?>? actualGetter;
xunit.console (5)