8255 references to Func
AnalyzerRunner (3)
Options.cs (3)
36internal readonly Func<string, bool> TestDocumentMatch; 89Func<string, bool> testDocumentMatch, 130Func<string, bool> testDocumentMatch = _ => true;
aspire (4)
Interaction\IInteractionService.cs (2)
13Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, CancellationToken cancellationToken = default); 14Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull;
Interaction\InteractionService.cs (2)
36public async Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, CancellationToken cancellationToken = default) 55public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
Aspire.Azure.Messaging.EventHubs.Tests (2)
tests\Aspire.Azure.Security.KeyVault.Tests\MockTransport.cs (2)
15private readonly Func<HttpMessage, MockResponse> _responseFactory; 31public MockTransport(Func<MockRequest, MockResponse> responseFactory)
Aspire.Azure.Security.KeyVault.Tests (2)
MockTransport.cs (2)
15private readonly Func<HttpMessage, MockResponse> _responseFactory; 31public MockTransport(Func<MockRequest, MockResponse> responseFactory)
Aspire.Cli.Tests (26)
Commands\AddCommandTests.cs (2)
484public Func<IEnumerable<(string FriendlyName, NuGetPackage Package)>, (string FriendlyName, NuGetPackage Package)>? PromptForIntegrationCallback { get; set; } 485public Func<IEnumerable<(string FriendlyName, NuGetPackage Package)>, (string FriendlyName, NuGetPackage Package)>? PromptForIntegrationVersionCallback { get; set; }
Commands\NewCommandTests.cs (4)
423public Func<IEnumerable<NuGetPackage>, NuGetPackage>? PromptForTemplatesVersionCallback { get; set; } 424public Func<(string TemplateName, string TemplateDescription, string? PathAppendage)[], (string TemplateName, string TemplateDescription, string? PathAppendage)>? PromptForTemplateCallback { get; set; } 425public Func<string, string>? PromptForProjectNameCallback { get; set; } 426public Func<string, string>? PromptForOutputPathCallback { get; set; }
Commands\PublishCommandTests.cs (1)
228public Func<IEnumerable<string>, string>? PromptForPublisherCallback { get; set; }
Commands\RunCommandTests.cs (3)
132var backchannelFactory = (IServiceProvider sp) => { 140var runnerFactory = (IServiceProvider sp) => { 168var projectLocatorFactory = (IServiceProvider sp) => new TestProjectLocator();
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)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\Shared\PropertyFetcher.AOT.cs (3)
186private readonly Func<TDeclaredObject, T> propertyFetch; 192this.propertyFetch = (Func<TDeclaredObject, T>)property.GetMethod!.CreateDelegate(typeof(Func<TDeclaredObject, T>));
Aspire.Dashboard (33)
Components\Controls\PropertyGrid.razor.cs (1)
95public Func<TItem, object?> ItemKey { get; init; } = static item => item.Key;
Components\Controls\StructuredLogDetails.razor.cs (1)
104private static void MoveAttributes(List<TelemetryPropertyViewModel> source, List<TelemetryPropertyViewModel> destination, Func<TelemetryPropertyViewModel, bool> predicate)
Components\Pages\Resources.razor.cs (3)
292bool UpdateFromResource(ResourceViewModel resource, Func<string, bool> resourceTypeVisible, Func<string, bool> stateVisible, Func<string, bool> healthStatusVisible)
ConsoleLogs\LogParser.cs (1)
40Func<string, string> callback = (s) =>
ConsoleLogs\UrlParser.cs (2)
16public static bool TryParse(string? text, Func<string, string>? nonMatchFragmentCallback, [NotNullWhen(true)] out string? modifiedText) 57static void AppendNonMatchFragment(StringBuilder stringBuilder, Func<string, string>? nonMatchFragmentCallback, string text)
Extensions\ComponentExtensions.cs (1)
18public static async Task ExecuteOnDefault<T>(this FluentDataGridRow<T> row, Func<T, Task> call)
Model\DashboardCommandExecutor.cs (2)
33public async Task ExecuteAsync(ResourceViewModel resource, CommandViewModel command, Func<ResourceViewModel, string> getResourceName) 78public async Task ExecuteAsyncCore(ResourceViewModel resource, CommandViewModel command, Func<ResourceViewModel, string> getResourceName)
Model\DebugSessionHelpers.cs (1)
13public static HttpClient CreateHttpClient(Uri debugSessionUri, string token, X509Certificate2? cert, Func<HttpClientHandler, HttpMessageHandler>? createHandler)
Model\MetricsHelpers.cs (1)
22Func<Func<Task>, Task> dispatcher,
Model\Otlp\SpanWaterfallViewModel.cs (1)
48public bool MatchesFilter(string filter, Func<OtlpApplicationView, string> getResourceName, [NotNullWhen(true)] out IEnumerable<SpanWaterfallViewModel>? matchedDescendents)
Model\ResourceGridViewModel.cs (1)
36public static List<ResourceGridViewModel> OrderNestedResources(List<ResourceGridViewModel> initialGridVMs, Func<ResourceViewModel, bool> isCollapsed)
Model\ResourceMenuItems.cs (3)
28Func<ResourceViewModel, string> getResourceName, 31Func<string?, Task> onViewDetails, 32Func<CommandViewModel, Task> commandSelected,
Model\ResourceOutgoingPeerResolver.cs (2)
117foreach (var transformer in s_addressTransformers) 154private static readonly List<Func<string, string>> s_addressTransformers = [
Model\ResourceViewModel.cs (1)
312public sealed record KnownProperty(string Key, Func<IStringLocalizer<Resources.Resources>, string> GetDisplayName);
Model\TraceHelpers.cs (2)
19var orderByFunc = static (OtlpSpan s) => s.StartTime; 28static void Visit(OtlpSpanCollection allSpans, OtlpSpan span, Func<OtlpSpan, TState, TState> spanAction, TState state, Func<OtlpSpan, DateTime> orderByFunc)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (1)
175Func<ReadOnlySequence<byte>, T> exporter)
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)
Otlp\Storage\TelemetryRepository.cs (1)
573var copyFunc = static (OtlpTrace t) => OtlpTrace.Clone(t);
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)
Telemetry\IDashboardTelemetrySender.cs (1)
12public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc);
Utils\FilterHelpers.cs (1)
25Func<TelemetryFilter, Task> openFilterAsync,
Aspire.Dashboard.Components.Tests (13)
Shared\TestDashboardClient.cs (2)
13private readonly Func<string, Channel<IReadOnlyList<ResourceLogLine>>>? _consoleLogsChannelProvider; 24Func<string, Channel<IReadOnlyList<ResourceLogLine>>>? consoleLogsChannelProvider = null,
Shared\TestLocalStorage.cs (1)
10public Func<string, (bool Success, object? Value)>? OnGetUnprotectedAsync { get; set; }
Shared\TestSessionStorage.cs (1)
10public Func<string, (bool Success, object? Value)>? OnGetAsync { get; set; }
tests\Shared\Logging\ITestSink.cs (2)
14Func<WriteContext, bool>? WriteEnabled { get; set; } 16Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
tests\Shared\Logging\TestLogger.cs (2)
11private readonly Func<LogLevel, bool> _filter; 18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
tests\Shared\Logging\TestSink.cs (4)
14Func<WriteContext, bool>? writeEnabled = null, 15Func<BeginScopeContext, bool>? beginEnabled = null) 24public Func<WriteContext, bool>? WriteEnabled { get; set; } 26public Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
tests\Shared\TestDashboardTelemetrySender.cs (1)
21public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc)
Aspire.Dashboard.Tests (15)
Integration\Playwright\Infrastructure\PlaywrightTestsBase.cs (1)
23public async Task RunTestAsync(Func<IPage, Task> test)
Integration\ServerRetryHelper.cs (2)
18public static Task BindPortWithRetry(Func<int, Task> retryFunc, ILogger logger) 26public static async Task BindPortsWithRetry(Func<List<int>, Task> retryFunc, ILogger logger, int portCount)
LocalBrowserStorageTests.cs (1)
131public Func<(string Identifier, object?[]? Args), object?>? OnInvoke { get; set; }
TelemetryRepositoryTests\TraceTests.cs (2)
1934private readonly Func<KeyValuePair<string, string>[], (string? Name, ResourceViewModel? Resource)>? _onResolve; 1937public TestOutgoingPeerResolver(Func<KeyValuePair<string, string>[], (string? Name, ResourceViewModel? Resource)>? onResolve = null)
tests\Shared\Logging\ITestSink.cs (2)
14Func<WriteContext, bool>? WriteEnabled { get; set; } 16Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
tests\Shared\Logging\TestLogger.cs (2)
11private readonly Func<LogLevel, bool> _filter; 18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
tests\Shared\Logging\TestSink.cs (4)
14Func<WriteContext, bool>? writeEnabled = null, 15Func<BeginScopeContext, bool>? beginEnabled = null) 24public Func<WriteContext, bool>? WriteEnabled { get; set; } 26public Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
tests\Shared\TestDashboardTelemetrySender.cs (1)
21public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc)
Aspire.Hosting (58)
ApplicationModel\CommandLineArgsCallbackAnnotation.cs (2)
18public CommandLineArgsCallbackAnnotation(Func<CommandLineArgsCallbackContext, Task> callback) 43public Func<CommandLineArgsCallbackContext, Task> Callback { get; }
ApplicationModel\CommandOptions.cs (2)
7/// Optional configuration for resource commands added with <see cref="ResourceBuilderExtensions.WithCommand{T}(Aspire.Hosting.ApplicationModel.IResourceBuilder{T}, string, string, Func{Aspire.Hosting.ApplicationModel.ExecuteCommandContext, Task{Aspire.Hosting.ApplicationModel.ExecuteCommandResult}}, Aspire.Hosting.ApplicationModel.CommandOptions?)"/>. 50public Func<UpdateCommandStateContext, ResourceCommandState>? UpdateState { get; set; }
ApplicationModel\ContainerRuntimeArgsCallbackAnnotation.cs (2)
18public ContainerRuntimeArgsCallbackAnnotation(Func<ContainerRuntimeArgsCallbackContext, Task> callback) 43public Func<ContainerRuntimeArgsCallbackContext, Task> Callback { get; }
ApplicationModel\EndpointEnvironmentInjectionFilterAnnotation.cs (2)
9internal class EndpointEnvironmentInjectionFilterAnnotation(Func<EndpointAnnotation, bool> filter) : IResourceAnnotation 11public Func<EndpointAnnotation, bool> Filter { get; } = filter;
ApplicationModel\EnvironmentCallbackAnnotation.cs (2)
68public EnvironmentCallbackAnnotation(Func<EnvironmentCallbackContext, Task> callback) 78public Func<EnvironmentCallbackContext, Task> Callback { get; private set; }
ApplicationModel\HttpCommandOptions.cs (2)
31public Func<HttpCommandRequestContext, Task>? PrepareRequest { get; set; } 36public Func<HttpCommandResultContext, Task<ExecuteCommandResult>>? GetCommandResult { get; set; }
ApplicationModel\ManifestPublishingCallbackAnnotation.cs (2)
33public ManifestPublishingCallbackAnnotation(Func<ManifestPublishingContext, Task>? callback) 41public Func<ManifestPublishingContext, Task>? Callback { get; }
ApplicationModel\ParameterResource.cs (2)
13private readonly Func<ParameterDefault?, string> _valueGetter; 22public ParameterResource(string name, Func<ParameterDefault?, string> callback, bool secret = false) : base(name)
ApplicationModel\ResourceCommandAnnotation.cs (4)
20Func<UpdateCommandStateContext, ResourceCommandState> updateState, 21Func<ExecuteCommandContext, Task<ExecuteCommandResult>> executeCommand, 60public Func<UpdateCommandStateContext, ResourceCommandState> UpdateState { get; } 66public Func<ExecuteCommandContext, Task<ExecuteCommandResult>> ExecuteCommand { get; }
ApplicationModel\ResourceLoggerService.cs (1)
295private static async IAsyncEnumerable<IReadOnlyList<LogLine>> CombineMultipleAsync(string[] resourceNames, Func<string, IAsyncEnumerable<IReadOnlyList<LogLine>>> fetch)
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)
ApplicationModel\ResourceUrlsCallbackAnnotation.cs (2)
30public ResourceUrlsCallbackAnnotation(Func<ResourceUrlsCallbackContext, Task> callback) 40public Func<ResourceUrlsCallbackContext, Task> Callback { get; private set; }
Cli\CliOrphanDetector.cs (1)
12internal Func<int, bool> IsProcessRunning { get; set; } = (int pid) =>
ConnectionStringParameterResource.cs (1)
12public ConnectionStringParameterResource(string name, Func<ParameterDefault?, string> callback, string? environmentVariableName) : base(name, callback, secret: true)
ContainerResourceBuilderExtensions.cs (2)
365/// This is intended to pass additional arguments to the underlying container runtime run command to enable advanced features such as exposing GPUs to the container. To pass runtime arguments to the actual container, use the <see cref="ResourceBuilderExtensions.WithArgs{T}(IResourceBuilder{T}, Func{CommandLineArgsCallbackContext, Task})"/> method. 371public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Func<ContainerRuntimeArgsCallbackContext, Task> callback) where T : ContainerResource
Dashboard\DashboardService.cs (1)
181private async Task ExecuteAsync(Func<CancellationToken, Task> execute, ServerCallContext serverCallContext)
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))
Dcp\KubernetesService.cs (5)
410Func<DcpKubernetesClient, TResult> operation, 411Func<Exception, bool> isRetryable, 425Func<DcpKubernetesClient, Task<TResult>> operation, 426Func<Exception, bool> isRetryable, 458Func<Exception, bool> isRetryable)
Lifecycle\LifecycleHookServiceCollectionExtensions.cs (2)
40public static void AddLifecycleHook<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, IDistributedApplicationLifecycleHook 51public static void TryAddLifecycleHook<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, IDistributedApplicationLifecycleHook
LinqExtensions.cs (1)
8public static (int index, T value) IndexOf<T>(this IEnumerable<T> source, Func<T, bool> predicate)
Orchestrator\ApplicationOrchestrator.cs (1)
143static Task PublishUpdateAsync(ResourceNotificationService notificationService, IResource resource, string? resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
ProjectResourceBuilderExtensions.cs (1)
646this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\NullPublishingActivityProgressReporter.cs (1)
39public Task UpdateActivityStatusAsync(PublishingActivity publishingActivity, Func<PublishingActivityStatus, PublishingActivityStatus> statusUpdate, CancellationToken cancellationToken)
Publishing\PublishingActivityProgressReporter.cs (2)
99Task UpdateActivityStatusAsync(PublishingActivity publishingActivity, Func<PublishingActivityStatus, PublishingActivityStatus> statusUpdate, CancellationToken cancellationToken); 123public async Task UpdateActivityStatusAsync(PublishingActivity publishingActivity, Func<PublishingActivityStatus, PublishingActivityStatus> statusUpdate, CancellationToken cancellationToken)
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)
Infrastructure\BoundedCacheWithFactory.cs (1)
27public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
Aspire.Hosting.Azure (3)
AzureProvisioningResource.cs (1)
121public static T CreateExistingOrNewProvisionableResource<T>(AzureResourceInfrastructure infrastructure, Func<string, BicepValue<string>, T> createExisting, Func<AzureResourceInfrastructure, T> createNew)
Provisioning\Provisioners\AzureProvisioner.cs (1)
65async Task UpdateStateAsync((IResource Resource, IAzureResource AzureResource) resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
Provisioning\Provisioners\BicepProvisioner.cs (1)
372private static string? FindFullPathFromPath(string command, string? pathVariable, char pathSeparator, Func<string, bool> fileExists)
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)
AzureContainerAppsInfrastructure.cs (1)
71static void SetKnownParameterValue(AzureBicepResource r, string key, Func<AzureBicepResource, object> factory)
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)
AzureBicepResourceTests.cs (6)
41public static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> AzureExtensions => 44private static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> CreateAllAzureExtensions(string resourceName) 83public void AzureExtensionsAutomaticallyAddAzureProvisioning(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource) 95public void BicepResourcesAreIdempotent(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource) 111public static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> AzureExtensionsWithHyphen => 116public void AzureResourcesProduceValidBicep(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource)
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)
tests\Shared\Logging\ITestSink.cs (2)
14Func<WriteContext, bool>? WriteEnabled { get; set; } 16Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
tests\Shared\Logging\TestLogger.cs (2)
11private readonly Func<LogLevel, bool> _filter; 18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
tests\Shared\Logging\TestSink.cs (4)
14Func<WriteContext, bool>? writeEnabled = null, 15Func<BeginScopeContext, bool>? beginEnabled = null) 24public Func<WriteContext, bool>? WriteEnabled { get; set; } 26public Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
Aspire.Hosting.Tests (17)
DistributedApplicationTests.cs (2)
301var callback1 = (IServiceProvider sp) => new DummyLifecycleHook(); 304var callback2 = (IServiceProvider sp) => new DummyLifecycleHook();
Helpers\DashboardServiceDataExtensions.cs (2)
11public static async Task<ResourceSnapshot> WaitForResourceAsync(this DashboardServiceData dashboardServiceData, string resourceName, Func<ResourceSnapshot, bool> predicate, CancellationToken cancellationToken = default) 30private static bool TryFindMatch(IEnumerable<ResourceSnapshot> resources, string resourceName, Func<ResourceSnapshot, bool> predicate, [NotNullWhen(true)] out ResourceSnapshot? match)
Helpers\KubernetesHelper.cs (2)
13public static async Task<T> GetResourceByNameAsync<T>(IKubernetesService kubernetes, string resourceName, string resourceNameSuffix, Func<T, bool> ready, CancellationToken cancellationToken = default) where T : CustomResource 28public static async Task<T> GetResourceByNameMatchAsync<T>(IKubernetesService kubernetes, string resourceNamePattern, Func<T, bool> ready, CancellationToken cancellationToken = default) where T : CustomResource
tests\Shared\Logging\ITestSink.cs (2)
14Func<WriteContext, bool>? WriteEnabled { get; set; } 16Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
tests\Shared\Logging\TestLogger.cs (2)
11private readonly Func<LogLevel, bool> _filter; 18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
tests\Shared\Logging\TestSink.cs (4)
14Func<WriteContext, bool>? writeEnabled = null, 15Func<BeginScopeContext, bool>? beginEnabled = null) 24public Func<WriteContext, bool>? WriteEnabled { get; set; } 26public Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
Utils\TestConsoleLogsService.cs (2)
12private readonly Func<string, Channel<IReadOnlyList<LogEntry>>>? _getConsoleLogsChannel; 14public TestConsoleLogsService(Func<string, Channel<IReadOnlyList<LogEntry>>>? getConsoleLogsChannel = null)
WithUrlsTests.cs (1)
21Func<ResourceUrlsCallbackContext, Task> callback = c => Task.CompletedTask;
Aspire.Microsoft.Data.SqlClient (8)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceSubscriber.cs (4)
14private readonly Func<string, ListenerHandler> handlerFactory; 15private readonly Func<DiagnosticListener, bool> diagnosticSourceFilter; 30Func<string, ListenerHandler> handlerFactory, 31Func<DiagnosticListener, bool> diagnosticSourceFilter,
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (3)
182private readonly Func<TDeclaredObject, T> propertyFetch; 188this.propertyFetch = (Func<TDeclaredObject, T>)property.GetMethod!.CreateDelegate(typeof(Func<TDeclaredObject, T>));
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientTraceInstrumentationOptions.cs (1)
158public Func<object, bool> Filter { get; set; }
Aspire.Microsoft.EntityFrameworkCore.SqlServer (8)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceSubscriber.cs (4)
14private readonly Func<string, ListenerHandler> handlerFactory; 15private readonly Func<DiagnosticListener, bool> diagnosticSourceFilter; 30Func<string, ListenerHandler> handlerFactory, 31Func<DiagnosticListener, bool> diagnosticSourceFilter,
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (3)
182private readonly Func<TDeclaredObject, T> propertyFetch; 188this.propertyFetch = (Func<TDeclaredObject, T>)property.GetMethod!.CreateDelegate(typeof(Func<TDeclaredObject, T>));
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientTraceInstrumentationOptions.cs (1)
158public Func<object, bool> Filter { get; set; }
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)
NatsClientPublicApiTests.cs (4)
26Func<NatsOpts, NatsOpts>? configureOptions = null; 62Func<NatsOpts, NatsOpts>? configureOptions = null; 94Func<NatsOpts, NatsOpts>? configureOptions = null; 130Func<NatsOpts, NatsOpts>? configureOptions = null;
Aspire.Playground.Tests (11)
Infrastructure\DistributedApplicationExtensions.cs (1)
150static void AssertDoesNotContain(IReadOnlyList<FakeLogRecord> logs, Func<FakeLogRecord, bool> predicate)
tests\Aspire.TestUtilities\FileUtil.cs (2)
12private static string? FindFullPathFromPath(string command, string? pathVariable, char pathSeparator, Func<string, bool> fileExists) 40private static string? FindFullPath(string command, string? pathVariable, char pathSeparator, Func<string, bool> fileExists)
tests\Shared\Logging\ITestSink.cs (2)
14Func<WriteContext, bool>? WriteEnabled { get; set; } 16Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
tests\Shared\Logging\TestLogger.cs (2)
11private readonly Func<LogLevel, bool> _filter; 18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
tests\Shared\Logging\TestSink.cs (4)
14Func<WriteContext, bool>? writeEnabled = null, 15Func<BeginScopeContext, bool>? beginEnabled = null) 24public Func<WriteContext, bool>? WriteEnabled { get; set; } 26public Func<BeginScopeContext, bool>? BeginEnabled { get; set; }
Aspire.StackExchange.Redis (9)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (6)
19private static readonly Lazy<Func<object, (string?, string?)>> MessageDataGetter = new(() => 24var messageDelegate = CreateFieldGetter<object>(profiledCommandType, "Message", BindingFlags.NonPublic | BindingFlags.Instance); 25var scriptDelegate = CreateFieldGetter<string>(scriptMessageType, "script", BindingFlags.NonPublic | BindingFlags.Instance); 194private static Func<object, TField?>? CreateFieldGetter<TField>( 220return (Func<object, TField>)getterMethod.CreateDelegate(typeof(Func<object, TField>));
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\PropertyFetcher.AOT.cs (3)
188private readonly Func<TDeclaredObject, T> propertyFetch; 194this.propertyFetch = (Func<TDeclaredObject, T>)property.GetMethod!.CreateDelegate(typeof(Func<TDeclaredObject, T>));
Aspire.Templates.Tests (1)
TemplateTestsBase.cs (1)
54Func<AspireProject, Task>? onBuildAspireProject = null,
Aspire.TestUtilities (2)
FileUtil.cs (2)
12private static string? FindFullPathFromPath(string command, string? pathVariable, char pathSeparator, Func<string, bool> fileExists) 40private static string? FindFullPath(string command, string? pathVariable, char pathSeparator, Func<string, bool> fileExists)
BasicWebSite (2)
ValueProviders\CustomValueProviderFactory.cs (2)
19private static readonly Dictionary<string, Func<ValueProviderFactoryContext, StringValues>> Values = new() 38if (Values.TryGetValue(key, out var fn))
BoundTreeGenerator (4)
BoundNodeClassWriter.cs (4)
354private void SeparatedList<T>(string separator, IEnumerable<T> items, Func<T, string> func) 366private void Comma<T>(IEnumerable<T> items, Func<T, string> func) 371private void Or<T>(IEnumerable<T> items, Func<T, string> func) 388private void ParenList<T>(IEnumerable<T> items, Func<T, string> func)
BuildBoss (1)
CompilerNuGetCheckerUtil.cs (1)
231Func<string, bool> excludeFunc,
CodeGenerator (2)
FeatureCollectionGenerator.cs (1)
214static string Each<T>(IEnumerable<T> values, Func<T, string> formatter)
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
308static string Each<T>(IEnumerable<T> values, Func<T, string> formatter)
csc (2)
src\Compilers\Core\CommandLine\ConsoleUtil.cs (2)
20internal static T RunWithUtf8Output<T>(Func<TextWriter, T> func) 41internal static T RunWithUtf8Output<T>(bool utf8Output, TextWriter textWriter, Func<TextWriter, T> func)
CustomEncryptorSample (1)
CustomBuilderExtensions.cs (1)
16Func<IServiceProvider, IXmlEncryptor> factory)
dotnet-svcutil-lib (10)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (4)
1046private static Func<object, string> s_serializeFunc; 1047private static Func<string, object> s_deserializeFunc; 1060internal static void SetScriptObjectJsonSerializer(Type typeOfScriptObject, Func<object, string> serializeFunc, Func<string, object> deserializeFunc)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\AsyncResult.cs (2)
25private Func<IAsyncResult, bool> _checkSyncValidationFunc; 250protected void SetCheckSyncValidationFunc(Func<IAsyncResult, bool> checkSyncValidationFunc)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\KeyInfoSerializer.cs (1)
52Func<KeyInfoSerializer, IEnumerable<SerializerEntries>> additionalEntries)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSKeyInfoSerializer.cs (1)
16private static Func<KeyInfoSerializer, IEnumerable<SecurityTokenSerializer.SerializerEntries>> CreateAdditionalEntries(SecurityVersion securityVersion, SecureConversationVersion secureConversationVersion)
Metadata\ServiceDescriptor.cs (1)
93public async Task ImportMetadataAsync(Action<WsdlImporter> onWsdlImporterCreated, Action<ServiceDescriptor> onBeforeMetadataImport, Func<ServiceDescriptor, bool> onAfterMetadataImport, CancellationToken cancellationToken)
Shared\Utilities\PathHelper.cs (1)
238private static async Task<string> TryFindItemAsync(Func<string, IEnumerable<string>> EnumerateItems, string itemName, string workingDir, ILogger logger, CancellationToken cancellationToken)
GenerateDocumentationAndConfigFiles (3)
Program.cs (1)
1043Func<DiagnosticSeverity?, string> getSeverityString,
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
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);
Commands\GetDocumentCommandWorker.cs (1)
97var factory = HostFactoryResolver.ResolveHostFactory(assembly,
http2cat (5)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
HttpStress (3)
Program.cs (3)
115Func<ClientContext, Task> TestAbort(string path) 168var clientOperations = new (string, Func<ClientContext, Task>)[] 586(string operation, Func<ClientContext, Task> func) = clientOperations[opIndex];
IIS.FunctionalTests (7)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (2)
105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
IIS.LongTests (15)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (2)
105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
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>>();
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
IIS.NewHandler.FunctionalTests (15)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (2)
105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
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>>();
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
IIS.NewShim.FunctionalTests (15)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (2)
105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
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>>();
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
IIS.ShadowCopy.Tests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (2)
105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
IISExpress.FunctionalTests (15)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (2)
105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
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>>();
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
illink (18)
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)
src\Servers\Kestrel\shared\Http2HeadersEnumerator.cs (1)
40public Func<string, Encoding?> EncodingSelector { get; set; } = KestrelServerOptions.DefaultHeaderEncodingSelector;
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
85internal Func<TestStreamContext, Http3ControlStream> OnCreateServerControlStream { get; set; }
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
17public static async Task BindPortsWithRetry(Func<int, Task> retryFunc, ILogger logger)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
20private Func<LogMessage, bool> _messageFilter; 39public Task<LogMessage> WaitForMessage(Func<LogMessage, bool> messageFilter)
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
34public Task<LogMessage> WaitForLogMessage(Func<LogMessage, bool> messageFilter)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (1)
111Func<ListenOptions, Task> createBinding)
InteractiveHost32 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
54var invokeOnMainThread = new Func<Func<object>, object>(operation => control!.Invoke(operation));
InteractiveHost64 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
54var invokeOnMainThread = new Func<Func<object>, object>(operation => control!.Invoke(operation));
Interop.FunctionalTests (3)
Http3\Http3RequestTests.cs (1)
1914private async Task WaitForLogAsync(Func<IEnumerable<WriteContext>, bool> testLogs, string message)
HttpClientHttp2InteropTests.cs (1)
454private Func<string, Task> _sendContent;
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
17public static async Task BindPortsWithRetry(Func<int, Task> retryFunc, ILogger logger)
InteropClient (1)
AsyncStreamExtensions.cs (1)
31public static async Task ForEachAsync<T>(this IAsyncStreamReader<T> streamReader, Func<T, Task> asyncAction)
InteropWebsite (1)
AsyncStreamExtensions.cs (1)
29public static async Task ForEachAsync<T>(this IAsyncStreamReader<T> streamReader, Func<T, Task> asyncAction)
Metrics (41)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132private static int CalculateDepthOfInheritance(INamedTypeSymbol namedType, Func<INamedTypeSymbol, bool> isExcludedFromInheritanceCount)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
17private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 20Func<INamedTypeSymbol, bool>? isExcludedFromInheritanceCountFunc = null) 34public Func<INamedTypeSymbol, bool> IsExcludedFromInheritanceCountFunc { get; }
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (2)
116private readonly Func<INamedTypeSymbol, bool> _isDisallowedCatchType; 122public DisallowGeneralCatchUnlessRethrowWalker(Func<INamedTypeSymbol, bool> isDisallowedCatchType, bool checkAnonymousFunctions)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
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\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
20private static readonly Func<IOperation, ImmutableArray<IOperation>> ElementsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Elements), fallbackResult: default);
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\IUtf8StringOperationWrapper.cs (1)
19private static readonly Func<IOperation, string> ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, string>(WrappedType, nameof(Value), fallbackResult: null!);
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\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
458Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, 473static bool TryParse(string s, (Compilation compilation, Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, string? namePrefix, string? optionForcedValue) arg, out SymbolNamesWithValueOption<TValue> option)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
Metrics.Legacy (41)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132private static int CalculateDepthOfInheritance(INamedTypeSymbol namedType, Func<INamedTypeSymbol, bool> isExcludedFromInheritanceCount)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
17private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 20Func<INamedTypeSymbol, bool>? isExcludedFromInheritanceCountFunc = null) 34public Func<INamedTypeSymbol, bool> IsExcludedFromInheritanceCountFunc { get; }
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (2)
116private readonly Func<INamedTypeSymbol, bool> _isDisallowedCatchType; 122public DisallowGeneralCatchUnlessRethrowWalker(Func<INamedTypeSymbol, bool> isDisallowedCatchType, bool checkAnonymousFunctions)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
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\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
20private static readonly Func<IOperation, ImmutableArray<IOperation>> ElementsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Elements), fallbackResult: default);
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\IUtf8StringOperationWrapper.cs (1)
19private static readonly Func<IOperation, string> ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, string>(WrappedType, nameof(Value), fallbackResult: null!);
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\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
458Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, 473static bool TryParse(string s, (Compilation compilation, Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, string? namePrefix, string? optionForcedValue) arg, out SymbolNamesWithValueOption<TValue> option)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
Microsoft.Arcade.Common (4)
ExponentialRetry.cs (2)
34public Task<bool> RunAsync(Func<int, Task<bool>> actionSuccessfulAsync) 40Func<int, Task<bool>> actionSuccessfulAsync,
IRetryHandler.cs (2)
13Func<int, Task<bool>> actionSuccessfulAsync); 16Func<int, Task<bool>> actionSuccessfulAsync,
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)
BootstrapHostBuilder.cs (1)
79public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
ConfigureHostBuilder.cs (1)
112public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
ConfigureWebHostBuilder.cs (1)
181IWebHostBuilder ISupportsStartup.UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
WebApplication.cs (1)
224public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware)
Microsoft.AspNetCore.App.Analyzers (6)
Infrastructure\VirtualChars\VirtualCharSequence.cs (5)
125public VirtualChar? FirstOrNull(Func<VirtualChar, bool> predicate) 138public VirtualChar? LastOrNull(Func<VirtualChar, bool> predicate) 152public bool Any(Func<VirtualChar, bool> predicate) 165public bool All(Func<VirtualChar, bool> predicate) 181public VirtualCharSequence SkipWhile(Func<VirtualChar, bool> predicate)
src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
30public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (1)
178private static V GetOrAdd<K, V>(IDictionary<K, V> dictionary, K key, Func<K, V> function)
Microsoft.AspNetCore.Authentication (4)
AuthenticationSchemeOptions.cs (1)
89public Func<HttpContext, string?>? ForwardDefaultSelector { get; set; }
Events\RemoteAuthenticationEvents.cs (3)
14public Func<AccessDeniedContext, Task> OnAccessDenied { get; set; } = context => Task.CompletedTask; 19public Func<RemoteFailureContext, Task> OnRemoteFailure { get; set; } = context => Task.CompletedTask; 24public Func<TicketReceivedContext, Task> OnTicketReceived { get; set; } = context => Task.CompletedTask;
Microsoft.AspNetCore.Authentication.BearerToken (1)
BearerTokenEvents.cs (1)
14public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask;
Microsoft.AspNetCore.Authentication.Certificate (3)
Events\CertificateAuthenticationEvents.cs (3)
16public Func<CertificateAuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 26public Func<CertificateValidatedContext, Task> OnCertificateValidated { get; set; } = context => Task.CompletedTask; 31public Func<CertificateChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask;
Microsoft.AspNetCore.Authentication.Cookies (11)
CookieAuthenticationEvents.cs (9)
17public Func<CookieValidatePrincipalContext, Task> OnValidatePrincipal { get; set; } = context => Task.CompletedTask; 22public Func<CookieSlidingExpirationContext, Task> OnCheckSlidingExpiration { get; set; } = context => Task.CompletedTask; 27public Func<CookieSigningInContext, Task> OnSigningIn { get; set; } = context => Task.CompletedTask; 32public Func<CookieSignedInContext, Task> OnSignedIn { get; set; } = context => Task.CompletedTask; 37public Func<CookieSigningOutContext, Task> OnSigningOut { get; set; } = context => Task.CompletedTask; 42public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToLogin { get; set; } = context => 59public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToAccessDenied { get; set; } = context => 76public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToLogout { get; set; } = context => 92public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToReturnUrl { get; set; } = context =>
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (2)
259Func<string, bool> rejectPredicate; 260Func<string, bool> predicate = value => keys.Any(k => value.StartsWith(k, StringComparison.OrdinalIgnoreCase));
Microsoft.AspNetCore.Authentication.Google (1)
GoogleHandler.cs (1)
91Func<T, string?> formatter,
Microsoft.AspNetCore.Authentication.JwtBearer (7)
JwtBearerConfigureOptions.cs (1)
16private static readonly Func<string, TimeSpan> _invariantTimeSpanParse = (string timespanString) => TimeSpan.Parse(timespanString, CultureInfo.InvariantCulture);
JwtBearerEvents.cs (5)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 19public Func<ForbiddenContext, Task> OnForbidden { get; set; } = context => Task.CompletedTask; 24public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 29public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => Task.CompletedTask; 34public Func<JwtBearerChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask;
src\Shared\StringHelpers.cs (1)
8public static T ParseValueOrDefault<T>(string? stringValue, Func<string, T> parser, T defaultValue)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
MicrosoftAccountHandler.cs (1)
105Func<T, string> formatter,
Microsoft.AspNetCore.Authentication.Negotiate (4)
Events\NegotiateEvents.cs (4)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 20public Func<LdapContext, Task> OnRetrieveLdapClaims { get; set; } = context => Task.CompletedTask; 25public Func<AuthenticatedContext, Task> OnAuthenticated { get; set; } = context => Task.CompletedTask; 30public Func<ChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask;
Microsoft.AspNetCore.Authentication.Negotiate.Test (2)
EventTests.cs (1)
478public void OnCompleted(Func<object, Task> callback, object state)
NegotiateHandlerTests.cs (1)
502public void OnCompleted(Func<object, Task> callback, object state)
Microsoft.AspNetCore.Authentication.OAuth (6)
ClaimActionCollectionMapExtensions.cs (2)
82public static void MapCustomJson(this ClaimActionCollection collection, string claimType, Func<JsonElement, string?> resolver) 97public static void MapCustomJson(this ClaimActionCollection collection, string claimType, string valueType, Func<JsonElement, string?> resolver)
CustomJsonClaimAction.cs (2)
20public CustomJsonClaimAction(string claimType, string valueType, Func<JsonElement, string?> resolver) 29public Func<JsonElement, string?> Resolver { get; }
Events\OAuthEvents.cs (2)
14public Func<OAuthCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => Task.CompletedTask; 19public Func<RedirectContext<OAuthOptions>, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context =>
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;
OpenIdConnectConfigureOptions.cs (2)
15private static readonly Func<string, TimeSpan> _invariantTimeSpanParse = (string timespanString) => TimeSpan.Parse(timespanString, CultureInfo.InvariantCulture); 16private static readonly Func<string, TimeSpan?> _invariantNullableTimeSpanParse = (string timespanString) => TimeSpan.Parse(timespanString, CultureInfo.InvariantCulture);
src\Shared\StringHelpers.cs (1)
8public static T ParseValueOrDefault<T>(string? stringValue, Func<string, T> parser, T defaultValue)
Microsoft.AspNetCore.Authentication.Test (12)
CertificateTests.cs (1)
790Func<HttpContext, bool> handler = null,
CookieTests.cs (2)
1793private Task<IHost> CreateHost(Action<CookieAuthenticationOptions> configureOptions, Func<HttpContext, Task> testpath = null, Uri baseAddress = null, bool claimsTransform = false) 1807private static async Task<IHost> CreateHostWithServices(Action<IServiceCollection> configureServices, Func<HttpContext, Task> testpath = null, Uri baseAddress = null)
FacebookTests.cs (1)
455private static async Task<IHost> CreateHost(Action<IApplicationBuilder> configure, Action<IServiceCollection> configureServices, Func<HttpContext, Task<bool>> handler)
GoogleTests.cs (1)
1144private static async Task<IHost> CreateHost(Action<GoogleOptions> configureOptions, Func<HttpContext, Task> testpath = null)
OAuthTests.cs (1)
511private static async Task<IHost> CreateHost(Action<IServiceCollection> configureServices, Func<HttpContext, Task<bool>> handler = null)
OpenIdConnect\TestServerBuilder.cs (1)
61Func<HttpContext, Task> handler,
OpenIdConnect\TestSettings.cs (1)
47public TestServer CreateTestServer(AuthenticationProperties properties = null, Func<HttpContext, Task> handler = null) => TestServerBuilder.CreateServer(_configureOptions, handler: handler, properties: properties);
RemoteAuthenticationTests.cs (2)
18private Task<IHost> CreateHost(Action<TOptions> configureOptions, Func<HttpContext, Task> testpath = null, bool isDefault = true) 34protected virtual async Task<IHost> CreateHostWithServices(Action<IServiceCollection> configureServices, Func<HttpContext, Task> testpath = null)
TestHttpMessageHandler.cs (1)
10public Func<HttpRequestMessage, HttpResponseMessage> Sender { get; set; }
TwitterTests.cs (1)
535private static async Task<IHost> CreateHost(Action<TwitterOptions> options, Func<HttpContext, Task<bool>> handler = null)
Microsoft.AspNetCore.Authentication.Twitter (2)
TwitterEvents.cs (2)
14public Func<TwitterCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => Task.CompletedTask; 19public Func<RedirectContext<TwitterOptions>, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context =>
Microsoft.AspNetCore.Authentication.WsFederation (6)
WsFederationEvents.cs (6)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 19public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 24public Func<RedirectContext, Task> OnRedirectToIdentityProvider { get; set; } = context => Task.CompletedTask; 29public Func<RemoteSignOutContext, Task> OnRemoteSignOut { get; set; } = context => Task.CompletedTask; 34public Func<SecurityTokenReceivedContext, Task> OnSecurityTokenReceived { get; set; } = context => Task.CompletedTask; 39public Func<SecurityTokenValidatedContext, Task> OnSecurityTokenValidated { get; set; } = context => Task.CompletedTask;
Microsoft.AspNetCore.Authorization (5)
AssertionRequirement.cs (3)
19public Func<AuthorizationHandlerContext, Task<bool>> Handler { get; } 25public AssertionRequirement(Func<AuthorizationHandlerContext, bool> handler) 36public AssertionRequirement(Func<AuthorizationHandlerContext, Task<bool>> handler)
AuthorizationPolicyBuilder.cs (2)
199public AuthorizationPolicyBuilder RequireAssertion(Func<AuthorizationHandlerContext, bool> handler) 212public AuthorizationPolicyBuilder RequireAssertion(Func<AuthorizationHandlerContext, Task<bool>> handler)
Microsoft.AspNetCore.Authorization.Policy (2)
src\Http\Routing\src\DataSourceDependentCache.cs (2)
16private readonly Func<IReadOnlyList<Endpoint>, T> _initializeCore; 27public DataSourceDependentCache(EndpointDataSource dataSource, Func<IReadOnlyList<Endpoint>, T> initialize)
Microsoft.AspNetCore.BrowserTesting (1)
BrowserManagerConfiguration.cs (1)
216private static T BindMultiValueMap<T>(IConfigurationSection processArgsMap, Func<Dictionary<string, HashSet<string>>, T> mapper)
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)
CompilerServices\RuntimeHelpers.cs (4)
51public static EventCallback<T> CreateInferredEventCallback<T>(object receiver, Func<T, Task> callback, T value) 81public static Func<T, Task> CreateInferredBindSetter<T>(Func<T, Task> callback, T value) 94public static Func<T, Task> CreateInferredBindSetter<T>(Action<T?> callback, T value)
EventCallbackFactory.cs (3)
77public EventCallback Create(object receiver, Func<object, Task> callback) 161public EventCallback<TValue> Create<TValue>(object receiver, Func<TValue, Task> callback) 191public EventCallback<TValue> CreateInferred<TValue>(object receiver, Func<TValue, Task> callback, TValue value)
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 =>
EventCallbackFactoryEventArgsExtensions.cs (2)
34public static EventCallback<EventArgs> Create(this EventCallbackFactory factory, object receiver, Func<EventArgs, Task> callback) 64public static EventCallback<ChangeEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ChangeEventArgs, Task> callback)
EventCallbackWorkItem.cs (1)
57case Func<T, Task> funcEventArgs:
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)
Reflection\PropertyGetter.cs (5)
15private readonly Func<object, object?> _GetterDelegate; 35getMethod.CreateDelegate(typeof(Func<,>).MakeGenericType(targetType, property.PropertyType)); 38_GetterDelegate = (Func<object, object>) 39callPropertyGetterClosedGenericMethod.CreateDelegate(typeof(Func<object, object>), propertyGetterAsFunc); 50Func<TTarget, TValue> Getter,
Routing\IHostEnvironmentNavigationManager.cs (1)
25void Initialize(string baseUri, string uri, Func<string, Task> onNavigateTo) =>
Microsoft.AspNetCore.Components.Analyzers (4)
InternalUsageAnalyzer.cs (4)
14private readonly Func<ISymbol, bool> _isInternalNamespace; 15private readonly Func<ISymbol, bool> _hasInternalAttribute; 28public InternalUsageAnalyzer(Func<ISymbol, bool> isInInternalNamespace, Func<ISymbol, bool> hasInternalAttribute, DiagnosticDescriptor descriptor)
Microsoft.AspNetCore.Components.Endpoints (14)
Builder\RazorComponentEndpointDataSource.cs (1)
35public Func<IDisposable, IDisposable> SetDisposableChangeTokenAction = disposableChangeToken => disposableChangeToken;
DependencyInjection\HttpNavigationManager.cs (2)
15private Func<string, Task>? _onNavigateTo; 19void IHostEnvironmentNavigationManager.Initialize(string baseUri, string uri, Func<string, Task> onNavigateTo)
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)
FieldIdentifier.cs (6)
19private static readonly ConcurrentDictionary<(Type ModelType, MemberInfo Member), Func<object, object>> _fieldAccessors = new(); 155ConcurrentDictionary<(Type ModelType, MemberInfo Member), Func<object, object>>? cache = null) 158Func<object, object>? accessor = null; 187static Func<object, object> CreateAccessor((Type model, MemberInfo member) arg) 194var lambda = Expression.Lambda<Func<object, object>>(expression, parameter); 196var func = lambda.Compile();
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (6)
252var func = CompileMemberEvaluator<int>(memberExpression); 257var func = CompileMemberEvaluator<string>(memberExpression); 262var func = CompileMemberEvaluator<ISpanFormattable>(memberExpression); 267var func = CompileMemberEvaluator<IFormattable>(memberExpression); 275static Func<object, TResult> CompileMemberEvaluator<TResult>(MemberExpression memberExpression) 280var replacedExpression = Expression.Lambda<Func<object, TResult>>(replacedMemberExpression, parameterExpression);
Microsoft.AspNetCore.Components.Forms.Tests (1)
FieldIdentifierTest.cs (1)
146var cache = new ConcurrentDictionary<(Type ModelType, MemberInfo FieldName), Func<object, object>>();
Microsoft.AspNetCore.Components.QuickGrid (10)
Columns\GridSort.cs (4)
40public static GridSort<TGridItem> ByAscending<U>(Expression<Func<TGridItem, U>> expression) 50public static GridSort<TGridItem> ByDescending<U>(Expression<Func<TGridItem, U>> expression) 60public GridSort<TGridItem> ThenAscending<U>(Expression<Func<TGridItem, U>> expression) 77public GridSort<TGridItem> ThenDescending<U>(Expression<Func<TGridItem, U>> expression)
Columns\PropertyColumn.cs (4)
16private Expression<Func<TGridItem, TProp>>? _lastAssignedProperty; 17private Func<TGridItem, string?>? _cellTextFunc; 23[Parameter, EditorRequired] public Expression<Func<TGridItem, TProp>> Property { get; set; } = default!; 46var compiledPropertyExpression = Property.Compile();
QuickGrid.razor.cs (2)
91[Parameter] public Func<TGridItem, object> ItemKey { get; set; } = x => x!; 110[Parameter] public Func<TGridItem, string?>? RowClass { get; set; }
Microsoft.AspNetCore.Components.SdkAnalyzers (4)
InternalUsageAnalyzer.cs (4)
14private readonly Func<ISymbol, bool> _isInternalNamespace; 15private readonly Func<ISymbol, bool> _hasInternalAttribute; 28public InternalUsageAnalyzer(Func<ISymbol, bool> isInInternalNamespace, Func<ISymbol, bool> hasInternalAttribute, DiagnosticDescriptor descriptor)
Microsoft.AspNetCore.Components.Server (8)
Circuits\CircuitHandler.cs (2)
81public virtual Func<CircuitInboundActivityContext, Task> CreateInboundActivityHandler(Func<CircuitInboundActivityContext, Task> next) => next;
Circuits\CircuitHost.cs (4)
28private Func<Func<Task>, Task> _dispatchInboundActivity; 641private static Func<Func<Task>, Task> BuildInboundActivityDispatcher(IReadOnlyList<CircuitHandler> circuitHandlers, Circuit circuit) 649var result = static (CircuitInboundActivityContext context) => context.Handler(); 653var next = result;
Circuits\RemoteNavigationManager.cs (2)
23private Func<string, Task>? _onNavigateTo; 58public void Initialize(string baseUri, string uri, Func<string, Task> onNavigateTo)
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)
ComponentBaseTest.cs (2)
482public Func<TestComponent, Task> OnInitAsyncLogic { get; set; } 486public Func<TestComponent, Task> OnParametersSetAsyncLogic { get; set; }
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)
JSComponents\JSComponentInterop.cs (1)
184var callback = jsObjectReference is null ? null : new Func<object, Task>(
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (6)
252var func = CompileMemberEvaluator<int>(memberExpression); 257var func = CompileMemberEvaluator<string>(memberExpression); 262var func = CompileMemberEvaluator<ISpanFormattable>(memberExpression); 267var func = CompileMemberEvaluator<IFormattable>(memberExpression); 275static Func<object, TResult> CompileMemberEvaluator<TResult>(MemberExpression memberExpression) 280var replacedExpression = Expression.Lambda<Func<object, TResult>>(replacedMemberExpression, parameterExpression);
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)
HtmlRendering\HtmlRendererTest.cs (1)
742Func<ParameterView, RenderFragment> CreateRenderFragment { get; set; }
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
AuthenticationStateSerializationOptions.cs (1)
34public Func<AuthenticationState, ValueTask<AuthenticationStateData?>> SerializationCallback { get; set; }
AuthenticationStateSerializer.cs (1)
16private readonly Func<AuthenticationState, ValueTask<AuthenticationStateData?>> _serializeCallback;
Microsoft.AspNetCore.Components.WebView (1)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
25public ManifestStaticWebAssetFileProvider(StaticWebAssetManifest manifest, Func<string, IFileProvider> fileProviderFactory)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (3)
TestUtils.cs (3)
72private Func<TestQueue, Task<bool>> _onTryEnter { get; } 78public TestQueue(Func<TestQueue, Task<bool>> onTryEnter, Action onExit = null) 84public TestQueue(Func<TestQueue, bool> onTryEnter, Action onExit = null) :
Microsoft.AspNetCore.Connections.Abstractions (15)
ConnectionBuilder.cs (4)
16private readonly IList<Func<ConnectionDelegate, ConnectionDelegate>> _components = new List<Func<ConnectionDelegate, ConnectionDelegate>>(); 31public IConnectionBuilder Use(Func<ConnectionDelegate, ConnectionDelegate> middleware) 45foreach (var component in Enumerable.Reverse(_components))
ConnectionBuilderExtensions.cs (3)
32/// If you aren't calling the next function, use <see cref="Run(IConnectionBuilder, Func{ConnectionContext, Task})"/> instead. 60/// If you aren't calling the next function, use <see cref="Run(IConnectionBuilder, Func{ConnectionContext, Task})"/> instead. 76public static IConnectionBuilder Run(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Task> middleware)
Features\IConnectionCompleteFeature.cs (1)
20void OnCompleted(Func<object, Task> callback, object state);
Features\IStatefulReconnectFeature.cs (1)
28public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect);
IConnectionBuilder.cs (1)
23IConnectionBuilder Use(Func<ConnectionDelegate, ConnectionDelegate> middleware);
IMultiplexedConnectionBuilder.cs (1)
23IMultiplexedConnectionBuilder Use(Func<MultiplexedConnectionDelegate, MultiplexedConnectionDelegate> middleware);
MultiplexedConnectionBuilder.cs (4)
16private readonly IList<Func<MultiplexedConnectionDelegate, MultiplexedConnectionDelegate>> _components = new List<Func<MultiplexedConnectionDelegate, MultiplexedConnectionDelegate>>(); 31public IMultiplexedConnectionBuilder Use(Func<MultiplexedConnectionDelegate, MultiplexedConnectionDelegate> middleware) 45foreach (var component in Enumerable.Reverse(_components))
Microsoft.AspNetCore.CookiePolicy (1)
CookiePolicyOptions.cs (1)
70public Func<HttpContext, bool>? CheckConsentNeeded { get; set; }
Microsoft.AspNetCore.CookiePolicy.Test (2)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (2)
259Func<string, bool> rejectPredicate; 260Func<string, bool> predicate = value => keys.Any(k => value.StartsWith(k, StringComparison.OrdinalIgnoreCase));
Microsoft.AspNetCore.Cors (4)
Infrastructure\CorsMiddleware.cs (1)
18private readonly Func<object, Task> OnResponseStartingDelegate = OnResponseStarting;
Infrastructure\CorsPolicy.cs (2)
15private Func<string, bool> _isOriginAllowed; 82public Func<string, bool> IsOriginAllowed
Infrastructure\CorsPolicyBuilder.cs (1)
206public CorsPolicyBuilder SetIsOriginAllowed(Func<string, bool> isOriginAllowed)
Microsoft.AspNetCore.Cors.Test (2)
CorsPolicyBuilderTests.cs (2)
12Func<string, bool> isOriginAllowed = origin => true; 179Func<string, bool> isOriginAllowed = origin => true;
Microsoft.AspNetCore.DataProtection (3)
DataProtectionBuilderExtensions.cs (1)
109public static IDataProtectionBuilder AddKeyEscrowSink(this IDataProtectionBuilder builder, Func<IServiceProvider, IKeyEscrowSink> factory)
KeyManagement\IDeletableKeyManager.cs (1)
47bool DeleteKeys(Func<IKey, bool> shouldDelete);
KeyManagement\XmlKeyManager.cs (1)
414public bool DeleteKeys(Func<IKey, bool> shouldDelete)
Microsoft.AspNetCore.DataProtection.Tests (1)
RegistryPolicyResolverTests.cs (1)
271private static RegistryPolicy WithUniqueTempRegKey(Func<RegistryKey, RegistryPolicy> testCode)
Microsoft.AspNetCore.Diagnostics (9)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (2)
40private readonly Func<ErrorContext, Task> _exceptionHandler; 72var nextFilter = _exceptionHandler;
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
27private readonly Func<object, Task> _clearCacheHeadersDelegate;
ExceptionHandler\ExceptionHandlerOptions.cs (1)
48public Func<Exception, int>? StatusCodeSelector { get; set; }
src\Shared\Reroute.cs (1)
16if (app.Properties.TryGetValue(UseRoutingKey, out var useRouting) && useRouting is Func<IApplicationBuilder, IApplicationBuilder> useRoutingFunc)
StatusCodePage\StatusCodePagesExtensions.cs (3)
55public static IApplicationBuilder UseStatusCodePages(this IApplicationBuilder app, Func<StatusCodeContext, Task> handler) 206private static Func<StatusCodeContext, Task> CreateHandler(string pathFormat, string? queryFormat, RequestDelegate? next = null) 208var handler = async (StatusCodeContext context) =>
StatusCodePage\StatusCodePagesOptions.cs (1)
57public Func<StatusCodeContext, Task> HandleAsync { get; set; }
Microsoft.AspNetCore.Diagnostics.Abstractions (1)
IDeveloperPageExceptionFilter.cs (1)
18Task HandleExceptionAsync(ErrorContext errorContext, Func<ErrorContext, Task> next);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
DatabaseDeveloperPageExceptionFilter.cs (1)
45public async Task HandleExceptionAsync(ErrorContext errorContext, Func<ErrorContext, Task> next)
Microsoft.AspNetCore.Diagnostics.HealthChecks (2)
Builder\HealthCheckApplicationBuilderExtensions.cs (1)
210Func<HttpContext, bool> predicate = c =>
HealthCheckOptions.cs (1)
23public Func<HealthCheckRegistration, bool>? Predicate { get; set; }
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Buffering\IncomingRequestLogBufferHolder.cs (1)
14public IncomingRequestLogBuffer GetOrAdd(string category, Func<string, IncomingRequestLogBuffer> valueFactory) =>
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (7)
Latency\AcceptanceTests.cs (1)
84private static bool IsMatchByName<TX>(in ReadOnlySpan<TX> span, Func<TX, bool> isMatch)
Latency\AddServerTimingHeaderMiddlewareTests.cs (1)
55public override void OnStarting(Func<object, Task> callback, object state)
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)
WebHostFunctionalTests.cs (1)
184private async Task ExecuteStartOrStartWithTest(Func<DeploymentResult, Task<HttpResponseMessage>> getResponse, string applicationName)
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcModelMetadata.cs (1)
46public override Func<object, object> PropertyGetter { get; }
Microsoft.AspNetCore.HeaderPropagation (4)
HeaderPropagationEntry.cs (2)
29Func<HeaderPropagationContext, StringValues>? valueFilter) 62public Func<HeaderPropagationContext, StringValues>? ValueFilter { get; }
HeaderPropagationEntryCollection.cs (2)
37public void Add(string headerName, Func<HeaderPropagationContext, StringValues> valueFilter) 79Func<HeaderPropagationContext, StringValues> valueFilter)
Microsoft.AspNetCore.Hosting (22)
GenericHost\GenericWebHostBuilder.cs (2)
189public IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory) 240var configureServices = configureServicesBuilder.Build(instance);
GenericHost\HostingStartupWebHostBuilder.cs (1)
88public IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
GenericHost\SlimWebHostBuilder.cs (1)
72public IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
Infrastructure\ISupportsStartup.cs (2)
12/// <see cref="WebHostBuilderExtensions.UseStartup(IWebHostBuilder, Type)"/> and <see cref="WebHostBuilderExtensions.UseStartup{TStartup}(IWebHostBuilder, Func{WebHostBuilderContext, TStartup})"/> 44IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory);
Internal\ConfigureContainerBuilder.cs (1)
18public Func<Action<object>, Action<object>> ConfigureContainerFilters { get; set; } = f => f;
Internal\ConfigureServicesBuilder.cs (4)
19public Func<Func<IServiceCollection, IServiceProvider?>, Func<IServiceCollection, IServiceProvider?>> StartupServiceFilters { get; set; } = f => f; 21public Func<IServiceCollection, IServiceProvider?> Build(object instance) => services => Invoke(instance, services);
Internal\StartupLoader.cs (7)
83public abstract Func<IServiceCollection, IServiceProvider> Build(); 105public override Func<IServiceCollection, IServiceProvider> Build() 108var configureServicesCallback = ConfigureServicesBuilder.Build(Instance); 132Func<IServiceCollection, IServiceProvider> ConfigureServices( 133Func<IServiceCollection, IServiceProvider?> configureServicesCallback, 168private Func<IServiceCollection, IServiceProvider?> BuildStartupServicesFilterPipeline(Func<IServiceCollection, IServiceProvider?> startup)
Internal\StartupMethods.cs (2)
12public StartupMethods(object? instance, Action<IApplicationBuilder> configure, Func<IServiceCollection, IServiceProvider> configureServices) 23public Func<IServiceCollection, IServiceProvider> ConfigureServicesDelegate { get; }
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
25public ManifestStaticWebAssetFileProvider(StaticWebAssetManifest manifest, Func<string, IFileProvider> fileProviderFactory)
WebHostBuilderExtensions.cs (1)
90public static IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(this IWebHostBuilder hostBuilder, Func<WebHostBuilderContext, TStartup> startupFactory) where TStartup : class
Microsoft.AspNetCore.Hosting.Tests (10)
Fakes\GenericWebHostBuilderWrapper.cs (1)
83public IWebHostBuilder UseStartup<TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
StaticWebAssets\ManifestStaticWebAssetsFileProviderTests.cs (4)
649private static (ManifestStaticWebAssetFileProvider.StaticWebAssetManifest manifest, Func<string, IFileProvider> factory) CreateTestManifest() 657Func<string, IFileProvider> factory = (string contentRoot) => 734private static (ManifestStaticWebAssetFileProvider.StaticWebAssetManifest manifest, Func<string, IFileProvider> factory) CreateTestManifestWithPattern() 741Func<string, IFileProvider> factory = (string contentRoot) =>
WebHostBuilderTests.cs (3)
69Assert.Throws<ArgumentNullException>(() => builder.UseServer(server).UseStartup((Func<WebHostBuilderContext, object>)null)); 1705private readonly Func<IServiceCollection, IServiceProvider> _configureServices; 1708public DelegatingStartupWithIStartup(Func<IServiceCollection, IServiceProvider> configureServices, Action<IApplicationBuilder> configure)
WebHostTests.cs (2)
1430public void OnCompleted(Func<object, Task> callback, object state) { } 1432public void OnStarting(Func<object, Task> callback, object state) { }
Microsoft.AspNetCore.Http (30)
Builder\ApplicationBuilder.cs (3)
23private readonly List<Func<RequestDelegate, RequestDelegate>> _components = new(); 120public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware) 128private static string CreateMiddlewareDescription(Func<RequestDelegate, RequestDelegate> middleware)
DefaultHttpContext.cs (7)
28private static readonly Func<IFeatureCollection, IItemsFeature> _newItemsFeature = f => new ItemsFeature(); 29private static readonly Func<DefaultHttpContext, IServiceProvidersFeature> _newServiceProvidersFeature = context => new RequestServicesFeature(context, context.ServiceScopeFactory); 30private static readonly Func<IFeatureCollection, IHttpAuthenticationFeature> _newHttpAuthenticationFeature = f => new HttpAuthenticationFeature(); 31private static readonly Func<IFeatureCollection, IHttpRequestLifetimeFeature> _newHttpRequestLifetimeFeature = f => new HttpRequestLifetimeFeature(); 32private static readonly Func<IFeatureCollection, ISessionFeature> _newSessionFeature = f => new DefaultSessionFeature(); 33private static readonly Func<IFeatureCollection, ISessionFeature?> _nullSessionFeature = f => null; 34private static readonly Func<IFeatureCollection, IHttpRequestIdentifierFeature> _newHttpRequestIdentifierFeature = f => new HttpRequestIdentifierFeature();
Features\HttpResponseFeature.cs (2)
37public virtual void OnStarting(Func<object, Task> callback, object state) 42public virtual void OnCompleted(Func<object, Task> callback, object state)
Features\QueryFeature.cs (1)
17private static readonly Func<IFeatureCollection, IHttpRequestFeature?> _nullRequestFeature = f => null;
Features\RequestCookiesFeature.cs (1)
15private static readonly Func<IFeatureCollection, IHttpRequestFeature?> _nullRequestFeature = f => null;
Internal\DefaultConnectionInfo.cs (3)
14private static readonly Func<IFeatureCollection, IHttpConnectionFeature> _newHttpConnectionFeature = f => new HttpConnectionFeature(); 15private static readonly Func<IFeatureCollection, ITlsConnectionFeature> _newTlsConnectionFeature = f => new TlsConnectionFeature(); 16private static readonly Func<IFeatureCollection, IConnectionLifetimeNotificationFeature> _newConnectionLifetime = f => new DefaultConnectionLifetimeNotificationFeature(f.Get<IHttpResponseFeature>());
Internal\DefaultHttpRequest.cs (6)
16private static readonly Func<IFeatureCollection, IHttpRequestFeature?> _nullRequestFeature = f => null; 17private static readonly Func<IFeatureCollection, IQueryFeature?> _newQueryFeature = f => new QueryFeature(f); 18private static readonly Func<DefaultHttpRequest, IFormFeature> _newFormFeature = r => new FormFeature(r, r._context.FormOptions ?? FormOptions.Default, r._context.GetEndpoint()); 19private static readonly Func<IFeatureCollection, IRequestCookiesFeature> _newRequestCookiesFeature = f => new RequestCookiesFeature(f); 20private static readonly Func<IFeatureCollection, IRouteValuesFeature> _newRouteValuesFeature = f => new RouteValuesFeature(); 21private static readonly Func<HttpContext, IRequestBodyPipeFeature> _newRequestBodyPipeFeature = context => new RequestBodyPipeFeature(context);
Internal\DefaultHttpResponse.cs (5)
17private static readonly Func<IFeatureCollection, IHttpResponseFeature?> _nullResponseFeature = f => null; 18private static readonly Func<IFeatureCollection, IHttpResponseBodyFeature?> _nullResponseBodyFeature = f => null; 19private static readonly Func<IFeatureCollection, IResponseCookiesFeature?> _newResponseCookiesFeature = f => new ResponseCookiesFeature(f); 127public override void OnStarting(Func<object, Task> callback, object state) 134public override void OnCompleted(Func<object, Task> callback, object state)
Internal\DefaultWebSocketManager.cs (2)
13private static readonly Func<IFeatureCollection, IHttpRequestFeature?> _nullRequestFeature = f => null; 14private static readonly Func<IFeatureCollection, IHttpWebSocketFeature?> _nullWebSocketFeature = f => null;
Microsoft.AspNetCore.Http.Abstractions (23)
Extensions\MapWhenExtensions.cs (2)
9using Predicate = Func<HttpContext, bool>; 23public static IApplicationBuilder MapWhen(this IApplicationBuilder app, Predicate predicate, Action<IApplicationBuilder> configuration)
Extensions\MapWhenOptions.cs (2)
13private Func<HttpContext, bool>? _predicate; 18public Func<HttpContext, bool>? Predicate
Extensions\UseWhenExtensions.cs (2)
8using Predicate = Func<HttpContext, bool>; 22public static IApplicationBuilder UseWhen(this IApplicationBuilder app, Predicate predicate, Action<IApplicationBuilder> configuration)
HttpResponse.cs (4)
19private static readonly Func<object, Task> _callbackDelegate = callback => ((Func<Task>)callback)(); 20private static readonly Func<object, Task> _disposeDelegate = state => 91public abstract void OnStarting(Func<object, Task> callback, object state); 110public abstract void OnCompleted(Func<object, Task> callback, object state);
IApplicationBuilder.cs (1)
37IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware);
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,
src\Shared\Reroute.cs (1)
16if (app.Properties.TryGetValue(UseRoutingKey, out var useRouting) && useRouting is Func<IApplicationBuilder, IApplicationBuilder> useRoutingFunc)
Microsoft.AspNetCore.Http.Abstractions.Tests (7)
MapPathMiddlewareTests.cs (1)
264public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware)
MapPredicateMiddlewareTests.cs (5)
8using Predicate = Func<HttpContext, bool>; 12private static readonly Predicate NotImplementedPredicate = new Predicate(environment => { throw new NotImplementedException(); }); 102map1.MapWhen((Predicate)FalsePredicate, UseNotImplemented); 103map1.MapWhen((Predicate)TruePredicate, map2 => map2.MapWhen((Predicate)TruePredicate, UseSuccess));
UsePathBaseExtensionsTests.cs (1)
41public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware)
Microsoft.AspNetCore.Http.Connections (4)
Internal\HttpConnectionContext.cs (3)
62internal Func<PipeWriter, Task>? NotifyOnReconnect { get; set; } 733public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect) 742var localOnReconnect = NotifyOnReconnect;
WebSocketOptions.cs (1)
28public Func<IList<string>, string>? SubProtocolSelector { get; set; }
Microsoft.AspNetCore.Http.Connections.Client (4)
HttpConnectionOptions.cs (1)
65public Func<HttpMessageHandler, HttpMessageHandler>? HttpMessageHandlerFactory { get; set; }
Internal\WebSocketsTransport.cs (3)
47private Func<PipeWriter, Task>? _notifyOnReconnect; 56public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect) 64var localNotifyOnReconnect = _notifyOnReconnect;
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionDispatcherTests.cs (2)
4075public override void OnCompleted(Func<object, Task> callback, object state) 4079public override void OnStarting(Func<object, Task> callback, object state)
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();
RequestDelegateFactoryContext.cs (1)
41public List<Func<HttpContext, ValueTask<object?>>> ParameterBinders { get; } = new();
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\ParameterBindingMethodCache.cs (3)
47private readonly ConcurrentDictionary<Type, (Func<ParameterInfo, Expression>?, int)> _bindAsyncMethodCallCache = new(); 218(Func<ParameterInfo, Expression>?, int) Finder(Type nonNullableParameterType) 442private MethodInfo? GetStaticMethodFromHierarchy(Type type, string name, Type[] parameterTypes, Func<MethodInfo, bool> validateReturnType)
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)
RequestDelegateFactoryTests.EndpointFilters.cs (2)
13[(Func<HttpContext, int>)((HttpContext httpContext) => 42)], 57[(Func<HttpContext, int?>)((HttpContext httpContext) => 42)],
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
158var handler = assembly.GetType("TestMapActions") 160?.CreateDelegate<Func<IEndpointRouteBuilder, IEndpointRouteBuilder>>(); 311internal static Project CreateProject(Func<CSharpCompilationOptions, CSharpCompilationOptions> modifyCompilationOptions = null)
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (1)
279var @delegate = (Todo todo) => new RemovesAcceptsMetadataResult();
ResponseExtensionTests.cs (2)
63public void OnCompleted(Func<object, Task> callback, object state) 68public void OnStarting(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)
IHttpResponseFeature.cs (3)
38/// <see cref="OnStarting(Func{object, Task}, object)"/> should no longer be called. 52void OnStarting(Func<object, Task> callback, object state); 60void OnCompleted(Func<object, Task> callback, object state);
Microsoft.AspNetCore.Http.Microbenchmarks (3)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
158var handler = assembly.GetType("TestMapActions") 160?.CreateDelegate<Func<IEndpointRouteBuilder, IEndpointRouteBuilder>>(); 311internal static Project CreateProject(Func<CSharpCompilationOptions, CSharpCompilationOptions> modifyCompilationOptions = null)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
30public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\Shared\RoslynUtils\IncrementalValuesProviderExtensions.cs (1)
13Func<TSource, TElement> sourceToElementTransform,
Microsoft.AspNetCore.Http.Results (8)
PhysicalFileHttpResult.cs (1)
104internal Func<string, FileInfoWrapper> GetFileInfoWrapper { get; init; } =
PushStreamHttpResult.cs (4)
16private readonly Func<Stream, Task> _streamWriterCallback; 24internal PushStreamHttpResult(Func<Stream, Task> streamWriterCallback, string? contentType) 38Func<Stream, Task> streamWriterCallback, 55Func<Stream, Task> streamWriterCallback,
Results.cs (1)
453Func<Stream, Task> streamWriterCallback,
src\Shared\ResponseContentTypeHelper.cs (1)
30Func<string, Encoding?> getEncoding,
TypedResults.cs (1)
473Func<Stream, Task> streamWriterCallback,
Microsoft.AspNetCore.Http.Results.Tests (4)
PushStreamResultTests.cs (2)
37var callback = (Stream body) => body.WriteAsync(Encoding.UTF8.GetBytes("Hello World").AsMemory()).AsTask(); 55var callback = (Stream body) => body.WriteAsync(Encoding.UTF8.GetBytes("Hello World").AsMemory()).AsTask();
ResultsTests.cs (1)
374Assert.Throws<ArgumentNullException>("streamWriterCallback", () => TypedResults.Stream(default(Func<Stream, Task>)));
TypedResultsTests.cs (1)
348Assert.Throws<ArgumentNullException>("streamWriterCallback", () => TypedResults.Stream(default(Func<Stream, Task>)));
Microsoft.AspNetCore.Http.Tests (14)
ApplicationBuilderTests.cs (2)
185public void OnCompleted(Func<object, Task> callback, object state) 190public void OnStarting(Func<object, Task> callback, object state)
DefaultHttpContextTests.cs (4)
428public List<(Func<object, Task> callback, object state)> CompletedCallbacks = new List<(Func<object, Task> callback, object state)>(); 437public void OnCompleted(Func<object, Task> callback, object state) 442public void OnStarting(Func<object, Task> callback, object state)
Features\FakeResponseFeature.cs (4)
8List<Tuple<Func<object, Task>, object>> _onCompletedCallbacks = new List<Tuple<Func<object, Task>, object>>(); 10public override void OnCompleted(Func<object, Task> callback, object state) 12_onCompletedCallbacks.Add(new Tuple<Func<object, Task>, object>(callback, state));
Internal\DefaultHttpResponseTests.cs (4)
102responseMock.Verify(m => m.OnCompleted(It.IsAny<Func<object, Task>>(), It.IsAny<object>()), Times.Never); 193private readonly List<(Func<object, Task>, object)> _callbacks = new(); 201public void OnCompleted(Func<object, Task> callback, object state) 206public void OnStarting(Func<object, Task> callback, object state)
Microsoft.AspNetCore.Http.ValidationsGenerator (1)
src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
30public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
Microsoft.AspNetCore.HttpOverrides (1)
CertificateForwardingOptions.cs (1)
27public Func<string, X509Certificate2> HeaderConverter = (headerValue) => new X509Certificate2(Convert.FromBase64String(headerValue));
Microsoft.AspNetCore.Identity (1)
SecurityStampValidatorOptions.cs (1)
22public Func<SecurityStampRefreshingPrincipalContext, Task>? OnRefreshingPrincipal { get; set; }
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (15)
SqlStoreOnlyUsersTestBase.cs (2)
44protected override Expression<Func<TUser, bool>> UserNameEqualsPredicate(string userName) => u => u.UserName == userName; 47protected override Expression<Func<TUser, bool>> UserNameStartsWithPredicate(string userName) => u => u.UserName.StartsWith(userName);
SqlStoreTestBase.cs (4)
83protected override Expression<Func<TRole, bool>> RoleNameEqualsPredicate(string roleName) => r => r.Name == roleName; 85protected override Expression<Func<TUser, bool>> UserNameEqualsPredicate(string userName) => u => u.UserName == userName; 88protected override Expression<Func<TRole, bool>> RoleNameStartsWithPredicate(string roleName) => r => r.Name.StartsWith(roleName); 90protected override Expression<Func<TUser, bool>> UserNameStartsWithPredicate(string userName) => u => u.UserName.StartsWith(userName);
src\Identity\test\Shared\MockHelpers.cs (1)
67var normalizerFunc = new Func<string, string>(i =>
UserStoreTest.cs (4)
413protected override Expression<Func<IdentityUser, bool>> UserNameEqualsPredicate(string userName) => u => u.UserName == userName; 415protected override Expression<Func<IdentityRole, bool>> RoleNameEqualsPredicate(string roleName) => r => r.Name == roleName; 418protected override Expression<Func<IdentityRole, bool>> RoleNameStartsWithPredicate(string roleName) => r => r.Name.StartsWith(roleName); 420protected override Expression<Func<IdentityUser, bool>> UserNameStartsWithPredicate(string userName) => u => u.UserName.StartsWith(userName);
UserStoreWithGenericsTest.cs (4)
68protected override Expression<Func<IdentityUserWithGenerics, bool>> UserNameEqualsPredicate(string userName) => u => u.UserName == userName; 70protected override Expression<Func<MyIdentityRole, bool>> RoleNameEqualsPredicate(string roleName) => r => r.Name == roleName; 73protected override Expression<Func<IdentityUserWithGenerics, bool>> UserNameStartsWithPredicate(string userName) => u => u.UserName.StartsWith(userName); 75protected override Expression<Func<MyIdentityRole, bool>> RoleNameStartsWithPredicate(string roleName) => r => r.Name.StartsWith(roleName);
Microsoft.AspNetCore.Identity.InMemory.Test (8)
FunctionalTest.cs (1)
291private async Task<TestServer> CreateServer(Action<IServiceCollection> configureServices = null, Func<HttpContext, Task> testpath = null, Uri baseAddress = null, bool testCore = false)
InMemoryStoreTest.cs (4)
52protected override Expression<Func<PocoUser, bool>> UserNameEqualsPredicate(string userName) => u => u.UserName == userName; 54protected override Expression<Func<PocoRole, bool>> RoleNameEqualsPredicate(string roleName) => r => r.Name == roleName; 56protected override Expression<Func<PocoUser, bool>> UserNameStartsWithPredicate(string userName) => u => u.UserName.StartsWith(userName, StringComparison.Ordinal); 58protected override Expression<Func<PocoRole, bool>> RoleNameStartsWithPredicate(string roleName) => r => r.Name.StartsWith(roleName, StringComparison.Ordinal);
InMemoryUserStoreTest.cs (2)
42protected override Expression<Func<PocoUser, bool>> UserNameEqualsPredicate(string userName) => u => u.UserName == userName; 44protected override Expression<Func<PocoUser, bool>> UserNameStartsWithPredicate(string userName) => u => u.UserName.StartsWith(userName, StringComparison.Ordinal);
src\Identity\test\Shared\MockHelpers.cs (1)
67var normalizerFunc = new Func<string, string>(i =>
Microsoft.AspNetCore.Identity.Specification.Tests (5)
IdentitySpecificationTestBase.cs (3)
114protected abstract Expression<Func<TRole, bool>> RoleNameEqualsPredicate(string roleName); 121protected abstract Expression<Func<TRole, bool>> RoleNameStartsWithPredicate(string roleName); 330Expression<Func<TRole, bool>> func = RoleNameStartsWithPredicate("CanQueryableRolesTest");
UserManagerSpecificationTests.cs (2)
131protected abstract Expression<Func<TUser, bool>> UserNameEqualsPredicate(string userName); 138protected abstract Expression<Func<TUser, bool>> UserNameStartsWithPredicate(string userName);
Microsoft.AspNetCore.Identity.Test (1)
src\Identity\test\Shared\MockHelpers.cs (1)
67var normalizerFunc = new Func<string, string>(i =>
Microsoft.AspNetCore.InternalTesting (8)
Logging\ITestSink.cs (2)
15Func<WriteContext, bool> WriteEnabled { get; set; } 17Func<BeginScopeContext, bool> BeginEnabled { get; set; }
Logging\TestLogger.cs (2)
13private readonly Func<LogLevel, bool> _filter; 20public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
Logging\TestSink.cs (4)
15Func<WriteContext, bool> writeEnabled = null, 16Func<BeginScopeContext, bool> beginEnabled = null) 25public Func<WriteContext, bool> WriteEnabled { get; set; } 27public Func<BeginScopeContext, bool> BeginEnabled { get; set; }
Microsoft.AspNetCore.InternalTesting.Tests (4)
ConditionalTheoryTest.cs (3)
73public void ConditionalTheoryWithFuncs(Func<int, int> func) 112public static TheoryData<Func<int, int>> GetActionTestData 113=> new TheoryData<Func<int, int>>
HttpClientSlimTest.cs (1)
68private HttpListener StartHost(out string address, int statusCode = 200, Func<HttpListenerContext, Task> handler = null)
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)
CustomRequestCultureProvider.cs (2)
13private readonly Func<HttpContext, Task<ProviderCultureResult?>> _provider; 19public CustomRequestCultureProvider(Func<HttpContext, Task<ProviderCultureResult?>> provider)
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisBuilder.cs (1)
63public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware)
Microsoft.AspNetCore.Mvc.Abstractions (18)
ModelBinding\BindingInfo.cs (4)
87public Func<ActionContext, bool>? RequestPredicate { get; set; } 280public Func<ModelMetadata, bool> PropertyFilter => CreatePropertyFilter(); 282private Func<ModelMetadata, bool> CreatePropertyFilter() 290foreach (var propertyFilter in propertyFilters)
ModelBinding\IPropertyFilterProvider.cs (1)
19Func<ModelMetadata, bool> PropertyFilter { get; }
ModelBinding\IRequestPredicateProvider.cs (1)
16Func<ActionContext, bool> RequestPredicate { get; }
ModelBinding\Metadata\ModelBindingMessageProvider.cs (6)
18public virtual Func<string, string> MissingBindRequiredValueAccessor { get; } = default!; 39public virtual Func<string, string> ValueMustNotBeNullAccessor { get; } = default!; 55public virtual Func<string, string> NonPropertyAttemptedValueIsInvalidAccessor { get; } = default!; 63public virtual Func<string, string> UnknownValueIsInvalidAccessor { get; } = default!; 78public virtual Func<string, string> ValueIsInvalidAccessor { get; } = default!; 85public virtual Func<string, string> ValueMustBeANumberAccessor { get; } = default!;
ModelBinding\ModelBindingContext.cs (1)
96public abstract Func<ModelMetadata, bool>? PropertyFilter { get; set; }
ModelBinding\ModelMetadata.cs (2)
601public abstract Func<object, object?>? PropertyGetter { get; } 611public virtual Func<object?[], object>? BoundConstructorInvoker => null;
src\Shared\ParameterBindingMethodCache.cs (3)
47private readonly ConcurrentDictionary<Type, (Func<ParameterInfo, Expression>?, int)> _bindAsyncMethodCallCache = new(); 218(Func<ParameterInfo, Expression>?, int) Finder(Type nonNullableParameterType) 442private MethodInfo? GetStaticMethodFromHierarchy(Type type, string name, Type[] parameterTypes, Func<MethodInfo, bool> validateReturnType)
Microsoft.AspNetCore.Mvc.Abstractions.Test (2)
ModelBinding\ModelMetadataTest.cs (2)
748public override Func<object, object> PropertyGetter 766public override Func<object[], object> BoundConstructorInvoker => throw new NotImplementedException();
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointModelMetadata.cs (1)
46public override Func<object, object>? PropertyGetter { get; }
Microsoft.AspNetCore.Mvc.Core (124)
ApiBehaviorOptions.cs (2)
18private Func<ActionContext, IActionResult> _invalidModelStateResponseFactory = default!; 24public Func<ActionContext, IActionResult> InvalidModelStateResponseFactory
ApplicationModels\DefaultApplicationModelProvider.cs (3)
25private readonly Func<ActionContext, bool> _supportsAllRequests; 26private readonly Func<ActionContext, bool> _supportsNonGetRequests; 230var requestPredicate = bindPropertiesAttribute.SupportsGet ? _supportsAllRequests : _supportsNonGetRequests;
ApplicationParts\RelatedAssemblyAttribute.cs (1)
50Func<string, bool> fileExists,
BindAttribute.cs (3)
16private static readonly Func<ModelMetadata, bool> _default = (m) => true; 18private Func<ModelMetadata, bool>? _propertyFilter; 52public Func<ModelMetadata, bool> PropertyFilter
BindPropertyAttribute.cs (3)
22private static readonly Func<ActionContext, bool> _supportsAllRequests = (c) => true; 23private static readonly Func<ActionContext, bool> _supportsNonGetRequests = IsNonGetRequest; 81Func<ActionContext, bool> IRequestPredicateProvider.RequestPredicate
ControllerBase.cs (5)
2607params Expression<Func<TModel, object?>>[] includeExpressions) 2644Func<ModelMetadata, bool> propertyFilter) 2684params Expression<Func<TModel, object?>>[] includeExpressions) 2718Func<ModelMetadata, bool> propertyFilter) 2788Func<ModelMetadata, bool> propertyFilter)
Controllers\ControllerActivatorProvider.cs (2)
18private readonly Func<ControllerContext, object>? _controllerActivatorCreate; 40public Func<ControllerContext, object> CreateActivator(ControllerActionDescriptor descriptor)
Controllers\ControllerFactoryProvider.cs (3)
12private readonly Func<ControllerContext, object>? _factoryCreateController; 38public Func<ControllerContext, object> CreateControllerFactory(ControllerActionDescriptor descriptor) 56var controllerActivator = _activatorProvider.CreateActivator(descriptor);
Controllers\DefaultControllerPropertyActivator.cs (1)
13private static readonly Func<Type, PropertyActivator<ControllerContext>[]> _getPropertiesToActivate =
Controllers\IControllerActivatorProvider.cs (2)
12/// Creates a <see cref="Func{T, TResult}"/> that creates a controller. 16Func<ControllerContext, object> CreateActivator(ControllerActionDescriptor descriptor);
Controllers\IControllerFactoryProvider.cs (1)
16Func<ControllerContext, object> CreateControllerFactory(ControllerActionDescriptor descriptor);
Infrastructure\ActionSelectionTable.cs (1)
103Func<T, IEnumerable<string>?> getRouteKeys,
Infrastructure\ControllerActionInvokerCache.cs (1)
62var controllerFactory = _controllerFactoryProvider.CreateControllerFactory(actionDescriptor);
Infrastructure\ControllerActionInvokerCacheEntry.cs (2)
14Func<ControllerContext, object> controllerFactory, 32public Func<ControllerContext, object> ControllerFactory { get; }
Infrastructure\TypeActivatorCache.cs (1)
15private readonly Func<Type, ObjectFactory> _createFactory =
ModelBinding\Binders\ComplexObjectModelBinder.cs (1)
408var metadataProviderFilter = bindingContext.ModelMetadata.PropertyFilterProvider?.PropertyFilter;
ModelBinding\Binders\ComplexTypeModelBinder.cs (1)
232var metadataProviderFilter = bindingContext.ModelMetadata.PropertyFilterProvider?.PropertyFilter;
ModelBinding\DefaultModelBindingContext.cs (2)
137public override Func<ModelMetadata, bool>? PropertyFilter 331public Func<ModelMetadata, bool>? PropertyFilter;
ModelBinding\DefaultPropertyFilterProvider.cs (5)
19private static readonly Func<ModelMetadata, bool> _default = (m) => true; 30public virtual IEnumerable<Expression<Func<TModel, object?>>>? PropertyIncludeExpressions => null; 33public virtual Func<ModelMetadata, bool> PropertyFilter 47private static Func<ModelMetadata, bool> GetPropertyFilterFromExpression( 48IEnumerable<Expression<Func<TModel, object?>>> includeExpressions)
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (3)
177public Func<ModelMetadata, bool> PropertyFilter => CreatePropertyFilter(); 179private Func<ModelMetadata, bool> CreatePropertyFilter() 187foreach (var propertyFilter in propertyFilters)
ModelBinding\Metadata\DefaultMetadataDetails.cs (2)
62public Func<object, object?>? PropertyGetter { get; set; } 72public Func<object?[], object>? BoundConstructorInvoker { get; set; }
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)
ModelBinding\Metadata\DefaultModelMetadata.cs (2)
548public override Func<object, object?>? PropertyGetter => _details.PropertyGetter; 554public override Func<object?[], object>? BoundConstructorInvoker => _details.BoundConstructorInvoker;
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (4)
21private readonly Func<ModelMetadataIdentity, ModelMetadataCacheEntry> _cacheEntryFactory; 253static Func<object?[], object> CreateObjectFactory(ConstructorInfo constructor) 258var factoryLamda = Expression.Lambda<Func<object?[], object>>(factoryExpressionBody, args); 369var getter = PropertyHelper.MakeNullSafeFastPropertyGetter(propertyHelper.Property);
ModelBinding\ModelBindingHelper.cs (9)
85params Expression<Func<TModel, object?>>[] includeExpressions) 91var propertyFilter = expression.Compile(); 131Func<ModelMetadata, bool> propertyFilter) 212Func<ModelMetadata, bool> propertyFilter) 327public static Expression<Func<ModelMetadata, bool>> GetPropertyFilterExpression<TModel>( 328Expression<Func<TModel, object?>>[] expressions) 346return Expression.Lambda<Func<ModelMetadata, bool>>(orWrapperExpression, firstExpression.Parameters); 349private static Expression<Func<ModelMetadata, bool>> GetPredicateExpression<TModel>( 350Expression<Func<TModel, object?>> expression)
ModelBinding\Validation\DefaultCollectionValidationStrategy.cs (4)
49private readonly ConcurrentDictionary<Type, Func<object, IEnumerator>> _genericGetEnumeratorCache = new ConcurrentDictionary<Type, Func<object, IEnumerator>>(); 67Func<object, IEnumerator> getEnumerator = _genericGetEnumeratorCache.GetOrAdd( 74Expression.Lambda<Func<object, IEnumerator>>(
Routing\AttributeRoute.cs (2)
19private readonly Func<ActionDescriptor[], IRouter> _handlerFactory; 26Func<ActionDescriptor[], IRouter> handlerFactory)
src\Http\Routing\src\DataSourceDependentCache.cs (2)
16private readonly Func<IReadOnlyList<Endpoint>, T> _initializeCore; 27public DataSourceDependentCache(EndpointDataSource dataSource, Func<IReadOnlyList<Endpoint>, T> initialize)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (2)
259Func<string, bool> rejectPredicate; 260Func<string, bool> predicate = value => keys.Any(k => value.StartsWith(k, StringComparison.OrdinalIgnoreCase));
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\PropertyActivator\PropertyActivator.cs (4)
14private readonly Func<TContext, object> _valueAccessor; 19Func<TContext, object> valueAccessor) 40Func<PropertyInfo, PropertyActivator<TContext>> createActivateInfo) 52Func<PropertyInfo, PropertyActivator<TContext>> createActivateInfo,
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,
src\Shared\ResponseContentTypeHelper.cs (1)
30Func<string, Encoding?> getEncoding,
Microsoft.AspNetCore.Mvc.Core.Test (53)
ApplicationModels\InferParameterBindingInfoConventionTest.cs (6)
878var expectedPredicate = CustomRequestPredicateAndPropertyFilterProviderAttribute.RequestPredicateStatic; 879var expectedPropertyFilter = CustomRequestPredicateAndPropertyFilterProviderAttribute.PropertyFilterStatic; 1137public static Func<ActionContext, bool> RequestPredicateStatic => (c) => true; 1138public static Func<ModelMetadata, bool> PropertyFilterStatic => (c) => true; 1140public Func<ActionContext, bool> RequestPredicate => RequestPredicateStatic; 1142public Func<ModelMetadata, bool> PropertyFilter => PropertyFilterStatic;
BindAttributeTest.cs (1)
33var propertyFilter = bind.PropertyFilter;
ControllerBaseTest.cs (3)
2721Func<ModelMetadata, bool> propertyFilter = (m) => 2754Func<ModelMetadata, bool> propertyFilter = (m) => 2903Func<ModelMetadata, bool> propertyFilter = (m) =>
Controllers\ControllerActivatorProviderTest.cs (2)
30var activatorDelegate = activatorProvider.CreateActivator(descriptor); 61var activatorDelegate = activatorProvider.CreateActivator(descriptor);
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;
Controllers\ControllerFactoryProviderTest.cs (2)
30var factoryResult = provider.CreateControllerFactory(descriptor); 134var factoryDelegate = provider.CreateControllerFactory(descriptor);
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (4)
952public static TheoryData<string, Func<object, object>> MyCanUpdateButCannotSetPropertyData 956return new TheoryData<string, Func<object, object>> 974Func<object, object> propertyAccessor) 1363public Func<ModelMetadata, bool> PropertyFilter
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (4)
1114public static TheoryData<string, Func<object, object>> MyCanUpdateButCannotSetPropertyData 1118return new TheoryData<string, Func<object, object>> 1136Func<object, object> propertyAccessor) 1538public Func<ModelMetadata, bool> PropertyFilter
ModelBinding\ModelBinderFactoryTest.cs (2)
678private readonly Func<ModelBinderProviderContext, IModelBinder> _factory; 680public TestModelBinderProvider(Func<ModelBinderProviderContext, IModelBinder> factory)
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;
ModelBinding\StubModelBinder.cs (3)
10private readonly Func<ModelBindingContext, Task> _callback; 35public StubModelBinder(Func<ModelBindingContext, ModelBindingResult> callback) 45public StubModelBinder(Func<ModelBindingContext, Task<ModelBindingResult>> callback)
ModelBinding\TestModelBinderProviderContext.cs (4)
19private readonly List<Func<ModelMetadata, IModelBinder>> _binderCreators = 20new List<Func<ModelMetadata, IModelBinder>>(); 69foreach (var creator in _binderCreators) 87public void OnCreatingBinder(Func<ModelMetadata, IModelBinder> binderCreator)
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (2)
232private readonly Func<ModelMetadata, bool> _shouldExclude; 234public ExcludePropertiesDefaultModelMetadataProvider(ICompositeMetadataDetailsProvider detailsProvider, Func<ModelMetadata, bool> shouldExclude) : base(detailsProvider)
Routing\AttributeRouteTest.cs (2)
48Func<ActionDescriptor[], IRouter> handlerFactory = (_) => 805Func<ActionDescriptor[], IRouter> handlerFactory,
TestFeatureProvider.cs (2)
12private readonly Func<TypeInfo, bool> _filter; 19public TestFeatureProvider(Func<TypeInfo, bool> filter)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (10)
DataAnnotationsMetadataProviderTest.cs (3)
27public static TheoryData<object, Func<DisplayMetadata, object>, object> DisplayDetailsData 31return new TheoryData<object, Func<DisplayMetadata, object>, object> 87Func<DisplayMetadata, object> accessor,
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)
ProblemDetailsWrapperProviderFactory.cs (2)
25public WrapperProvider(Type wrappingType, Func<object?, object?> wrapDelegate) 33public Func<object?, object?> WrapDelegate { get; }
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
XmlDataContractSerializerInputFormatterTest.cs (1)
771public override void OnCompleted(Func<object, Task> callback, object state)
XmlSerializerInputFormatterTest.cs (1)
706public override void OnCompleted(Func<object, Task> callback, object state)
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>));
src\Shared\ResponseContentTypeHelper.cs (1)
30Func<string, Encoding?> getEncoding,
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
NewtonsoftJsonInputFormatterTest.cs (1)
624public override void OnCompleted(Func<object, Task> callback, object state)
NewtonsoftJsonPatchInputFormatterTest.cs (1)
279public override void OnCompleted(Func<object, Task> callback, object state)
Microsoft.AspNetCore.Mvc.Razor (15)
DefaultTagHelperFactory.cs (2)
21private readonly Func<Type, PropertyActivator<ViewContext>[]> _getPropertiesToActivate; 22private static readonly Func<PropertyInfo, PropertyActivator<ViewContext>> _createActivateInfo = CreateActivateInfo;
HelperResult.cs (3)
14private readonly Func<TextWriter, Task> _asyncAction; 23public HelperResult(Func<TextWriter, Task> asyncAction) 33public Func<TextWriter, Task> WriteAction => _asyncAction;
RazorPageBase.cs (1)
371protected void DefineSection(string name, Func<object?, Task> section)
RazorPagePropertyActivator.cs (7)
20private readonly Func<ViewDataDictionary, ViewDataDictionary> _nestedFactory; 80Func<ViewContext, object> valueAccessor; 139public Func<ViewContext, object> UrlHelperAccessor { get; init; } = default!; 141public Func<ViewContext, object> JsonHelperAccessor { get; init; } = default!; 143public Func<ViewContext, object> DiagnosticSourceAccessor { get; init; } = default!; 145public Func<ViewContext, object> HtmlEncoderAccessor { get; init; } = default!; 147public Func<ViewContext, object> ModelExpressionProviderAccessor { get; init; } = default!;
TagHelpers\TagHelperComponentPropertyActivator.cs (2)
19private readonly Func<Type, PropertyActivator<ViewContext>[]> _getPropertiesToActivate = GetPropertiesToActivate; 20private static readonly Func<PropertyInfo, PropertyActivator<ViewContext>> _createActivateInfo = CreateActivateInfo;
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
ChecksumValidator.cs (1)
98Func<Stream, byte[]> hashData;
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
RuntimeViewCompilerTest.cs (2)
868Func<string, CompiledViewDescriptor> compile = null) 882public Func<string, CompiledViewDescriptor> Compile { get; set; }
Microsoft.AspNetCore.Mvc.Razor.Test (3)
RazorPageCreateModelExpressionTest.cs (1)
103Func<NotQuiteIdentityRazorPage, ModelExpression> createModelExpression,
RazorPageTest.cs (2)
28private readonly Func<TextWriter, Task> NullAsyncWrite = writer => writer.WriteAsync(string.Empty); 1387Func<TestableRazorPage, Task> executeAction,
Microsoft.AspNetCore.Mvc.RazorPages (24)
ApplicationModels\DefaultPageApplicationModelPartsProvider.cs (3)
17private readonly Func<ActionContext, bool> _supportsAllRequests; 18private readonly Func<ActionContext, bool> _supportsNonGetRequests; 123var requestPredicate = bindPropertiesAttribute.SupportsGet ? _supportsAllRequests : _supportsNonGetRequests;
DependencyInjection\PageConventionCollectionExtensions.cs (1)
25Func<PageApplicationModel, IFilterMetadata> factory)
Infrastructure\DefaultPageModelActivatorProvider.cs (1)
19public Func<PageContext, object> CreateActivator(CompiledPageActionDescriptor actionDescriptor)
Infrastructure\DefaultPageModelFactoryProvider.cs (3)
11private static readonly Func<PropertyInfo, PropertyActivator<PageContext>> _createActivateInfo = 20public Func<PageContext, object>? CreateModelFactory(CompiledPageActionDescriptor descriptor) 29var modelActivator = _modelActivator.CreateActivator(descriptor);
Infrastructure\PageActionInvokerCache.cs (1)
85Func<PageContext, object>? modelFactory = null;
Infrastructure\PageActionInvokerCacheEntry.cs (2)
19Func<PageContext, object>? modelFactory, 49public Func<PageContext, object>? ModelFactory { get; }
Infrastructure\ServiceBasedPageModelActivatorProvider.cs (1)
14public Func<PageContext, object> CreateActivator(CompiledPageActionDescriptor descriptor)
IPageModelActivatorProvider.cs (1)
16Func<PageContext, object> CreateActivator(CompiledPageActionDescriptor descriptor);
IPageModelFactoryProvider.cs (1)
16Func<PageContext, object>? CreateModelFactory(CompiledPageActionDescriptor descriptor);
PageBase.cs (5)
1355params Expression<Func<TModel, object?>>[] includeExpressions) 1391Func<ModelMetadata, bool> propertyFilter) 1430params Expression<Func<TModel, object?>>[] includeExpressions) 1463Func<ModelMetadata, bool> propertyFilter) 1531Func<ModelMetadata, bool> propertyFilter)
PageModel.cs (5)
260params Expression<Func<TModel, object?>>[] includeExpressions) 296Func<ModelMetadata, bool> propertyFilter) 335params Expression<Func<TModel, object?>>[] includeExpressions) 368Func<ModelMetadata, bool> propertyFilter) 436Func<ModelMetadata, bool> propertyFilter)
Microsoft.AspNetCore.Mvc.RazorPages.Test (12)
Infrastructure\DefaultPageModelActivatorProviderTest.cs (2)
52var activator = activatorProvider.CreateActivator(actionDescriptor); 82var activator = activatorProvider.CreateActivator(actionDescriptor);
Infrastructure\DefaultPageModelFactoryProviderTest.cs (3)
20var factory = factoryProvider.CreateModelFactory(descriptor); 53var factory = factoryProvider.CreateModelFactory(descriptor); 73var factory = factoryProvider.CreateModelFactory(descriptor);
Infrastructure\PageActionInvokerProviderTest.cs (1)
90Func<PageContext, object> modelFactory = _ => null;
Infrastructure\PageActionInvokerTest.cs (3)
1484Func<PageContext, object> modelFactory = null, 1674private readonly Func<PageContext, Task> _executeAction; 1681public TestPageResultExecutor(Func<PageContext, Task> executeAction)
Infrastructure\ServiceBasedPageModelActivatorProviderTest.cs (3)
51var activator = activatorProvider.CreateActivator(pageContext.ActionDescriptor); 83var activator = activatorProvider.CreateActivator(pageContext.ActionDescriptor); 114var activator = activatorProvider.CreateActivator(context.ActionDescriptor);
Microsoft.AspNetCore.Mvc.TagHelpers (1)
JavaScriptResources.cs (1)
31Func<string, Stream> getManifestResourceStream,
Microsoft.AspNetCore.Mvc.TagHelpers.Test (7)
ImageTagHelperTest.cs (1)
381private static IUrlHelperFactory MakeUrlHelperFactory(Func<string, string> contentAction = null)
JavaScriptResourcesTest.cs (4)
18var getManifestResourceStream = new Func<string, Stream>(name => stream); 35var getManifestResourceStream = new Func<string, Stream>(name => stream); 56var getManifestResourceStream = new Func<string, Stream>(name => 80var getManifestResourceStream = new Func<string, Stream>(name => stream);
LinkTagHelperTest.cs (1)
1204private static IUrlHelperFactory MakeUrlHelperFactory(Func<string,string> content = null)
ScriptTagHelperTest.cs (1)
1158private static IUrlHelperFactory MakeUrlHelperFactory(Func<string, string> urlResolver = null)
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);
DeferredHostBuilder.cs (3)
16private Func<string[], object>? _hostFactory; 89public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull 113public void SetHostFactory(Func<string[], object> hostFactory)
WebApplicationFactory.cs (5)
277var factory = HostFactoryResolver.ResolveHostFactory( 803private readonly Func<IWebHostBuilder, TestServer> _createServer; 804private readonly Func<IHostBuilder, IHost> _createHost; 812Func<IWebHostBuilder, TestServer> createServer, 813Func<IHostBuilder, IHost> createHost,
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);
ExpressionHelper.cs (2)
215var lambda = Expression.Lambda<Func<object, object>>(converted, fakeParameter); 216Func<object, object> func;
ExpressionMetadataProvider.cs (4)
15Expression<Func<TModel, TResult>> expression, 78var cachedFunc = CachedExpressionCompiler.Process(expression); 84var func = expression.Compile(); 179Func<object, object> modelAccessor = (ignore) => viewDataInfo.Value;
Filters\SaveTempDataFilter.cs (1)
14private static readonly Func<object, Task> OnStartingCallback = (state) => OnStarting((HttpContext)state);
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)
IModelExpressionProvider.cs (1)
24Expression<Func<TModel, TValue>> expression);
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) =>
ModelExpressionProvider.cs (2)
37public string GetExpressionText<TModel, TValue>(Expression<Func<TModel, TValue>> expression) 47Expression<Func<TModel, TValue>> expression)
ModelStateDictionaryExtensions.cs (5)
27Expression<Func<TModel, object>> expression, 54Expression<Func<TModel, object>> expression, 76Expression<Func<TModel, object>> expression, 99Expression<Func<TModel, object>> expression) 116Expression<Func<TModel, object>> expression)
Rendering\HtmlHelperDisplayExtensions.cs (5)
233Expression<Func<TModel, TResult>> expression) 272Expression<Func<TModel, TResult>> expression, 308Expression<Func<TModel, TResult>> expression, 349Expression<Func<TModel, TResult>> expression, 390Expression<Func<TModel, TResult>> expression,
Rendering\HtmlHelperDisplayNameExtensions.cs (1)
38Expression<Func<TModelItem, TResult>> expression)
Rendering\HtmlHelperEditorExtensions.cs (5)
230Expression<Func<TModel, TResult>> expression) 265Expression<Func<TModel, TResult>> expression, 301Expression<Func<TModel, TResult>> expression, 338Expression<Func<TModel, TResult>> expression, 379Expression<Func<TModel, TResult>> expression,
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\HtmlHelperLabelExtensions.cs (3)
51Expression<Func<TModel, TResult>> expression) 70Expression<Func<TModel, TResult>> expression, 94Expression<Func<TModel, TResult>> expression,
Rendering\HtmlHelperSelectExtensions.cs (4)
222Expression<Func<TModel, TResult>> expression, 261Expression<Func<TModel, TResult>> expression, 304Expression<Func<TModel, TResult>> expression, 404Expression<Func<TModel, TResult>> expression,
Rendering\HtmlHelperValidationExtensions.cs (4)
178Expression<Func<TModel, TResult>> expression) 206Expression<Func<TModel, TResult>> expression, 241Expression<Func<TModel, TResult>> expression, 275Expression<Func<TModel, TResult>> expression,
Rendering\HtmlHelperValueExtensions.cs (1)
51Expression<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()
ViewComponents\DefaultViewComponentFactory.cs (1)
16private readonly Func<Type, PropertyActivator<ViewComponentContext>[]> _getPropertiesToActivate;
ViewDataDictionaryControllerPropertyActivator.cs (1)
16private readonly Func<Type, PropertyActivator<ControllerContext>[]> _getPropertiesToActivate;
ViewDataDictionaryFactory.cs (2)
33public static Func<ViewDataDictionary, ViewDataDictionary> CreateNestedFactory(Type modelType) 44Expression.Lambda<Func<ViewDataDictionary, ViewDataDictionary>>(
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (212)
CachedExpressionCompilerTest.cs (62)
18var func = CachedExpressionCompiler.Process(expression); 34var func1 = CachedExpressionCompiler.Process(expression1); 35var func2 = CachedExpressionCompiler.Process(expression2); 51var func = CachedExpressionCompiler.Process(expression); 67var func = CachedExpressionCompiler.Process(expression); 83var func = CachedExpressionCompiler.Process(expression); 101var func1 = CachedExpressionCompiler.Process(expression1); 108var func2 = CachedExpressionCompiler.Process(expression2); 124var func = CachedExpressionCompiler.Process(expression); 147var func = CachedExpressionCompiler.Process(expression); 163var func = CachedExpressionCompiler.Process(expression); 179var func1 = CachedExpressionCompiler.Process(expression1); 180var func2 = CachedExpressionCompiler.Process(expression2); 197var func = CachedExpressionCompiler.Process(expression); 213var func1 = CachedExpressionCompiler.Process(expression1); 214var func2 = CachedExpressionCompiler.Process(expression2); 230var func = CachedExpressionCompiler.Process(expression); 246var func = CachedExpressionCompiler.Process(expression); 261var func = CachedExpressionCompiler.Process(expression); 277var func = CachedExpressionCompiler.Process(expression); 293var func1 = CachedExpressionCompiler.Process(expression1); 294var func2 = CachedExpressionCompiler.Process(expression2); 309var func = CachedExpressionCompiler.Process(expression); 325var func = CachedExpressionCompiler.Process(expression); 341var func = CachedExpressionCompiler.Process(expression); 357var func = CachedExpressionCompiler.Process(expression); 373var func = CachedExpressionCompiler.Process(expression); 389var func = CachedExpressionCompiler.Process(expression); 405var func = CachedExpressionCompiler.Process(expression); 421var func = CachedExpressionCompiler.Process(expression); 437var func = CachedExpressionCompiler.Process(expression); 454var func = CachedExpressionCompiler.Process(expression); 470var func = CachedExpressionCompiler.Process(expression); 487var func = CachedExpressionCompiler.Process(expression); 503var func = CachedExpressionCompiler.Process(expression); 520var func = CachedExpressionCompiler.Process(expression); 536var func1 = CachedExpressionCompiler.Process(expression1); 537var func2 = CachedExpressionCompiler.Process(expression2); 552var func1 = CachedExpressionCompiler.Process(expression1); 553var func2 = CachedExpressionCompiler.Process(expression2); 579var func = CachedExpressionCompiler.Process(expression); 602var func = CachedExpressionCompiler.Process(expression); 623var func = CachedExpressionCompiler.Process(expression); 650var func = CachedExpressionCompiler.Process(expression); 673var func = CachedExpressionCompiler.Process(expression); 689var func = CachedExpressionCompiler.Process(expression); 705var func = CachedExpressionCompiler.Process(expression); 725var func = CachedExpressionCompiler.Process(expression); 745var func = CachedExpressionCompiler.Process(expression); 765var func = CachedExpressionCompiler.Process(expression); 781var func = CachedExpressionCompiler.Process(expression); 797var func = CachedExpressionCompiler.Process(expression); 813var func = CachedExpressionCompiler.Process(expression); 828var func = CachedExpressionCompiler.Process(expression); 845var func = CachedExpressionCompiler.Process(expression); 861var func = CachedExpressionCompiler.Process(expression); 876var func = CachedExpressionCompiler.Process(expression); 889var func = CachedExpressionCompiler.Process(expression); 895private static Expression<Func<TModel, TResult>> GetExpression<TModel, TResult>(Expression<Func<TModel, TResult>> expression) 898private static Expression<Func<TestModel, TResult>> GetTestModelExpression<TResult>(Expression<Func<TestModel, TResult>> expression)
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),
Filters\SaveTempDataFilterTest.cs (2)
53.Setup(rf => rf.OnStarting(It.IsAny<Func<object, Task>>(), It.IsAny<object>())) 415public override void OnStarting(Func<object, Task> callback, object state)
MemberExpressionCacheKeyComparerTest.cs (2)
187private static MemberExpressionCacheKey GetKey<TResult>(Expression<Func<TestModel, TResult>> expression) 190private static MemberExpressionCacheKey GetKey<TModel, TResult>(Expression<Func<TModel, TResult>> expression)
MemberExpressionCacheKeyTest.cs (1)
70private static MemberExpressionCacheKey GetKey<TResult>(Expression<Func<TestModel, TResult>> expression)
Rendering\DefaultTemplatesUtilities.cs (3)
175Func<IHtmlHelper, IHtmlHelper> innerHelperWrapper) 202Func<IHtmlHelper, IHtmlHelper> innerHelperWrapper) 224Func<IHtmlHelper, IHtmlHelper> innerHelperWrapper,
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,
ViewExecutorTest.cs (1)
380private IView CreateView(Func<ViewContext, Task> action)
Microsoft.AspNetCore.OpenApi (31)
Extensions\JsonNodeSchemaExtensions.cs (3)
191internal static void ApplyPrimitiveTypesAndFormats(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 363internal static void MapPolymorphismOptionsToDiscriminator(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 403internal static void ApplySchemaReferenceId(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId)
Extensions\OpenApiEndpointConventionBuilderExtensions.cs (3)
50/// <param name="configureOperation">An <see cref="Func{T, TResult}"/> that returns a new OpenAPI annotation given a generated operation.</param> 54public static TBuilder WithOpenApi<TBuilder>(this TBuilder builder, Func<OpenApiOperation, OpenApiOperation> configureOperation) 63private static void AddAndConfigureOperationForEndpoint(EndpointBuilder endpointBuilder, Func<OpenApiOperation, OpenApiOperation>? configure = null)
Services\OpenApiOptions.cs (2)
50public Func<ApiDescription, bool> ShouldInclude { get; set; } 59public Func<JsonTypeInfo, string?> CreateSchemaReferenceId { get; set; } = CreateDefaultSchemaReferenceId;
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\ParameterBindingMethodCache.cs (3)
47private readonly ConcurrentDictionary<Type, (Func<ParameterInfo, Expression>?, int)> _bindAsyncMethodCallCache = new(); 218(Func<ParameterInfo, Expression>?, int) Finder(Type nonNullableParameterType) 442private MethodInfo? GetStaticMethodFromHierarchy(Type type, string name, Type[] parameterTypes, Func<MethodInfo, bool> validateReturnType)
Microsoft.AspNetCore.OpenApi.SourceGenerators (1)
src\Shared\RoslynUtils\IncrementalValuesProviderExtensions.cs (1)
13Func<TSource, TElement> sourceToElementTransform,
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)
DispatcherExtensions.cs (1)
12public async Task<TValue?> ScheduleAsync(TKey key, Func<TKey, Task<TValue?>> valueFactory)
OutputCachePolicyBuilder.cs (3)
78public OutputCachePolicyBuilder With(Func<OutputCacheContext, bool> predicate) 182public OutputCachePolicyBuilder SetCacheKeyPrefix(Func<HttpContext, string> keyPrefix) 227public OutputCachePolicyBuilder VaryByValue(Func<HttpContext, KeyValuePair<string, string>> varyBy)
Policies\PredicatePolicy.cs (2)
13private readonly Func<OutputCacheContext, ValueTask<bool>> _predicate; 21public PredicatePolicy(Func<OutputCacheContext, ValueTask<bool>> asyncPredicate, IOutputCachePolicy policy)
Microsoft.AspNetCore.OutputCaching.Tests (1)
OutputCacheMiddlewareTests.cs (1)
805public override void OnStarting(Func<object, Task> callback, object state) { }
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)
OwinFeatureCollection.cs (4)
182void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 194void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 318var accept = (Func<WebSocketAcceptContext, Task<WebSocket>>)obj;
WebSockets\OwinWebSocketAcceptAdapter.cs (5)
9using AppFunc = Func<IDictionary<string, object>, Task>; 14Func // WebSocketFunc callback 21Func 114public static AppFunc AdaptWebSockets(AppFunc next)
WebSockets\WebSocketAcceptAdapter.cs (11)
9using AppFunc = Func<IDictionary<string, object>, Task>; 14Func // WebSocketFunc callback 21Func 34private readonly WebSocketAcceptAlt _accept; 35private AppFunc _callback; 43public WebSocketAcceptAdapter(IDictionary<string, object> env, WebSocketAcceptAlt accept) 49private void AcceptWebSocket(IDictionary<string, object> options, AppFunc callback) 61public static AppFunc AdaptWebSockets(AppFunc next) 66if (environment.TryGetValue(OwinConstants.WebSocket.AcceptAlt, out accept) && accept is WebSocketAcceptAlt) 68var adapter = new WebSocketAcceptAdapter(environment, (WebSocketAcceptAlt)accept);
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)
DefaultRateLimiterPolicy.cs (2)
11private readonly Func<HttpContext, RateLimitPartition<DefaultKeyType>> _partitioner; 14public DefaultRateLimiterPolicy(Func<HttpContext, RateLimitPartition<DefaultKeyType>> partitioner, Func<OnRejectedContext, CancellationToken, ValueTask>? onRejected)
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)
RequestDecompressionMiddlewareTests.cs (1)
32Func<Stream, Stream> compressorDelegate,
Microsoft.AspNetCore.ResponseCaching.Tests (1)
ResponseCachingMiddlewareTests.cs (1)
890public override void OnStarting(Func<object, Task> callback, object state) { }
Microsoft.AspNetCore.Rewrite (1)
src\Shared\Reroute.cs (1)
16if (app.Properties.TryGetValue(UseRoutingKey, out var useRouting) && useRouting is Func<IApplicationBuilder, IApplicationBuilder> useRoutingFunc)
Microsoft.AspNetCore.Routing (16)
Builder\RoutingEndpointConventionBuilderExtensions.cs (1)
63public static TBuilder WithDisplayName<TBuilder>(this TBuilder builder, Func<EndpointBuilder, string> func) where TBuilder : IEndpointConventionBuilder
DataSourceDependentCache.cs (2)
16private readonly Func<IReadOnlyList<Endpoint>, T> _initializeCore; 27public DataSourceDependentCache(EndpointDataSource dataSource, Func<IReadOnlyList<Endpoint>, T> initialize)
DefaultLinkGenerator.cs (1)
36private readonly Func<RouteEndpoint, TemplateBinder> _createTemplateBinder;
DefaultLinkParser.cs (1)
23private readonly Func<RouteEndpoint, MatcherState> _createMatcher;
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)
MinimalFormTests.cs (1)
392public async Task MapRequestDelegate_WithForm_RequiresValidation_InvalidToken_Fails(Func<IEndpointRouteBuilder, IEndpointConventionBuilder> addDelegate)
Microsoft.AspNetCore.Routing.Tests (5)
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (1)
478var @delegate = [Attribute1, Attribute2] (AddsCustomParameterMetadata param1) => new AddsCustomEndpointMetadataResult();
Constraints\CompositeRouteConstraintTests.cs (1)
35static readonly Expression<Func<IRouteConstraint, bool>> ConstraintMatchMethodExpression =
Template\RoutePatternPrecedenceTests.cs (1)
20private static decimal ComputeRoutePattern(string template, Func<RoutePattern, decimal> func)
Template\RouteTemplatePrecedenceTests.cs (1)
18private static decimal ComputeRouteTemplate(string template, Func<RouteTemplate, decimal> func)
Tree\TreeRouterTest.cs (1)
2099public Func<RouteContext, bool> MatchingDelegate { get; set; }
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));
StandardFeatureCollection.cs (3)
13private static readonly Func<RequestContext, object> _identityFunc = ReturnIdentity; 14private static readonly Dictionary<Type, Func<RequestContext, object?>> _featureFuncLookup = new() 74Func<RequestContext, object?>? lookupFunc;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (5)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (1)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
src\Shared\Http2cat\Http2CatOptions.cs (1)
12public Func<Http2Utilities, Task> Scenaro { get; set; }
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
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;
Core\IISHttpContext.FeatureCollection.cs (2)
327void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 332void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state)
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
Microsoft.AspNetCore.Server.IISIntegration (1)
IISMiddleware.cs (1)
29private static readonly Func<object, Task> ClearUserDelegate = ClearUser;
Microsoft.AspNetCore.Server.IntegrationTesting (4)
TestMatrix.cs (4)
19private IList<Tuple<Func<TestVariant, bool>, string>> Skips { get; } = new List<Tuple<Func<TestVariant, bool>, string>>(); 86public TestMatrix Skip(string message, Func<TestVariant, bool> check) 88Skips.Add(new Tuple<Func<TestVariant, bool>, string>(check, message));
Microsoft.AspNetCore.Server.Kestrel.Core (66)
HttpsConfigurationService.cs (1)
28private Func<ListenOptions, ListenOptions>? _useHttpsWithDefaults;
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\CertificatePathWatcher.cs (2)
16private readonly Func<string, IFileProvider?> _fileProviderFactory; 49internal CertificatePathWatcher(string contentRootPath, ILogger<CertificatePathWatcher> logger, Func<string, IFileProvider?> fileProviderFactory)
Internal\ConnectionDispatcher.cs (2)
13private readonly Func<T, Task> _connectionDelegate; 17public ConnectionDispatcher(ServiceContext serviceContext, Func<T, Task> connectionDelegate, TransportConnectionManager transportConnectionManager)
Internal\Http\HttpHeaders.cs (1)
277public static void ValidateHeaderValueCharacters(string headerName, StringValues headerValues, Func<string, Encoding?> encodingSelector)
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\Http\HttpProtocol.FeatureCollection.cs (2)
249void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 254void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state)
Internal\Http\HttpRequestHeaders.cs (2)
22public Func<string, Encoding?> EncodingSelector { get; set; } 24public HttpRequestHeaders(bool reuseHeaderValues = true, Func<string, Encoding?>? encodingSelector = null)
Internal\Http\HttpResponseHeaders.cs (4)
21public Func<string, Encoding?> EncodingSelector { get; set; } 23public HttpResponseHeaders(Func<string, Encoding?>? encodingSelector = null) 46var encodingSelector = EncodingSelector; 75Func<string, Encoding?> encodingSelector)
Internal\Http\HttpResponseTrailers.cs (2)
14public Func<string, Encoding?> EncodingSelector { get; set; } 16public HttpResponseTrailers(Func<string, Encoding?>? encodingSelector = null)
Internal\Http3\Http3HeadersEnumerator.cs (1)
27public Func<string, Encoding?> EncodingSelector { get; set; } = KestrelServerOptions.DefaultHeaderEncodingSelector;
Internal\Infrastructure\HttpUtilities.cs (2)
116public static string GetRequestHeaderString(this ReadOnlySpan<byte> span, string name, Func<string, Encoding?> encodingSelector, bool checkForNewlineChars) 155private static string GetRequestHeaderStringWithoutDefaultEncodingCore(this ReadOnlySpan<byte> span, string name, Func<string, Encoding?> encodingSelector)
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)
Internal\Infrastructure\KestrelConnectionOfT.cs (2)
13private readonly Func<T, Task> _connectionDelegate; 19Func<T, Task> connectionDelegate,
Internal\Infrastructure\TransportManager.cs (1)
97private void StartAcceptLoop<T>(IConnectionListener<T> connectionListener, Func<T, Task> connectionDelegate, EndpointConfig? endpointConfig) where T : BaseConnectionContext
KestrelServerOptions.cs (5)
41internal static readonly Func<string, Encoding?> DefaultHeaderEncodingSelector = _ => null; 46private Func<string, Encoding?> _requestHeaderEncodingSelector = DefaultHeaderEncodingSelector; 48private Func<string, Encoding?> _responseHeaderEncodingSelector = DefaultHeaderEncodingSelector; 158public Func<string, Encoding?> RequestHeaderEncodingSelector 168public Func<string, Encoding?> ResponseHeaderEncodingSelector
ListenOptions.cs (8)
21private readonly List<Func<ConnectionDelegate, ConnectionDelegate>> _middleware = new List<Func<ConnectionDelegate, ConnectionDelegate>>(); 22private readonly List<Func<MultiplexedConnectionDelegate, MultiplexedConnectionDelegate>> _multiplexedMiddleware = new List<Func<MultiplexedConnectionDelegate, MultiplexedConnectionDelegate>>(); 174public IConnectionBuilder Use(Func<ConnectionDelegate, ConnectionDelegate> middleware) 180IMultiplexedConnectionBuilder IMultiplexedConnectionBuilder.Use(Func<MultiplexedConnectionDelegate, MultiplexedConnectionDelegate> middleware) 199var component = _middleware[i]; 215var component = _multiplexedMiddleware[i];
Middleware\ConnectionLimitMiddleware.cs (3)
13private readonly Func<T, Task> _next; 18public ConnectionLimitMiddleware(Func<T, Task> next, long connectionLimit, KestrelTrace trace, KestrelMetrics metrics) 24internal ConnectionLimitMiddleware(Func<T, Task> next, ResourceCounter concurrentConnectionCounter, KestrelTrace trace, KestrelMetrics metrics)
Middleware\HttpsConnectionMiddleware.cs (2)
34private readonly Func<Stream, SslStream> _sslStreamFactory; 44private readonly Func<TlsHandshakeCallbackContext, ValueTask<SslServerAuthenticationOptions>>? _tlsCallbackOptions;
src\Servers\Kestrel\shared\Http2HeadersEnumerator.cs (1)
40public Func<string, Encoding?> EncodingSelector { get; set; } = KestrelServerOptions.DefaultHeaderEncodingSelector;
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
TlsHandshakeCallbackOptions.cs (1)
19public Func<TlsHandshakeCallbackContext, ValueTask<SslServerAuthenticationOptions>> OnConnection { get; set; } = default!;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (15)
AddressBinderTests.cs (1)
18private readonly Func<ListenOptions, ListenOptions> _noopUseHttps = l => l;
ConnectionDispatcherTests.cs (1)
118private static KestrelConnection<ConnectionContext> CreateKestrelConnection(TestServiceContext serviceContext, DefaultConnectionContext connection, TransportConnectionManager transportConnectionManager, Func<ConnectionContext, Task> connectionDelegate = null)
HttpRequestHeadersTests.cs (1)
638var headers = new HttpRequestHeaders(encodingSelector: useLatin1 ? _ => Encoding.Latin1 : (Func<string, Encoding>)null);
HttpUtilitiesTest.cs (5)
126private void TestKnownStringsInterning(string input, string expected, Func<byte[], string> action) 232public static TheoryData<Func<string, Encoding>> ExceptionThrownForCRLFData 236return new TheoryData<Func<string, Encoding>> { 246private void ExceptionThrownForCRLF(Func<string, Encoding> selector) 255private void ExceptionNotThrownForCRLF(Func<string, Encoding> selector)
src\Servers\Kestrel\shared\Http2HeadersEnumerator.cs (1)
40public Func<string, Encoding?> EncodingSelector { get; set; } = KestrelServerOptions.DefaultHeaderEncodingSelector;
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
308static string Each<T>(IEnumerable<T> values, Func<T, string> formatter)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
17public static async Task BindPortsWithRetry(Func<int, Task> retryFunc, ILogger logger)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
20private Func<LogMessage, bool> _messageFilter; 39public Task<LogMessage> WaitForMessage(Func<LogMessage, bool> messageFilter)
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
34public Task<LogMessage> WaitForLogMessage(Func<LogMessage, bool> messageFilter)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (1)
111Func<ListenOptions, Task> createBinding)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (12)
Http1ReadingBenchmark.cs (2)
24private static readonly Func<object, Task> _syncTaskFunc = (obj) => Task.CompletedTask; 27private static readonly Func<object, Task> _pseudoAsyncTaskFunc = (obj) => _pseudoAsyncTask;
Http1WritingBenchmark.cs (2)
23private static readonly Func<object, Task> _syncTaskFunc = (obj) => Task.CompletedTask; 26private static readonly Func<object, Task> _pseudoAsyncTaskFunc = (obj) => _pseudoAsyncTask;
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)
src\Servers\Kestrel\shared\Http2HeadersEnumerator.cs (1)
40public Func<string, Encoding?> EncodingSelector { get; set; } = KestrelServerOptions.DefaultHeaderEncodingSelector;
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
85internal Func<TestStreamContext, Http3ControlStream> OnCreateServerControlStream { get; set; }
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
20private Func<LogMessage, bool> _messageFilter; 39public Task<LogMessage> WaitForMessage(Func<LogMessage, bool> messageFilter)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (1)
111Func<ListenOptions, Task> createBinding)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
NamedPipeTransportOptions.cs (1)
79public Func<CreateNamedPipeServerStreamContext, NamedPipeServerStream> CreateNamedPipeServerStream { get; set; } = CreateDefaultNamedPipeServerStream;
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)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
17public static async Task BindPortsWithRetry(Func<int, Task> retryFunc, ILogger logger)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
20private Func<LogMessage, bool> _messageFilter; 39public Task<LogMessage> WaitForMessage(Func<LogMessage, bool> messageFilter)
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
34public Task<LogMessage> WaitForLogMessage(Func<LogMessage, bool> messageFilter)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
SocketTransportOptions.cs (1)
111public Func<EndPoint, Socket> CreateBoundListenSocket { get; set; } = CreateDefaultBoundListenSocket;
Microsoft.AspNetCore.Shared.Tests (44)
PropertyHelperTest.cs (6)
493var accessor = PropertyHelper.MakeFastPropertyGetter(property.Property); 507var accessor = PropertyHelper.MakeFastPropertyGetter(property.Property); 521var accessor = PropertyHelper.MakeNullSafeFastPropertyGetter(property.Property); 538var accessor = PropertyHelper.MakeNullSafeFastPropertyGetter(property.Property); 555var accessor = PropertyHelper.MakeNullSafeFastPropertyGetter(property.Property); 572var accessor = PropertyHelper.MakeNullSafeFastPropertyGetter(property.Property);
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\PropertyActivator\PropertyActivator.cs (4)
14private readonly Func<TContext, object> _valueAccessor; 19Func<TContext, object> valueAccessor) 40Func<PropertyInfo, PropertyActivator<TContext>> createActivateInfo) 52Func<PropertyInfo, PropertyActivator<TContext>> createActivateInfo,
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,
src\Shared\ServerInfrastructure\DuplexPipeStreamAdapter.cs (2)
20public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, Func<Stream, TStream> createStream) : 25public DuplexPipeStreamAdapter(IDuplexPipe duplexPipe, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, TStream> createStream) :
src\Shared\ServerInfrastructure\SslDuplexPipe.cs (1)
19public SslDuplexPipe(IDuplexPipe transport, StreamPipeReaderOptions readerOptions, StreamPipeWriterOptions writerOptions, Func<Stream, SslStream> factory) :
Microsoft.AspNetCore.SignalR.Client.Core (18)
HubConnection.cs (6)
121public event Func<Exception?, Task>? Closed; 141public event Func<Exception?, Task>? Reconnecting; 161public event Func<string?, Task>? Reconnected; 1784var closed = Closed; 1962var reconnecting = Reconnecting; 1989var reconnected = Reconnected;
HubConnectionExtensions.cs (4)
211public static IDisposable On(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Func<object?[], Task> handler) 215var currentHandler = (Func<object?[], Task>)state; 242public static IDisposable On<T1>(this HubConnection hubConnection, string methodName, Func<T1, Task> handler)
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)
HubConnectionTests.cs (1)
73private static Func<EndPoint, ValueTask<ConnectionContext>> GetHttpConnectionFactory(string url, ILoggerFactory loggerFactory, string path, HttpTransportType transportType, TransferFormat transferFormat)
Microsoft.AspNetCore.SignalR.Client.Tests (17)
HttpConnectionFactoryTests.cs (1)
79Func<HttpMessageHandler, HttpMessageHandler> handlerFactory = handler => handler;
HttpConnectionTests.Helpers.cs (1)
70private static async Task WithConnectionAsync(HttpConnection connection, Func<HttpConnection, Task> body)
HubConnectionTests.ConnectionLifecycle.cs (6)
28private static readonly IDictionary<string, Func<HubConnection, Task>> MethodsThatRequireActiveConnection = new Dictionary<string, Func<HubConnection, Task>>() 194var method = MethodsThatRequireActiveConnection[name]; 208var method = MethodsThatRequireActiveConnection[name]; 459var method = MethodsThatRequireActiveConnection[methodName]; 646private static async Task AsyncUsing(HubConnection connection, Func<HubConnection, Task> action)
HubConnectionTests.cs (1)
1040public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnected) { }
TestHttpMessageHandler.cs (8)
23private readonly List<Func<RequestDelegate, RequestDelegate>> _middleware = new List<Func<RequestDelegate, RequestDelegate>>(); 90foreach (var middleware in _middleware) 137void OnRequestCore(Func<RequestDelegate, RequestDelegate> middleware) 192public void OnLongPollDelete(Func<CancellationToken, HttpResponseMessage> handler) => OnLongPollDelete((cancellationToken) => Task.FromResult(handler(cancellationToken))); 194public void OnLongPollDelete(Func<CancellationToken, Task<HttpResponseMessage>> handler) 209public void OnLongPoll(Func<CancellationToken, HttpResponseMessage> handler) => OnLongPoll(cancellationToken => Task.FromResult(handler(cancellationToken))); 211public void OnLongPoll(Func<CancellationToken, Task<HttpResponseMessage>> handler)
Microsoft.AspNetCore.SignalR.Core (36)
IHubFilter.cs (2)
17ValueTask<object?> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object?>> next) => next(invocationContext); 25Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) => next(context);
Internal\ChannelBasedSemaphore.cs (3)
43public ValueTask RunAsync<TState>(Func<TState, Task<bool>> callback, TState state) 54private async ValueTask RunSlowAsync<TState>(Func<TState, Task<bool>> callback, TState state) 60private async Task RunTask<TState>(Func<TState, Task<bool>> callback, TState state)
Internal\DefaultHubDispatcher.cs (4)
31private readonly Func<HubInvocationContext, ValueTask<object?>>? _invokeMiddleware; 32private readonly Func<HubLifetimeContext, Task>? _onConnectedMiddleware; 71var nextFilter = _invokeMiddleware; 74var connectedFilter = _onConnectedMiddleware;
Internal\HubFilterFactory.cs (2)
22public async ValueTask<object?> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object?>> next) 39public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next)
Internal\TypedClientBuilder.cs (5)
17private static readonly Lazy<Func<IClientProxy, T>> _builder = new Lazy<Func<IClientProxy, T>>(GenerateClientBuilder); 36private static Func<IClientProxy, T> GenerateClientBuilder() 46return (Func<IClientProxy, T>)factoryMethod!.CreateDelegate(typeof(Func<IClientProxy, T>));
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)
RedisOptions.cs (2)
27public Func<TextWriter, Task<IConnectionMultiplexer>>? ConnectionFactory { get; set; } 32var factory = ConnectionFactory;
Microsoft.AspNetCore.SignalR.Tests (19)
AddSignalRTests.cs (1)
359public ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
HubConnectionHandlerTests.cs (5)
5229public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect) { } 5337private Func<PipeWriter, Task> _notifyOnReconnect; 5347public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect) 5404private readonly Func<HubConnectionContext, string> _getUserId; 5406public TestUserIdProvider(Func<HubConnectionContext, string> getUserId)
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)
DelegateConnectionFactory.cs (2)
11private readonly Func<EndPoint, ValueTask<ConnectionContext>> _connectDelegate; 14public DelegateConnectionFactory(Func<EndPoint, ValueTask<ConnectionContext>> connectDelegate)
src\Shared\SignalR\FunctionalTestBase.cs (4)
14private readonly Func<WriteContext, bool> _globalExpectedErrorsFilter; 22private Func<WriteContext, bool> ResolveExpectedErrorsFilter(Func<WriteContext, bool> expectedErrorsFilter) 40public Task<InProcessTestServer<T>> StartServer<T>(Func<WriteContext, bool> expectedErrorsFilter = null, Action<KestrelServerOptions> configureKestrelServerOptions = null) where T : class
src\Shared\SignalR\VerifiableLoggedTest.cs (2)
20public virtual VerifyNoErrorsScope StartVerifiableLog(Func<WriteContext, bool> expectedErrorsFilter = null) 25private VerifyNoErrorsScope CreateScope(Func<WriteContext, bool> expectedErrorsFilter = null)
src\Shared\SignalR\VerifyNoErrorScope.cs (2)
15private readonly Func<WriteContext, bool> _expectedErrorsFilter; 22public VerifyNoErrorsScope(ILoggerFactory loggerFactory = null, IDisposable wrappedDisposable = null, Func<WriteContext, bool> expectedErrorsFilter = null)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (2)
ListLoggerFactory.cs (2)
14private readonly Func<string, bool> _shouldLogCategory; 22public ListLoggerFactory(Func<string, bool> shouldLogCategory)
Microsoft.AspNetCore.StaticFiles (2)
StaticFileOptions.cs (2)
16internal static readonly Func<StaticFileResponseContext, Task> _defaultOnPrepareResponseAsync = _ => Task.CompletedTask; 78public Func<StaticFileResponseContext, Task> OnPrepareResponseAsync { get; set; }
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);
HttpContextBuilder.cs (2)
28private Func<PipeWriter, Task>? _sendRequestStream; 68internal void SendRequestStream(Func<PipeWriter, Task> sendRequestStream)
ResponseFeature.cs (2)
74public void OnStarting(Func<object, Task> callback, object state) 89public void OnCompleted(Func<object, Task> callback, object state)
WebHostBuilderFactory.cs (1)
23var factory = HostFactoryResolver.ResolveWebHostBuilderFactory<IWebHostBuilder>(assembly);
Microsoft.AspNetCore.TestHost.Tests (2)
TestClientTests.cs (2)
553private readonly Func<Stream, Task> _sendContent; 555public PushContent(Func<Stream, Task> sendContent)
Microsoft.AspNetCore.Testing (2)
ServiceFakesHostExtensions.cs (2)
24private static readonly Func<Uri, bool> _defaultAddressFilter = static _ => true; 35public static HttpClient CreateClient(this IHost host, HttpMessageHandler? handler = null, Func<Uri, bool>? addressFilter = null)
Microsoft.AspNetCore.WebSockets.Tests (1)
KestrelWebSocketHelpers.cs (1)
18public static IAsyncDisposable CreateServer(ILoggerFactory loggerFactory, out int port, Func<HttpContext, Task> app, Action<WebSocketOptions> configure = null)
Microsoft.AspNetCore.WebUtilities.Tests (8)
HttpRequestStreamReaderTest.cs (7)
150public static async Task ReadLine_ReadMultipleLines(Func<HttpRequestStreamReader, Task<string>> action) 172public static async Task ReadLine_ReadWithNoNewlines(Func<HttpRequestStreamReader, Task<string>> action) 189public static async Task ReadLine_MultipleContinuousLines(Func<HttpRequestStreamReader, Task<string>> action) 213public static async Task ReadLine_CarriageReturnAndLineFeedAcrossBufferBundaries(Func<HttpRequestStreamReader, Task<string>> action) 237public static async Task ReadLine_EOF(Func<HttpRequestStreamReader, Task<string>> action) 250public static async Task ReadLine_NewLineOnly(Func<HttpRequestStreamReader, Task<string>> action) 389public static async Task StreamDisposed_ExpectObjectDisposedExceptionAsync(Func<HttpRequestStreamReader, Task> action)
HttpResponseStreamWriterTest.cs (1)
777public static async Task StreamDisposed_ExpectedObjectDisposedExceptionAsync(Func<HttpResponseStreamWriter, Task> function)
Microsoft.Build (61)
BackEnd\Components\Communications\INodeProvider.cs (1)
71IList<NodeInfo> CreateNodes(int nextNodeId, INodePacketFactory packetFactory, Func<NodeInfo, NodeConfiguration> configurationFactory, int numberOfNodesToCreate);
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
192public IList<NodeInfo> CreateNodes(int nextNodeId, INodePacketFactory factory, Func<NodeInfo, NodeConfiguration> configurationFactory, int numberOfNodesToCreate)
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (1)
79public IList<NodeInfo> CreateNodes(int nextNodeId, INodePacketFactory factory, Func<NodeInfo, NodeConfiguration> configurationFactory, int numberOfNodesToCreate)
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (1)
164public IList<NodeInfo> CreateNodes(int nextNodeId, INodePacketFactory packetFactory, Func<NodeInfo, NodeConfiguration> configurationFactory, int numberOfNodesToCreate)
BackEnd\Components\Scheduler\Scheduler.cs (2)
582Func<int, int> grantCores = (availableCores) => 990private void AssignUnscheduledRequestsToInProcNode(List<ScheduleResponse> responses, HashSet<int> idleNodes, Func<SchedulableRequest, bool> shouldBeScheduled)
BackEnd\Shared\BuildRequestConfiguration.cs (2)
811private Func<string, bool> shouldSkipStaticGraphIsolationOnReference; 826Func<string, bool> GetReferenceFilter()
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (1)
437Func<string, string?> getPropertyValue = p =>
BuildCheck\Infrastructure\CheckScopeClassifier.cs (1)
22public static Func<EvaluationCheckScope, bool> IsScopingReady => (scope) => (scope is EvaluationCheckScope.ProjectFileOnly or EvaluationCheckScope.All) || IsScopingInitialized;
BuildCheck\Infrastructure\ConfigurationProvider.cs (1)
278Func<CheckConfiguration, T?> propertyGetter) where T : struct
BuildEnvironmentHelper.cs (3)
468Func<string, string> getEnvironmentVariable = null, 495private static Func<string, string> s_getEnvironmentVariable = GetEnvironmentVariable; 609var existsCheck = mode == BuildEnvironmentMode.VisualStudio ? new Func<string, bool>(_ => true) : File.Exists;
CachingFileSystemWrapper.cs (1)
84private bool CachedExistenceCheck(string path, Func<string, bool> existenceCheck)
Collections\ConvertingEnumerable.cs (4)
28private readonly Func<TFrom, TTo> _converter; 33internal ConvertingEnumerable(IEnumerable<TFrom> backingEnumerable, Func<TFrom, TTo> converter) 71private readonly Func<TFrom2, TTo2> _converter; 76internal ConvertingEnumerator(IEnumerator<TFrom2> backingEnumerator, Func<TFrom2, TTo2> converter)
Collections\CopyOnReadEnumerable.cs (2)
37private readonly Func<TSource, TResult> _selector; 45public CopyOnReadEnumerable(IEnumerable<TSource> backingEnumerable, object syncRoot, Func<TSource, TResult> selector)
Collections\IItemDictionary.cs (1)
46IEnumerable<TResult> GetCopyOnReadEnumerable<TResult>(Func<T, TResult> selector);
Collections\ItemDictionary.cs (1)
151public IEnumerable<TResult> GetCopyOnReadEnumerable<TResult>(Func<T, TResult> selector)
Collections\PropertyDictionary.cs (3)
211public IEnumerable<TResult> GetCopyOnReadEnumerable<TResult>(Func<T, TResult> selector) 552internal IEnumerable<TResult> Filter<TResult>(Func<T, bool> filter, Func<T, TResult> selector)
Collections\ReadOnlyConvertingDictionary.cs (2)
30private readonly Func<V, N> _converter; 35internal ReadOnlyConvertingDictionary(IDictionary<K, V> backing, Func<V, N> converter)
Construction\ProjectElementContainer.cs (1)
765Func<ProjectElement, ProjectElement> nextSibling,
Construction\ProjectRootElement.cs (1)
1718private void ReloadFrom(Func<bool, XmlDocumentWithLocation> documentProducer, bool throwIfUnsavedChanges, bool? preserveFormatting)
CopyOnWriteDictionary.cs (1)
219public IEnumerable<KeyValuePair<string, V>> Where(Func<KeyValuePair<string, V>, bool> predicate)
Evaluation\ConditionEvaluator.cs (1)
153public ConcurrentStack<GenericExpressionNode> GetOrAdd(string condition, Func<string, ConcurrentStack<GenericExpressionNode>> addFunc)
Evaluation\ItemSpec.cs (2)
576private readonly Func<string, string> _normalize; 584_normalize = options == MatchOnMetadataOptions.PathLike ? (Func<string, string>)(p => FileUtilities.NormalizePathForComparisonNoThrow(p, Environment.CurrentDirectory)) : p => p;
Evaluation\LazyItemEvaluator.IncludeOperation.cs (2)
42Lazy<Func<string, bool>>? excludeTester = null; 56excludeTester = new Lazy<Func<string, bool>>(() => EngineFileUtilities.GetFileSpecMatchTester(excludePatterns, _rootDirectory));
Graph\ProjectGraph.cs (1)
498Func<ProjectGraphNode, string> nodeIdProvider,
Instance\ImmutableProjectCollections\ImmutableElementCollectionConverter.cs (3)
27Func<TCached, T> convertElement) 109private readonly Func<TCached, T> _getElementInstance; 114Func<TCached, T> getElementInstance)
Instance\ImmutableProjectCollections\ImmutableItemDefinitionsListConverter.cs (2)
18private readonly Func<TCached, T> _getInstance; 23Func<TCached, T> getInstance)
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)
Instance\ImmutableProjectCollections\ImmutableLinkedMultiDictionaryConverter.cs (4)
15private readonly Func<K, IEnumerable<VCached>> _getCachedValues; 16private readonly Func<VCached, V> _getInstance; 18public ImmutableLinkedMultiDictionaryConverter(Func<K, IEnumerable<VCached>> getCachedValues, Func<VCached, V> getInstance)
Instance\ImmutableProjectCollections\ImmutablePropertyCollectionConverter.cs (1)
14public ImmutablePropertyCollectionConverter(IDictionary<string, TCached> properties, Func<TCached, T> convertProperty)
Instance\ImmutableProjectCollections\ImmutableStringValuedListConverter.cs (2)
15private readonly Func<T, string> _getStringValue; 17public ImmutableStringValuedListConverter(IList<T> itemList, Func<T, string> getStringValue)
Instance\ImmutableProjectCollections\ImmutableValuedElementCollectionConverter.cs (1)
20Func<TCached, T> convertElement)
Instance\ProjectInstance.cs (1)
929Func<ProjectItem, ProjectItemInstance> convertCachedItemToInstance =
Logging\BinaryLogger\BinaryLogger.cs (1)
159internal Func<string, string> PathParameterExpander { private get; set; } = ExpandPathParameter;
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
341private BinaryLogRecordKind PreprocessRecordsTillNextEvent(Func<BinaryLogRecordKind, bool> isPreprocessRecord)
Utilities\EngineFileUtilities.cs (1)
605internal static Func<string, bool> GetFileSpecMatchTester(IList<string> filespecsEscaped, string? currentDirectory)
Microsoft.Build.BuildCheck.UnitTests (1)
EndToEndTests.cs (1)
951var ExecuteDotnetCommand = (string parameters) =>
Microsoft.Build.Engine.OM.UnitTests (23)
BuildEnvironmentHelper.cs (3)
468Func<string, string> getEnvironmentVariable = null, 495private static Func<string, string> s_getEnvironmentVariable = GetEnvironmentVariable; 609var existsCheck = mode == BuildEnvironmentMode.VisualStudio ? new Func<string, bool>(_ => true) : File.Exists;
CachingFileSystemWrapper.cs (1)
84private bool CachedExistenceCheck(string path, Func<string, bool> existenceCheck)
Definition\DefinitionEditing_Tests.cs (1)
2572private static void AssertDisabledItemSplitting(string projectContents, int itemIndex, SetupProject setupProject, Action<Project, ProjectItem> itemOperation, string metadataToInsert = "", Func<string, Project> projectProvider = null)
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)
ObjectModelRemoting\RemoteProjectsProviderMock\CollectionsHelpers.cs (1)
14public static IList<A> ConvertCollection<A, B>(this IEnumerable<B> source, Func<B, A> converter)
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\ProjectElemetExportHelper.cs (3)
30public ElementInfo(Type type, Func<ProjectElement, bool> checker, ExporterFactory factory) 38public ElementInfo(Func<ProjectElement, bool> checker, ExporterFactory factory) 45public Func<ProjectElement, bool> Checker { get; }
Microsoft.Build.Engine.UnitTests (21)
BackEnd\SdkResolverLoader_Tests.cs (2)
455public Func<string, Assembly> LoadResolverAssemblyFunc { get; set; } 459public Func<Assembly, IEnumerable<Type>> GetResolverTypesFunc { get; set; }
BackEnd\TranslationHelpers.cs (2)
173(Func<DictionaryEntry, string>)(d => d.Key.ToString()), 174(Func<DictionaryEntry, string>)(d => d.Value.ToString()));
BuildEventArgsSerialization_Tests.cs (2)
1226private void Roundtrip<T>(T args, params Func<T, string>[] fieldsToCompare) 1248foreach (var field in fieldsToCompare)
Evaluation\EvaluationLogging_Tests.cs (1)
44Func<Project, MockLogger> reevaluationLoggerFactory = null)
FileMatcher_Tests.cs (2)
2405Func<string[], string[]> normalizeAllFunc = (paths => normalizeAllPaths ? paths.Select(MockFileSystem.Normalize).ToArray() : paths); 2406Func<string[], string[]> normalizeMatching = (paths => normalizeExpectedMatchingFiles ? paths.Select(MockFileSystem.Normalize).ToArray() : paths);
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)
Graph\ProjectGraph_Tests.cs (1)
1847Func<ProjectGraphNode, string> nodeIdProvider = GetProjectFileName;
Microsoft.Build.Framework (19)
BuildCheck\EnumerableExtensions.cs (1)
114Func<TValue, TKey> extractKey,
FileClassifier.cs (2)
256public void RegisterFrameworkLocations(Func<string, string?> getPropertyValue) 270public void RegisterKnownImmutableLocations(Func<string, string?> getPropertyValue)
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)
ImmutableSegmentedList`1.cs (1)
205/// <inheritdoc cref="ImmutableList{T}.ConvertAll{TOutput}(Func{T, TOutput})"/>
ImmutableSegmentedList`1+Builder.cs (1)
77/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.ConvertAll{TOutput}(Func{T, TOutput})"/>
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)
TaskParameterEventArgs.cs (2)
109internal static Func<TaskParameterEventArgs, string> MessageGetter = args => 126internal static Func<int, IDictionary<string, string>> DictionaryFactory = capacity => new Dictionary<string, string>(capacity);
Microsoft.Build.Tasks.CodeAnalysis (2)
src\Compilers\Core\CommandLine\ConsoleUtil.cs (2)
20internal static T RunWithUtf8Output<T>(Func<TextWriter, T> func) 41internal static T RunWithUtf8Output<T>(bool utf8Output, TextWriter textWriter, Func<TextWriter, T> func)
Microsoft.Build.Tasks.Core (6)
AssemblyFoldersFromConfig.cs (1)
68private void FindDirectories(List<AssemblyFolderItem> assemblyTargets, Func<AssemblyFolderItem, bool> platformFilter)
BuildEnvironmentHelper.cs (3)
468Func<string, string> getEnvironmentVariable = null, 495private static Func<string, string> s_getEnvironmentVariable = GetEnvironmentVariable; 609var existsCheck = mode == BuildEnvironmentMode.VisualStudio ? new Func<string, bool>(_ => true) : File.Exists;
CachingFileSystemWrapper.cs (1)
84private bool CachedExistenceCheck(string path, Func<string, bool> existenceCheck)
CopyOnWriteDictionary.cs (1)
219public IEnumerable<KeyValuePair<string, V>> Where(Func<KeyValuePair<string, V>, bool> predicate)
Microsoft.Build.Tasks.UnitTests (3)
DownloadFile_Tests.cs (2)
367private readonly Func<Stream, Task> _func; 370public MockHttpContent(int length, Func<Stream, Task> func)
ResolveNonMSBuildProjectOutput_Tests.cs (1)
171private void TestUnresolvedReferencesHelper(ArrayList projectRefs, Hashtable pregenOutputs, Func<string, bool> isManaged,
Microsoft.Build.UnitTests.Shared (5)
EnvironmentProvider.cs (5)
28private readonly Func<string, string?> _getEnvironmentVariable; 31public EnvironmentProvider(Func<string, string?> getEnvironmentVariable) 35public EnvironmentProvider(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath) 110public static string? GetDotnetExePath(Func<string, string?>? getEnvironmentVariable = null) 120public static string? GetDotnetExePath(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath)
Microsoft.Build.Utilities.Core (6)
AssemblyFoldersFromConfig.cs (1)
68private void FindDirectories(List<AssemblyFolderItem> assemblyTargets, Func<AssemblyFolderItem, bool> platformFilter)
BuildEnvironmentHelper.cs (3)
468Func<string, string> getEnvironmentVariable = null, 495private static Func<string, string> s_getEnvironmentVariable = GetEnvironmentVariable; 609var existsCheck = mode == BuildEnvironmentMode.VisualStudio ? new Func<string, bool>(_ => true) : File.Exists;
CachingFileSystemWrapper.cs (1)
84private bool CachedExistenceCheck(string path, Func<string, bool> existenceCheck)
CopyOnWriteDictionary.cs (1)
219public IEnumerable<KeyValuePair<string, V>> Where(Func<KeyValuePair<string, V>, bool> predicate)
Microsoft.Cci.Extensions (13)
Comparers\ApiComparer.cs (4)
13private readonly Func<T, ApiKind> _kindProvider; 14private readonly Func<T, string> _nameProvider; 16public ApiComparer(Func<T, ApiKind> kindProvider, Func<T, string> nameProvider)
Comparers\StringKeyComparer.cs (2)
11private readonly Func<T, string> _getKey; 18public StringKeyComparer(Func<T, string> getKey)
Differs\ElementDifferenceFactory.cs (2)
20private Func<IDifferenceRuleMetadata, bool> _ruleFilter; 26public ElementDifferenceFactory(CompositionContainer container, Func<IDifferenceRuleMetadata, bool> ruleFilter = null)
Experimental\TypeReferenceSearcher.cs (2)
56private Func<ITypeReference, bool> _typePredicate; 66public void Search(Func<ITypeReference, bool> typePredicate, IAssembly assembly)
Filters\MappingDifferenceFilter.cs (2)
13private readonly Func<DifferenceType, bool> _include; 16public MappingDifferenceFilter(Func<DifferenceType, bool> include, ICciFilter filter)
Filters\TypesOnlyMappingDifferenceFilter.cs (1)
12public TypesOnlyMappingDifferenceFilter(Func<DifferenceType, bool> include, ICciFilter filter)
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)
CodeGen\CompilationTestData.cs (2)
43public Func<ISymWriterMetadataProvider, SymUnmanagedWriter>? SymWriterFactory; 58public ILBuilder GetIL(Func<IMethodSymbolInternal, bool> predicate)
CodeGen\ILBuilder.cs (1)
1218private bool AllBlocks(Func<BasicBlock, bool> predicate)
Collections\ArrayBuilderExtensions.cs (4)
15public static bool Any<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 39public static bool All<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 71public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TResult> map) 245public static void FreeAll<T>(this ArrayBuilder<T> builder, Func<T, ArrayBuilder<T>?> getNested)
Collections\CachingDictionary.cs (4)
33private readonly Func<TKey, ImmutableArray<TElement>> _getElementsOfKey; 34private readonly Func<IEqualityComparer<TKey>, SegmentedHashSet<TKey>> _getKeys; 56Func<TKey, ImmutableArray<TElement>> getElementsOfKey, 57Func<IEqualityComparer<TKey>, SegmentedHashSet<TKey>> getKeys,
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\HashSetExtensions.cs (1)
37internal static bool Any<T>(this HashSet<T> hashSet, Func<T, bool> predicate)
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)
Collections\TemporaryArrayExtensions.cs (3)
43public static bool Any<T>(this in TemporaryArray<T> array, Func<T, bool> predicate) 54public static bool All<T>(this in TemporaryArray<T> array, Func<T, bool> predicate) 68public static T? SingleOrDefault<T>(this in TemporaryArray<T> array, Func<T, bool> predicate)
Collections\UnionCollection.cs (1)
48public static ICollection<T> Create<TOrig>(ImmutableArray<TOrig> collections, Func<TOrig, ICollection<T>> selector)
Compilation.EmitStream.cs (1)
145Func<string, Stream> streamConstructor = path => fileSystem.CreateFileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
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,
Compilation\SemanticModel.cs (1)
897internal virtual Func<SyntaxNode, bool>? GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) => null;
DiagnosticAnalyzer\AdditionalTextValueProvider.cs (1)
23public AdditionalTextValueProvider(Func<AdditionalText, TValue> computeValue, IEqualityComparer<AdditionalText>? additionalTextComparer = null)
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\AnalysisValueProvider.cs (2)
16private readonly Func<TKey, TValue> _computeValue; 25public AnalysisValueProvider(Func<TKey, TValue> computeValue, IEqualityComparer<TKey> keyComparer)
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\CachingSemanticModelProvider.cs (1)
63private readonly Func<SyntaxTree, SemanticModel> _createSemanticModel;
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (3)
737Func<DiagnosticAnalyzer, AnalyzerActionCounts> getAnalyzerActionCounts = analyzer => analyzerActionCounts[analyzer]; 1235Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnosticDescriptors = analyzer => 1247Func<DiagnosticSuppressor, ImmutableArray<SuppressionDescriptor>> getSupportedSuppressionDescriptors = suppressor =>
DiagnosticAnalyzer\CompilationWithAnalyzersOptions.cs (3)
16private readonly Func<Exception, bool>? _analyzerExceptionFilter; 34public Func<Exception, bool>? AnalyzerExceptionFilter => _analyzerExceptionFilter; 100Func<Exception, bool>? analyzerExceptionFilter)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
62Func<Location, bool> locationFilter,
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,
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (1)
171internal static ControlFlowGraph GetControlFlowGraph(IOperation operation, Func<IOperation, ControlFlowGraph>? getControlFlowGraph, CancellationToken cancellationToken)
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (1)
331Func<IOperation, ControlFlowGraph> getControlFlowGraph,
DiagnosticAnalyzer\SourceTextValueProvider.cs (1)
24public SourceTextValueProvider(Func<SourceText, TValue> computeValue, IEqualityComparer<SourceText>? sourceTextComparer = null)
DiagnosticAnalyzer\SyntaxTreeValueProvider.cs (1)
23public SyntaxTreeValueProvider(Func<SyntaxTree, TValue> computeValue, IEqualityComparer<SyntaxTree>? syntaxTreeComparer = null)
DiaSymReader\SymUnmanagedFactory.cs (4)
79private static readonly Lazy<Func<string, string>> s_lazyGetEnvironmentVariable = new Lazy<Func<string, string>>(() => 88return (Func<string, string>)method.CreateDelegate(typeof(Func<string, string>));
Emit\DebugDocumentsBuilder.cs (1)
58internal Cci.DebugSourceDocument GetOrAddDebugDocument(string path, string basePath, Func<string, Cci.DebugSourceDocument> factory)
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\EditAndContinue\EncMappedMethod.cs (4)
10internal readonly struct EncMappedMethod(IMethodSymbolInternal previousMethod, Func<SyntaxNode, SyntaxNode?>? syntaxMap, Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdit) 13public readonly Func<SyntaxNode, SyntaxNode?>? SyntaxMap = syntaxMap; 14public readonly Func<SyntaxNode, RuntimeRudeEdit?>? RuntimeRudeEdit = runtimeRudeEdit;
Emit\EditAndContinue\SymbolChanges.cs (4)
48private readonly Func<ISymbol, bool> _isAddedSymbol; 50protected SymbolChanges(DefinitionMap definitionMap, IEnumerable<SemanticEdit> edits, Func<ISymbol, bool> isAddedSymbol) 282public SymbolChange GetChangeForPossibleReAddedMember(ITypeDefinitionMember item, Func<ITypeDefinitionMember, bool> definitionExistsInAnyPreviousGeneration) 288SymbolChange fixChangeIfMemberIsReAdded(ITypeDefinitionMember item, SymbolChange change, Func<ITypeDefinitionMember, bool> definitionExistsInAnyPreviousGeneration)
Emit\EmitOptions.cs (1)
123internal Func<ImmutableArray<byte>, string>? TestOnly_DataToHexViaXxHash128 { get; init; }
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\ConcurrentLruCache.cs (1)
224public V GetOrAdd<T>(K key, T arg, Func<T, V> creator)
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)
InternalUtilities\OneOrMany.cs (4)
123public OneOrMany<TResult> Select<TResult>(Func<T, TResult> selector) 142public T? FirstOrDefault(Func<T, bool> predicate) 169public bool All(Func<T, bool> predicate) 178public bool Any(Func<T, bool> predicate)
InternalUtilities\SingleInitNullable.cs (1)
48public T Initialize<TArg>(Func<TArg, T> valueFactory, TArg arg)
InternalUtilities\SpanUtilities.cs (1)
24public static bool All<TElement>(this ReadOnlySpan<TElement> span, Func<TElement, bool> predicate)
InternalUtilities\StringExtensions.cs (3)
57private static readonly Func<char, char> s_toLower = char.ToLower; 58private static readonly Func<char, char> s_toUpper = char.ToUpper; 80Func<char, char> convert)
MetadataReader\MetadataHelpers.cs (1)
598ReadOnlyMemory<char> nameMemory, ImmutableArray<T> splitSystemString, Func<ReadOnlyMemory<char>, T> convert)
MetadataReference\AssemblyMetadata.cs (2)
53private readonly Func<string, ModuleMetadata>? _moduleFactoryOpt; 97internal AssemblyMetadata(ModuleMetadata manifestModule, Func<string, ModuleMetadata> moduleFactory)
NativePdbWriter\PdbWriter.cs (2)
32private readonly Func<ISymWriterMetadataProvider, SymUnmanagedWriter> _symWriterFactory; 44public PdbWriter(string fileName, Func<ISymWriterMetadataProvider, SymUnmanagedWriter> symWriterFactory, HashAlgorithmName hashAlgorithmNameOpt)
Operations\ControlFlowGraphBuilder.cs (3)
1988private void VisitAndPushArray<T>(ImmutableArray<T> array, Func<T, IOperation>? unwrapper = null) where T : IOperation 2019private ImmutableArray<T> VisitArray<T>(ImmutableArray<T> originalArray, Func<T, IOperation>? unwrapper = null, Func<IOperation, int, ImmutableArray<T>, T>? wrapper = null) where T : IOperation 3956Func<IOperation, IOperation>? visitResource = null)
PEWriter\CustomDebugInfoWriter.cs (1)
166Func<ILocalDefinition, bool> filter,
PEWriter\ExtendedPEBuilder.cs (1)
43Func<IEnumerable<Blob>, BlobContentId>? deterministicIdProvider,
PEWriter\MetadataWriter.cs (2)
1865public PortablePdbBuilder GetPortablePdbBuilder(ImmutableArray<int> typeSystemRowCounts, MethodDefinitionHandle debugEntryPoint, Func<IEnumerable<Blob>, BlobContentId> deterministicIdProviderOpt) 2110private void AddCustomAttributesToTable<T>(IEnumerable<T> parentList, Func<T, EntityHandle> getDefinitionHandle)
PEWriter\PeWriter.cs (2)
191var peIdProvider = isDeterministic ? 206var portablePdbIdProvider = (context.Module.PdbChecksumAlgorithm.Name != null) ?
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)
SourceGeneration\GeneratorDriver.cs (2)
60public GeneratorDriver RunGenerators(Compilation compilation, Func<GeneratorFilterContext, bool>? generatorFilter, CancellationToken cancellationToken = default) 213internal GeneratorDriverState RunGeneratorsCore(Compilation compilation, DiagnosticBag? diagnosticsBag, Func<GeneratorFilterContext, bool>? generatorFilter = null, CancellationToken cancellationToken = default)
SourceGeneration\GeneratorTimerExtensions.cs (4)
30public static RunTimer CreateSingleGeneratorRunTimer(this CodeAnalysisEventSource eventSource, ISourceGenerator generator, Func<TimeSpan, TimeSpan> adjustRunTime) 49private readonly Func<TimeSpan, TimeSpan>? _adjustRunTime; 60public RunTimer(Func<TimeSpan, TimeSpan>? adjustRunTime) 66public RunTimer(Action<TimeSpan> callback, Func<TimeSpan, TimeSpan>? adjustRunTime = null)
SourceGeneration\Nodes\InputNode.cs (3)
24private readonly Func<DriverStateTable.Builder, ImmutableArray<T>> _getInput; 30public InputNode(Func<DriverStateTable.Builder, ImmutableArray<T>> getInput, IEqualityComparer<T>? inputComparer = null) 35private InputNode(Func<DriverStateTable.Builder, ImmutableArray<T>> getInput, Action<IIncrementalGeneratorOutputNode>? registerOutput, IEqualityComparer<T>? inputComparer = null, IEqualityComparer<T>? comparer = null, string? name = null)
SourceGeneration\Nodes\ValueSourceExtensions.cs (1)
36public static IncrementalValuesProvider<TSource> Where<TSource>(this IncrementalValuesProvider<TSource> source, Func<TSource, bool> predicate) => source.SelectMany((item, _) => predicate(item) ? ImmutableArray.Create(item) : ImmutableArray<TSource>.Empty);
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\ImmutableSegmentedList`1.cs (1)
205/// <inheritdoc cref="ImmutableList{T}.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
77/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (4)
15public static bool All<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 47public static bool Any<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 84public static T Last<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 101public static IEnumerable<TResult> Select<T, TResult>(this ImmutableSegmentedList<T> immutableList, Func<T, TResult> selector)
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\ArrayBuilder.cs (3)
519internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 567public void AddRange<U>(ArrayBuilder<U> items, Func<U, T> selector) 709public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
122internal ObjectPool(Func<ObjectPool<T>, T> factory, int size)
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\GreenNode.cs (3)
902public static GreenNode? CreateList<TFrom>(IEnumerable<TFrom>? enumerable, Func<TFrom, GreenNode> select) 911public static GreenNode? CreateList<TFrom>(List<TFrom> list, Func<TFrom, GreenNode> select) 933public static GreenNode? CreateList<TFrom>(IReadOnlyList<TFrom> list, Func<TFrom, GreenNode> select)
Syntax\InternalSyntax\SyntaxDiagnosticInfoList.cs (1)
25internal bool Any(Func<DiagnosticInfo, bool> predicate)
Syntax\SeparatedSyntaxList.cs (3)
259public int IndexOf(Func<TNode, bool> predicate) 298public int LastIndexOf(Func<TNode, bool> predicate) 316internal bool Any(Func<TNode, bool> predicate)
Syntax\SyntaxList`1.cs (3)
409internal bool All(Func<TNode, bool> predicate) 521public int IndexOf(Func<TNode, bool> predicate) 566public int LastIndexOf(Func<TNode, bool> predicate)
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)
Syntax\SyntaxToken.cs (7)
23private static readonly Func<DiagnosticInfo, Diagnostic> s_createDiagnosticWithoutLocation = Diagnostic.Create; 25internal static readonly Func<SyntaxToken, bool> NonZeroWidth = t => t.Width > 0; 26internal static readonly Func<SyntaxToken, bool> Any = t => true; 598internal SyntaxToken GetNextToken(Func<SyntaxToken, bool> predicate, Func<SyntaxTrivia, bool>? stepInto = null) 629internal SyntaxToken GetPreviousToken(Func<SyntaxToken, bool> predicate, Func<SyntaxTrivia, bool>? stepInto = null)
Syntax\SyntaxTrivia.cs (1)
24internal static readonly Func<SyntaxTrivia, bool> Any = t => true;
Microsoft.CodeAnalysis.Analyzers (41)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132private static int CalculateDepthOfInheritance(INamedTypeSymbol namedType, Func<INamedTypeSymbol, bool> isExcludedFromInheritanceCount)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
17private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 20Func<INamedTypeSymbol, bool>? isExcludedFromInheritanceCountFunc = null) 34public Func<INamedTypeSymbol, bool> IsExcludedFromInheritanceCountFunc { get; }
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (2)
116private readonly Func<INamedTypeSymbol, bool> _isDisallowedCatchType; 122public DisallowGeneralCatchUnlessRethrowWalker(Func<INamedTypeSymbol, bool> isDisallowedCatchType, bool checkAnonymousFunctions)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
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\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
20private static readonly Func<IOperation, ImmutableArray<IOperation>> ElementsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Elements), fallbackResult: default);
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\IUtf8StringOperationWrapper.cs (1)
19private static readonly Func<IOperation, string> ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, string>(WrappedType, nameof(Value), fallbackResult: null!);
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\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
458Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, 473static bool TryParse(string s, (Compilation compilation, Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, string? namePrefix, string? optionForcedValue) arg, out SymbolNamesWithValueOption<TValue> option)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
Microsoft.CodeAnalysis.AnalyzerUtilities (139)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132private static int CalculateDepthOfInheritance(INamedTypeSymbol namedType, Func<INamedTypeSymbol, bool> isExcludedFromInheritanceCount)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
17private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 20Func<INamedTypeSymbol, bool>? isExcludedFromInheritanceCountFunc = null) 34public Func<INamedTypeSymbol, bool> IsExcludedFromInheritanceCountFunc { get; }
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (2)
116private readonly Func<INamedTypeSymbol, bool> _isDisallowedCatchType; 122public DisallowGeneralCatchUnlessRethrowWalker(Func<INamedTypeSymbol, bool> isDisallowedCatchType, bool checkAnonymousFunctions)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
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\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
20private static readonly Func<IOperation, ImmutableArray<IOperation>> ElementsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Elements), fallbackResult: default);
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\IUtf8StringOperationWrapper.cs (1)
19private static readonly Func<IOperation, string> ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, string>(WrappedType, nameof(Value), fallbackResult: null!);
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\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
458Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, 473static bool TryParse(string s, (Compilation compilation, Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, string? namePrefix, string? optionForcedValue) arg, out SymbolNamesWithValueOption<TValue> option)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
src\RoslynAnalyzers\Utilities\FlowAnalysis\BranchWithInfo.cs (1)
17private static readonly Func<ControlFlowRegion, IEnumerable<ControlFlowRegion>> s_getTransitiveNestedRegions = GetTransitiveNestedRegions;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CopyDataFlowOperationVisitor.cs (5)
78Func<AnalysisEntity, CopyAbstractValue> getDefaultCopyValue) 139Func<AnalysisEntity, CopyAbstractValue?> tryGetAddressSharedCopyValue, 152Func<AnalysisEntity, CopyAbstractValue?> tryGetAddressSharedCopyValue, 450Func<AnalysisEntity, bool>? predicate = null; 523private void ApplyMissingCurrentAnalysisDataCore(CopyAnalysisData mergedData, Func<AnalysisEntity, bool>? predicate)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CoreCopyAnalysisDataDomain.cs (2)
19private readonly Func<AnalysisEntity, CopyAbstractValue> _getDefaultCopyValue; 21public CoreCopyAnalysisDataDomain(AbstractValueDomain<CopyAbstractValue> valueDomain, Func<AnalysisEntity, CopyAbstractValue> getDefaultCopyValue)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysisContext.cs (2)
32Func<CopyAnalysisContext, CopyAnalysisResult?> tryGetOrComputeAnalysisResult, 52Func<CopyAnalysisContext, CopyAnalysisResult?> tryGetOrComputeAnalysisResult,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysisData.cs (2)
192internal void AssertValidCopyAnalysisData(Func<AnalysisEntity, CopyAbstractValue?>? tryGetDefaultCopyValue = null, bool initializingParameters = false) 201Func<AnalysisEntity, CopyAbstractValue?>? tryGetDefaultCopyValue = null,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\SetCopyAbstractValuePredicateKind.cs (1)
12/// Predicate kind for <see cref="CopyDataFlowOperationVisitor.SetAbstractValue(CopyAnalysisData, AnalysisEntity, CopyAbstractValue, System.Func{AnalysisEntity, CopyAbstractValue}, SetCopyAbstractValuePredicateKind?, bool)"/>
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.cs (1)
96Func<ITypeSymbol, bool> isDisposableTypeNotRequiringToBeDisposed,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisContext.cs (5)
36Func<DisposeAnalysisContext, DisposeAnalysisResult?> tryGetOrComputeAnalysisResult, 44Func<ITypeSymbol, bool> isDisposableTypeNotRequiringToBeDisposed) 75Func<DisposeAnalysisContext, DisposeAnalysisResult?> tryGetOrComputeAnalysisResult, 80Func<ITypeSymbol, bool> isDisposableTypeNotRequiringToBeDisposed) 112internal Func<ITypeSymbol, bool> IsDisposableTypeNotRequiringToBeDisposed { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
112public static Func<ITypeSymbol?, bool> GetIsDisposableDelegate(Compilation compilation)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateAnalysis.cs (5)
60Func<GlobalFlowStateAnalysisContext, GlobalFlowStateValueSetFlowOperationVisitor> createOperationVisitor, 70Func<IOperation, ValueContentAbstractValue>? getValueContentValueForAdditionalSupportedValueTypeOperation = null) 90Func<GlobalFlowStateAnalysisContext, GlobalFlowStateValueSetFlowOperationVisitor> createOperationVisitor, 100Func<IOperation, ValueContentAbstractValue>? getValueContentValueForAdditionalSupportedValueTypeOperation = null) 127Func<GlobalFlowStateAnalysisContext, GlobalFlowStateValueSetFlowOperationVisitor> createOperationVisitor)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateAnalysisContext.cs (2)
35Func<GlobalFlowStateAnalysisContext, GlobalFlowStateAnalysisResult?> tryGetOrComputeAnalysisResult, 63Func<GlobalFlowStateAnalysisContext, GlobalFlowStateAnalysisResult?> tryGetOrComputeAnalysisResult,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysisContext.cs (2)
35Func<ParameterValidationAnalysisContext, ParameterValidationAnalysisResult?> tryGetOrComputeAnalysisResult, 59Func<ParameterValidationAnalysisContext, ParameterValidationAnalysisResult?> tryGetOrComputeAnalysisResult)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.CorePointsToAnalysisDataDomain.cs (3)
22private readonly Func<ITypeSymbol?, bool> _isDisposable; 27Func<ITypeSymbol?, bool> isDisposable) 58Func<PointsToAbstractValue, ImmutableHashSet<AnalysisEntity>> getChildAnalysisEntities,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.cs (3)
87var isDisposable = DisposeAnalysisHelper.GetIsDisposableDelegate(analysisContext.ControlFlowGraph.OriginalOperation.SemanticModel!.Compilation); 94internal static bool ShouldBeTracked([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol?, bool> isDisposable) 98internal static bool ShouldBeTracked(AnalysisEntity analysisEntity, PointsToAnalysisKind pointsToAnalysisKind, Func<ITypeSymbol?, bool> isDisposable)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToAnalysisDomain.cs (3)
18public PointsToAnalysisDomain(DefaultPointsToValueGenerator defaultPointsToValueGenerator, Func<ITypeSymbol?, bool> isDisposable) 26Func<PointsToAbstractValue, ImmutableHashSet<AnalysisEntity>> getChildAnalysisEntities, 28Func<ITypeSymbol?, bool> isDisposable)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (1)
443Func<ITypeSymbol?, bool> isDisposable,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisContext.cs (2)
34Func<PointsToAnalysisContext, PointsToAnalysisResult?> tryGetOrComputeAnalysisResult, 60Func<PointsToAnalysisContext, PointsToAnalysisResult?> tryGetOrComputeAnalysisResult,
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\Analysis\PropertySetAnalysis\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (2)
596Func<PropertySetAbstractValue, HazardousUsageEvaluationResult> evaluationFunction, 597Func<AbstractLocation, PropertySetAbstractValue>? locationToAbstractValueMapping = null)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisContext.cs (2)
38Func<PropertySetAnalysisContext, PropertySetAnalysisResult?> tryGetOrComputeAnalysisResult, 81Func<PropertySetAnalysisContext, PropertySetAnalysisResult?> tryGetOrComputeAnalysisResult,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetCallbacks.cs (1)
52Func<object?, bool> badLiteralValuePredicate)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysisContext.cs (2)
34Func<TaintedDataAnalysisContext, TaintedDataAnalysisResult?> tryGetOrComputeAnalysisResult, 76Func<TaintedDataAnalysisContext, TaintedDataAnalysisResult?> tryGetOrComputeAnalysisResult,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysis.cs (2)
57Func<IOperation, ValueContentAbstractValue>? getValueContentValueForAdditionalSupportedValueTypeOperation = null) 91Func<IOperation, ValueContentAbstractValue>? getValueContentValueForAdditionalSupportedValueTypeOperation = null)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysisContext.cs (5)
34Func<ValueContentAnalysisContext, ValueContentAnalysisResult?> tryGetOrComputeAnalysisResult, 36Func<IOperation, ValueContentAbstractValue>? getValueForAdditionalSupportedValueTypeOperation, 50public Func<IOperation, ValueContentAbstractValue>? GetValueForAdditionalSupportedValueTypeOperation { get; } 62Func<ValueContentAnalysisContext, ValueContentAnalysisResult?> tryGetOrComputeAnalysisResult, 64Func<IOperation, ValueContentAbstractValue>? getValueContentValueForAdditionalSupportedValueTypeOperation,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractDataFlowAnalysisContext.cs (2)
41Func<TAnalysisContext, TAnalysisResult?> tryGetOrComputeAnalysisResult, 89public Func<TAnalysisContext, TAnalysisResult?> TryGetOrComputeAnalysisResult { get; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityDataFlowOperationVisitor.cs (3)
433private ImmutableHashSet<AnalysisEntity> GetChildAnalysisEntities(PointsToAbstractValue? instanceLocation, Func<AnalysisEntity, bool>? predicate) 453private ImmutableHashSet<AnalysisEntity> GetChildAnalysisEntities(Func<AnalysisEntity, bool> predicate) 738Func<AnalysisEntity, bool>? predicate = null;
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\AnalysisEntityMapAbstractDomain.cs (6)
18private static readonly Func<AnalysisEntity, bool> s_defaultIsTrackedEntity = new(_ => true); 19private static readonly Func<PointsToAbstractValue, bool> s_defaultIsTrackedPointsToValue = new(_ => true); 21private readonly Func<AnalysisEntity, bool> _isTrackedEntity; 22private readonly Func<PointsToAbstractValue, bool> _isTrackedPointsToValue; 26Func<AnalysisEntity, bool> isTrackedEntity, 27Func<PointsToAbstractValue, bool> isTrackedPointsToValue)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
165protected Func<TAnalysisContext, TAnalysisResult?> TryGetOrComputeAnalysisResult 2102Func<TKey, bool>? predicate)
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; }
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\InterproceduralAnalysisPredicate.cs (7)
14private readonly Func<IMethodSymbol, bool>? _skipAnalysisForInvokedMethodPredicate; 15private readonly Func<IMethodSymbol, bool>? _skipAnalysisForInvokedLambdaOrLocalFunctionPredicate; 16private readonly Func<IDataFlowAnalysisContext, bool>? _skipAnalysisForInvokedContextPredicate; 19Func<IMethodSymbol, bool>? skipAnalysisForInvokedMethodPredicate, 20Func<IMethodSymbol, bool>? skipAnalysisForInvokedLambdaOrLocalFunctionPredicate, 21Func<IDataFlowAnalysisContext, bool>? skipAnalysisForInvokedContextPredicate) 37var predicate = isLambdaOrLocalFunction ?
src\RoslynAnalyzers\Utilities\FlowAnalysis\SingleThreadedConcurrentDictionary.cs (1)
40public TValue? GetOrAdd(TKey key, Func<TKey, TValue?> valueFactory)
Microsoft.CodeAnalysis.BannedApiAnalyzers (41)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132private static int CalculateDepthOfInheritance(INamedTypeSymbol namedType, Func<INamedTypeSymbol, bool> isExcludedFromInheritanceCount)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
17private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 20Func<INamedTypeSymbol, bool>? isExcludedFromInheritanceCountFunc = null) 34public Func<INamedTypeSymbol, bool> IsExcludedFromInheritanceCountFunc { get; }
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (2)
116private readonly Func<INamedTypeSymbol, bool> _isDisallowedCatchType; 122public DisallowGeneralCatchUnlessRethrowWalker(Func<INamedTypeSymbol, bool> isDisallowedCatchType, bool checkAnonymousFunctions)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
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\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
20private static readonly Func<IOperation, ImmutableArray<IOperation>> ElementsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Elements), fallbackResult: default);
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\IUtf8StringOperationWrapper.cs (1)
19private static readonly Func<IOperation, string> ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, string>(WrappedType, nameof(Value), fallbackResult: null!);
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\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
458Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, 473static bool TryParse(string s, (Compilation compilation, Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, string? namePrefix, string? optionForcedValue) arg, out SymbolNamesWithValueOption<TValue> option)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
Microsoft.CodeAnalysis.CodeStyle (355)
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
106private static readonly Func<Guid, ConcurrentDictionary<string, string?>> s_createCache =
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
88Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 394Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (4)
15public static bool Any<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 39public static bool All<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 71public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TResult> map) 245public static void FreeAll<T>(this ArrayBuilder<T> builder, Func<T, ArrayBuilder<T>?> getNested)
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\Collections\TemporaryArrayExtensions.cs (3)
43public static bool Any<T>(this in TemporaryArray<T> array, Func<T, bool> predicate) 54public static bool All<T>(this in TemporaryArray<T> array, Func<T, bool> predicate) 68public static T? SingleOrDefault<T>(this in TemporaryArray<T> array, Func<T, bool> predicate)
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\ConcurrentDictionaryExtensions.cs (2)
37using var _ = PooledDelegates.GetPooledFunction(valueFactory, factoryArgument, out var boundFunction); 55using var _a = PooledDelegates.GetPooledFunction(addValueFactory, factoryArgument, out var pooledAddValueFactory);
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\InternalUtilities\OneOrMany.cs (4)
123public OneOrMany<TResult> Select<TResult>(Func<T, TResult> selector) 142public T? FirstOrDefault(Func<T, bool> predicate) 169public bool All(Func<T, bool> predicate) 178public bool Any(Func<T, bool> predicate)
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
48public T Initialize<TArg>(Func<TArg, T> valueFactory, TArg arg)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (3)
57private static readonly Func<char, char> s_toLower = char.ToLower; 58private static readonly Func<char, char> s_toUpper = char.ToUpper; 80Func<char, char> convert)
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\ImmutableSegmentedList`1.cs (1)
205/// <inheritdoc cref="ImmutableList{T}.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
77/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (4)
15public static bool All<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 47public static bool Any<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 84public static T Last<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 101public static IEnumerable<TResult> Select<T, TResult>(this ImmutableSegmentedList<T> immutableList, Func<T, TResult> selector)
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\ArrayBuilder.cs (3)
519internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 567public void AddRange<U>(ArrayBuilder<U> items, Func<U, T> selector) 709public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
122internal ObjectPool(Func<ObjectPool<T>, T> factory, int size)
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\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (2)
17Func<CancellationToken, ValueTask> processBatchAsync, 21private static Func<ImmutableSegmentedList<VoidResult>, CancellationToken, ValueTask> Convert(Func<CancellationToken, ValueTask> processBatchAsync)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (2)
123Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null) 147Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (1)
200private static Func<string, T> GetParser(string type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (2)
23OptionGroup group, string name, CodeStyleOption2<T> defaultValue, Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null) 27OptionGroup group, string name, CodeStyleOption2<T> defaultValue, Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\VisualBasic\VisualBasicCodeStyleOptions.cs (1)
20Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (5)
119public VirtualChar? FirstOrNull(Func<VirtualChar, bool> predicate) 130public VirtualChar? LastOrNull(Func<VirtualChar, bool> predicate) 142public bool Any(Func<VirtualChar, bool> predicate) 153public bool All(Func<VirtualChar, bool> predicate) 167public VirtualCharSequence SkipWhile(Func<VirtualChar, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ChildSyntaxListExtensions.cs (2)
12public static SyntaxNodeOrToken First(this ChildSyntaxList childSyntaxList, Func<SyntaxNodeOrToken, bool> predicate) 24public static SyntaxNodeOrToken Last(this ChildSyntaxList childSyntaxList, Func<SyntaxNodeOrToken, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (1)
105public static int IndexOf<T>(this IList<T> list, Func<T, bool> predicate)
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\ObjectWriterExtensions.cs (1)
23public static ImmutableArray<T> ReadArray<T>(this ObjectReader reader, Func<ObjectReader, T> read)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
341public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate) 354public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate) 357public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(true)] out IOperation? foundOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (2)
22Func<SyntaxNode, bool>? predicate = null) 52Func<SyntaxNode, bool>? predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (1)
100public static int IndexOf(this string? text, Func<char, bool> predicate)
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\Extensions\SyntaxTriviaListExtensions.cs (1)
11public static SyntaxTrivia? FirstOrNull(this SyntaxTriviaList triviaList, Func<SyntaxTrivia, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.OperationTreeAnalysisData.cs (3)
18private readonly Func<IMethodSymbol, BasicBlockAnalysisData> _analyzeLocalFunction; 24Func<IMethodSymbol, BasicBlockAnalysisData> analyzeLocalFunction) 40Func<IMethodSymbol, BasicBlockAnalysisData> analyzeLocalFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
21private static readonly Func<TextSpan, bool> s_notEmpty = s => !s.IsEmpty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (2)
111Func<SyntaxToken, int> tokenColumnGetter, 140Func<SyntaxToken, int> tokenColumnGetter,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (2)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (1)
20Func<SyntaxNode, bool>? predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
86public static void Log<TArg>(FunctionId functionId, Func<TArg, string> messageGetter, TArg arg, LogLevel logLevel = LogLevel.Debug) 183public static IDisposable LogBlock<TArg>(FunctionId functionId, Func<TArg, string> messageGetter, TArg arg, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
23public static LogMessage Create<TArg>(Func<TArg, string> messageGetter, TArg arg, LogLevel logLevel) 121private Func<TArg0, string>? _messageGetter; 124public static LogMessage Construct(Func<TArg0, string> messageGetter, TArg0 arg, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
108Func<string, TValue> parser,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (1)
22public PooledObject(ObjectPool<T> pool, Func<ObjectPool<T>, T> allocator, Action<ObjectPool<T>, T> releaser) : this()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (2)
16Func<string, Optional<T>> parseValue, 17Func<T, string> serializeValue) : IEditorConfigValueSerializer
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (1)
41internal Option2(OptionDefinition<T> definition, string? languageName, Func<IOption2, IPublicOption>? publicOptionFactory)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (1)
33internal PerLanguageOption2(OptionDefinition<T> optionDefinition, Func<IOption2, IPublicOption>? publicOptionFactory)
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\Serialization\ObjectReader.cs (2)
259public (char[] array, int length) ReadCharArray(Func<int, char[]>? getArray) 264Func<int, T[]>? getArray = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
43Func<TMemberDeclarationSyntax, bool> membersToKeep, CancellationToken cancellationToken) 79Func<TMemberDeclarationSyntax, bool> membersToKeep) 102void AddSelectedMemberDeclarations(TMemberDeclarationSyntax member, Func<TMemberDeclarationSyntax, bool> membersToKeep)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (4)
28public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction) 33public static AsyncLazy<T> Create<T>(Func<CancellationToken, T> synchronousComputeFunction) 38public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction, Func<CancellationToken, T> synchronousComputeFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy.cs (1)
15public static CancellableLazy<T> Create<T>(Func<CancellationToken, T> valueFactory)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy`1.cs (3)
14private Func<CancellationToken, T>? _valueFactory; 17public CancellableLazy(Func<CancellationToken, T> valueFactory) 58Interlocked.Exchange<Func<CancellationToken, T>?>(ref _valueFactory, null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ComparerWithState.cs (2)
26public static int CompareTo<T>(T first, T second, ImmutableArray<Func<T, IComparable>> comparableMethods) 28foreach (var comparableMethod in comparableMethods)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ConcatImmutableArray`1.cs (1)
18public bool Any(Func<T, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
16public static V GetOrAdd<K, V>(this IDictionary<K, V> dictionary, K key, Func<K, V> function)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.cs (1)
38public static Matcher<T> Single<T>(Func<T, bool> predicate, string description)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
12private sealed class SingleMatcher(Func<T, bool> predicate, string description) : Matcher<T>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher`1.cs (1)
37internal static Matcher<T> Single(Func<T, bool> predicate, string description)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
99public static bool HasDuplicates<T, U>(this ArrayBuilder<T> builder, Func<T, U> selector)
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\Analyzers\Core\CodeFixes\AddParameter\CodeFixData.cs (4)
13Func<CancellationToken, Task<Solution>> createChangedSolutionNonCascading, 14Func<CancellationToken, Task<Solution>>? createChangedSolutionCascading) 25public Func<CancellationToken, Task<Solution>> CreateChangedSolutionNonCascading { get; } = createChangedSolutionNonCascading ?? throw new ArgumentNullException(nameof(createChangedSolutionNonCascading)); 30public Func<CancellationToken, Task<Solution>>? CreateChangedSolutionCascading { get; } = createChangedSolutionCascading;
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
300static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
21Func<ITypeSymbol, bool> includeMemberType,
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
120private readonly Func<CancellationToken, Task<Solution>> _createChangedSolutionAsync; 137Func<CancellationToken, Task<Solution>> createChangedSolutionAsync,
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (3)
103private readonly Func<CancellationToken, Task<Solution>> _createChangedSolution; 105private ProjectOptionsChangeAction(string title, Func<CancellationToken, Task<Solution>> createChangedSolution) 111public static ProjectOptionsChangeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
54protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 71Func<SyntaxEditor, Task> editAsync,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (3)
501Func<SyntaxTrivia, bool> isEndOfLineTrivia, 521Func<SyntaxToken, bool> isComma, 549Func<SyntaxToken, bool> isAccessibilityModifier)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
221Func<SyntaxNode, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
195Func<SyntaxList<TDeclaration>, TDeclaration?>? after = null, 196Func<SyntaxList<TDeclaration>, TDeclaration?>? before = null)
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\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
23public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 26Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\IRemoveUnnecessaryImportsService.cs (1)
16Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
32private static readonly Func<ISymbol, bool> s_LocalNameFilter = s => 75string baseName, Func<ISymbol, bool> filter,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (1)
35Func<ISymbol, bool> filter, IEnumerable<string> usedNames, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
19protected readonly Func<TypeInferenceInfo, bool> IsUsableTypeFunc; 24private static readonly Func<TypeInferenceInfo, bool> s_isNotNull = t => t.InferredType != null;
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\Simplification\ISimplificationService.cs (2)
20Func<SyntaxNode, bool>? expandInsideNode, 27Func<SyntaxNode, bool>? expandInsideNode,
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)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2+Test.cs (1)
81public Func<ImmutableArray<Diagnostic>, Diagnostic?>? DiagnosticSelector { get; set; }
src\Features\DiagnosticsTestUtilities\CodeActions\VisualBasicCodeFixVerifier`2+Test.cs (1)
72public Func<ImmutableArray<Diagnostic>, Diagnostic?>? DiagnosticSelector { get; set; }
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)
ImmutableSegmentedList`1.cs (1)
205/// <inheritdoc cref="ImmutableList{T}.ConvertAll{TOutput}(Func{T, TOutput})"/>
ImmutableSegmentedList`1+Builder.cs (1)
77/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.ConvertAll{TOutput}(Func{T, TOutput})"/>
ImmutableSegmentedListExtensions.cs (4)
15public static bool All<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 47public static bool Any<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 84public static T Last<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 101public static IEnumerable<TResult> Select<T, TResult>(this ImmutableSegmentedList<T> immutableList, Func<T, TResult> selector)
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\Binder_Expressions.cs (1)
10006private static readonly Func<PropertySymbol, bool> s_isIndexedPropertyWithNonOptionalArguments = property =>
Binder\Binder_Symbols.cs (3)
1573private static readonly Func<Symbol, MethodSymbol> s_toMethodSymbolFunc = s => (MethodSymbol)s; 1574private static readonly Func<Symbol, PropertySymbol> s_toPropertySymbolFunc = s => (PropertySymbol)s; 2767private static bool CheckFeatureAvailability<TData>(SyntaxTree tree, MessageID feature, DiagnosticBag? diagnostics, TData data, Func<TData, Location> getLocation, bool forceWarning = false)
Binder\BindingDiagnosticBag.cs (1)
108internal bool ReportUseSite<TData>(Symbol? symbol, Func<TData, Location> getLocation, TData data)
Binder\DecisionDagBuilder.cs (7)
2082public abstract string Dump(Func<BoundDagTest, string> dump); 2090public override string Dump(Func<BoundDagTest, string> dump) => "TRUE"; 2111public override string Dump(Func<BoundDagTest, string> dump) => "FALSE"; 2210public override string Dump(Func<BoundDagTest, string> dump) => dump(this.Test); 2302public override string Dump(Func<BoundDagTest, string> dump) => $"Not ({Negated.Dump(dump)})"; 2452public override string Dump(Func<BoundDagTest, string> dump) 2506public override string Dump(Func<BoundDagTest, string> dump)
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (2)
413System.Func<UserDefinedConversionAnalysis, bool> isValid = conv => IsEncompassedBy(sourceExpression, source, conv.FromType, ref inLambdaUseSiteInfo); 467System.Func<UserDefinedConversionAnalysis, bool> isValid = conv => IsEncompassedBy(conv.ToType, target, ref inLambdaUseSiteInfo);
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)
Compilation\CSharpSemanticModel.cs (1)
5259internal abstract override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol);
Compilation\MemberSemanticModel.cs (1)
2361internal sealed override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
505internal sealed override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol)
Compilation\SyntaxTreeSemanticModel.cs (5)
38private Func<CSharpSyntaxNode, MemberSemanticModel> _createMemberModelFunction; 42private static readonly Func<CSharpSyntaxNode, bool> s_isMemberDeclarationFunction = IsMemberDeclaration; 1058var createMemberModelFunction = _createMemberModelFunction ?? 1064internal MemberSemanticModel GetOrAddModel(CSharpSyntaxNode node, Func<CSharpSyntaxNode, MemberSemanticModel> createMemberModelFunction) 2461internal override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol)
CSharpExtensions.cs (3)
372internal static IList<DirectiveTriviaSyntax> GetDirectives(this SyntaxNode node, Func<DirectiveTriviaSyntax, bool>? filter = null) 380public static DirectiveTriviaSyntax? GetFirstDirective(this SyntaxNode node, Func<DirectiveTriviaSyntax, bool>? predicate = null) 388public static DirectiveTriviaSyntax? GetLastDirective(this SyntaxNode node, Func<DirectiveTriviaSyntax, bool>? predicate = null)
Declarations\DeclarationTable.cs (3)
290Func<string, bool> predicate, 312Func<string, bool> predicate, 314Func<SingleTypeDeclaration, bool> typePredicate,
Emitter\EditAndContinue\CSharpSymbolChanges.cs (1)
14public CSharpSymbolChanges(DefinitionMap definitionMap, IEnumerable<SemanticEdit> edits, Func<ISymbol, bool> isAddedSymbol)
Emitter\EditAndContinue\EmitHelpers.cs (1)
27Func<ISymbol, bool> isAddedSymbol,
Errors\MessageID.cs (2)
415Func<TData, Location> getLocation, 430Func<TData, Location> getLocation,
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))
Lowering\LocalRewriter\LocalRewriter.cs (1)
415static bool hasReturnTypeOrParameter(MethodSymbol localFunction, Func<TypeWithAnnotations, bool> predicate) =>
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
1325Func<BoundStatement, BoundStatement> rewriteBody)
Parser\DocumentationCommentParser.cs (2)
374Func<DocumentationCommentParser, bool> isNotExpectedFunction, 375Func<DocumentationCommentParser, bool> abortFunction,
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,
Parser\LexerCache.cs (2)
189Func<TArg, SyntaxTrivia> createTriviaFunction, 229Func<TArg, SyntaxToken> createTokenFunction,
Symbols\AnonymousTypes\AnonymousTypeDescriptor.cs (1)
39internal static string ComputeKey<T>(ImmutableArray<T> fields, Func<T, string> getName)
Symbols\ArrayTypeSymbol.cs (1)
408internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\DynamicTypeSymbol.cs (1)
228internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
400public FunctionPointerMethodSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
173internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\FunctionTypeSymbol.cs (1)
181internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\NamedTypeSymbol.cs (4)
708protected static Func<Symbol, bool> IsInstanceFieldOrEvent = symbol => 968internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 1173internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.HasType; 1175internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsErrorType = type => type.HasType && type.Type.IsErrorType();
Symbols\NativeIntegerTypeSymbol.cs (1)
249internal static bool EqualsHelper<TSymbol>(TSymbol symbol, Symbol? other, TypeCompareKind comparison, Func<TSymbol, Symbol> getUnderlyingSymbol)
Symbols\ObsoleteAttributeHelpers.cs (2)
59private static ThreeState GetObsoleteContextState(Symbol symbol, bool forceComplete, Func<Symbol, ThreeState> getStateFromSymbol) 130static ObsoleteDiagnosticKind getDiagnosticKind(Symbol containingMember, bool forceComplete, Func<Symbol, ThreeState> getStateFromSymbol)
Symbols\PointerTypeSymbol.cs (1)
270internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\Retargeting\RetargetingSymbolTranslator.cs (7)
34private readonly Func<Symbol, RetargetingMethodSymbol> _createRetargetingMethod; 35private readonly Func<Symbol, RetargetingNamespaceSymbol> _createRetargetingNamespace; 36private readonly Func<Symbol, RetargetingTypeParameterSymbol> _createRetargetingTypeParameter; 37private readonly Func<Symbol, RetargetingNamedTypeSymbol> _createRetargetingNamedType; 38private readonly Func<Symbol, FieldSymbol> _createRetargetingField; 39private readonly Func<Symbol, RetargetingPropertySymbol> _createRetargetingProperty; 40private readonly Func<Symbol, RetargetingEventSymbol> _createRetargetingEvent;
Symbols\Source\SourceAssemblySymbol.cs (1)
216private string? GetWellKnownAttributeDataStringField(Func<CommonAssemblyWellKnownAttributeData, string> fieldGetter, string? missingValue = null, QuickAttributes? attributeMatchesOpt = null)
Symbols\Source\SourceMemberContainerSymbol.cs (2)
1921bool hasBaseTypeOrInterface(Func<NamedTypeSymbol, bool> predicate) 3080private static bool All<T>(SyntaxList<T> list, Func<T, bool> predicate) where T : CSharpSyntaxNode
Symbols\Source\SourceNamespaceSymbol.cs (1)
121private static readonly Func<SingleNamespaceDeclaration, SyntaxReference> s_declaringSyntaxReferencesSelector = d =>
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (1)
260Func<MethodSymbol, ImmutableArray<ParameterSymbol>> getParameters) :
Symbols\Synthesized\SynthesizedEmbeddedNullableAttributeSymbol.cs (1)
118Func<MethodSymbol, ImmutableArray<ParameterSymbol>> getParameters,
Symbols\TypeMap.cs (1)
24public static readonly Func<TypeWithAnnotations, TypeSymbol> AsTypeSymbol = t => t.Type;
Symbols\TypeParameterSymbol.cs (1)
693internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\TypeSymbol.cs (2)
645internal abstract TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform); 652private static readonly Func<TypeWithAnnotations, TypeWithAnnotations> s_setUnknownNullability =
Syntax\CompilationUnitSyntax.cs (2)
21internal IList<ReferenceDirectiveTriviaSyntax> GetReferenceDirectives(Func<ReferenceDirectiveTriviaSyntax, bool>? filter) 52private bool HasFirstTokenDirective(Func<SyntaxNode, bool> predicate)
Syntax\CSharpSyntaxNode.cs (6)
222internal IList<DirectiveTriviaSyntax> GetDirectives(Func<DirectiveTriviaSyntax, bool>? filter = null) 230public DirectiveTriviaSyntax? GetFirstDirective(Func<DirectiveTriviaSyntax, bool>? predicate = null) 270public DirectiveTriviaSyntax? GetLastDirective(Func<DirectiveTriviaSyntax, bool>? predicate = null) 334internal SyntaxToken GetFirstToken(Func<SyntaxToken, bool>? predicate, Func<SyntaxTrivia, bool>? stepInto = null) 426public new SyntaxTrivia FindTrivia(int position, Func<SyntaxTrivia, bool> stepInto)
Syntax\DirectiveTriviaSyntax.cs (3)
69public DirectiveTriviaSyntax? GetNextDirective(Func<DirectiveTriviaSyntax, bool>? predicate = null) 100public DirectiveTriviaSyntax? GetPreviousDirective(Func<DirectiveTriviaSyntax, bool>? predicate = null) 359private static readonly Func<SyntaxToken, bool> s_hasDirectivesFunction = t => t.ContainsDirectives;
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)
Syntax\SyntaxFactory.cs (3)
1977public static bool AreEquivalent(SyntaxNode? oldNode, SyntaxNode? newNode, Func<SyntaxKind, bool>? ignoreChildNode = null) 2027public static bool AreEquivalent<TNode>(SyntaxList<TNode> oldList, SyntaxList<TNode> newList, Func<SyntaxKind, bool>? ignoreChildNode = null) 2058public static bool AreEquivalent<TNode>(SeparatedSyntaxList<TNode> oldList, SeparatedSyntaxList<TNode> newList, Func<SyntaxKind, bool>? ignoreChildNode = null)
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
377IMethodSymbol? GetAccessibleInstanceConstructor(ImmutableArray<IMethodSymbol> constructors, Func<IMethodSymbol, bool> predicate) 741Func<TArrayCreationExpressionSyntax, TypeSyntax> getType, 742Func<TArrayCreationExpressionSyntax, InitializerExpressionSyntax?> getInitializer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
24Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
680public static IEnumerable<SyntaxNode> GetAncestorsOrThis(this SyntaxNode? node, Func<SyntaxNode, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (4)
87private static readonly Func<SyntaxKind, bool> s_isDot = k => k is SyntaxKind.DotToken; 88private static readonly Func<SyntaxKind, bool> s_isDotOrArrow = k => k is SyntaxKind.DotToken or SyntaxKind.MinusGreaterThanToken; 89private static readonly Func<SyntaxKind, bool> s_isDotOrArrowOrColonColon = 106this SyntaxTree syntaxTree, int position, Func<SyntaxKind, bool> predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (2)
14Func<string, int> map, 46internal static string ToEditorConfigFlagList(int flags, Func<int, string> map)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
25Func<SyntaxNode, bool>? predicate,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (17)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
421Func<IOperation, T?> captureAssignedSymbol) 1133Func<T, bool> firstCondition, Func<T, bool> secondCondition)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (1)
106Func<string, bool> isUnique,
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)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
344Func<TListSyntax, IEnumerable<SyntaxNode>> getElements)
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
88public static int IndexOf<T>(IReadOnlyList<T> list, Func<T, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
174Func<SyntaxList<TDeclaration>, TDeclaration?>? after = null, 175Func<SyntaxList<TDeclaration>, TDeclaration?>? before = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
740private static TDeclarationNode UpdateDeclarationModifiers<TDeclarationNode>(TDeclarationNode declaration, Func<SyntaxTokenList, SyntaxTokenList> computeNewModifiersList)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
245Func<T, bool> isNegative, Func<T, T> negate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
39Func<SyntaxNode, bool>? predicate,
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,
Completion\CompletionProviders\ConversionCompletionProviderTests.cs (1)
599Func<string, Task> verifyFunc = conversionIsOffered
EditorConfigSettings\Updater\SettingsUpdaterTests.TestAnalyzerConfigOptions.cs (2)
16private readonly Func<string, string?>? _lookup = null; 22public TestAnalyzerConfigOptions(Func<string, string?> lookup)
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)
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (5)
40Func<Compilation, ISymbol> symbolMatcher, 56protected static async Task RunTestAsync(Func<string, Task> testRunner) 80Func<Compilation, ISymbol> symbolMatcher, 192Func<Compilation, ISymbol> symbolMatcher, 207Func<Compilation, ISymbol> symbolMatcher,
src\VisualStudio\Core\Def\CodeCleanup\AbstractCodeCleanUpFixer_Helper.cs (1)
21internal static EnabledDiagnosticOptions AdjustDiagnosticOptions(EnabledDiagnosticOptions enabledDiagnostics, Func<string, bool> isFixIdEnabled)
SymbolKey\SymbolKeyErrorTypeTests.cs (1)
371private static void VerifyResolution(string source, Func<Compilation, ISymbol> symbolToResolve)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (12)
CodeGen\CodeGenOverridingAndHiding.cs (1)
4095Func<bool, Action<ModuleSymbol>> validator = isFromMetadata => module =>
CodeGen\WinMdDelegateTests.cs (2)
36Func<string[], Action<ModuleSymbol>> getValidator = expectedMembers => m => 223Func<FieldSymbol, bool> isWinRt = (field) =>
Emit\EmitMetadataTests.cs (9)
495Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 545Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 594Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 661Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 729Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 845Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 1080Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 1269Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 2151Func<bool, Action<ModuleSymbol>> validator = isFromSource => (ModuleSymbol m) =>
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (13)
Emit\EditAndContinue\EditAndContinuePdbTests.cs (2)
147var syntaxMap1 = GetSyntaxMapFromMarkers(source0, source1); 267var syntaxMap2 = GetSyntaxMapFromMarkers(source1, source2);
Emit\EditAndContinue\EditAndContinueTest.cs (1)
39protected override Func<SyntaxNode, SyntaxNode> GetEquivalentNodesMap(ISymbol left, ISymbol right)
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)
Emit\EditAndContinue\EditAndContinueTests.cs (2)
12183var isAddedSymbol = new Func<ISymbol, bool>(s => false); 12268var isAddedSymbol = new Func<ISymbol, bool>(s => false);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (15)
Attributes\AttributeTests.cs (3)
2617Func<bool, Action<ModuleSymbol>> symbolValidator = isFromSource => moduleSymbol => 2996Func<bool, Action<ModuleSymbol>> symbolValidator = isFromMetadata => moduleSymbol => 5621Func<bool, Action<ModuleSymbol>> validator = isFromSource => (ModuleSymbol module) =>
Attributes\AttributeTests_Conditional.cs (1)
622Func<bool, Action<ModuleSymbol>> validator = isFromSource => module =>
Attributes\AttributeTests_Nullable.cs (3)
43Func<CSharpCompilation, MetadataReference> getReference = c => useImageReferences ? c.EmitToImageReference() : c.ToMetadataReference(); 108Func<CSharpCompilation, MetadataReference> getReference = c => useImageReferences ? c.EmitToImageReference() : c.ToMetadataReference(); 206Func<CSharpCompilation, MetadataReference> getReference = c => useImageReferences ? c.EmitToImageReference() : c.ToMetadataReference();
Attributes\AttributeTests_Security.cs (1)
36Func<bool, Action<ModuleSymbol>> attributeValidator = isFromSource => (ModuleSymbol module) =>
Attributes\AttributeTests_WellKnownAttributes.cs (3)
2761Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 3747Func<bool, Action<ModuleSymbol>> attributeValidator = isFromSource => (ModuleSymbol m) => 3878Func<bool, Action<ModuleSymbol>> attributeValidator = isFromSource => (ModuleSymbol m) =>
Diagnostics\DiagnosticAnalyzerTests.cs (3)
1539Func<string, bool> isGeneratedFile = fileName => fileName.Contains("SourceFileWithAutoGeneratedComment") || generatedFileNames.Contains(fileName); 1693private static void VerifyGeneratedCodeAnalyzerDiagnostics(Compilation compilation, AnalyzerOptions analyzerOptions, Func<string, bool> isGeneratedFileName, GeneratedCodeAnalysisFlags? generatedCodeAnalysisFlagsOpt) 1705private static DiagnosticDescription[] GetExpectedGeneratedCodeAnalyzerDiagnostics(Compilation compilation, Func<string, bool> isGeneratedFileName, GeneratedCodeAnalysisFlags? generatedCodeAnalysisFlagsOpt)
Diagnostics\OperationAnalyzerTests.cs (1)
1306Func<int, string> buildSequenceOfBinaryExpressions =
Microsoft.CodeAnalysis.CSharp.Features (97)
ChangeSignature\CSharpChangeSignatureService.cs (1)
690Func<AddedParameter, T> createNewParameterMethod) where T : SyntaxNode
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
26private static readonly Func<DirectiveTriviaSyntax, bool> s_isNullableDirectiveTriviaPredicate =
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (5)
61var replacementFunc = GetReplacementFunc(node, model); 72private static Func<SyntaxNode, SyntaxNode>? GetReplacementFunc(SyntaxNode? node, SemanticModel model) 94private static Func<SyntaxNode, SyntaxNode>? CombineLogicalAndOperands(BinaryExpressionSyntax logicalAnd, SemanticModel model) 162private static Func<SyntaxNode, SyntaxNode>? CombineWhenClauseCondition(PatternSyntax switchPattern, ExpressionSyntax condition, SemanticModel model) 613var replacementFunc = GetReplacementFunc(currentNode, semanticModel);
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>>)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (3)
376Func<ITypeSymbol, bool> typeCheckMethod, 411Func<ITypeSymbol, bool> typeCheckMethod, 790Func<ExpressionSyntax, StatementSyntax> leafExpressionCreationMethod,
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
419Func<TListSyntax, IEnumerable<SyntaxNode>> getElements)
ConvertToRawString\ConvertToRawStringHelpers.cs (1)
48public static bool AllEscapesAre(VirtualCharSequence sequence, Func<VirtualChar, bool> predicate)
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)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (4)
1003protected override SyntaxNode? GetSymbolDeclarationSyntax(ISymbol symbol, Func<ImmutableArray<SyntaxReference>, SyntaxReference?> selector, CancellationToken cancellationToken) 1471internal override Func<SyntaxNode, bool> IsLambda 1474internal override Func<SyntaxNode, bool> IsNotLambda 1477internal override Func<SyntaxNode, IEnumerable<SyntaxToken>> DescendantTokensIgnoringLambdaBodies
EditAndContinue\DeclarationBody\CopyConstructorDeclarationBody.cs (2)
49public override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 52public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\ExplicitAutoPropertyAccessorDeclarationBody.cs (2)
32public override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 35public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\FieldWithInitializerDeclarationBody.cs (2)
49public override IEnumerable<SyntaxToken> GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 55public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithExplicitInitializerDeclarationBody.cs (2)
43public override IEnumerable<SyntaxToken> GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 46public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithImplicitInitializerDeclarationBody.cs (2)
37public override IEnumerable<SyntaxToken> GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 40public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\PrimaryConstructorWithExplicitInitializerDeclarationBody.cs (2)
36public override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 39public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\PrimaryConstructorWithImplicitInitializerDeclarationBody.cs (2)
36public override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 39public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorWithExplicitBodyDeclarationBody.cs (2)
42public sealed override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 45public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\PropertyOrIndexerWithExplicitBodyDeclarationBody.cs (2)
37public sealed override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 40public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\RecordParameterDeclarationBody.cs (2)
29public override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 32public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (2)
39public override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 42public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\SyntaxComparer.cs (1)
708Func<SyntaxKind, bool>? ignoreChildFunction;
ExtractMethod\Extensions.cs (1)
120private static bool PartOfConstantInitializerExpression<T>(this SyntaxNode node, Func<T, SyntaxTokenList> modifiersGetter) where T : SyntaxNode
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
132static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Solution>> createSolution)
Organizing\CSharpOrganizingService.Rewriter.cs (1)
19private readonly Func<SyntaxNode, IEnumerable<ISyntaxOrganizer>> _nodeToOrganizersGetter = treeOrganizer.GetNodeToOrganizers(organizers.ToList());
Organizing\Organizers\ModifiersOrganizer.Comparer.cs (1)
36private static readonly ImmutableArray<Func<SyntaxToken, IComparable>> s_comparers =
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 =
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (4)
26private static readonly Func<TupleExpressionSyntax, SyntaxToken> s_getOpenToken = e => e.OpenParenToken; 27private static readonly Func<TupleExpressionSyntax, SyntaxToken> s_getCloseToken = e => e.CloseParenToken; 28private static readonly Func<TupleExpressionSyntax, SyntaxNodeOrTokenList> s_getArgumentsWithSeparators = e => e.Arguments.GetWithSeparators(); 29private static readonly Func<TupleExpressionSyntax, IEnumerable<string>> s_getArgumentNames = e => e.Arguments.Select(a => a.NameColon?.Name.Identifier.ValueText ?? string.Empty);
Snippets\CSharpSnippetHelpers.cs (2)
18public static int GetTargetCaretPositionInBlock<TTargetNode>(TTargetNode caretTarget, Func<TTargetNode, BlockSyntax> getBlock, SourceText sourceText) 46Document document, TTargetNode targetNode, Func<TTargetNode, BlockSyntax> getBlock, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
377IMethodSymbol? GetAccessibleInstanceConstructor(ImmutableArray<IMethodSymbol> constructors, Func<IMethodSymbol, bool> predicate) 741Func<TArrayCreationExpressionSyntax, TypeSyntax> getType, 742Func<TArrayCreationExpressionSyntax, InitializerExpressionSyntax?> getInitializer,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
421Func<IOperation, T?> captureAssignedSymbol) 1133Func<T, bool> firstCondition, Func<T, bool> secondCondition)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (1)
106Func<string, bool> isUnique,
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)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
344Func<TListSyntax, IEnumerable<SyntaxNode>> getElements)
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
88public static int IndexOf<T>(IReadOnlyList<T> list, Func<T, bool> predicate)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (6)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
48private static void TestSpans(string source, Func<SyntaxNode, bool> hasLabel) 92private static void TestErrorSpansAllKinds(Func<SyntaxKind, bool> hasLabel)
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)
IOperation\IOperationTests_IConversionExpression.cs (3)
5361public Func<IOperation, IConversionOperation> OperationSelector { get; set; } 5363public Func<IOperation, IOperation> ConversionChildSelector { get; set; } = ConversionOrDelegateChildSelector; 5365public Func<SyntaxNode, SyntaxNode> SyntaxSelector { get; set; }
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (4)
InteractiveSessionTests.cs (4)
873var f = CSharpScript.EvaluateAsync<Func<int, int>>(@" 906var f = CSharpScript.RunAsync("using System;", ScriptOptions). 908ContinueWith<Func<int, int>>("new Func<int,int>(Sqr)").Result.ReturnValue;
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;
Semantics\ConstantTests.cs (1)
1451private static string ParseAndGetConstantFoldingSteps(string source, Func<BoundNode, bool> predicate)
Semantics\DelegateTypeTests.cs (1)
15710var setNotNullable = (TypeWithAnnotations type) => TypeWithAnnotations.Create(type.Type, NullableAnnotation.NotAnnotated);
Semantics\LambdaTests.cs (1)
2687private static void AppendLines(StringBuilder builder, int n, Func<int, string> getLine)
Semantics\NamedAndOptionalTests.cs (5)
2045Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 2127Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 2178Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 2261Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 2343Func<bool, Action<ModuleSymbol>> validator = isFromSource => module =>
Semantics\NullableContextTests.cs (1)
2244private static string[] GetIsNullableEnabledMethods(object compilationData, Func<object, string> toString = null)
Semantics\NullableReferenceTypesTests.cs (2)
127023Func<bool, bool> identity = x => x; 127058Func<bool, bool> identity = x => x;
Semantics\OperatorTests.cs (1)
3195private static void TestBoundTree(string source, System.Func<IEnumerable<KeyValuePair<TreeDumperNode, TreeDumperNode>>, IEnumerable<string>> query)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (137)
Compilation\CSharpCompilationOptionsTests.cs (3)
35Func<CompilationOptions, T> getter, 42Func<TOptions, T> getter, T validNonDefaultValue) 100Func<CSharpCompilationOptions, T> getter,
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
1721Func<ISymbol, bool> isExtensionMethod = symbol => 1884Func<ISymbol, bool> isExtensionMethod = symbol =>
Compilation\SymbolSearchTests.cs (1)
246private static void Test(CSharpCompilation compilation, Func<string, bool> predicate, bool includeNamespace, bool includeType, bool includeMember, int count)
DocumentationComments\DocumentationModeTests.cs (1)
366private void TestIncluded(string xml, string xpath, string expectedTextTemplate, Func<string, DiagnosticDescription[]> makeExpectedDiagnostics, bool fallbackToErrorCodeOnlyForNonEnglish = false)
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 =>
Symbols\ExtensionMethodTests.cs (2)
2449Func<bool, Action<ModuleSymbol>> validator = isFromSource => module => 2493Func<bool, Action<ModuleSymbol>> validator = isFromSource => module =>
Symbols\IndexerTests.cs (1)
1140Func<bool, Action<ModuleSymbol>> validator = isFromSource => module =>
Symbols\Source\CustomModifierCopyTests.cs (1)
2122private static Func<Symbol, bool> IsPropertyWithSingleParameter(SpecialType paramSpecialType, bool isArrayType = false)
Symbols\Source\NullablePublicAPITests.cs (2)
1030Func<CSharpCompilation, T[]> memberFunc, 1031Func<T, PublicNullableAnnotation> nullabilityFunc,
Symbols\Source\PropertyTests.cs (1)
2762Func<string[], Action<ModuleSymbol>> getValidator = expectedMembers => m =>
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (14)
IncrementalParsing\IncrementalParsingTests.cs (1)
3469Func<SyntaxTree, GreenNode> extractGreenClassC = tree =>
Parsing\CSharpParseOptionsTests.cs (1)
20private void TestProperty<T>(Func<CSharpParseOptions, T, CSharpParseOptions> factory, Func<CSharpParseOptions, T> getter, T validValue)
Syntax\SyntaxEquivalenceTests.cs (1)
34private void VerifyEquivalent(SyntaxNode node1, SyntaxNode node2, Func<SyntaxKind, bool> ignoreChildNode)
Syntax\SyntaxFactoryTests.cs (1)
110Func<string, SyntaxToken> makeStringLiteral = value =>
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)
SemanticModelTestBase.cs (1)
108Func<SyntaxNode, bool> isConstructorInitializer = n =>
Microsoft.CodeAnalysis.CSharp.Workspaces (26)
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (1)
24private static readonly Func<ITypeSymbol, bool> s_shouldInclude = t => t.TypeKind != TypeKind.Error && t.GetArity() > 0;
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1999private SyntaxNode Isolate(SyntaxNode declaration, Func<SyntaxNode, SyntaxNode> editor)
ExternalAccess\Pythia\Api\PythiaSyntaxExtensions.cs (1)
22public static bool IsFoundUnder<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode> childGetter) where TParent : SyntaxNode
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)
Simplification\CSharpSimplificationService.Expander.cs (2)
47private readonly Func<SyntaxNode, bool> _expandInsideNode; 54Func<SyntaxNode, bool> expandInsideNode,
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (3)
21private readonly Func<SyntaxNodeOrToken, bool> _isNodeOrTokenOutsideSimplifySpans; 29public static ImmutableArray<NodeOrTokenToReduce> Compute(SyntaxNode root, Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpans) 36private NodesAndTokensToReduceComputer(Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpans)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (1)
24Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
680public static IEnumerable<SyntaxNode> GetAncestorsOrThis(this SyntaxNode? node, Func<SyntaxNode, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (4)
87private static readonly Func<SyntaxKind, bool> s_isDot = k => k is SyntaxKind.DotToken; 88private static readonly Func<SyntaxKind, bool> s_isDotOrArrow = k => k is SyntaxKind.DotToken or SyntaxKind.MinusGreaterThanToken; 89private static readonly Func<SyntaxKind, bool> s_isDotOrArrowOrColonColon = 106this SyntaxTree syntaxTree, int position, Func<SyntaxKind, bool> predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (2)
14Func<string, int> map, 46internal static string ToEditorConfigFlagList(int flags, Func<int, string> map)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
25Func<SyntaxNode, bool>? predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
174Func<SyntaxList<TDeclaration>, TDeclaration?>? after = null, 175Func<SyntaxList<TDeclaration>, TDeclaration?>? before = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
740private static TDeclarationNode UpdateDeclarationModifiers<TDeclarationNode>(TDeclarationNode declaration, Func<SyntaxTokenList, SyntaxTokenList> computeNewModifiersList)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
245Func<T, bool> isNegative, Func<T, T> negate,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
39Func<SyntaxNode, bool>? predicate,
Microsoft.CodeAnalysis.EditorFeatures (26)
DocumentationComments\CopilotGenerateDocumentationCommentProvider.cs (1)
74Func<CancellationToken, Task<ProposalBase?>> generateProposal = async (cancellationToken) =>
DocumentationComments\DocumentationCommentSuggestion.cs (1)
71Func<CancellationToken, Task<ProposalBase?>> generateProposal, CancellationToken cancellationToken)
EditorConfigSettings\Data\Conversions.cs (4)
9internal readonly struct Conversions<TFrom, TTo>(Func<TFrom, TTo> to, Func<TTo, TFrom> from) 11public readonly Func<TFrom, TTo> To = to; 12public readonly Func<TTo, TFrom> From = from;
EditorConfigSettings\Extensions\EnumerableExtensions.cs (1)
12public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
GoToDefinition\AbstractGoToCommandHandler`2.cs (2)
71private Func<CancellationToken, Task>? _delayHook; 288internal ref Func<CancellationToken, Task>? DelayHook
IntelliSense\AsyncCompletion\Helpers.cs (1)
163using var _ = PooledDelegates.GetPooledFunction(static (filterText, pattern) => filterText.StartsWith(pattern, StringComparison.CurrentCultureIgnoreCase), textTypedSoFar, out Func<string, bool> isPrefixMatch);
LanguageServer\AbstractLanguageClientMiddleLayer.cs (2)
16public abstract Task HandleNotificationAsync(string methodName, JsonElement methodParam, Func<JsonElement, Task> sendNotification); 18public abstract Task<JsonElement> HandleRequestAsync(string methodName, JsonElement methodParam, Func<JsonElement, Task<JsonElement>> sendRequest);
Logging\FunctionIdOptions.cs (2)
17private static readonly Func<FunctionId, Option2<bool>> s_optionCreator = CreateOption; 46public static Func<FunctionId, bool> CreateFunctionIsEnabledPredicate(IGlobalOptionService globalOptions)
Organizing\OrganizeDocumentCommandHandler.cs (1)
58private static CommandState GetCommandState(EditorCommandArgs args, Func<IOrganizeImportsService, string> descriptionString, bool needsSemantics)
Preview\SolutionPreviewItem.cs (2)
21internal sealed class SolutionPreviewItem(ProjectId? projectId, DocumentId? documentId, Func<CancellationToken, Task<object?>> lazyPreview) 25public readonly Func<CancellationToken, Task<object?>> LazyPreview = lazyPreview;
Shared\Extensions\ITextViewExtensions.AutoClosingViewProperty.cs (1)
22Func<TTextView, TProperty> valueCreator,
Shared\Extensions\ITextViewExtensions.cs (3)
162Func<TTextView, TProperty> valueCreator) where TTextView : ITextView 173Func<TTextView, TProperty> valueCreator) where TTextView : ITextView 185Func<TTextView, TProperty> valueCreator,
Shared\Tagging\EventSources\TaggerEventSources.cs (1)
48public static ITaggerEventSource OnGlobalOptionChanged(IGlobalOptionService globalOptions, Func<IOption2, bool> predicate)
Shared\Tagging\EventSources\TaggerEventSources.OptionChangedEventSource.cs (1)
12private sealed class GlobalOptionChangedEventSource(IGlobalOptionService globalOptions, Func<IOption2, bool> predicate) : AbstractTaggerEventSource
Shared\Utilities\IThreadingContext.cs (1)
72JoinableTask RunWithShutdownBlockAsync(Func<CancellationToken, Task> func);
Shared\Utilities\ThreadingContext.cs (1)
65public JoinableTask RunWithShutdownBlockAsync(Func<CancellationToken, Task> func)
Shared\Utilities\VirtualTreePoint.cs (1)
61private static readonly ImmutableArray<Func<VirtualTreePoint, IComparable>> s_comparers =
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)
ITextImageHelpers.cs (2)
18private static readonly Func<ITextChange, TextChangeRange> s_forwardTextChangeRange = c => CreateTextChangeRange(c, forward: true); 19private static readonly Func<ITextChange, TextChangeRange> s_backwardTextChangeRange = c => CreateTextChangeRange(c, forward: false);
Shared\Extensions\ITextSnapshotLineExtensions.cs (1)
81public static ITextSnapshotLine? GetPreviousMatchingLine(this ITextSnapshotLine line, Func<ITextSnapshotLine, bool> predicate)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (34)
CodeGeneration\AbstractCodeGenerationTests.cs (1)
70Func<SyntaxGenerator, SyntaxNode> nodeCreator,
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)
CodeGeneration\CodeGenerationTests.CSharp.cs (2)
1508var getField = CreateField(Accessibility.Public, new Editing.DeclarationModifiers(), typeof(int), "f2"); 1534var getField = CreateField(Accessibility.Public, new Editing.DeclarationModifiers(), typeof(int), "f2");
CodeGeneration\CodeGenerationTests.VisualBasic.cs (1)
1533var getField = CreateField(Accessibility.Public, new DeclarationModifiers(isStatic: true), typeof(int), "f2");
Microsoft.CodeAnalysis.EditorFeatures.Wpf (28)
Interactive\ResetInteractive.cs (4)
29private readonly Func<string, string> _createReference; 31private readonly Func<string, string> _createImport; 37internal ResetInteractive(EditorOptionsService editorOptionsService, Func<string, string> createReference, Func<string, string> createImport)
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)
SignatureHelp\Controller.Session_SetModelSelectedItem.cs (2)
16private void SetModelExplicitlySelectedItem(Func<Model, SignatureHelpItem> selector) 27Func<Model, SignatureHelpItem> selector)
Suggestions\PreviewChanges\PreviewChangesCodeAction.cs (2)
22private readonly Func<CancellationToken, Task<SolutionPreviewResult?>> _getPreviewResultAsync; 24public PreviewChangesCodeAction(Workspace workspace, CodeAction originalCodeAction, Func<CancellationToken, Task<SolutionPreviewResult?>> getPreviewResultAsync)
ViewHostingControl.cs (2)
19private readonly Func<ITextBuffer, IWpfTextView> _createView; 26Func<ITextBuffer, IWpfTextView> createView,
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
Placeholders.cs (1)
9public static bool All(this string s, Func<char, bool> predicate)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (1)
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
122internal ObjectPool(Func<ObjectPool<T>, T> factory, int size)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (4)
Debugger\Engine\DkmInspectionSession.cs (3)
41internal T InvokeFormatter<T>(object instance, MethodId method, Func<IDkmClrFormatter, T> f) 46internal T InvokeResultProvider<T>(object instance, MethodId method, Func<IDkmClrResultProvider, T> f) 77internal TResult Invoke<TResult>(object instance, MethodId method, Func<TInterface, TResult> f)
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
122internal ObjectPool(Func<ObjectPool<T>, T> factory, int size)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (10)
Completion\FSharpCommonCompletionUtilities.cs (2)
15public static bool IsStartingNewWord(SourceText text, int characterPosition, Func<char, bool> isWordStartCharacter, Func<char, bool> isWordCharacter)
Internal\NavigateTo\FSharpNavigateToSearchService.cs (2)
39Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 54Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound,
SignatureHelp\FSharpSignatureHelpItem.cs (3)
37public Func<CancellationToken, IEnumerable<TaggedText>> DocumentationFactory { get; } 39private static readonly Func<CancellationToken, IEnumerable<TaggedText>> s_emptyDocumentationFactory = _ => []; 43Func<CancellationToken, IEnumerable<TaggedText>> documentationFactory,
SignatureHelp\FSharpSignatureHelpParameter.cs (3)
26public Func<CancellationToken, IEnumerable<TaggedText>> DocumentationFactory { get; } 56private static readonly Func<CancellationToken, IEnumerable<TaggedText>> s_emptyDocumentationFactory = _ => []; 61Func<CancellationToken, IEnumerable<TaggedText>> documentationFactory,
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (2)
Remote\RazorServiceDescriptorsWrapper.cs (2)
27Func<string, string> featureDisplayNameProvider, 38Func<string, string> featureDisplayNameProvider,
Microsoft.CodeAnalysis.Features (148)
AddImport\SymbolReferenceFinder.cs (1)
564SearchScope searchScope, string name, ITypeSymbol type, Func<IMethodSymbol, bool> predicate, CancellationToken cancellationToken)
ChangeSignature\AbstractChangeSignatureService.cs (1)
683Func<AddedParameter, T> createNewParameterMethod) where T : SyntaxNode
CodeFixes\Service\CodeFixService.cs (3)
76private Func<string, bool>? GetShouldIncludeDiagnosticPredicate( 747Func<Diagnostic, bool> hasFix, 748Func<ImmutableArray<Diagnostic>, Task<ImmutableArray<CodeFix>>> getFixes,
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (1)
340private static readonly Func<DocumentId, ConcurrentBag<(CodeAction, Document)>> s_getValue =
CodeLens\CodeLensReferencesService.cs (2)
43Func<CodeLensFindReferencesProgress, Task<T>> onResults, Func<CodeLensFindReferencesProgress, Task<T>> onCapped,
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)
Common\TaggedText.cs (1)
89this IEnumerable<SymbolDisplayPart>? displayParts, TaggedTextStyle style = TaggedTextStyle.None, Func<ISymbol?, string?>? getNavigationHint = null, bool includeNavigationHints = true)
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)
Completion\CompletionService.ProviderManager.cs (1)
160using var _ = PooledDelegates.GetPooledFunction(static (p, n) => p.Name == n, item.ProviderName, out Func<CompletionProvider, bool> isNameMatchingProviderPredicate);
Completion\Providers\AbstractSymbolCompletionProvider.cs (2)
149Func<SymbolAndSelectionInfo, TSyntaxContext> contextLookup, 230Func<SymbolAndSelectionInfo, TSyntaxContext> contextLookup,
Completion\Providers\RecommendedKeyword.cs (2)
15Func<CancellationToken, ImmutableArray<SymbolDisplayPart>> descriptionFactory, 22public Func<CancellationToken, ImmutableArray<SymbolDisplayPart>> DescriptionFactory { get; } = descriptionFactory;
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.CompilationManager.cs (1)
89var exceptionFilter = (Exception ex) =>
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,
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (2)
54Func<string, bool>? shouldIncludeDiagnostic, 170Func<string, bool>? shouldIncludeDiagnostic,
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);
EditAndContinue\AbstractSimpleMemberBody.cs (2)
30public sealed override IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens) 33public override IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens)
EditAndContinue\CommittedSolution.cs (1)
381Func<Project, CompilationOutputs> compilationOutputsProvider,
EditAndContinue\DebuggingSession.cs (2)
33private readonly Func<Project, CompilationOutputs> _compilationOutputsProvider; 132Func<Project, CompilationOutputs> compilationOutputsProvider,
EditAndContinue\DeclarationBody.cs (1)
39public IEnumerable<SyntaxNode> GetDescendantNodes(Func<SyntaxNode, bool> descendIntoChildren)
EditAndContinue\EditAndContinueService.cs (2)
53private Func<Project, CompilationOutputs> _compilationOutputsProvider = GetCompilationOutputs; 289public void SetOutputProvider(Func<Project, CompilationOutputs> value)
EditAndContinue\EditSession.cs (5)
767var mergedUpdateEditSyntaxMaps = new Dictionary<SymbolKey, (Func<SyntaxNode, SyntaxNode?>? matchingNodes, Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdits)>(symbolKeyComparer); 775Func<SyntaxNode, SyntaxNode?>? mergedMatchingNodes; 776Func<SyntaxNode, RuntimeRudeEdit?>? mergedRuntimeRudeEdits; 1038static _ => false : (Func<ISymbol, bool>)projectChanges.AddedSymbols.Contains;
EditAndContinue\MemberBody.cs (2)
34public abstract IEnumerable<SyntaxToken>? GetActiveTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens); 42public abstract IEnumerable<SyntaxToken> GetUserCodeTokens(Func<SyntaxNode, IEnumerable<SyntaxToken>> getDescendantTokens);
EditAndContinue\SemanticEditInfo.cs (4)
20public readonly Func<SyntaxNode, SyntaxNode?>? MatchingNodes; 21public readonly Func<SyntaxNode, RuntimeRudeEdit?>? RuntimeRudeEdits; 25Func<SyntaxNode, SyntaxNode?>? matchingNodes = null, 26Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdits = null)
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (1)
177public bool ScanCurrentCharAsTokenIfMatch(Func<StackFrameKind, bool> isMatch, out StackFrameToken token)
EncapsulateField\EncapsulateFieldResult.cs (1)
12internal sealed class EncapsulateFieldResult(string name, Glyph glyph, Func<CancellationToken, Task<Solution>> getSolutionAsync)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (1)
286private static void ClearQueueWorker<TKey, TValue>(SemaphoreSlim gate, Dictionary<TKey, TValue> map, Func<TValue, IDisposable> disposerSelector)
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (2)
38Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 56Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound,
ExternalAccess\Watch\Api\WatchHotReloadService.cs (1)
174public Task<Updates> GetUpdatesAsync(Solution solution, Func<Project, bool> isRunningProject, CancellationToken cancellationToken)
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
122Func<SyntaxTrivia, bool> conditionToLeftAtCallSite)
ExtractMethod\ExtractMethodResult.cs (2)
30Func<CancellationToken, Task<(Document document, SyntaxToken? invocationNameToken)>>? getDocumentAsync) 45Func<CancellationToken, Task<(Document document, SyntaxToken? invocationNameToken)>> getDocumentAsync)
GenerateType\AbstractGenerateTypeService.cs (1)
218? (Func<string, bool>)null
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
84private readonly Func<ISymbol?, string?> _getNavigationHint;
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
65Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound,
NavigateTo\AbstractNavigateToSearchService.cs (2)
37Solution solution, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound) 69private static IEnumerable<T> Prioritize<T>(IEnumerable<T> items, Func<T, bool> isPriority)
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (1)
26Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound,
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (2)
30Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 151Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound,
NavigateTo\INavigateToSearchService.cs (4)
22Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 42Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 69Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 87Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound,
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)
Navigation\IDefinitionLocationService.cs (1)
47Document document, int position, Func<CancellationToken, Task<IEnumerable<(Document document, TextSpan sourceSpan)>?>> getNavigableItems, CancellationToken cancellationToken)
Navigation\NavigableItemFactory.SymbolLocationNavigableItem.cs (1)
31/// <seealso cref="InterlockedOperations.Initialize{T, U}(ref StrongBox{T}, Func{U, T}, U)"/>
NavigationBar\AbstractNavigationBarItemService.cs (2)
44Solution solution, ISymbol symbol, SyntaxTree tree, Func<SyntaxReference, TextSpan> computeFullSpan) 51Func<SyntaxReference, TextSpan> computeFullSpan,
Organizing\AbstractOrganizingService.cs (1)
31protected Func<SyntaxNode, IEnumerable<ISyntaxOrganizer>> GetNodeToOrganizers(IEnumerable<ISyntaxOrganizer> organizers)
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
268Func<SyntaxNode, SyntaxNode> wrapConvertedSyntax,
Shared\Extensions\DocumentExtensions.cs (1)
55Func<Document, Task<ImmutableArray<T>>> getItemsWorker)
Shared\Extensions\ISymbolExtensions_2.cs (1)
233public static Func<CancellationToken, IEnumerable<TaggedText>> GetDocumentationPartsFactory(
Shared\Extensions\ISymbolExtensions_Sorting.cs (1)
155Func<TSymbol, string[]> getParameterTypeNames)
SignatureHelp\AbstractSignatureHelpProvider.cs (3)
139Func<CancellationToken, IEnumerable<TaggedText>> documentationFactory, 156Func<CancellationToken, IEnumerable<TaggedText>>? documentationFactory, 173Func<CancellationToken, IEnumerable<TaggedText>>? documentationFactory,
SignatureHelp\AbstractSignatureHelpProvider.SymbolKeySignatureHelpItem.cs (1)
16Func<CancellationToken, IEnumerable<TaggedText>>? documentationFactory,
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\SignatureHelpItem.cs (4)
36public Func<CancellationToken, IEnumerable<TaggedText>> DocumentationFactory { get; } 38private static readonly Func<CancellationToken, IEnumerable<TaggedText>> s_emptyDocumentationFactory = _ => []; 42Func<CancellationToken, IEnumerable<TaggedText>>? documentationFactory, 66Func<CancellationToken, IEnumerable<SymbolDisplayPart>> documentationFactory,
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,
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (1)
25Func<CancellationToken, Task<Document>> createChangedDocument, MergeDirection direction, string ifKeywordText);
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (1)
23protected abstract CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText);
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (1)
48protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, MergeDirection direction, string ifKeywordText)
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (1)
47protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText)
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (1)
36protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, MergeDirection direction, string ifKeywordText)
SplitOrMergeIfStatements\Nested\AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs (1)
34protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText)
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
106private static readonly Func<Guid, ConcurrentDictionary<string, string?>> s_createCache =
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
88Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 394Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\Analyzers\Core\CodeFixes\AddParameter\CodeFixData.cs (4)
13Func<CancellationToken, Task<Solution>> createChangedSolutionNonCascading, 14Func<CancellationToken, Task<Solution>>? createChangedSolutionCascading) 25public Func<CancellationToken, Task<Solution>> CreateChangedSolutionNonCascading { get; } = createChangedSolutionNonCascading ?? throw new ArgumentNullException(nameof(createChangedSolutionNonCascading)); 30public Func<CancellationToken, Task<Solution>>? CreateChangedSolutionCascading { get; } = createChangedSolutionCascading;
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
300static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
21Func<ITypeSymbol, bool> includeMemberType,
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
120private readonly Func<CancellationToken, Task<Solution>> _createChangedSolutionAsync; 137Func<CancellationToken, Task<Solution>> createChangedSolutionAsync,
SymbolSearch\Windows\SymbolSearchUpdateEngine.cs (1)
117Func<string, bool> packageNameMatches,
Wrapping\WrapItemsAction.cs (1)
54ImmutableArray<T> items, ImmutableArray<string> mostRecentlyUsedKeys, Func<T, string> getKey)
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
BrokeredServices\MockServiceBroker.cs (1)
16public Func<Type, object>? CreateService;
EditAndContinue\ActiveStatementsDescription.cs (1)
36public ActiveStatementsDescription(string oldMarkedSource, string newMarkedSource, Func<string, SyntaxTree> syntaxTreeFactory, ActiveStatementFlags[]? flags)
EditAndContinue\MockManagedEditAndContinueDebuggerService.cs (1)
17public Func<Guid, ManagedHotReloadAvailability>? IsEditAndContinueAvailable;
EditAndContinue\RudeEditDiagnosticDescription.cs (1)
52public string ToString(Func<string, string?>? tryGetResource)
EditAndContinue\SemanticEditDescription.cs (6)
15Func<Compilation, ISymbol> symbolProvider, 16Func<Compilation, ITypeSymbol>? partialType, 20Func<Compilation, ISymbol>? deletedSymbolContainerProvider) 23public readonly Func<Compilation, ISymbol> SymbolProvider = symbolProvider; 24public readonly Func<Compilation, ITypeSymbol>? PartialType = partialType; 25public readonly Func<Compilation, ISymbol>? DeletedSymbolContainerProvider = deletedSymbolContainerProvider;
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditSessionActiveStatementsTests.cs (1)
44var mockCompilationOutputsProvider = new Func<Project, CompilationOutputs>(_ => new MockCompilationOutputs(Guid.NewGuid()));
Microsoft.CodeAnalysis.InteractiveHost (40)
Interactive\Core\InteractiveHost.Service.cs (3)
33private readonly Func<Func<object>, object> _invokeOnMainThread; 119private Service(Func<Func<object>, object> invokeOnMainThread) 219public static async Task RunServerAsync(string pipeName, int clientProcessId, Func<Func<object>, object> invokeOnMainThread)
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (4)
15public static bool Any<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 39public static bool All<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 71public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TResult> map) 245public static void FreeAll<T>(this ArrayBuilder<T> builder, Func<T, ArrayBuilder<T>?> getNested)
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\ImmutableSegmentedList`1.cs (1)
205/// <inheritdoc cref="ImmutableList{T}.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
77/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (4)
15public static bool All<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 47public static bool Any<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 84public static T Last<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 101public static IEnumerable<TResult> Select<T, TResult>(this ImmutableSegmentedList<T> immutableList, Func<T, TResult> selector)
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\ArrayBuilder.cs (3)
519internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 567public void AddRange<U>(ArrayBuilder<U> items, Func<U, T> selector) 709public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
122internal ObjectPool(Func<ObjectPool<T>, T> factory, int size)
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (2)
17Func<CancellationToken, ValueTask> processBatchAsync, 21private static Func<ImmutableSegmentedList<VoidResult>, CancellationToken, ValueTask> Convert(Func<CancellationToken, ValueTask> processBatchAsync)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (4)
28public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction) 33public static AsyncLazy<T> Create<T>(Func<CancellationToken, T> synchronousComputeFunction) 38public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction, Func<CancellationToken, T> synchronousComputeFunction)
Microsoft.CodeAnalysis.LanguageServer.Protocol (34)
Extensions\Extensions.cs (1)
123Func<T, ProjectId> projectIdGetter,
Extensions\ProtocolConversions.cs (2)
376public static async Task<LSP.TextDocumentEdit[]> ChangedDocumentsToTextDocumentEditsAsync<T>(IEnumerable<DocumentId> changedDocuments, Func<DocumentId, T> getNewDocumentFunc, 377Func<DocumentId, T> getOldDocumentFunc, IDocumentTextDifferencingService? textDiffService, CancellationToken cancellationToken) where T : TextDocument
Features\EditAndContinue\EditAndContinueDiagnosticSource_Workspace.cs (1)
38public static async ValueTask<ImmutableArray<IDiagnosticSource>> CreateWorkspaceDiagnosticSourcesAsync(Solution solution, Func<Document, bool> isDocumentOpen, CancellationToken cancellationToken)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
133Func<CodeAction, Task<UnifiedSuggestedActionSet?>> getFixAllSuggestedActionSetAsync,
Handler\BufferedProgress.cs (3)
72public static BufferedProgress<TIn> Create<TIn, TOut>(IProgress<TOut>? progress, Func<TIn, TOut> transform) 75static IProgress<TIn> Transform<TIn, TOut>(this IProgress<TOut> progress, Func<TIn, TOut> transform) 88sealed class ProgressTransformer<TIn, TOut>(IProgress<TOut> inner, Func<TIn, TOut> transform) : IProgress<TIn>
Handler\CodeActions\CodeActionResolveHelper.cs (4)
215Func<DocumentId, TTextDocument?> getOldDocument) 231Func<DocumentId, TTextDocument?> getNewDocument) 268Func<DocumentId, TTextDocument?> getNewDocument, 269Func<DocumentId, TTextDocument?> getOldDocument)
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDocumentsAndProjectDiagnosticSourceProvider.cs (1)
71Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer = !compilerFullSolutionAnalysisEnabled || !analyzersFullSolutionAnalysisEnabled
Handler\Diagnostics\DiagnosticSources\AbstractProjectDiagnosticSource.cs (2)
19public static AbstractProjectDiagnosticSource CreateForFullSolutionAnalysisDiagnostics(Project project, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer) 36private sealed class FullSolutionAnalysisDiagnosticSource(Project project, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer)
Handler\Diagnostics\DiagnosticSources\AbstractWorkspaceDocumentDiagnosticSource.cs (2)
18public static AbstractWorkspaceDocumentDiagnosticSource CreateForFullSolutionAnalysisDiagnostics(TextDocument document, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer) 24private sealed class FullSolutionAnalysisDiagnosticSource(TextDocument document, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer)
Handler\Diagnostics\DiagnosticSources\NonLocalDocumentDiagnosticSource.cs (2)
13internal sealed class NonLocalDocumentDiagnosticSource(TextDocument document, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer) 16private readonly Func<DiagnosticAnalyzer, bool>? _shouldIncludeAnalyzer = shouldIncludeAnalyzer;
LspServices\BaseService.cs (3)
22public static BaseService CreateLazily<T>(Func<ILspServices, T> creator) 33private sealed class LazyService<T>(Func<ILspServices, T> creator) : BaseService 37private readonly Func<ILspServices, T> _creator = creator;
Protocol\Converters\StringEnumConverter.cs (2)
22private static readonly Func<string, TStringEnumType> CreateEnum; 35CreateEnum = Expression.Lambda<Func<string, TStringEnumType>>(body, param).Compile();
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)
RoslynLanguageServer.cs (1)
118void AddLazyService<T>(Func<ILspServices, T> creator)
Microsoft.CodeAnalysis.PooledObjects.Package (13)
ArrayBuilder.cs (3)
519internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 567public void AddRange<U>(ArrayBuilder<U> items, Func<U, T> selector) 709public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
ObjectPool`1.cs (1)
122internal ObjectPool(Func<ObjectPool<T>, T> factory, int size)
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)
ITypeParameterSymbolExtensions.cs (2)
12private static readonly Func<ITypeParameterSymbol, bool> s_hasReferenceTypeConstraint 15private static readonly Func<ITypeParameterSymbol, NullableAnnotation> s_referenceTypeConstraintNullableAnnotation
ITypeSymbolExtensions.cs (1)
12private static readonly Func<ITypeSymbol, NullableAnnotation> s_nullableAnnotation
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
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\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (2)
DeclarePublicApiFix.cs (2)
190private readonly Func<CancellationToken, Task<Solution>> _createChangedAdditionalDocument; 192public AdditionalDocumentChangeAction(string title, DocumentId? apiDocId, bool isPublic, Func<CancellationToken, Task<Solution>> createChangedAdditionalDocument)
Microsoft.CodeAnalysis.Rebuild.UnitTests (4)
RebuildCommandLineTests.cs (4)
241void Permutate(CommandInfo commandInfo, params Func<CommandInfo, IEnumerable<CommandInfo>>[] permutations) 244foreach (var p in permutations) 434void Permutate(CommandInfo commandInfo, params Func<CommandInfo, IEnumerable<CommandInfo>>[] permutations) 437foreach (var p in permutations)
Microsoft.CodeAnalysis.Remote.ServiceHub (28)
ExternalAccess\Pythia\Api\PythiaBrokeredServiceImplementation.cs (3)
15public static ValueTask<T> RunServiceAsync<T>(Func<CancellationToken, ValueTask<T>> implementation, CancellationToken cancellationToken) 18public static ValueTask RunServiceAsync(Func<CancellationToken, ValueTask> implementation, CancellationToken cancellationToken) 25public static ValueTask<T> RunServiceAsync<T>(this PythiaPinnedSolutionInfoWrapper solutionInfo, ServiceBrokerClient client, Func<Solution, ValueTask<T>> implementation, CancellationToken cancellationToken)
ExternalAccess\Razor\Api\RazorBrokeredServiceImplementation.cs (3)
15public static ValueTask<T> RunServiceAsync<T>(Func<CancellationToken, ValueTask<T>> implementation, CancellationToken cancellationToken) 18public static ValueTask RunServiceAsync(Func<CancellationToken, ValueTask> implementation, CancellationToken cancellationToken) 21public static ValueTask<T> RunServiceAsync<T>(this RazorPinnedSolutionInfoWrapper solutionInfo, ServiceBrokerClient client, Func<Solution, ValueTask<T>> implementation, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Api\UnitTestingBrokeredServiceImplementation.cs (3)
15public static ValueTask<T> RunServiceAsync<T>(Func<CancellationToken, ValueTask<T>> implementation, CancellationToken cancellationToken) 18public static ValueTask RunServiceAsync(Func<CancellationToken, ValueTask> implementation, CancellationToken cancellationToken) 27public static ValueTask<T> RunServiceAsync<T>(this UnitTestingPinnedSolutionInfoWrapper solutionInfo, ServiceBrokerClient client, Func<Solution, ValueTask<T>> implementation, CancellationToken cancellationToken)
Host\AssetProvider.cs (4)
219Task SynchronizeProjectAssetAsync<TAsset>(AssetPath assetPath, Func<ProjectStateChecksums, Checksum> getChecksum) 220=> SynchronizeProjectAssetOrCollectionAsync<TAsset, Func<ProjectStateChecksums, Checksum>>( 225Task SynchronizeProjectAssetCollectionAsync<TAsset>(AssetPath assetPath, Func<ProjectStateChecksums, ChecksumCollection> getChecksums) 226=> SynchronizeProjectAssetOrCollectionAsync<TAsset, Func<ProjectStateChecksums, ChecksumCollection>>(
Host\RemoteWorkspace.cs (2)
81Func<Solution, ValueTask<T>> implementation, 91Func<Solution, ValueTask<T>> implementation,
Host\RemoteWorkspace.InFlightSolution.cs (1)
55Func<CancellationToken, Task<Solution>> computeDisconnectedSolutionAsync)
Host\RemoteWorkspaceManager.cs (3)
61public RemoteWorkspaceManager(Func<RemoteWorkspace, SolutionAssetCache> createAssetCache) 67Func<RemoteWorkspace, SolutionAssetCache> createAssetCache, 106Func<Solution, ValueTask<T>> implementation,
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)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (1)
250Func<DiagnosticAnalyzer, bool> shouldInclude;
src\VisualStudio\Core\Def\Watson\FaultReporter.cs (1)
305private static List<string> CollectFilePaths(string logDirectoryPath, string logFileExtension, Func<string, bool> shouldExcludeLogFile)
Microsoft.CodeAnalysis.Remote.Workspaces (9)
BrokeredServiceDescriptors.cs (1)
25private static readonly Func<string, string> NameNormalize =
ExternalAccess\Pythia\Api\PythiaServiceDescriptorsWrapper.cs (1)
21Func<string, string> featureDisplayNameProvider,
ExternalAccess\UnitTesting\Api\UnitTestingServiceDescriptorsWrapper.cs (1)
21Func<string, string> featureDisplayNameProvider,
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)
ServiceDescriptors.cs (2)
96private readonly Func<string, string> _featureDisplayNameProvider; 100Func<string, string> featureDisplayNameProvider,
Microsoft.CodeAnalysis.ResxSourceGenerator (41)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132private static int CalculateDepthOfInheritance(INamedTypeSymbol namedType, Func<INamedTypeSymbol, bool> isExcludedFromInheritanceCount)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
17private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 20Func<INamedTypeSymbol, bool>? isExcludedFromInheritanceCountFunc = null) 34public Func<INamedTypeSymbol, bool> IsExcludedFromInheritanceCountFunc { get; }
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (2)
116private readonly Func<INamedTypeSymbol, bool> _isDisallowedCatchType; 122public DisallowGeneralCatchUnlessRethrowWalker(Func<INamedTypeSymbol, bool> isDisallowedCatchType, bool checkAnonymousFunctions)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
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\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
20private static readonly Func<IOperation, ImmutableArray<IOperation>> ElementsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Elements), fallbackResult: default);
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\IUtf8StringOperationWrapper.cs (1)
19private static readonly Func<IOperation, string> ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, string>(WrappedType, nameof(Value), fallbackResult: null!);
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\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
458Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, 473static bool TryParse(string s, (Compilation compilation, Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, string? namePrefix, string? optionForcedValue) arg, out SymbolNamesWithValueOption<TValue> option)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
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,
ScriptBuilder.cs (4)
78internal Func<object[], Task<T>> CreateExecutor<T>(ScriptCompiler compiler, Compilation compilation, bool emitDebugInformation, CancellationToken cancellationToken) 88var executor = Build<T>(compilation, diagnostics, emitDebugInformation, cancellationToken); 122private Func<object[], Task<T>> Build<T>( 163return runtimeEntryPoint.CreateDelegate<Func<object[], Task<T>>>();
ScriptExecutionState.cs (3)
69ImmutableArray<Func<object[], Task>> precedingExecutors, 70Func<object[], Task> currentExecutor, 72Func<Exception, bool> catchExceptionOpt,
ScriptState.cs (2)
156public Task<ScriptState<object>> ContinueWithAsync(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken)) 180public Task<ScriptState<TResult>> ContinueWithAsync<TResult>(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
Utilities\ParameterValidationHelpers.cs (1)
68internal static IEnumerable<S> SelectChecked<T, S>(IEnumerable<T> items, string parameterName, Func<T, S> selector)
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)
Assert\DiffUtil.cs (2)
55public IEnumerable<string> CalculateDiff(IList<T> sequenceA, IList<T> sequenceB, Func<T, string> toString) 77public static string DiffReport<T>(IEnumerable<T> expected, IEnumerable<T> actual, string separator, IEqualityComparer<T> comparer = null, Func<T, string> toString = null)
Compilation\CompilationDifference.cs (1)
85Func<Cci.ILocalDefinition, ILVisualizer.LocalInfo> mapLocal = null,
Compilation\CompilationExtensions.cs (1)
148var isAddedSymbol = new Func<ISymbol, bool>(s => allAddedSymbols?.Contains(s) ?? false);
Compilation\CompilationTestDataExtensions.cs (1)
115internal static Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> EncDebugInfoProvider(this CompilationTestData.MethodData methodData)
Compilation\TestStrongNameFileSystem.cs (1)
12internal Func<string, byte[]> ReadAllBytesFunc { get; set; }
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1267private void CacheAndVerifyControlFlowGraph(ImmutableArray<IOperation> operationBlocks, Func<IOperation, (ControlFlowGraph Graph, ISymbol AssociatedSymbol)> getControlFlowGraph)
Diagnostics\DiagnosticDescription.cs (4)
44private readonly Func<SyntaxNode, bool> _syntaxPredicate; 78Func<SyntaxNode, bool> syntaxNodePredicate, 103Func<SyntaxNode, bool> syntaxNodePredicate, 232public DiagnosticDescription WhereSyntax(Func<SyntaxNode, bool> syntaxPredicate)
Diagnostics\ThrowingDiagnosticAnalyzer.cs (3)
61public static void VerifyAnalyzerEngineIsSafeAgainstExceptions(Func<DiagnosticAnalyzer, IEnumerable<Diagnostic>> runAnalysis) 66public static async Task VerifyAnalyzerEngineIsSafeAgainstExceptionsAsync(Func<DiagnosticAnalyzer, IEnumerable<Diagnostic>> runAnalysis) 71public static async Task VerifyAnalyzerEngineIsSafeAgainstExceptionsAsync(Func<DiagnosticAnalyzer, Task<IEnumerable<Diagnostic>>> runAnalysis)
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
161private void AssertSequenceEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual, Func<IEnumerable<T>, IOrderedEnumerable<T>> sorter = null)
MarkedSource\MarkupTestFile.cs (1)
180private static V GetOrAdd<K, V>(IDictionary<K, V> dictionary, K key, Func<K, V> function)
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)
Metadata\ILBuilderVisualizer.cs (2)
139Func<Cci.ILocalDefinition, LocalInfo> mapLocal = null, 178Func<Cci.ILocalDefinition, LocalInfo> mapLocal = null)
Metadata\ILValidation.cs (1)
375public static Dictionary<int, string> GetSequencePointMarkers(XElement methodXml, Func<string, SourceText> getSource)
Mocks\TestAnalyzerAssemblyLoader.cs (2)
20private readonly Func<string, Assembly>? _loadFromPath; 22public TestAnalyzerAssemblyLoader(Action<string>? addDependencyLocation = null, Func<string, Assembly>? loadFromPath = null)
Mocks\TestEqualityComparer.cs (1)
13public class TestEqualityComparer<T>(Func<T?, T?, bool>? equals = null, Func<T, int>? getHashCode = null) : IEqualityComparer<T>
ObjectReference.cs (3)
19public static ObjectReference<T> CreateFromFactory<T, TArg>(Func<TArg, T> targetFactory, TArg arg) 163public U UseReference<U>(Func<T, U> function) 174public ObjectReference<TResult> GetObjectReference<TResult>(Func<T, TResult> function) where TResult : class
PDB\DeterministicBuildCompilationTestHelpers.cs (2)
25public static void VerifyPdbOption<T>(this ImmutableDictionary<string, string> pdbOptions, string pdbName, T expectedValue, Func<T, bool> isDefault = null, Func<T, string> toString = null)
SourceGeneration\TestGenerators.cs (2)
56private readonly Func<GeneratorExecutionContext, Location> _produceLocation; 58public DiagnosticProducingGenerator(Func<GeneratorExecutionContext, Location> produceLocation)
TestableFileSystem.cs (2)
22public Func<string, bool> FileExistsFunc { get; private set; } = delegate { throw new InvalidOperationException(); }; 43Func<string, bool>? fileExistsFunc = null)
TestBase.cs (2)
332Func<SyntaxNode, bool>? syntaxNodePredicate = null, 351Func<SyntaxNode, bool>? syntaxNodePredicate = null,
TestHelpers.cs (2)
106Func<SyntaxNode, bool> syntaxNodePredicate = null, 132Func<SyntaxNode, bool> syntaxNodePredicate = null,
Microsoft.CodeAnalysis.Threading.Package (34)
AsyncBatchingWorkQueue`0.cs (2)
17Func<CancellationToken, ValueTask> processBatchAsync, 21private static Func<ImmutableSegmentedList<VoidResult>, CancellationToken, ValueTask> Convert(Func<CancellationToken, ValueTask> processBatchAsync)
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\ImmutableSegmentedList`1.cs (1)
205/// <inheritdoc cref="ImmutableList{T}.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
77/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (4)
15public static bool All<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 47public static bool Any<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 84public static T Last<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 101public static IEnumerable<TResult> Select<T, TResult>(this ImmutableSegmentedList<T> immutableList, Func<T, TResult> selector)
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\ArrayBuilder.cs (3)
519internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 567public void AddRange<U>(ArrayBuilder<U> items, Func<U, T> selector) 709public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
122internal ObjectPool(Func<ObjectPool<T>, T> factory, int size)
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)
AnalyzerAssemblyLoaderTests.cs (2)
1803private class TestAnalyzerPathResolver(Func<string, string?> getRealFilePathFunc) : MarshalByRefObject, IAnalyzerPathResolver 1805private readonly Func<string, string?> _getRealFilePathFunc = getRealFilePathFunc;
Collections\HashSet\TestingTypes.cs (2)
369public Func<DelegateEquatable?, bool> EqualsWorker { get; set; } 376public Func<ValueDelegateEquatable, bool> EqualsWorker { get; set; }
Collections\ImmutableArrayExtensionsTests.cs (1)
148Func<int, bool> isOdd = x => x % 2 == 1;
Collections\ImmutableListTestBase.cs (2)
579private readonly Func<object?, bool> equalsCallback; 581internal ProgrammaticEquals(Func<object?, bool> equalsCallback)
Collections\ImmutableSetTest.cs (6)
359private void SetCompareTestHelper<T>(Func<System.Collections.Immutable.IImmutableSet<T>, Func<IEnumerable<T>, bool>> operation, Func<ISet<T>, Func<IEnumerable<T>, bool>> baselineOperation, IEnumerable<Tuple<IEnumerable<T>, IEnumerable<T>, bool>> scenarios) 371var expectedFunc = baselineOperation(baselineSet); 375var actualFunc = operation(this.SetWith(scenario.Item1.ToArray()));
Collections\IndexOfTests.cs (2)
23Func<IEnumerable<int>, TCollection> factory, 92Func<IEnumerable<int>, TCollection> factory,
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)
Collections\TopologicalSortTests.cs (1)
21private static TopologicalSortAddSuccessors<T> GetAddSuccessorsFunction<T>(T[][] successors, Func<T, int> toInt)
Diagnostics\AnalysisContextInfoTests.cs (2)
58private readonly Func<string, bool> _throwPredicate; 61public Analyzer(Func<string, bool> throwPredicate)
Emit\EmitBaselineTests.cs (2)
22var debugInfoProvider = new Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation>(_ => default); 23var localSigProvider = new Func<MethodDefinitionHandle, StandaloneSignatureHandle>(_ => default);
Emit\EmitOptionsTests.cs (1)
22Func<EmitOptions, T> getter,
Text\TextChangeTests.cs (4)
1257Func<SourceText, SourceText> fnChange1, 1258Func<SourceText, SourceText> fnChange2) 1275Func<SourceText, SourceText> fnChange1, 1276Func<SourceText, SourceText> fnChange2,
Microsoft.CodeAnalysis.VisualBasic (4)
Declarations\MergedTypeDeclaration.vb (2)
138Private Shared ReadOnly s_identityFunc As Func(Of SingleTypeDeclaration, SingleTypeDeclaration) = 141Private Shared ReadOnly s_mergeFunc As Func(Of IEnumerable(Of SingleTypeDeclaration), MergedTypeDeclaration) =
Symbols\SynthesizedSymbols\SynthesizedClonedTypeParameterSymbol.vb (2)
27Private ReadOnly _typeMapFactory As Func(Of Symbol, TypeSubstitution) 40Friend Sub New(correspondingMethodTypeParameter As TypeParameterSymbol, container As Symbol, name As String, typeMapFactory As Func(Of Symbol, TypeSubstitution))
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (6)
ExpressionTrees\Sources\ExprLambdaUtils.vb (1)
21Public Shared Sub Check(Of T1, T2)(e As Expression(Of Func(Of T1, T2)), expected As String)
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\AbstractClassificationService.cs (4)
27private Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>>? _getNodeClassifiers; 28private Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>>? _getTokenClassifiers; 185(Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>>, Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>>) GetExtensionClassifiers(
Classification\Classifier.cs (2)
84var getNodeClassifiers = extensionManager.CreateNodeExtensionGetter(syntaxClassifiers, c => c.SyntaxNodeTypes); 85var getTokenClassifiers = extensionManager.CreateTokenExtensionGetter(syntaxClassifiers, c => c.SyntaxTokenKinds);
Classification\ClassifierHelper.cs (1)
236Func<TClassifiedSpan, TextSpan> getSpan,
Classification\SyntaxClassification\AbstractSyntaxClassificationService.cs (4)
29Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 30Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>> getTokenClassifiers, 50Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 51Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>> getTokenClassifiers,
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,
Classification\SyntaxClassification\ISyntaxClassificationService.cs (4)
38Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 39Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>> getTokenClassifiers, 47Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 48Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>> getTokenClassifiers,
Classification\SyntaxClassification\SyntaxClassificationExtensions.cs (4)
32Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 33Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>> getTokenClassifiers, 51Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 52Func<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)"/>
CodeCleanup\AbstractCodeCleanerService.cs (3)
458Func<SyntaxNode, ImmutableArray<TextSpan>> spanGetter, 521SyntaxNode root, Func<SyntaxNode, ImmutableArray<TextSpan>> spanGetter) 539Func<SyntaxNode, ImmutableArray<TextSpan>> spanGetter,
CodeFixesAndRefactorings\FixAllProviderInfo.cs (1)
129private readonly Func<Diagnostic, bool> _canBeSuppressedOrUnsuppressed = suppressionFixer.IsFixableDiagnostic;
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (1)
64Func<SyntaxEditor, Task> editAsync,
Editing\SymbolEditorExtensions.cs (1)
60Func<SyntaxGenerator, SyntaxNode> getNewBaseType,
Editing\SyntaxGenerator.cs (2)
1467protected static SyntaxNode? PreserveTrivia<TNode>(TNode? node, Func<TNode, SyntaxNode> nodeChanger) where TNode : SyntaxNode 1496protected static SyntaxNode ReplaceWithTrivia<TNode>(SyntaxNode root, TNode original, Func<TNode, SyntaxNode> replacer)
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\Declarations\DeclarationFinder_SourceDeclarations.cs (1)
203string pattern, Func<SearchQuery, Task<ImmutableArray<ISymbol>>> searchAsync)
FindSymbols\FindLiterals\FindLiteralsSearchEngine.cs (1)
95static async IAsyncEnumerable<TResult> SelectManyAsync<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, IAsyncEnumerable<TResult>> selector)
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\FindReferences\Finders\AbstractReferenceFinder.cs (2)
347Func<SyntaxTreeIndex, bool> predicate, 375Func<SyntaxTreeIndex, bool> isRelevantDocument,
FindSymbols\SearchQuery.cs (4)
21private readonly Func<string, bool> _predicate; 54private SearchQuery(Func<string, bool> predicate) 72public static SearchQuery CreateCustom(Func<string, bool> predicate) 75public readonly Func<string, bool> GetPredicate()
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)
FindSymbols\SymbolTree\SymbolTreeInfo_Serialization.cs (1)
32Func<Checksum, ValueTask<SymbolTreeInfo>> createAsync,
Log\AbstractLogAggregator.cs (1)
28private readonly Func<object, TValue> _createCounter;
Log\AggregateLogger.cs (2)
42public static ILogger AddOrReplace(ILogger newLogger, ILogger oldLogger, Func<ILogger, bool> predicate) 87public static ILogger Remove(ILogger logger, Func<ILogger, bool> predicate)
Log\EtwLogger.cs (1)
14internal sealed class EtwLogger(Func<FunctionId, bool> isEnabledPredicate) : ILogger
Log\TraceLogger.cs (1)
14internal sealed class TraceLogger(Func<FunctionId, bool>? isEnabledPredicate) : ILogger
Options\OptionChangedEventArgs.cs (1)
14public bool HasOption(Func<IOption2, bool> predicate)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
179/// <param name="candidateSymbols">symbols corresponding to <see cref="Expression{Func}"/> or <see cref="Func{some_args, TResult}"/>
Rename\ConflictEngine\DeclarationConflictHelpers.cs (1)
40Func<ISymbol, ImmutableArray<ImmutableArray<ITypeSymbol>>> getAllSignatures)
Serialization\SerializerService.cs (1)
36private static readonly Func<WellKnownSynchronizationKind, string> s_logKind = k => k.ToString();
Shared\Extensions\ISymbolExtensions.cs (1)
647this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation, Func<T, bool> inclusionFilter) where T : ISymbol
Shared\TestHooks\AsynchronousOperationListener.cs (1)
183public async Task WaitUntilConditionIsMetAsync(Func<IEnumerable<DiagnosticAsyncToken>, bool> condition)
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (1)
44private readonly Func<string, AsynchronousOperationListener> _createCallback;
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)
SourceGeneratorTelemetry\ISourceGeneratorTelemetryCollectorWorkspaceService.cs (1)
13void CollectRunResult(GeneratorDriverRunResult driverRunResult, GeneratorDriverTimingInfo driverTimingInfo, Func<ISourceGenerator, AnalyzerReference> getAnalyzerReference);
SourceGeneratorTelemetry\SourceGeneratorTelemetryCollectorWorkspaceService.cs (2)
45private GeneratorTelemetryKey GetTelemetryKey(ISourceGenerator generator, Func<ISourceGenerator, AnalyzerReference> getAnalyzerReference) 51Func<ISourceGenerator, AnalyzerReference> getAnalyzerReference)
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (4)
15public static bool Any<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 39public static bool All<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 71public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TResult> map) 245public static void FreeAll<T>(this ArrayBuilder<T> builder, Func<T, ArrayBuilder<T>?> getNested)
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\Collections\TemporaryArrayExtensions.cs (3)
43public static bool Any<T>(this in TemporaryArray<T> array, Func<T, bool> predicate) 54public static bool All<T>(this in TemporaryArray<T> array, Func<T, bool> predicate) 68public static T? SingleOrDefault<T>(this in TemporaryArray<T> array, Func<T, bool> predicate)
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\InternalUtilities\OneOrMany.cs (4)
123public OneOrMany<TResult> Select<TResult>(Func<T, TResult> selector) 142public T? FirstOrDefault(Func<T, bool> predicate) 169public bool All(Func<T, bool> predicate) 178public bool Any(Func<T, bool> predicate)
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
48public T Initialize<TArg>(Func<TArg, T> valueFactory, TArg arg)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (3)
57private static readonly Func<char, char> s_toLower = char.ToLower; 58private static readonly Func<char, char> s_toUpper = char.ToUpper; 80Func<char, char> convert)
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\ImmutableSegmentedList`1.cs (1)
205/// <inheritdoc cref="ImmutableList{T}.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
77/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (4)
15public static bool All<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 47public static bool Any<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 84public static T Last<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 101public static IEnumerable<TResult> Select<T, TResult>(this ImmutableSegmentedList<T> immutableList, Func<T, TResult> selector)
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\ArrayBuilder.cs (3)
519internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 567public void AddRange<U>(ArrayBuilder<U> items, Func<U, T> selector) 709public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
122internal ObjectPool(Func<ObjectPool<T>, T> factory, int size)
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\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (2)
17Func<CancellationToken, ValueTask> processBatchAsync, 21private static Func<ImmutableSegmentedList<VoidResult>, CancellationToken, ValueTask> Convert(Func<CancellationToken, ValueTask> processBatchAsync)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (2)
123Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null) 147Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (1)
200private static Func<string, T> GetParser(string type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (2)
23OptionGroup group, string name, CodeStyleOption2<T> defaultValue, Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null) 27OptionGroup group, string name, CodeStyleOption2<T> defaultValue, Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\VisualBasic\VisualBasicCodeStyleOptions.cs (1)
20Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (5)
119public VirtualChar? FirstOrNull(Func<VirtualChar, bool> predicate) 130public VirtualChar? LastOrNull(Func<VirtualChar, bool> predicate) 142public bool Any(Func<VirtualChar, bool> predicate) 153public bool All(Func<VirtualChar, bool> predicate) 167public VirtualCharSequence SkipWhile(Func<VirtualChar, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ChildSyntaxListExtensions.cs (2)
12public static SyntaxNodeOrToken First(this ChildSyntaxList childSyntaxList, Func<SyntaxNodeOrToken, bool> predicate) 24public static SyntaxNodeOrToken Last(this ChildSyntaxList childSyntaxList, Func<SyntaxNodeOrToken, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (1)
105public static int IndexOf<T>(this IList<T> list, Func<T, bool> predicate)
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\ObjectWriterExtensions.cs (1)
23public static ImmutableArray<T> ReadArray<T>(this ObjectReader reader, Func<ObjectReader, T> read)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (3)
341public static bool HasAnyOperationDescendant(this ImmutableArray<IOperation> operationBlocks, Func<IOperation, bool> predicate) 354public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate) 357public static bool HasAnyOperationDescendant(this IOperation operationBlock, Func<IOperation, bool> predicate, [NotNullWhen(true)] out IOperation? foundOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (2)
22Func<SyntaxNode, bool>? predicate = null) 52Func<SyntaxNode, bool>? predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (1)
100public static int IndexOf(this string? text, Func<char, bool> predicate)
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\Extensions\SyntaxTriviaListExtensions.cs (1)
11public static SyntaxTrivia? FirstOrNull(this SyntaxTriviaList triviaList, Func<SyntaxTrivia, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.OperationTreeAnalysisData.cs (3)
18private readonly Func<IMethodSymbol, BasicBlockAnalysisData> _analyzeLocalFunction; 24Func<IMethodSymbol, BasicBlockAnalysisData> analyzeLocalFunction) 40Func<IMethodSymbol, BasicBlockAnalysisData> analyzeLocalFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (1)
21private static readonly Func<TextSpan, bool> s_notEmpty = s => !s.IsEmpty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (2)
111Func<SyntaxToken, int> tokenColumnGetter, 140Func<SyntaxToken, int> tokenColumnGetter,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (2)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (1)
20Func<SyntaxNode, bool>? predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
86public static void Log<TArg>(FunctionId functionId, Func<TArg, string> messageGetter, TArg arg, LogLevel logLevel = LogLevel.Debug) 183public static IDisposable LogBlock<TArg>(FunctionId functionId, Func<TArg, string> messageGetter, TArg arg, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
23public static LogMessage Create<TArg>(Func<TArg, string> messageGetter, TArg arg, LogLevel logLevel) 121private Func<TArg0, string>? _messageGetter; 124public static LogMessage Construct(Func<TArg0, string> messageGetter, TArg0 arg, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
108Func<string, TValue> parser,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (1)
22public PooledObject(ObjectPool<T> pool, Func<ObjectPool<T>, T> allocator, Action<ObjectPool<T>, T> releaser) : this()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (2)
16Func<string, Optional<T>> parseValue, 17Func<T, string> serializeValue) : IEditorConfigValueSerializer
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (1)
41internal Option2(OptionDefinition<T> definition, string? languageName, Func<IOption2, IPublicOption>? publicOptionFactory)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (1)
33internal PerLanguageOption2(OptionDefinition<T> optionDefinition, Func<IOption2, IPublicOption>? publicOptionFactory)
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\Serialization\ObjectReader.cs (2)
259public (char[] array, int length) ReadCharArray(Func<int, char[]>? getArray) 264Func<int, T[]>? getArray = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (3)
43Func<TMemberDeclarationSyntax, bool> membersToKeep, CancellationToken cancellationToken) 79Func<TMemberDeclarationSyntax, bool> membersToKeep) 102void AddSelectedMemberDeclarations(TMemberDeclarationSyntax member, Func<TMemberDeclarationSyntax, bool> membersToKeep)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (4)
28public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction) 33public static AsyncLazy<T> Create<T>(Func<CancellationToken, T> synchronousComputeFunction) 38public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction, Func<CancellationToken, T> synchronousComputeFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy.cs (1)
15public static CancellableLazy<T> Create<T>(Func<CancellationToken, T> valueFactory)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy`1.cs (3)
14private Func<CancellationToken, T>? _valueFactory; 17public CancellableLazy(Func<CancellationToken, T> valueFactory) 58Interlocked.Exchange<Func<CancellationToken, T>?>(ref _valueFactory, null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ComparerWithState.cs (2)
26public static int CompareTo<T>(T first, T second, ImmutableArray<Func<T, IComparable>> comparableMethods) 28foreach (var comparableMethod in comparableMethods)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ConcatImmutableArray`1.cs (1)
18public bool Any(Func<T, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
16public static V GetOrAdd<K, V>(this IDictionary<K, V> dictionary, K key, Func<K, V> function)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.cs (1)
38public static Matcher<T> Single<T>(Func<T, bool> predicate, string description)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher.SingleMatcher.cs (1)
12private sealed class SingleMatcher(Func<T, bool> predicate, string description) : Matcher<T>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Matcher`1.cs (1)
37internal static Matcher<T> Single(Func<T, bool> predicate, string description)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (1)
99public static bool HasDuplicates<T, U>(this ArrayBuilder<T> builder, Func<T, U> selector)
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\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
54protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 71Func<SyntaxEditor, Task> editAsync,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (3)
501Func<SyntaxTrivia, bool> isEndOfLineTrivia, 521Func<SyntaxToken, bool> isComma, 549Func<SyntaxToken, bool> isAccessibilityModifier)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
221Func<SyntaxNode, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
195Func<SyntaxList<TDeclaration>, TDeclaration?>? after = null, 196Func<SyntaxList<TDeclaration>, TDeclaration?>? before = null)
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\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
23public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 26Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\IRemoveUnnecessaryImportsService.cs (1)
16Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
32private static readonly Func<ISymbol, bool> s_LocalNameFilter = s => 75string baseName, Func<ISymbol, bool> filter,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (1)
35Func<ISymbol, bool> filter, IEnumerable<string> usedNames, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
19protected readonly Func<TypeInferenceInfo, bool> IsUsableTypeFunc; 24private static readonly Func<TypeInferenceInfo, bool> s_isNotNull = t => t.InferredType != null;
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\Simplification\ISimplificationService.cs (2)
20Func<SyntaxNode, bool>? expandInsideNode, 27Func<SyntaxNode, bool>? expandInsideNode,
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\Interop\SqlConnection.cs (2)
210/// <inheritdoc cref="RunInTransaction{TState, TResult}(Func{TState, TResult}, TState, bool)"/> 229Func<TState, TResult> action, TState state, bool throwOnSqlException)
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
SymbolSearch\ISymbolSearchService.cs (1)
133private static readonly ImmutableArray<Func<PackageWithAssemblyResult, IComparable>> s_comparers =
TemporaryStorage\TemporaryStorageService.MemoryMappedInfo.cs (1)
119private static T RunWithCompactingGCFallback<TArg, T>(Func<TArg, T> function, TArg argument)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
564Func<DocumentId, SourceTextContainer?> getContainer)
Workspace\ProjectSystem\ProjectSystemProject.cs (2)
233private void ChangeProjectProperty<T>(ref T field, T newValue, Func<Solution, Solution> updateSolution, bool logThrowAwayTelemetry = false) 348private void ChangeProjectOutputPath(ref string? field, string? newValue, Func<Solution, Solution> withNewValue)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (3)
268public void ApplyChangeToWorkspace(ProjectId projectId, Func<CodeAnalysis.Solution, CodeAnalysis.Solution> solutionTransformation) 870Func<Project, IEnumerable<TReference>> getReferences, 871Func<TReference, string> getFilePath,
Workspace\Solution\Checksum.cs (2)
102public static Func<Checksum, string> GetChecksumLogInfo { get; } 105public static Func<IEnumerable<Checksum>, string> GetChecksumsLogInfo { get; }
Workspace\Solution\Project.cs (2)
389Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken) 455private async Task<bool> ContainsAsync(Func<Document, Task<bool>> predicateAsync)
Workspace\Solution\ProjectState.AnalyzerConfigOptionsCache.cs (1)
27private readonly Func<string, AnalyzerConfigData> _computeFunction = path => new AnalyzerConfigData(configSet.GetOptionsForSourcePath(path), fallbackOptions);
Workspace\Solution\SolutionCompilationState.cs (1)
147Func<StateChange, TranslationAction?>? translate,
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
33private static readonly Func<ProjectState, string> s_logBuildCompilationAsync =
Workspace\Solution\TextDocumentStates.cs (2)
74public TextDocumentStates(IEnumerable<DocumentInfo> infos, Func<DocumentInfo, TState> stateConstructor) 128public ImmutableArray<TValue> SelectAsArray<TValue>(Func<TState, TValue> selector)
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)
MSBuild\DiagnosticReporter.cs (1)
23public void Report(DiagnosticReportingMode mode, string message, Func<string, Exception>? createException = null)
MSBuild\ProjectMap.cs (1)
166private static bool TryFindPathInProjectIdSet(string? path, Func<ProjectId, string?> getPathById, HashSet<ProjectId> set, [NotNullWhen(true)] out ProjectId? result)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (88)
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (4)
15public static bool Any<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 39public static bool All<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 71public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TResult> map) 245public static void FreeAll<T>(this ArrayBuilder<T> builder, Func<T, ArrayBuilder<T>?> getNested)
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\ConcurrentLruCache.cs (1)
224public V GetOrAdd<T>(K key, T arg, Func<T, V> creator)
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\InternalUtilities\OneOrMany.cs (4)
123public OneOrMany<TResult> Select<TResult>(Func<T, TResult> selector) 142public T? FirstOrDefault(Func<T, bool> predicate) 169public bool All(Func<T, bool> predicate) 178public bool Any(Func<T, bool> predicate)
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
48public T Initialize<TArg>(Func<TArg, T> valueFactory, TArg arg)
src\Compilers\Core\Portable\InternalUtilities\SpanUtilities.cs (1)
24public static bool All<TElement>(this ReadOnlySpan<TElement> span, Func<TElement, bool> predicate)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (3)
57private static readonly Func<char, char> s_toLower = char.ToLower; 58private static readonly Func<char, char> s_toUpper = char.ToUpper; 80Func<char, char> convert)
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\ImmutableSegmentedList`1.cs (1)
205/// <inheritdoc cref="ImmutableList{T}.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (1)
77/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.ConvertAll{TOutput}(Func{T, TOutput})"/>
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (4)
15public static bool All<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 47public static bool Any<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 84public static T Last<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 101public static IEnumerable<TResult> Select<T, TResult>(this ImmutableSegmentedList<T> immutableList, Func<T, TResult> selector)
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\ArrayBuilder.cs (3)
519internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 567public void AddRange<U>(ArrayBuilder<U> items, Func<U, T> selector) 709public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
122internal ObjectPool(Func<ObjectPool<T>, T> factory, int size)
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\ObjectPools\PooledObject.cs (1)
22public PooledObject(ObjectPool<T> pool, Func<ObjectPool<T>, T> allocator, Action<ObjectPool<T>, T> releaser) : this()
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (9)
MSBuildWorkspaceTestBase.cs (4)
43protected async Task AssertCSCompilationOptionsAsync<T>(T expected, Func<CS.CSharpCompilationOptions, T> actual) 49protected async Task AssertCSParseOptionsAsync<T>(T expected, Func<CS.CSharpParseOptions, T> actual) 55protected async Task AssertVBCompilationOptionsAsync<T>(T expected, Func<VB.VisualBasicCompilationOptions, T> actual) 61protected async Task AssertVBParseOptionsAsync<T>(T expected, Func<VB.VisualBasicParseOptions, T> actual)
SolutionGeneration.cs (2)
313Func<T, string> itemTypeSelector, 315Func<T, string> attributeValueGetter,
TestFiles\Resources.cs (3)
43private static readonly Func<string, byte[]> s_bytesLoader = LoadBytes; 44private static readonly Func<string, string> s_textLoader = LoadText; 48private static TResult GetOrLoadValue<TResult>(string name, Func<string, TResult> loader, ref Dictionary<string, TResult> cache)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Remote\InProcRemoteHostClientProvider.cs (1)
41Func<RemoteWorkspace, SolutionAssetCache> createAssetStorage,
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)
UtilityTest\AsyncLazyTests.cs (4)
230Func<CancellationToken, object> synchronousComputation = c => 278Func<CancellationToken, Task<object>> asynchronousComputeFunction = 284Func<CancellationToken, object> synchronousComputeFunction = 311Func<CancellationToken, Task<string>>? asynchronousComputation = null;
UtilityTest\DocumentationCommentIdTests.cs (2)
32private static TSymbol CheckDeclarationId<TSymbol>(string expectedId, Compilation compilation, Func<TSymbol, bool> test) 42private static void CheckDeclarationIdExact<TSymbol>(string expectedId, Compilation compilation, Func<TSymbol, bool> test)
UtilityTest\NameGeneratorTests.cs (2)
92Func<string, bool> canUse = (s) => s.Length > 5; 97private static void VerifyEnsureUniquenessInPlace(string[] names, bool[]? isFixed, Func<string, bool>? canUse, bool isCaseSensitive, string[] expectedResult)
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\EXPRExtensions.cs (1)
12public static Expr Map(this Expr expr, Func<Expr, Expr> f)
Microsoft.Data.Analysis (11)
DataFrame.IO.cs (4)
61private static Type GuessKind(int col, List<(long LineNumber, string[] Line)> read, Func<IEnumerable<string>, Type> guessTypeFunction) 360CultureInfo cultureInfo = null, Func<IEnumerable<string>, Type> guessTypeFunction = null) 545CultureInfo cultureInfo = null, Func<IEnumerable<string>, Type> guessTypeFunction = null) 572Func<IEnumerable<string>, Type> guessTypeFunction = null)
DataFrameColumns\ArrowStringDataFrameColumn.cs (1)
684public ArrowStringDataFrameColumn Apply(Func<string, string> func)
DataFrameColumns\StringDataFrameColumn.cs (1)
88public StringDataFrameColumn Apply(Func<string, string> func, bool inPlace = false)
GroupBy.cs (1)
335private DataFrameColumn ResizeAndInsertColumn(int columnIndex, long rowIndex, bool firstGroup, DataFrame ret, PrimitiveDataFrameColumn<long> empty, Func<string, DataFrameColumn> getColumn = null)
PrimitiveColumnContainer.cs (2)
197public void Apply(Func<T, T> func) 215public void Apply<TResult>(Func<T?, TResult?> func, PrimitiveColumnContainer<TResult> resultContainer)
PrimitiveDataFrameColumn.cs (2)
667public PrimitiveDataFrameColumn<T> Apply(Func<T, T> func, bool inPlace = false) 681public PrimitiveDataFrameColumn<TResult> Apply<TResult>(Func<T?, TResult?> func) where TResult : unmanaged
Microsoft.DotNet.AsmDiff (1)
DiffEngine.cs (1)
99Func<DifferenceType, bool> diffFilterPredicate = t => (t != DifferenceType.Added || configuration.IsOptionSet(DiffConfigurationOptions.IncludeAdded)) &&
Microsoft.DotNet.Build.Tasks.Feed.Tests (2)
TestDoubles\MockRetryHandler.cs (2)
27public Task<bool> RunAsync(Func<int, Task<bool>> actionSuccessfulAsync) 30public async Task<bool> RunAsync(Func<int, Task<bool>> actionSuccessfulAsync, CancellationToken cancellationToken)
Microsoft.DotNet.Build.Tasks.Packaging (7)
Extensions.cs (2)
140public static void UpdateMember<T1, T2>(this T1 target, Expression<Func<T1, T2>> memberLamda, T2 value) 162public static void AddRangeToMember<T, TItem>(this T target, Expression<Func<T, ICollection<TItem>>> memberLamda, IEnumerable<TItem> value)
FilterUnknownPackages.cs (1)
37Func<string, bool> isKnownPackage;
NuGetPack.cs (3)
154Func<string, string> nuspecPropertyProvider = GetNuspecPropertyProviderFunction(NuspecProperties); 189private static Func<string, string> GetNuspecPropertyProviderFunction(ITaskItem[] nuspecProperties) 194private Manifest GetManifest(string nuspecPath, Func<string, string> nuspecPropertyProvider, bool isPackedPackage)
NugetPropertyStringProvider.cs (1)
29public static Func<string, string> GetNuspecPropertyProviderFunction(string[] nuspecPropertyStrings)
Microsoft.DotNet.Build.Tasks.Packaging.Tests (1)
ValidateHarvestVersionIsLatestForReleaseTests.cs (1)
152public Func<string, PackageReport> PackageReportFunc { get; set; }
Microsoft.DotNet.GenFacades (1)
RoslynBuildTask.cs (1)
57private Assembly LoadRoslyn(AssemblyName name, Func<string, Assembly> loadFromPath)
Microsoft.DotNet.Helix.Sdk (1)
AzureDevOpsTask.cs (1)
199Func<Exception, bool> isRetryable, CancellationToken cancellationToken)
Microsoft.DotNet.Internal.SymbolHelper (1)
SymbolUploadHelper.cs (1)
499async Task<Task<string?>> LogFromStreamReader(Task<string?> outputTask, Func<CancellationToken, ValueTask<string?>> readLine, Action<string> logMethod, CancellationToken ct)
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,
TestHelpers\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, string separator, IEqualityComparer<T> comparer = null, Func<T, string> toString = null)
Microsoft.DotNet.RemoteExecutor (3)
RemoteExecutor.cs (3)
200public static RemoteInvokeHandle Invoke(Func<string, Task<int>> method, string arg, 268public static RemoteInvokeHandle Invoke(Func<string, Task> method, string arg, 336public static RemoteInvokeHandle Invoke(Func<string, int> method, string arg,
Microsoft.DotNet.SourceBuild.Tasks (2)
src\UsageReport\XmlParsingHelpers.cs (2)
32Func<T, string> selector) 39Func<T, string> selector)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (1)
HelperFactory.cs (1)
224m.GetParameters()[1].ParameterType.GetGenericTypeDefinition() == typeof(Func<,>))
Microsoft.DotNet.XliffTasks (1)
EnumerableExtensions.cs (1)
11public static bool IsSorted<T, U>(this IEnumerable<T> source, Func<T, U> keySelector, IComparer<U> comparer)
Microsoft.DotNet.XUnitAssert.Tests (2)
AsyncCollectionAssertsTests.cs (1)
74 await Assert.ThrowsAsync<ArgumentNullException>("action", () => Assert.AllAsync(new object[0].ToAsyncEnumerable(), (Func<object, Task>)null!));
CollectionAssertsTests.cs (1)
72 await Assert.ThrowsAsync<ArgumentNullException>("action", () => Assert.AllAsync(new object[0], (Func<object, Task>)null!));
Microsoft.Extensions.AI (17)
ChatCompletion\ChatClientBuilder.cs (3)
15private readonly Func<IServiceProvider, IChatClient> _innerClientFactory; 31public ChatClientBuilder(Func<IServiceProvider, IChatClient> innerClientFactory) 69public ChatClientBuilder Use(Func<IChatClient, IChatClient> clientFactory)
ChatCompletion\ChatClientBuilderServiceCollectionExtensions.cs (2)
42Func<IServiceProvider, IChatClient> innerClientFactory, 86Func<IServiceProvider, IChatClient> innerClientFactory,
Embeddings\EmbeddingGeneratorBuilder.cs (3)
18private readonly Func<IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>> _innerGeneratorFactory; 34public EmbeddingGeneratorBuilder(Func<IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>> innerGeneratorFactory) 74public EmbeddingGeneratorBuilder<TInput, TEmbedding> Use(Func<IEmbeddingGenerator<TInput, TEmbedding>, IEmbeddingGenerator<TInput, TEmbedding>> generatorFactory)
Embeddings\EmbeddingGeneratorBuilderServiceCollectionExtensions.cs (2)
47Func<IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>> innerGeneratorFactory, 99Func<IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>> innerGeneratorFactory,
Functions\AIFunctionFactory.cs (1)
1170Func<ParameterInfo, AIFunctionFactoryOptions.ParameterBindingOptions>? GetBindParameterOptions,
Functions\AIFunctionFactoryOptions.cs (1)
74public Func<ParameterInfo, ParameterBindingOptions>? ConfigureParameterBinding { get; set; }
SpeechToText\SpeechToTextClientBuilder.cs (3)
15private readonly Func<IServiceProvider, ISpeechToTextClient> _innerClientFactory; 30public SpeechToTextClientBuilder(Func<IServiceProvider, ISpeechToTextClient> innerClientFactory) 64public SpeechToTextClientBuilder Use(Func<ISpeechToTextClient, ISpeechToTextClient> clientFactory)
SpeechToText\SpeechToTextClientBuilderServiceCollectionExtensions.cs (2)
35Func<IServiceProvider, ISpeechToTextClient> innerClientFactory, 70Func<IServiceProvider, ISpeechToTextClient> innerClientFactory,
Microsoft.Extensions.AI.Abstractions (8)
ChatCompletion\ChatResponseExtensions.cs (2)
79public static void AddMessages(this IList<ChatMessage> list, ChatResponseUpdate update, Func<AIContent, bool>? filter = null) 190static void Coalesce<TContent>(List<AIContent> contents, Func<string, TContent> fromText)
Contents\FunctionCallContent.cs (1)
76Func<TEncoding, IDictionary<string, object?>?> argumentParser)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (3)
261Func<JsonPropertyInfo, ParameterInfo?>? parameterInfoMapper = 428if (_simpleTypeSchemaFactories.TryGetValue(typeInfo.Type, out Func<JsonNumberHandling, JsonSchema>? simpleTypeSchemaFactory)) 579private static readonly Dictionary<Type, Func<JsonNumberHandling, JsonSchema>> _simpleTypeSchemaFactories = new()
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (1)
142public static Func<JsonPropertyInfo, ParameterInfo?>? ResolveJsonConstructorParameterMapper(
Utilities\AIJsonSchemaCreateOptions.cs (1)
38public Func<ParameterInfo, bool>? IncludeParameter { get; init; }
Microsoft.Extensions.AI.Abstractions.Tests (2)
Utilities\AIJsonUtilitiesTests.cs (2)
103case null when property.PropertyType == typeof(Func<ParameterInfo, bool>): 104Func<ParameterInfo, bool> includeParameter = static (parameter) => true;
Microsoft.Extensions.AI.Evaluation (5)
EvaluationMetricExtensions.cs (1)
57Func<EvaluationDiagnostic, bool>? predicate = null)
EvaluationResultExtensions.cs (2)
99Func<EvaluationDiagnostic, bool>? predicate = null) 119Func<EvaluationMetric, EvaluationMetricInterpretation?> interpretationProvider)
Utilities\TaskExtensions.cs (2)
16this IEnumerable<Func<CancellationToken, Task<T>>> functions, 25this IEnumerable<Func<CancellationToken, ValueTask<T>>> functions,
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)
ReportingConfiguration.cs (2)
87public Func<EvaluationMetric, EvaluationMetricInterpretation?>? EvaluationMetricInterpreter { get; } 140Func<EvaluationMetric, EvaluationMetricInterpretation?>? evaluationMetricInterpreter = null,
ScenarioRun.cs (2)
91private readonly Func<EvaluationMetric, EvaluationMetricInterpretation?>? _evaluationMetricInterpreter; 105Func<EvaluationMetric, EvaluationMetricInterpretation?>? evaluationMetricInterpreter = null,
ScenarioRunResultExtensions.cs (1)
31Func<EvaluationDiagnostic, bool>? predicate = null)
Storage\DiskBasedReportingConfiguration.cs (1)
66Func<EvaluationMetric, EvaluationMetricInterpretation?>? evaluationMetricInterpreter = null,
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Storage\AzureStorageReportingConfiguration.cs (1)
71Func<EvaluationMetric, EvaluationMetricInterpretation?>? evaluationMetricInterpreter = null,
Microsoft.Extensions.AI.Ollama (1)
OllamaUtilities.cs (1)
24public static void TransferNanosecondsTime<TResponse>(TResponse response, Func<TResponse, long?> getNanoseconds, string key, ref AdditionalPropertiesDictionary<long>? metadata)
Microsoft.Extensions.AI.Tests (16)
ChatCompletion\ChatClientBuilderTest.cs (1)
68Assert.Throws<ArgumentNullException>("innerClientFactory", () => new ChatClientBuilder((Func<IServiceProvider, IChatClient>)null!));
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,
Embeddings\EmbeddingGeneratorBuilderTests.cs (1)
68() => new EmbeddingGeneratorBuilder<string, Embedding<float>>((Func<IServiceProvider, IEmbeddingGenerator<string, Embedding<float>>>)null!));
Functions\AIFunctionFactoryTest.cs (2)
151Func<string, string> dotnetFunc2 = a => a + " " + a; 172Func<ParameterInfo, AIFunctionFactoryOptions.ParameterBindingOptions> getBindParameterMode = _ => default;
Microsoft.Extensions.Caching.Abstractions (6)
Hybrid\HybridCache.cs (2)
44public ValueTask<T> GetOrCreateAsync<T>(string key, Func<CancellationToken, ValueTask<T>> factory, 51public static readonly Func<Func<CancellationToken, ValueTask<T>>, CancellationToken, ValueTask<T>> Instance = static (callback, ct) => callback(ct);
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)
ExpirationTests.cs (1)
26Func<CancellationToken, ValueTask<Guid>> callback = static _ => new(Guid.NewGuid());
SizeTests.cs (2)
168Func<CancellationToken, ValueTask<MutablePoco>> func = _ => 234Func<CancellationToken, ValueTask<ImmutablePoco>> func = _ =>
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
582private void Compact(long removalSizeTarget, Func<CacheEntry, long> computeEntrySize, CoherentState coherentState) 635static void ExpirePriorityBucket(ref long removedSize, long removalSizeTarget, Func<CacheEntry, long> computeEntrySize, List<CacheEntry> entriesToRemove, List<(CacheEntry Entry, DateTime LastAccessed)> priorityEntries)
Microsoft.Extensions.Configuration.Abstractions (1)
ConfigurationRootExtensions.cs (1)
36public static string GetDebugView(this IConfigurationRoot root, Func<ConfigurationDebugViewContext, string>? processValue)
Microsoft.Extensions.Configuration.KeyPerFile (1)
KeyPerFileConfigurationSource.cs (1)
35public Func<string, bool> IgnoreCondition { get; set; }
Microsoft.Extensions.Configuration.Xml (2)
XmlDocumentDecryptor.cs (2)
26private readonly Func<XmlDocument, EncryptedXml>? _encryptedXmlFactory; 38internal XmlDocumentDecryptor(Func<XmlDocument, EncryptedXml> encryptedXmlFactory)
Microsoft.Extensions.DependencyInjection (35)
ServiceLookup\CompiledServiceProviderEngine.cs (1)
23public override Func<ServiceProviderEngineScope, object?> RealizeService(ServiceCallSite callSite) => ResolverBuilder.Build(callSite);
ServiceLookup\DynamicServiceProviderEngine.cs (1)
21public override Func<ServiceProviderEngineScope, object?> RealizeService(ServiceCallSite callSite)
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\Expressions\ExpressionsServiceProviderEngine.cs (1)
18public override Func<ServiceProviderEngineScope, object> RealizeService(ServiceCallSite callSite)
ServiceLookup\FactoryCallSite.cs (2)
10public Func<IServiceProvider, object> Factory { get; } 12public FactoryCallSite(ResultCache cache, Type serviceType, Func<IServiceProvider, object> factory) : base(cache, null)
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>));
ServiceLookup\ILEmit\ILEmitResolverBuilderContext.cs (1)
15public List<Func<IServiceProvider, object>>? Factories { get; set; }
ServiceLookup\ILEmit\ILEmitServiceProviderEngine.cs (1)
19public override Func<ServiceProviderEngineScope, object?> RealizeService(ServiceCallSite callSite)
ServiceLookup\RuntimeServiceProviderEngine.cs (1)
15public override Func<ServiceProviderEngineScope, object?> RealizeService(ServiceCallSite callSite)
ServiceLookup\ServiceLookupHelpers.cs (2)
17internal static readonly MethodInfo InvokeFactoryMethodInfo = typeof(Func<IServiceProvider, object>) 18.GetMethod(nameof(Func<IServiceProvider, object>.Invoke), LookupFlags)!;
ServiceLookup\ServiceProviderEngine.cs (1)
10public abstract Func<ServiceProviderEngineScope, object?> RealizeService(ServiceCallSite callSite);
ServiceLookup\StackGuard.cs (2)
61private R RunOnEmptyStackCore<R>(Func<object, R> action, object state) 68Task<R> task = Task.Factory.StartNew((Func<object?, R>)action, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
ServiceProvider.cs (4)
24private readonly Func<ServiceIdentifier, ServiceAccessor> _createServiceAccessor; 255Func<ServiceProviderEngineScope, object?> realizedService = _engine.RealizeService(callSite); 261internal void ReplaceServiceAccessor(ServiceCallSite callSite, Func<ServiceProviderEngineScope, object?> accessor) 324public Func<ServiceProviderEngineScope, object?>? RealizedService { get; set; }
Microsoft.Extensions.DependencyInjection.Abstractions (30)
Extensions\ServiceCollectionDescriptorExtensions.cs (6)
148Func<IServiceProvider, object> implementationFactory) 199Func<IServiceProvider, TService> implementationFactory) 254Func<IServiceProvider, object> implementationFactory) 305Func<IServiceProvider, TService> implementationFactory) 360Func<IServiceProvider, object> implementationFactory) 429Func<IServiceProvider, TService> implementationFactory)
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)
DefaultHealthCheckService.cs (1)
39Func<HealthCheckRegistration, bool>? predicate,
DelegateHealthCheck.cs (2)
16private readonly Func<CancellationToken, Task<HealthCheckResult>> _check; 22public DelegateHealthCheck(Func<CancellationToken, Task<HealthCheckResult>> check)
DependencyInjection\HealthChecksBuilderDelegateExtensions.cs (4)
74Func<CancellationToken, HealthCheckResult> check, 93Func<CancellationToken, HealthCheckResult> check, 160Func<CancellationToken, Task<HealthCheckResult>> check, 179Func<CancellationToken, Task<HealthCheckResult>> check,
HealthCheckPublisherHostedService.cs (1)
184var withOptionsPredicate = (HealthCheckRegistration r) =>
HealthCheckPublisherOptions.cs (1)
78public Func<HealthCheckRegistration, bool>? Predicate { get; set; }
HealthCheckService.cs (1)
61Func<HealthCheckRegistration, bool>? predicate,
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (4)
HealthCheckRegistration.cs (4)
26private Func<IServiceProvider, IHealthCheck> _factory; 85Func<IServiceProvider, IHealthCheck> factory, 105Func<IServiceProvider, IHealthCheck> factory, 128public Func<IServiceProvider, IHealthCheck> Factory
Microsoft.Extensions.Diagnostics.Probes (4)
KubernetesProbesExtensions.cs (3)
64var originalPredicate = options.FilterChecks; 81var originalPredicate = options.FilterChecks; 98var originalPredicate = options.FilterChecks;
TcpEndpointProbesOptions.cs (1)
54public Func<HealthCheckRegistration, bool>? FilterChecks { get; set; }
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
MockHealthCheckService.cs (1)
18public override Task<HealthReport> CheckHealthAsync(Func<HealthCheckRegistration, bool>? predicate, CancellationToken cancellationToken = default)
Microsoft.Extensions.Diagnostics.Testing (2)
Logging\FakeLogCollectorOptions.cs (1)
64public Func<FakeLogRecord, string> OutputFormatter { get; set; } = FakeLogRecord.Formatter;
Metrics\MetricCollector.cs (1)
272private void Initialize(Func<Instrument, bool> instrumentPredicate)
Microsoft.Extensions.Features (3)
FeatureReferences.cs (3)
96Func<TState, TFeature?> factory) where TFeature : class? 112private TFeature? UpdateCached<TFeature, TState>(ref TFeature? cached, TState state, Func<TState, TFeature?> factory, int revision, bool flush) where TFeature : class? 143public TFeature? Fetch<TFeature>(ref TFeature? cached, Func<IFeatureCollection, TFeature?> factory)
Microsoft.Extensions.Hosting (4)
HostApplicationBuilder.cs (1)
377public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
HostBuilder.cs (1)
122public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
Internal\ServiceFactoryAdapter.cs (2)
14private readonly Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>>? _factoryResolver; 23public ServiceFactoryAdapter(Func<HostBuilderContext> contextResolver, Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factoryResolver)
Microsoft.Extensions.Hosting.Abstractions (2)
IHostBuilder.cs (1)
62IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull;
ServiceCollectionHostedServiceExtensions.cs (1)
37public static IServiceCollection AddHostedService<THostedService>(this IServiceCollection services, Func<IServiceProvider, THostedService> implementationFactory)
Microsoft.Extensions.Hosting.Testing (1)
FakeHostBuilder.cs (1)
83public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory)
Microsoft.Extensions.Hosting.Testing.Tests (1)
FakeHostBuilderTests.cs (1)
193var functor = (HostBuilderContext _) => factory;
Microsoft.Extensions.Http (23)
DefaultHttpClientFactory.cs (1)
26private readonly Func<string, Lazy<ActiveHandlerTrackingEntry>> _entryFactory;
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)
DependencyInjection\HttpClientBuilderExtensions.Logging.cs (1)
46public static IHttpClientBuilder AddLogger(this IHttpClientBuilder builder, Func<IServiceProvider, IHttpClientLogger> httpClientLoggerFactory, bool wrapHandlersPipeline = false)
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (2)
707public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, Func<HttpClient, TImplementation> factory) 746public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, string name, Func<HttpClient, TImplementation> factory)
HttpClientFactoryOptions.cs (2)
74/// Gets or sets the <see cref="Func{T, R}"/> that determines whether to redact the HTTP header value before logging. 76public Func<string, bool> ShouldRedactHeaderValue { get; set; } = LogHelper.ShouldRedactHeaderValue;
Logging\HttpHeadersLogValue.cs (2)
15private readonly Func<string, bool> _shouldRedactHeaderValue; 20public HttpHeadersLogValue(Kind kind, HttpHeaders headers, HttpHeaders? contentHeaders, Func<string, bool> shouldRedactHeaderValue)
Logging\LoggingHttpMessageHandler.cs (1)
56Func<string, bool> shouldRedactHeaderValue = _options?.ShouldRedactHeaderValue ?? LogHelper.ShouldRedactHeaderValue;
Logging\LoggingScopeHttpMessageHandler.cs (1)
57Func<string, bool> shouldRedactHeaderValue = _options?.ShouldRedactHeaderValue ?? LogHelper.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)
DependencyInjection\PollyHttpClientBuilderExtensions.cs (3)
63Func<HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> policySelector) 217Func<PolicyBuilder<HttpResponseMessage>, IAsyncPolicy<HttpResponseMessage>> configurePolicy) 254public static IHttpClientBuilder AddPolicyHandler(this IHttpClientBuilder builder, Func<IServiceProvider, HttpRequestMessage, string, IAsyncPolicy<HttpResponseMessage>> policyFactory, Func<HttpRequestMessage, string> keySelector)
PolicyHttpMessageHandler.cs (3)
49/// The <see cref="PollyHttpClientBuilderExtensions.AddTransientHttpErrorPolicy(IHttpClientBuilder, Func{PolicyBuilder{HttpResponseMessage}, IAsyncPolicy{HttpResponseMessage}})"/> 78private readonly Func<HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> _policySelector; 98public PolicyHttpMessageHandler(Func<HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> policySelector)
Microsoft.Extensions.Http.Polly.Tests (4)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (3)
578public List<Func<HttpRequestMessage, HttpResponseMessage>> Responses { get; } = new List<Func<HttpRequestMessage, HttpResponseMessage>>(); 582var func = Responses[CallCount++ % Responses.Count];
PolicyHttpMessageHandlerTest.cs (1)
421public TestPolicyHttpMessageHandler(Func<HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> policySelector)
Microsoft.Extensions.Http.Resilience (23)
Hedging\HttpStandardHedgingResilienceOptions.cs (2)
32/// <see cref="StandardHedgingHandlerBuilderExtensions.SelectPipelineBy(IStandardHedgingHandlerBuilder, Func{IServiceProvider, Func{System.Net.Http.HttpRequestMessage, string}})"/> extensions.
Hedging\StandardHedgingHandlerBuilderExtensions.cs (2)
96public static IStandardHedgingHandlerBuilder SelectPipelineBy(this IStandardHedgingHandlerBuilder builder, Func<IServiceProvider, Func<HttpRequestMessage, string>> selectorFactory)
Polly\HttpRetryStrategyOptionsExtensions.cs (1)
49var shouldHandle = Throw.IfNullOrMemberNull(options, options?.ShouldHandle);
Resilience\HttpResiliencePipelineBuilderExtensions.cs (2)
37public static IHttpResiliencePipelineBuilder SelectPipelineBy(this IHttpResiliencePipelineBuilder builder, Func<IServiceProvider, Func<HttpRequestMessage, string>> selectorFactory)
Resilience\HttpStandardResiliencePipelineBuilderExtensions.cs (2)
98public static IHttpStandardResiliencePipelineBuilder SelectPipelineBy(this IHttpStandardResiliencePipelineBuilder builder, Func<IServiceProvider, Func<HttpRequestMessage, string>> selectorFactory)
Resilience\Internal\PipelineKeyOptions.cs (1)
14public Func<HttpRequestMessage, string>? KeyProvider { get; set; }
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)
Resilience\ResilienceHandler.cs (2)
20private readonly Func<HttpRequestMessage, ResiliencePipeline<HttpResponseMessage>> _pipelineProvider; 27public ResilienceHandler(Func<HttpRequestMessage, ResiliencePipeline<HttpResponseMessage>> pipelineProvider)
Resilience\ResilienceHttpClientBuilderExtensions.Resilience.cs (4)
71var selector = CreatePipelineSelector(serviceProvider, pipelineBuilder.PipelineName); 102private static Func<HttpRequestMessage, ResiliencePipeline<HttpResponseMessage>> CreatePipelineSelector(IServiceProvider serviceProvider, string pipelineName) 105var pipelineKeyProvider = serviceProvider.GetPipelineKeyProvider(pipelineName); 124private static void TouchPipelineKey(Func<HttpRequestMessage, string> provider)
Routing\Internal\RoutingHelper.cs (1)
12public static T SelectByWeight<T>(this IList<T> endpoints, Func<T, double> weightProvider, Randomizer randomizer)
Routing\RoutingStrategyBuilderExtensions.cs (1)
117internal static IRoutingStrategyBuilder ConfigureRoutingStrategy(this IRoutingStrategyBuilder builder, Func<IServiceProvider, Func<RequestRoutingStrategy>> factory)
Microsoft.Extensions.Http.Resilience.Tests (2)
Hedging\StandardHedgingTests.cs (1)
113var generator = options.Hedging.ActionGenerator;
Resilience\HttpClientBuilderExtensionsTests.BySelector.cs (1)
51var provider = PipelineKeyProviderHelper.GetPipelineKeyProvider(builder.Services.BuildServiceProvider(), builder.PipelineName)!;
Microsoft.Extensions.Localization (2)
IResourceNamesCache.cs (1)
20IList<string>? GetOrAdd(string name, Func<string, IList<string>?> valueFactory);
ResourceNamesCache.cs (1)
25public IList<string>? GetOrAdd(string name, Func<string, IList<string>?> valueFactory)
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)
LoggerMessage.cs (1)
21public static Func<ILogger, IDisposable?> DefineScope(string formatString)
Microsoft.Extensions.Logging.AzureAppServices (3)
AzureBlobLoggerOptions.cs (1)
34public Func<AzureBlobLoggerContext, string> FileNameFormat { get; set; } = context =>
BlobLoggerProvider.cs (2)
23private readonly Func<string, ICloudAppendBlob> _blobReferenceFactory; 47Func<string, ICloudAppendBlob> blobReferenceFactory) :
Microsoft.Extensions.ML (1)
ServiceCollectionExtensions.cs (1)
49Func<IServiceProvider, PredictionEnginePool<TData, TPrediction>> implementationFactory)
Microsoft.Extensions.ObjectPool (1)
DefaultObjectPool.cs (1)
18private readonly Func<T, bool> _returnFunc;
Microsoft.Extensions.Options (4)
OptionsBuilder.cs (2)
343public virtual OptionsBuilder<TOptions> Validate(Func<TOptions, bool> validation) 352public virtual OptionsBuilder<TOptions> Validate(Func<TOptions, bool> validation, string failureMessage)
ValidateOptions.cs (2)
20public ValidateOptions(string? name, Func<TOptions, bool> validation, string failureMessage) 37public Func<TOptions, bool> Validation { get; }
Microsoft.Extensions.ServiceDiscovery (1)
ConfigurationServiceEndpointProviderOptions.cs (1)
21public Func<ServiceEndpoint, bool> ShouldApplyHostNameMetadata { get; set; } = _ => false;
Microsoft.Extensions.ServiceDiscovery.Dns (2)
DnsServiceEndpointProviderOptions.cs (1)
34public Func<ServiceEndpoint, bool> ShouldApplyHostNameMetadata { get; set; } = _ => false;
DnsSrvServiceEndpointProviderOptions.cs (1)
42public Func<ServiceEndpoint, bool> ShouldApplyHostNameMetadata { get; set; } = _ => false;
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
67private sealed class FakeEndpointResolverProvider(Func<ServiceEndpointQuery, (bool Result, IServiceEndpointProvider? Resolver)> createResolverDelegate) : IServiceEndpointProviderFactory
Microsoft.Extensions.Telemetry (10)
Latency\Internal\LatencyConsoleExporter.cs (2)
22private static readonly Func<int, CompositeFormat> _rows = Memoize.Function((int nameColumnWidth) => CompositeFormat.Parse($" {{0,-{nameColumnWidth}}} | {{1}}" + Environment.NewLine)); 28private static readonly Func<int, string> _dashes = Memoize.Function<int, string>(num => new('-', num));
Logging\ExtendedLoggerFactory.cs (1)
34private readonly Func<DataClassificationSet, Redactor> _redactorProvider;
Logging\Import\LoggerInformation.cs (1)
33public Func<LogLevel, bool> LoggerIsEnabled { get; }
Logging\LoggerConfig.cs (2)
26Func<DataClassificationSet, Redactor> getRedactor, 56public Func<DataClassificationSet, Redactor> GetRedactor { get; }
src\Shared\Memoization\Memoize.cs (2)
41public static Func<TParameter, TResult> Function<TParameter, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TResult>(Func<TParameter, TResult> f)
src\Shared\Memoization\MemoizedFunction.cs (2)
60private readonly Func<TParameter, TResult> _function; 66public MemoizedFunction(Func<TParameter, TResult> function)
Microsoft.Extensions.WebEncoders (2)
EncoderServiceCollectionExtensions.cs (2)
60private static Func<IServiceProvider, TService> CreateFactory<TService>( 62Func<TextEncoderSettings, TService> customSettingsFactory)
Microsoft.Gen.ComplianceReports (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
52Func<SyntaxNode, SyntaxNode?> transform, 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Gen.ContextualOptions (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
52Func<SyntaxNode, SyntaxNode?> transform, 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Gen.Logging (3)
Parsing\TemplateProcessor.cs (1)
78internal static string? MapTemplates(string? message, Func<string, string> mapTemplate)
src\Generators\Shared\GeneratorUtilities.cs (2)
52Func<SyntaxNode, SyntaxNode?> transform, 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
52Func<SyntaxNode, SyntaxNode?> transform, 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Gen.Metrics (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
52Func<SyntaxNode, SyntaxNode?> transform, 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Gen.MetricsReports (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
52Func<SyntaxNode, SyntaxNode?> transform, 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
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)
ArrayMarshallingInfoProvider.cs (1)
72Func<ITypeSymbol, MarshallingInfo> getMarshallingInfoForElement = (ITypeSymbol elementType) => elementMarshallingInfo;
CustomMarshallingInfoHelper.cs (1)
78Func<ITypeSymbol, MarshallingInfo> getMarshallingInfoForElement = (ITypeSymbol elementType) => getMarshallingInfoCallback(elementType, useSiteAttributeProvider, indirectionDepth + 1);
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)
Marshalling\MarshallerHelpers.cs (2)
121Func<T, U> keyFn, 122Func<T, IEnumerable<U>> getDependentIndicesFn)
ValueEqualityImmutableDictionary.cs (2)
68Func<TSource, TKey> keySelector, 69Func<TSource, TValue> valueSelector)
Microsoft.JSInterop (3)
Infrastructure\DotNetDispatcher.cs (3)
33private static readonly ConcurrentDictionary<Type, Func<object, Task>> _cachedConvertToTaskByType = new(); 373var converterDelegate = _cachedConvertToTaskByType.GetOrAdd(type, (Type t, MethodInfo taskConverterMethodInfo) => 374taskConverterMethodInfo.MakeGenericMethod(t).CreateDelegate<Func<object, Task>>(), _taskConverterMethodInfo);
Microsoft.Maui (15)
Animations\Easing.cs (3)
78 readonly Func<double, double> _easingFunc; 113 public Easing(Func<double, double> easingFunc) 133 public static implicit operator Easing(Func<double, double> func)
Converters\EasingTypeConverter.cs (1)
14 => sourceType == typeof(string) || sourceType == typeof(Func<double, double>);
Extensions\EnumerableExtensions.cs (2)
36 public static IDictionary<TKey, List<TSource>> GroupToDictionary<TSource, TKey>(this IEnumerable<TSource> enumeration, Func<TSource, TKey> func) 143 public static int IndexOf<T>(this IEnumerable<T> enumerable, Func<T, bool> predicate)
Handlers\View\ViewHandlerOfT.cs (1)
58 public static Func<ViewHandler<TVirtualView, TPlatformView>, TPlatformView>? PlatformViewFactory { get; set; }
Hosting\ImageSources\ImageSourceServiceCollectionExtensions.cs (1)
35 public static IImageSourceServiceCollection AddService<TImageSource>(this IImageSourceServiceCollection services, Func<IServiceProvider, IImageSourceService<TImageSource>> implementationFactory)
Hosting\MauiHandlersCollectionExtensions.cs (2)
61 Func<IServiceProvider, IElementHandler> handlerImplementationFactory) 119 Func<IServiceProvider, IElementHandler> handlerImplementationFactory)
Layouts\GridLayoutManager.cs (2)
613 void ResolveStars(Definition[] defs, double availableSpace, Func<Cell, bool> cellCheck, Func<Size, double> dimension, double starCount)
MauiContext.cs (2)
55 readonly ConcurrentDictionary<Type, (object, Func<object, object?>)> _scopeStatic = new(); 75 public void AddSpecific(Type type, Func<object, object?> getter, object state)
Platform\ViewExtensions.cs (1)
87 static ParentView? FindParent(this ParentView? view, Func<ParentView?, bool> searchExpression)
Microsoft.Maui.Controls (64)
Animation.cs (1)
36 Func<double, double> transform = AnimationExtensions.Interpolate(start, end);
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,
BindableObjectExtensions.cs (1)
132 Func<TSource, TProperty> getter,
BindingBase.Create.cs (1)
22 Func<TSource, TProperty> getter,
Command.cs (3)
27 public Command(Action<T> execute, Func<T, bool> canExecute) 66 readonly Func<object, bool> _canExecute; 87 public Command(Action<object> execute, Func<object, bool> canExecute) : this(execute)
DependencyResolver.cs (1)
22 public static void ResolveUsing(Func<Type, object> resolver)
DragAndDrop\DragEventArgs.cs (2)
11 Func<IElement?, Point?>? _getPosition; 28 internal DragEventArgs(DataPackage dataPackage, Func<IElement?, Point?>? getPosition, PlatformDragEventArgs platformArgs)
DragAndDrop\DragGestureRecognizer.cs (1)
111 internal DragStartingEventArgs SendDragStarting(View element, Func<IElement?, Point?>? getPosition = null, PlatformDragStartingEventArgs? platformArgs = null)
DragAndDrop\DragStartingEventArgs.cs (2)
12 Func<IElement?, Point?>? _getPosition; 26 internal DragStartingEventArgs(Func<IElement?, Point?>? getPosition, PlatformDragStartingEventArgs? platformArgs)
DragAndDrop\DropEventArgs.cs (2)
11 Func<IElement?, Point?>? _getPosition; 29 internal DropEventArgs(DataPackageView? view, Func<IElement?, Point?>? getPosition, PlatformDropEventArgs platformArgs)
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
Hosting\AppHostBuilderExtensions.cs (1)
54 internal static MauiAppBuilder UseMauiPrimaryApp<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TApp>(this MauiAppBuilder builder, Func<IServiceProvider, TApp> implementationFactory)
ImageSource.cs (1)
95 public static ImageSource FromStream(Func<CancellationToken, Task<Stream>> stream)
Internals\ResourceLoader.cs (2)
12 static Func<ResourceLoadingQuery, ResourceLoadingResponse> _resourceProvider2; 14 public static Func<ResourceLoadingQuery, ResourceLoadingResponse> ResourceProvider2
LegacyLayouts\Constraint.cs (2)
13 Func<RelativeLayout, double> _measureFunc; 40 public static Constraint RelativeToParent(Func<RelativeLayout, double> measure)
PlatformBindingHelpers.cs (1)
128 public static void SetBindingContext<TPlatformView>(TPlatformView target, object bindingContext, Func<TPlatformView, IEnumerable<TPlatformView>> getChild = null) where TPlatformView : class
PointerEventArgs.cs (2)
12 Func<IElement?, Point?>? _getPosition; 26 internal PointerEventArgs(Func<IElement?, Point?>? getPosition, PlatformPointerEventArgs? args = null)
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)
Registrar.cs (2)
344 internal static Func<object, IViewHandler> RendererToHandlerShim { get; private set; } 345 public static void RegisterRendererToHandlerShim(Func<object, IViewHandler> handlerShim)
Shell\ShellExtensions.cs (2)
24 public static BaseShellItem SearchForPart(this IShellController shell, Func<BaseShellItem, bool> searchBy) 37 public static BaseShellItem SearchForPart(this BaseShellItem part, Func<BaseShellItem, bool> searchBy)
StreamImageSource.cs (4)
13 public static readonly BindableProperty StreamProperty = BindableProperty.Create(nameof(Stream), typeof(Func<CancellationToken, Task<Stream>>), typeof(StreamImageSource), 14 default(Func<CancellationToken, Task<Stream>>)); 20 public virtual Func<CancellationToken, Task<Stream>> Stream 22 get { return (Func<CancellationToken, Task<Stream>>)GetValue(StreamProperty); }
StyleSheets\Selector.cs (2)
150 readonly Func<IStyleSelectable, bool> func; 151 public Generic(Func<IStyleSelectable, bool> func)
TapGestureRecognizer.cs (1)
56 internal void SendTapped(View sender, Func<IElement?, Point?>? getPosition = null)
TappedEventArgs.cs (2)
9 Func<IElement?, Point?>? _getPosition; 17 internal TappedEventArgs(object? parameter, Func<IElement?, Point?>? getPosition) : this(parameter)
Tweener.cs (2)
35 readonly Func<long, bool> _step; 37 public TweenerAnimation(Func<long, bool> step)
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)
ViewExtensions.cs (2)
95 Func<double, Rect> computeBounds = progress => 330 internal static Element? FindParentWith(this Element element, Func<Element, bool> withMatch, bool includeThis = false)
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)
AppHostBuilderExtensions.Embedding.cs (1)
16 public static MauiAppBuilder UseMauiEmbedding<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TApp>(this MauiAppBuilder builder, Func<IServiceProvider, TApp> implementationFactory)
Microsoft.Maui.Controls.SourceGen (1)
src\Controls\src\Xaml\XmlTypeXamlExtensions.cs (1)
40 Func<(string typeName, string clrNamespace, string assemblyName), T> refFromTypeInfo,
Microsoft.Maui.Controls.Xaml (3)
Embedding\EmbeddingExtensions.cs (1)
36 public static MauiAppBuilder UseMauiEmbeddedApp<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TApp>(this MauiAppBuilder builder, Func<IServiceProvider, TApp> implementationFactory)
Hosting\AppHostBuilderExtensions.cs (1)
30 public static MauiAppBuilder UseMauiApp<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TApp>(this MauiAppBuilder builder, Func<IServiceProvider, TApp> implementationFactory)
XmlTypeXamlExtensions.cs (1)
40 Func<(string typeName, string clrNamespace, string assemblyName), T> refFromTypeInfo,
Microsoft.ML.AutoML (4)
API\AutoMLExperimentExtension.cs (1)
178public static AutoMLExperiment SetPerformanceMonitor<TPerformanceMonitor>(this AutoMLExperiment experiment, Func<IServiceProvider, TPerformanceMonitor> factory)
AutoMLExperiment\AutoMLExperiment.cs (3)
136public AutoMLExperiment SetMonitor<TMonitor>(Func<IServiceProvider, TMonitor> factory) 152public AutoMLExperiment SetTrialRunner<TTrialRunner>(Func<IServiceProvider, TTrialRunner> factory) 174public AutoMLExperiment SetTuner<TTuner>(Func<IServiceProvider, TTuner> factory)
Microsoft.ML.Core (32)
ComponentModel\ComponentFactory.cs (3)
58public static IComponentFactory<TComponent> CreateFromFunction<TComponent>(Func<IHostEnvironment, TComponent> factory) 96private readonly Func<IHostEnvironment, TComponent> _factory; 98public SimpleComponentFactory(Func<IHostEnvironment, TComponent> factory)
Data\IHostEnvironment.cs (1)
268public static T Apply<T>(this IHost host, string channelName, Func<IChannel, T> func)
Data\ServerChannel.cs (2)
96public void Register<T1, TRet>(string name, Func<T1, TRet> func) 223/// some variety of <see cref="Func{TResult}"/>, <see cref="Func{T1, TResult}"/>,
Utilities\FuncInstanceMethodInfo1`2.cs (1)
56public static FuncInstanceMethodInfo1<TTarget, TResult> Create(Expression<Func<TTarget, Func<TResult>>> expression)
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\FuncInstanceMethodInfo1`4.cs (1)
58public static FuncInstanceMethodInfo1<TTarget, T1, T2, TResult> Create(Expression<Func<TTarget, Func<T1, T2, TResult>>> expression)
Utilities\FuncInstanceMethodInfo2`4.cs (1)
58public static FuncInstanceMethodInfo2<TTarget, T1, T2, TResult> Create(Expression<Func<TTarget, Func<T1, T2, TResult>>> expression)
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\FuncInstanceMethodInfo3`4.cs (1)
58public static FuncInstanceMethodInfo3<TTarget, T1, T2, TResult> Create(Expression<Func<TTarget, Func<T1, T2, TResult>>> expression)
Utilities\FuncMethodInfo1`2.cs (1)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T, TResult}"/>,
Utilities\FuncMethodInfo3`2.cs (1)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T, TResult}"/>,
Utilities\FuncStaticMethodInfo1`2.cs (2)
14/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T, TResult}"/>, 27public FuncStaticMethodInfo1(Func<T, TResult> function)
Utilities\FuncStaticMethodInfo3`2.cs (2)
14/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T, TResult}"/>, 27public FuncStaticMethodInfo3(Func<T, TResult> function)
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)
Data\DataViewUtils.cs (1)
176public static bool AllCacheable(DataViewSchema schema, Func<DataViewSchema.Column, bool> predicate)
Data\IRowSeekable.cs (1)
17RowSeeker GetSeeker(Func<int, bool> predicate);
Data\RowCursorUtils.cs (1)
489internal static Func<int, bool> FromColumnsToPredicate(IEnumerable<DataViewSchema.Column> columnsNeeded, DataViewSchema sourceSchema)
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\BatchDataViewMapperBase.cs (4)
35var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, SchemaBindings.AsSchema); 53var predInput = GetSchemaBindingDependencies(predicate); 71protected abstract Func<int, bool> GetSchemaBindingDependencies(Func<int, bool> predicate);
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\CompositeRowToRowMapper.cs (2)
92private readonly Func<int, bool> _pred; 94public SubsetActive(DataViewRow row, Func<int, bool> pred)
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)
DataView\ZipBinding.cs (3)
51public Func<int, bool>[] GetInputPredicates(Func<int, bool> predicate) 54var result = new Func<int, bool>[_sources.Length];
DataView\ZipDataView.cs (2)
77var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema); 117public Cursor(ZipDataView parent, DataViewRowCursor[] srcCursors, Func<int, bool> predicate)
Dirty\ChooseColumnsByIndexTransform.cs (8)
153internal bool[] GetActive(Func<int, bool> predicate) 158internal Func<int, bool> GetDependencies(Func<int, bool> predicate) 238protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate) 248var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 250var inputPred = _bindings.GetDependencies(predicate); 262var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 264var inputPred = _bindings.GetDependencies(predicate);
Evaluators\BinaryClassifierEvaluator.cs (5)
158private protected override Func<int, bool> GetActiveColsCore(RoleMappedSchema schema) 160var pred = base.GetActiveColsCore(schema); 1135private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 1148private protected override Delegate[] CreateGettersCore(DataViewRow input, Func<int, bool> activeCols, out Action disposer)
Evaluators\ClusteringEvaluator.cs (5)
126private protected override Func<int, bool> GetActiveColsCore(RoleMappedSchema schema) 128var pred = base.GetActiveColsCore(schema); 641private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 649private protected override Delegate[] CreateGettersCore(DataViewRow input, Func<int, bool> activeCols, out Action disposer)
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,
Evaluators\MulticlassClassificationEvaluator.cs (3)
695private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 709private protected override Delegate[] CreateGettersCore(DataViewRow input, Func<int, bool> activeCols, out Action disposer)
Evaluators\MultiOutputRegressionEvaluator.cs (3)
439private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 460private protected override Delegate[] CreateGettersCore(DataViewRow input, Func<int, bool> activeCols, out Action disposer)
Evaluators\QuantileRegressionEvaluator.cs (3)
345private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 380private protected override Delegate[] CreateGettersCore(DataViewRow input, Func<int, bool> activeCols, out Action disposer)
Evaluators\RankingEvaluator.cs (3)
123private protected override Func<int, bool> GetActiveColsCore(RoleMappedSchema schema) 125var pred = base.GetActiveColsCore(schema); 751protected override Delegate[] CreateGetters(RowCursorState state, Func<int, bool> predicate)
Evaluators\RegressionEvaluator.cs (3)
255private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 269private protected override Delegate[] CreateGettersCore(DataViewRow input, Func<int, bool> activeCols, out Action disposer)
Model\Pfa\ModelUtils.cs (1)
34public static string CreateNameCore(string name, Func<string, bool> contains)
Prediction\CalibratorCatalog.cs (3)
261private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 313protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Prediction\PredictionEngine.cs (2)
114var makeMapper = TransformerChecker(env, transformer); 132private protected virtual Func<DataViewSchema, IRowToRowMapper> TransformerChecker(IExceptionContext ectx, ITransformer transformer)
Scorers\GenericScorer.cs (2)
249protected override bool WantParallelCursors(Func<int, bool> predicate) 265protected override Delegate[] GetGetters(DataViewRow output, Func<int, bool> predicate)
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\BootstrapSamplingTransformer.cs (1)
163protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
Transforms\ColumnBindingsBase.cs (5)
589public bool[] GetActive(Func<int, bool> predicate) 603public bool[] GetActiveInput(Func<int, bool> predicate) 625var predicate = RowCursorUtils.FromColumnsToPredicate(inputColumns, AsSchema); 633public bool AnyNewColumnsActive(Func<int, bool> predicate) 770public bool[] GetActiveInput(Func<int, bool> predicate)
Transforms\ColumnConcatenatingTransformer.cs (3)
857private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 875protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Transforms\ColumnCopying.cs (1)
213protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Transforms\ColumnSelecting.cs (1)
73private readonly Func<string, bool> _selectPredicate;
Transforms\FeatureContributionCalculationTransformer.cs (1)
203protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> active, out Action disposer)
Transforms\GenerateNumberTransform.cs (7)
231public Func<int, bool> GetDependencies(Func<int, bool> predicate) 327protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate) 340var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 342var inputPred = _bindings.GetDependencies(predicate); 353var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 355var inputPred = _bindings.GetDependencies(predicate);
Transforms\Hashing.cs (1)
1354protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) => _parent.GetGetterCore(input, iinfo, out disposer);
Transforms\KeyToValue.cs (1)
212protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Transforms\KeyToVector.cs (1)
449protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
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\Normalizer.cs (1)
756protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Transforms\OneToOneTransformerBase.cs (2)
109private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
Transforms\PerGroupTransformBase.cs (6)
62public Func<int, bool> GetDependencies(Func<int, bool> predicate) 165var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 183private DataViewRowCursor GetRowCursorCore(Func<int, bool> predicate) 189var predInput = bindings.GetDependencies(predicate); 202protected abstract Delegate[] CreateGetters(TState state, Func<int, bool> predicate);
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\RowShufflingTransformer.cs (1)
245protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
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\SkipTakeFilter.cs (1)
205protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
Transforms\SlotsDroppingTransformer.cs (1)
719protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
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 =
Transforms\TypeConverting.cs (1)
467protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Transforms\ValueMapping.cs (1)
1048protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Transforms\ValueToKeyMappingTransformer.cs (1)
756protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
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)
DataViewSchema.cs (1)
271public void Add(Annotations annotations, Func<string, bool> selector)
Microsoft.ML.Ensemble (1)
OutputCombiners\BaseStacking.cs (1)
170List<FeatureSubsetModel<TOutput>> models, Func<float, T> labelConvert)
Microsoft.ML.GenAI.Samples (1)
Mistral\Mistral_7B_Instruct.cs (1)
135functionMap: new Dictionary<string, Func<string, Task<string>>>
Microsoft.ML.ImageAnalytics (7)
ImageGrayscale.cs (1)
162protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
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)
ImagePixelExtractor.cs (1)
294protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
ImageResizer.cs (1)
272protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
VectorToImageTransform.cs (1)
325protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Microsoft.ML.InternalCodeAnalyzer (2)
NameFixProvider.cs (2)
75Func<string, string> renamer = null; 103SyntaxNode identifier, string name, Func<string, string> renamer, CancellationToken cancellationToken)
Microsoft.ML.Mkl.Components (1)
VectorWhitening.cs (1)
597protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Microsoft.ML.OnnxConverter (1)
OnnxContextImpl.cs (1)
171private string GetUniqueName(string prefix, Func<string, bool> pred)
Microsoft.ML.OnnxTransformer (23)
DnnImageFeaturizerTransform.cs (3)
18/// <seealso cref="OnnxCatalog.DnnFeaturizeImage(TransformsCatalog, string, Func{DnnImageFeaturizerInput, EstimatorChain{ColumnCopyingTransformer}}, string)"/> 82/// <seealso cref="OnnxCatalog.DnnFeaturizeImage(TransformsCatalog, string, Func{DnnImageFeaturizerInput, EstimatorChain{ColumnCopyingTransformer}}, string)"/> 98internal DnnImageFeaturizerEstimator(IHostEnvironment env, string outputColumnName, Func<DnnImageFeaturizerInput, EstimatorChain<ColumnCopyingTransformer>> modelFactory, string inputColumnName = null)
OnnxCatalog.cs (1)
495Func<DnnImageFeaturizerInput, EstimatorChain<ColumnCopyingTransformer>> modelFactory,
OnnxTransform.cs (6)
608private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 615protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) 618private Delegate CreateGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, OnnxRuntimeOutputCacher outputCacher) 641public override Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer) 762var caster = _parent.Model.ModelInfo.OutputsInfo[_parent.MapDataViewColumnToOnnxOutputTensor(iinfo)].Caster;
OnnxTypeParser.cs (8)
268public static IEnumerable<TDst> CastOnnxSequenceToIEnumerable<TSrc, TDst>(IEnumerable<TSrc> o, Func<TSrc, object> caster) 281/// Create a <see cref="Func{T, TResult}"/> to map a <see cref="NamedOnnxValue"/> to the associated .NET <see langword="object"/>. 287public static Func<NamedOnnxValue, object> GetDataViewValueCasterAndResultedType(OnnxCSharpToProtoWrapper.TypeProto typeProto, out Type resultedType) 306Func<NamedOnnxValue, object> caster = (NamedOnnxValue value) => 325Func<NamedOnnxValue, object> caster = (NamedOnnxValue value) => methodSpecialized.Invoke(value, new object[] { }); 340var elementCaster = GetDataViewValueCasterAndResultedType(typeProto.SequenceType.ElemType, out Type elementType); 351Func<NamedOnnxValue, object> caster = (NamedOnnxValue value) => 374Func<NamedOnnxValue, object> caster = (NamedOnnxValue value) =>
OnnxUtils.cs (5)
130public Func<NamedOnnxValue, object> Caster { get; } 132public OnnxVariableInfo(string name, OnnxShape shape, Type typeInOnnxRuntime, DataViewType mlnetType, Func<NamedOnnxValue, object> caster) 272var casterPool = new Dictionary<string, Func<NamedOnnxValue, object>>(); 299Dictionary<string, Func<NamedOnnxValue, object>> casterPool) 308var caster = casterPool?[name];
Microsoft.ML.Parquet (1)
PartitionedFileLoader.cs (1)
681private Delegate MarshalGetter(Func<DataViewSchema.Column, ValueGetter<DataViewSchema.Column>> func, Type type, DataViewSchema.Column column)
Microsoft.ML.PCA (1)
PcaTransformer.cs (1)
569protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Microsoft.ML.StandardTrainers (10)
Optimizer\LineSearch.cs (6)
22float Minimize(Func<float, float> func); 274private readonly Func<float, float> _func; 289public StepAndValue(Func<float, float> func) 295public StepAndValue(Func<float, float> func, float initStep) 330public float Minimize(Func<float, float> func) 336private float FindMinimum(Func<float, float> func)
Standard\ModelStatistics.cs (1)
490Func<float, string> decorateProbabilityString = (float probZ) =>
Standard\SdcaBinary.cs (2)
811Func<DataViewRowId, long> getIndexFromId = GetIndexFromIdGetter(idToIdx, biasReg.Length); 1110private protected Func<DataViewRowId, long> GetIndexFromIdGetter(IdToIdxLookup idToIdx, int biasLength)
Standard\SdcaMulticlass.cs (1)
200Func<DataViewRowId, long> getIndexFromId = GetIndexFromIdGetter(idToIdx, biasReg.Length);
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)
BaseTestBaseline.cs (2)
479private IEnumerator<string> LineEnumerator(TextReader reader, Func<string, bool> stop) 501Func<string, bool> stop = x => x == tailSignature;
Microsoft.ML.Tests (6)
ExpressionLanguageTests\ExpressionLanguageTests.cs (3)
247var getters = new Func<ReadOnlyMemory<char>, bool>[types.Length]; 285private Func<ReadOnlyMemory<char>, bool> GetGetter(int i, DataViewType dst, object[] args) 479((Func<I8, I8>)(X)).GetMethodInfo(),
PermutationFeatureImportanceTests.cs (2)
959Func<T, double> metricSelector) 967Func<T, double> metricSelector)
Scenarios\Api\TestApi.cs (1)
356Func<IDataView, List<string>> getWorkclass = (IDataView view) =>
Microsoft.ML.TimeSeries (35)
PredictionEngine.cs (2)
44Action<PingerArgument> CreatePinger(DataViewRow input, Func<int, bool> activeOutput, out Action disposer); 265private protected override Func<DataViewSchema, IRowToRowMapper> TransformerChecker(IExceptionContext ectx, ITransformer transformer)
SequentialAnomalyDetectionTransformBase.cs (4)
342public Func<int, bool> GetDependencies(Func<int, bool> activeOutput) 352public Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer) 380public Action<PingerArgument> CreatePinger(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
SequentialForecastingTransformBase.cs (4)
146public Func<int, bool> GetDependencies(Func<int, bool> activeOutput) 156public Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer) 221public Action<PingerArgument> CreatePinger(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
SequentialTransformBase.cs (1)
371protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
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);
SrCnnEntireAnomalyDetector.cs (4)
164public Func<int, bool> GetDependencies(Func<int, bool> predicate) 249protected override Func<int, bool> GetSchemaBindingDependencies(Func<int, bool> predicate)
SrCnnTransformBase.cs (4)
185public Func<int, bool> GetDependencies(Func<int, bool> activeOutput) 195public Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer) 223public Action<PingerArgument> CreatePinger(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
Microsoft.ML.Tokenizers (1)
Utils\TokenizerExtensions.cs (1)
16public static T? ArgMin<T>(this IEnumerable<T> source, Func<T, int> getValue)
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)
AutoFormerV2\ObjectDetectionTrainer.cs (4)
790protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) 876public override Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer) 985private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
NasBert\NasBertTrainer.cs (1)
566protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
NasBert\NerTrainer.cs (2)
437private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
NasBert\SentenceSimilarityTrainer.cs (2)
294private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
NasBert\TextClassificationTrainer.cs (2)
371private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
Roberta\QATrainer.cs (4)
761protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) 827public override Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer) 939private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
TorchSharpBaseTrainer.cs (2)
485protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) 490public override Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
Microsoft.ML.Transforms (81)
CustomMappingCatalog.cs (1)
81public static IDataView FilterByCustomPredicate<TSrc>(this DataOperationsCatalog catalog, IDataView input, Func<TSrc, bool> filterPredicate)
CustomMappingFilter.cs (7)
40var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema); 42Func<int, bool> inputPred = TypedSrc.GetDependencies(predicate); 57private readonly Func<TSrc, bool> _predicate; 61public CustomMappingFilter(IHostEnvironment env, IDataView input, Func<TSrc, bool> predicate) 76var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, Schema); 78Func<int, bool> inputPred = TypedSrc.GetDependencies(predicate); 114var predicate = parent._predicate;
CustomMappingTransformer.cs (3)
130Delegate[] IRowMapper.CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer) 177Func<int, bool> IRowMapper.GetDependencies(Func<int, bool> activeOutput)
Dracula\CountTableTransformer.cs (1)
672protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Expression\BuiltinFunctions.cs (1)
82public static MethodInfo Fn<T1, T2>(Func<T1, T2> fn)
Expression\CodeGen.cs (2)
50{ typeFn = typeof(Func<,>); break; } 677private void CallFnc<TSrc, TDst>(Func<TSrc, TDst> fn)
ExpressionTransformer.cs (7)
463var fn = (Func<T0, TDst>)del; 607var fn = (Func<T0, TDst>)del; 966protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) 976private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
GcnTransform.cs (1)
360protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
GroupTransform.cs (4)
161var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 165protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate) 341private int[] GetColumnIds(DataViewSchema schema, string[] names, Func<string, Exception> except) 515public Cursor(GroupTransform parent, Func<int, bool> predicate)
KeyToVectorMapping.cs (1)
336protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
LoadTransform.cs (1)
91Func<string, bool> predicate =
MissingValueDroppingTransformer.cs (1)
217protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
MissingValueIndicatorTransformer.cs (1)
235protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
MissingValueReplacing.cs (2)
511Func<int[], VBuffer<int>> function = CreateVBuffer<int>; 622protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
OptionalColumnTransform.cs (10)
201public Func<int, bool> GetDependencies(Func<int, bool> predicate) 223var predicate = RowCursorUtils.FromColumnsToPredicate(dependingColumns, AsSchema); 224Func<int, bool> dependencies = GetDependencies(predicate); 317protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate) 326var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 328var inputPred = _bindings.GetDependencies(predicate); 340var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 341var inputPred = _bindings.GetDependencies(predicate); 378Func<int, bool> activeInfos =
PermutationFeatureImportance.cs (1)
26Func<IDataView, TMetric> evaluationFunc,
PermutationFeatureImportanceExtensions.cs (1)
657Func<IDataView, TMetric> evaluationFunc,
ProduceIdTransform.cs (7)
71public Func<int, bool> GetDependencies(Func<int, bool> predicate) 144var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 145var inputPred = _bindings.GetDependencies(predicate); 156var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 157var inputPred = _bindings.GetDependencies(predicate); 167protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
RandomFourierFeaturizing.cs (1)
502protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
StatefulCustomMappingTransformer.cs (5)
131Func<int, bool> needCol = c => columnsNeeded == null ? false : columnsNeeded.Any(x => x.Index == c); 135var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 220Func<int, bool> inputPred = c => active[c]; 231Func<int, bool> needCol = c => columnsNeeded == null ? false : columnsNeeded.Any(x => x.Index == c); 244protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate)
StatefulFilterTransform.cs (2)
107var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 109Func<int, bool> inputPred = c => activeInputs[c];
Text\LdaTransform.cs (1)
596protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Text\NgramHashingTransformer.cs (3)
558protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) 589private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
Text\NgramTransform.cs (1)
670protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Text\StopWordsRemovingTransformer.cs (4)
402protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) 507private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput) 1096protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Text\TextNormalizing.cs (1)
326protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Text\TokenizingByCharacters.cs (1)
464protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Text\WordBagTransform.cs (3)
300protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) 330private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
Text\WordEmbeddingsExtractor.cs (1)
543protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Text\WordTokenizing.cs (1)
234protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
UngroupTransform.cs (5)
166protected override bool? ShouldUseParallelCursors(Func<int, bool> predicate) 182var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 193var predicate = RowCursorUtils.FromColumnsToPredicate(columnsNeeded, OutputSchema); 385public bool[] GetActiveInput(Func<int, bool> predicate) 479public Cursor(IChannelProvider provider, DataViewRowCursor input, UngroupBinding schema, Func<int, bool> predicate)
Microsoft.ML.Vision (3)
DnnRetrainTransform.cs (3)
856protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) 947private protected override Func<int, bool> GetDependenciesCore(Func<int, bool> activeOutput)
Microsoft.VisualBasic.Tests (1)
Microsoft\VisualBasic\ApplicationServices\AssemblyInfoTests.cs (1)
67private static string GetAttributeValue<TAttribute>(Assembly assembly, Func<TAttribute, string> getAttributeValue)
Microsoft.VisualStudio.LanguageServices (37)
CodeCleanup\AbstractCodeCleanUpFixer_Helper.cs (1)
21internal static EnabledDiagnosticOptions AdjustDiagnosticOptions(EnabledDiagnosticOptions enabledDiagnostics, Func<string, bool> isFixIdEnabled)
EditorConfigSettings\SettingsEditorPane.cs (1)
158Func<IWpfSettingsEditorViewModel, ISettingsEditorView> createView)
FindReferences\Contexts\WithReferencesFindUsagesContext.cs (1)
142Func<RoslynDefinitionBucket, Task<Entry?>> createEntryAsync,
Interactive\VsResetInteractive.cs (2)
46Func<string, string> createReference, 47Func<string, string> createImport)
LanguageService\AbstractPackage`2.cs (2)
139protected void RegisterService<T>(Func<CancellationToken, Task<T>> serviceCreator) 143protected void RegisterLanguageService(Type t, Func<CancellationToken, Task<object>> serviceCreator)
MoveToNamespace\VisualStudioMoveToNamespaceOptionsService.cs (2)
22private readonly Func<MoveToNamespaceDialogViewModel, bool?> _showDialog; 32internal VisualStudioMoveToNamespaceOptionsService(Func<MoveToNamespaceDialogViewModel, bool?> showDialog)
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (1)
337Func<string, (ModuleMetadata moduleMetadata, TemporaryStorageStreamHandle? storageHandle)> moduleMetadataFactory)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
224public V GetOrAdd<T>(K key, T arg, Func<T, V> creator)
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)
TaskList\ExternalErrorDiagnosticUpdateSource.cs (3)
51private readonly AsyncBatchingWorkQueue<Func<CancellationToken, Task>> _taskQueue; 79_taskQueue = new AsyncBatchingWorkQueue<Func<CancellationToken, Task>>( 87private async ValueTask ProcessTaskQueueItemsAsync(ImmutableSegmentedList<Func<CancellationToken, Task>> list, CancellationToken cancellationToken)
Telemetry\CodeMarkerLogger.cs (4)
124private static readonly Func<CodeMarkerId, CodeMarkerId> s_getter = i => i; 125private static Func<Tuple<CodeMarkerId, CodeMarkerId>, CodeMarkerId> s_startGetter => t => t.Item1; 126private static Func<Tuple<CodeMarkerId, CodeMarkerId>, CodeMarkerId> s_endGetter => t => t.Item2; 150private static void FireCodeMarkers<T>(Dictionary<FunctionId, List<T>> map, FunctionId functionId, Func<T, int> getter)
Utilities\DelegateCommand.cs (2)
14private readonly Func<object, bool> _canExecute; 24public DelegateCommand(Action<object> action, Func<object, bool> canExecute)
Watson\FaultReporter.cs (1)
305private static List<string> CollectFilePaths(string logDirectoryPath, string logFileExtension, Func<string, bool> shouldExcludeLogFile)
Workspace\SourceGeneratedFileManager.cs (1)
106public Func<CancellationToken, Task<bool>> GetNavigationCallback(SourceGeneratedDocument document, TextSpan sourceSpan)
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)
Interactive\Commands\TestResetInteractive.cs (2)
47Func<string, string> createReference, 48Func<string, string> createImport,
PersistentStorage\AbstractPersistentStorageTests.cs (1)
941private static void DoSimultaneousWrites(Func<string, Task> write)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Features\OrganizeImports\XamlRemoveUnnecessaryImportsService.cs (1)
31Document document, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
MSBuild (6)
BuildEnvironmentHelper.cs (3)
468Func<string, string> getEnvironmentVariable = null, 495private static Func<string, string> s_getEnvironmentVariable = GetEnvironmentVariable; 609var existsCheck = mode == BuildEnvironmentMode.VisualStudio ? new Func<string, bool>(_ => true) : File.Exists;
CachingFileSystemWrapper.cs (1)
84private bool CachedExistenceCheck(string path, Func<string, bool> existenceCheck)
CopyOnWriteDictionary.cs (1)
219public IEnumerable<KeyValuePair<string, V>> Where(Func<KeyValuePair<string, V>, bool> predicate)
JsonOutputFormatter.cs (1)
28internal void AddPropertiesInJsonFormat(string[] propertyNames, Func<string, string> getProperty)
MSBuildTaskHost (5)
BuildEnvironmentHelper.cs (3)
468Func<string, string> getEnvironmentVariable = null, 495private static Func<string, string> s_getEnvironmentVariable = GetEnvironmentVariable; 609var existsCheck = mode == BuildEnvironmentMode.VisualStudio ? new Func<string, bool>(_ => true) : File.Exists;
Concurrent\ConcurrentDictionary.cs (1)
289public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
CopyOnWriteDictionary.cs (1)
219public IEnumerable<KeyValuePair<string, V>> Where(Func<KeyValuePair<string, V>, bool> predicate)
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
235[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<,>))]
netstandard (1)
netstandard.cs (1)
803[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<,>))]
OpenIdConnectSample (1)
Startup.cs (1)
327private static async Task WriteHtmlAsync(HttpResponse response, Func<HttpResponse, Task> writeContent)
PresentationCore (14)
System\Windows\clipboard.cs (4)
300/// A <see cref="Func{Type, TypeName}"/> that is used only when deserializing non-OLE formats. It returns the type if 443Func<TypeName, Type?> resolver, 461/// You must use the <see cref="TryGetData{T}(string, Func{TypeName, Type?}, out T)"/> with an explicit resolver. 475/// <inheritdoc cref="TryGetData{T}(string, Func{TypeName, Type}, out T)"/>
System\Windows\dataobject.cs (3)
142/// <inheritdoc cref="Clipboard.TryGetData{T}(string, Func{TypeName, Type}, out T)"/> 146Func<TypeName, Type?> resolver, 173Func<TypeName, Type?>? resolver,
System\Windows\DataObjectExtensions.cs (2)
56/// <inheritdoc cref="ITypedDataObject.TryGetData{T}(string, Func{Reflection.Metadata.TypeName, Type}, bool, out T)"/> 63Func<Reflection.Metadata.TypeName, Type?> resolver,
System\Windows\Input\ManipulationBoundaryFeedbackEventArgs.cs (1)
71internal Func<Point, Point> CompensateForBoundaryFeedback
System\Windows\Input\ManipulationDevice.cs (1)
508private Func<Point, Point> _compensateForBoundaryFeedback;
System\Windows\ITypedDataObject.cs (2)
41/// <inheritdoc cref="IDataObjectInternal.TryGetData{T}(string, Func{TypeName, Type}, bool, out T)" /> 45Func<TypeName, Type?> resolver,
System\Windows\Ole\DataObjectAdapter.cs (1)
44Func<TypeName, Type?> resolver,
PresentationFramework (52)
MS\Internal\Data\DataBindEngine.cs (1)
329internal ViewRecord GetViewRecord(object collection, CollectionViewSource key, Type collectionViewType, bool createView, Func<object, object> GetSourceItem)
MS\Internal\Data\LiveShapingList.cs (1)
653private void ForEachUntil(Func<LiveShapingItem, bool> action)
MS\Internal\Data\RBTree.cs (1)
444internal void ForEachUntil(Func<T, bool> action)
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\Helper.cs (1)
1290internal static T FindVisualAncestor<T>(DependencyObject element, Func<DependencyObject, bool> shouldContinueFunc) where T : DependencyObject
MS\Internal\WindowsRuntime\Generated\WinRT\ComWrappersSupport.cs (3)
19private static readonly ConcurrentDictionary<string, Func<IInspectable, object>> TypedObjectFactoryCache = new ConcurrentDictionary<string, Func<IInspectable, object>>(); 30public static TReturn MarshalDelegateInvoke<TDelegate, TReturn>(IntPtr thisPtr, Func<TDelegate, TReturn> invoke)
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;
System\Windows\Controls\ItemCollection.cs (1)
1491internal void SetItemsSource(IEnumerable value, Func<object, object> GetSourceItem = null)
System\Windows\Data\CollectionViewSource.cs (2)
804internal static CollectionView GetDefaultCollectionView(object source, bool createView, Func<object, object> GetSourceItem=null) 820internal static CollectionView GetDefaultCollectionView(object source, DependencyObject d, Func<object, object> GetSourceItem=null)
System\Windows\Data\ListCollectionView.cs (1)
2424internal static IComparer PrepareComparer(IComparer customSort, SortDescriptionCollection sort, Func<object, CollectionView> lazyGetCollectionView, object state)
System\Windows\Input\KeyboardNavigation.cs (1)
3515public void Process(Func<object, bool> action)
System\Windows\Markup\Baml2006\Baml6ConstructorInfo.cs (3)
8public Baml6ConstructorInfo(List<Type> types, Func<Object[], object> ctor) 15private Func<Object[], object> _constructor; 18public Func<Object[], object> Constructor { get { return _constructor; } }
System\Windows\Markup\Baml2006\WpfKnownMember.cs (2)
27private Func<object, object> _getDelegate; 125public Func<object, object> GetDelegate
Roslyn.Diagnostics.Analyzers (44)
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (1)
44Func<CancellationToken, Task<Document>> createChangedDocument;
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (1)
44Func<CancellationToken, Task<Document>> createChangedDocument;
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132private static int CalculateDepthOfInheritance(INamedTypeSymbol namedType, Func<INamedTypeSymbol, bool> isExcludedFromInheritanceCount)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
17private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 20Func<INamedTypeSymbol, bool>? isExcludedFromInheritanceCountFunc = null) 34public Func<INamedTypeSymbol, bool> IsExcludedFromInheritanceCountFunc { get; }
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (2)
116private readonly Func<INamedTypeSymbol, bool> _isDisallowedCatchType; 122public DisallowGeneralCatchUnlessRethrowWalker(Func<INamedTypeSymbol, bool> isDisallowedCatchType, bool checkAnonymousFunctions)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
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\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
20private static readonly Func<IOperation, ImmutableArray<IOperation>> ElementsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Elements), fallbackResult: default);
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\IUtf8StringOperationWrapper.cs (1)
19private static readonly Func<IOperation, string> ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, string>(WrappedType, nameof(Value), fallbackResult: null!);
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\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
458Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, 473static bool TryParse(string s, (Compilation compilation, Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, string? namePrefix, string? optionForcedValue) arg, out SymbolNamesWithValueOption<TValue> option)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
src\RoslynAnalyzers\Utilities\Refactoring\Extensions\SyntaxTokenExtensions.cs (1)
12public static T? GetAncestor<T>(this SyntaxToken token, Func<T, bool>? predicate = null)
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;
EditAndContinue\EditAndContinueTestUtilities.cs (3)
19public static EmitBaseline CreateInitialBaseline(Compilation compilation, ModuleMetadata module, Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> debugInformationProvider) 21var localSignatureProvider = new Func<MethodDefinitionHandle, StandaloneSignatureHandle>(methodHandle => 105Func<THandle, Handle> toHandle,
EditAndContinue\SemanticEditDescription.cs (6)
12Func<Compilation, ISymbol> symbolProvider, 13Func<Compilation, ISymbol>? newSymbolProvider = null, 14Func<SyntaxNode, RuntimeRudeEdit?>? rudeEdits = null, 18public readonly Func<Compilation, ISymbol> SymbolProvider = symbolProvider; 19public readonly Func<Compilation, ISymbol> NewSymbolProvider = newSymbolProvider ?? symbolProvider; 20public readonly Func<SyntaxNode, RuntimeRudeEdit?>? RudeEdits = rudeEdits;
Writer\SymWriterTestUtilities.cs (1)
14public static readonly Func<ISymWriterMetadataProvider, SymUnmanagedWriter> ThrowingFactory =
Roslyn.VisualStudio.DiagnosticsWindow (3)
Loggers\OutputWindowLogger.cs (2)
23private readonly Func<FunctionId, bool> _isEnabledPredicate; 25public OutputWindowLogger(Func<FunctionId, bool> isEnabledPredicate)
OptionPages\PerformanceLoggersPage.cs (1)
60var isEnabled = FunctionIdOptions.CreateFunctionIsEnabledPredicate(globalOptions);
Roslyn.VisualStudio.Next.UnitTests (4)
Services\ServiceHubServicesTests_ExtensionMessageHandler.cs (1)
750Func<string, Assembly>? loadFromPath = null,
Services\SolutionServiceTests.cs (3)
1258private static async Task VerifySolutionUpdate(string code, Func<Solution, Solution> newSolutionGetter) 1267Func<Solution, Solution> newSolutionGetter, 1274Func<Solution, Solution> newSolutionGetter,
RunTests (1)
AssemblyScheduler.cs (1)
160Func<TestMethodInfo, TWeight> getWeightFunc,
SemanticSearch.BuildTask (1)
GenerateFilteredReferenceAssembliesTask.cs (1)
282Func<ISymbol, bool> filter)
Shared (4)
Memoization\Memoize.cs (2)
41public static Func<TParameter, TResult> Function<TParameter, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TResult>(Func<TParameter, TResult> f)
Memoization\MemoizedFunction.cs (2)
60private readonly Func<TParameter, TResult> _function; 66public MemoizedFunction(Func<TParameter, TResult> function)
Shared.Tests (4)
Memoization\MemoizeTests.cs (4)
15Func<int, int> doubler = x => x * 2; 24Func<int, Task<int>> doubler = x => Task.FromResult(x * 2); 43Func<int, int> doubler = x => 61Func<object?, string> toString = x =>
Sockets.BindTests (4)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
20private Func<LogMessage, bool> _messageFilter; 39public Task<LogMessage> WaitForMessage(Func<LogMessage, bool> messageFilter)
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
34public Task<LogMessage> WaitForLogMessage(Func<LogMessage, bool> messageFilter)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (1)
270private async Task RunTestWithStaticPort(Func<int, Task> test)
Sockets.FunctionalTests (3)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (2)
20private Func<LogMessage, bool> _messageFilter; 39public Task<LogMessage> WaitForMessage(Func<LogMessage, bool> messageFilter)
src\Servers\Kestrel\shared\test\TestApplicationErrorLoggerLoggedTest.cs (1)
34public Task<LogMessage> WaitForLogMessage(Func<LogMessage, bool> messageFilter)
System.Collections.Concurrent (2)
System\Collections\Concurrent\ConcurrentDictionary.cs (2)
1207public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) 1401public TValue AddOrUpdate(TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
System.Collections.Immutable (44)
System\Collections\Frozen\FrozenDictionary.cs (3)
86this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer = null) 100this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey>? comparer = null)
System\Collections\Immutable\ImmutableArray.cs (2)
277public static ImmutableArray<TResult> CreateRange<TSource, TResult>(ImmutableArray<TSource> items, Func<TSource, TResult> selector) 309public static ImmutableArray<TResult> CreateRange<TSource, TResult>(ImmutableArray<TSource> items, int start, int length, Func<TSource, TResult> selector)
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\ImmutableInterlocked.cs (1)
34public static bool Update<T>(ref T location, Func<T, T> transformer) where T : class?
System\Collections\Immutable\ImmutableList_1.Builder.cs (1)
347public ImmutableList<TOutput> ConvertAll<TOutput>(Func<T, TOutput> converter)
System\Collections\Immutable\ImmutableList_1.cs (2)
567/// A <see cref="Func{T, TResult}"/> delegate that converts each element from 577public ImmutableList<TOutput> ConvertAll<TOutput>(Func<T, TOutput> converter)
System\Collections\Immutable\ImmutableList_1.Node.cs (2)
926/// A <see cref="Func{T, TResult}"/> delegate that converts each element from 935internal ImmutableList<TOutput>.Node ConvertAll<TOutput>(Func<T, TOutput> converter)
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\DataAnnotations\RangeAttribute.cs (3)
106private Func<object, object?>? Conversion { get; set; } 108private void Initialize(IComparable minimum, IComparable maximum, Func<object, object?> conversion) 236Func<object, object?> conversion;
System\ComponentModel\DataAnnotations\ValidationContext.cs (3)
36private Func<Type, object?>? _serviceProvider; 247/// A <see cref="Func{T, TResult}" /> that can return service instances given the 251public void InitializeServiceProvider(Func<Type, object?> serviceProvider)
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\Hosting\ExportProvider.GetExportOverrides.cs (1)
266Func<Export, Lazy<object, object>> typedExportFactory = ExportServices.CreateSemiStronglyTypedLazyFactory(type, metadataViewType);
System\ComponentModel\Composition\Hosting\FilteredCatalog.cs (3)
16private readonly Func<ComposablePartDefinition, bool> _filter; 27public FilteredCatalog(ComposablePartCatalog catalog, Func<ComposablePartDefinition, bool> filter) : 32internal FilteredCatalog(ComposablePartCatalog catalog, Func<ComposablePartDefinition, bool> filter, FilteredCatalog? complement)
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependenciesTraversal.cs (2)
17private readonly Func<ImportDefinition, bool> _importFilter; 20public DependenciesTraversal(FilteredCatalog catalog, Func<ImportDefinition, bool> importFilter)
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependentsTraversal.cs (2)
23private readonly Func<ImportDefinition, bool> _importFilter; 26public DependentsTraversal(FilteredCatalog catalog, Func<ImportDefinition, bool> importFilter)
System\ComponentModel\Composition\Hosting\FilteredCatalog.Traversal.cs (2)
28public FilteredCatalog IncludeDependencies(Func<ImportDefinition, bool> importFilter) 51public FilteredCatalog IncludeDependents(Func<ImportDefinition, bool> importFilter)
System\ComponentModel\Composition\Hosting\ImportSourceImportDefinitionHelpers.cs (1)
68public override Expression<Func<ExportDefinition, bool>> Constraint
System\ComponentModel\Composition\Hosting\ScopingExtensions.cs (1)
135public static FilteredCatalog Filter(this ComposablePartCatalog catalog, Func<ComposablePartDefinition, bool> filter)
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (3)
25private Expression<Func<ExportDefinition, bool>>? _constraint; 260/// A <see cref="Expression{TDelegate}"/> containing a <see cref="Func{T, TResult}"/> 272public override Expression<Func<ExportDefinition, bool>> Constraint =>
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\ExportfactoryCreator.cs (4)
23public Func<Export, object> CreateStronglyTypedExportFactoryFactory(Type exportType, Type? metadataViewType) 40Func<Export, object> exportFactoryFactory = (Func<Export, object>)Delegate.CreateDelegate(typeof(Func<Export, object>), this, genericMethod);
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\ReflectionModel\PartCreatorMemberImportDefinition.cs (1)
38public override Expression<Func<ExportDefinition, bool>> Constraint
System\ComponentModel\Composition\ReflectionModel\PartCreatorParameterImportDefinition.cs (1)
38public override Expression<Func<ExportDefinition, bool>> Constraint
System.ComponentModel.Composition.Registration (29)
System\ComponentModel\Composition\Registration\ExportBuilder.cs (4)
14private List<Tuple<string, Func<Type, object>>> _metadataItemFuncs; 49public ExportBuilder AddMetadata(string name, Func<Type, object> itemFunc) 51_metadataItemFuncs ??= new List<Tuple<string, Func<Type, object>>>(); 84foreach (Tuple<string, Func<Type, object>> item in _metadataItemFuncs)
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\ComponentModel\ReflectTypeDescriptionProvider.cs (2)
101private readonly Func<Type, TypeConverter> _constructionFunc; 117public IntrinsicTypeConverterData(Func<Type, TypeConverter> constructionFunc, bool cacheConverterInstance = true)
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\Composition\Hosting\Core\ExportDescriptorPromise.cs (1)
41Func<IEnumerable<CompositionDependency>, ExportDescriptor> getDescriptor)
System\Composition\Hosting\Providers\ExportFactory\ExportFactoryWithMetadataExportDescriptorProvider.cs (1)
42var metadataProvider = MetadataViewProvider.GetMetadataViewProvider<TMetadata>();
System\Composition\Hosting\Providers\Lazy\LazyWithMetadataExportDescriptorProvider.cs (1)
30var metadataProvider = MetadataViewProvider.GetMetadataViewProvider<TMetadata>();
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (3)
19public static Func<IDictionary<string, object>, TMetadata> GetMetadataViewProvider<TMetadata>() 37return Expression.Lambda<Func<IDictionary<string, object>, TMetadata>>( 68return Expression.Lambda<Func<IDictionary<string, object>, TMetadata>>(
System.Configuration.ConfigurationManager (6)
System\Configuration\BaseConfigurationRecord.cs (2)
242internal Func<string, string> TypeStringTransformer => CurrentConfiguration?.TypeStringTransformer; 244internal Func<string, string> AssemblyStringTransformer => CurrentConfiguration?.AssemblyStringTransformer;
System\Configuration\Configuration.cs (4)
21private Func<string, string> _assemblyStringTransformer; 26private Func<string, string> _typeStringTransformer; 120public Func<string, string> TypeStringTransformer 133public Func<string, string> AssemblyStringTransformer
System.Core (1)
System.Core.cs (1)
93[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<,>))]
System.Data.Common (42)
System\Data\Common\DataStorage.cs (1)
127private static readonly Func<Type, Tuple<bool, bool, bool, bool>> s_inspectTypeForInterfaces = InspectTypeForInterfaces;
System\Data\DataRowExtensions.cs (4)
145internal static readonly Func<object, T?> s_unbox = Create(); 147private static Func<object, T?> Create() 161static Func<object, T?> CreateWhenDynamicCodeSupported() 167.CreateDelegate<Func<object, T>>();
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\SortExpressionBuilder.cs (7)
41private readonly LinkedList<Func<T, object>> _selectors = new LinkedList<Func<T, object>>(); 44private LinkedListNode<Func<T, object>>? _currentSelector; 50internal void Add(Func<T, object> keySelector, Comparison<object> compare, bool isOrderBy) 80foreach (Func<T, object> selector in _selectors) 132foreach (Func<T, object> selector in _selectors) 167foreach (Func<T, object> selector in _selectors)
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)
src\libraries\Common\src\System\Data\ProviderBase\DbReferenceCollection.cs (1)
140internal T? FindItem<T>(int tag, Func<T, bool> filterMethod) where T : class
System.Diagnostics.DiagnosticSource (7)
System\Diagnostics\ActivityListener.cs (1)
48public Func<ActivitySource, bool>? ShouldListenTo { get; set; }
System\Diagnostics\ActivitySource.cs (2)
64Func<ActivitySource, bool>? shouldListenTo = listener.ShouldListenTo; 354var shouldListenTo = ((ActivityListener)obj).ShouldListenTo;
System\Diagnostics\DsesFilterAndTransform.cs (3)
845_propertyFetch = (Func<TObject, TProperty>)property.GetMethod!.CreateDelegate(typeof(Func<TObject, TProperty>)); 852private readonly Func<TObject, TProperty> _propertyFetch;
System\Diagnostics\Metrics\AggregatorStore.cs (1)
416private readonly Func<TObjectSequence, TAggregator?> _createAggregator;
System.Formats.Asn1 (1)
System\Formats\Asn1\AsnWriter.cs (1)
232public TReturn Encode<TReturn>(Func<ReadOnlySpan<byte>, TReturn> encodeCallback)
System.Linq (315)
System\Linq\Aggregate.cs (1)
86public static TResult Aggregate<TSource, TAccumulate, TResult>(this IEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)
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\AnyAll.cs (2)
44public static bool Any<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) 80public static bool All<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
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\Count.cs (2)
46public static int Count<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) 156public static long LongCount<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
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\Iterator.cs (2)
90public virtual IEnumerable<TResult> Select<TResult>(Func<TSource, TResult> selector) => 100public virtual IEnumerable<TSource> Where(Func<TSource, bool> predicate) =>
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\OfType.SpeedOpt.cs (3)
146public override IEnumerable<TResult2> Select<TResult2>(Func<TResult, TResult2> selector) 155Func<object, TResult2> localSelector = 169Func<object, bool> isTResult = static o => o is TResult;
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\OrderedEnumerable.SpeedOpt.cs (2)
271Func<TElement, TKey> keySelector = _keySelector; 323Func<TElement, TKey> keySelector = _keySelector;
System\Linq\Range.SpeedOpt.cs (1)
12public override IEnumerable<TResult> Select<TResult>(Func<int, TResult> selector)
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\SelectMany.SpeedOpt.cs (2)
37Func<TSource, IEnumerable<TResult>> selector = _selector; 54Func<TSource, IEnumerable<TResult>> selector = _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\Skip.cs (2)
41public static IEnumerable<TSource> SkipWhile<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) 61private static IEnumerable<TSource> SkipWhileIterator<TSource>(IEnumerable<TSource> source, Func<TSource, bool> predicate)
System\Linq\SkipTake.SpeedOpt.cs (1)
52public override IEnumerable<TResult> Select<TResult>(Func<TSource, TResult> selector) =>
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\Take.cs (2)
199public static IEnumerable<TSource> TakeWhile<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) 219private static IEnumerable<TSource> TakeWhileIterator<TSource>(IEnumerable<TSource> source, Func<TSource, bool> predicate)
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\AggregateAsync.cs (2)
189Func<TAccumulate, TResult> resultSelector, 202Func<TAccumulate, TResult> resultSelector)
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\AllAsync.cs (2)
26Func<TSource, bool> predicate, 36Func<TSource, bool> predicate)
System\Linq\AnyAsync.cs (2)
50Func<TSource, bool> predicate, 60Func<TSource, bool> predicate)
System\Linq\CountAsync.cs (4)
54Func<TSource, bool> predicate, 64Func<TSource, bool> predicate) 154Func<TSource, bool> predicate, 164Func<TSource, bool> predicate)
System\Linq\CountBy.cs (2)
25Func<TSource, TKey> keySelector, 36IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer, [EnumeratorCancellation] CancellationToken cancellationToken)
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\Empty.cs (1)
36public IOrderedAsyncEnumerable<TResult> CreateOrderedAsyncEnumerable<TKey>(Func<TResult, TKey> keySelector, IComparer<TKey>? comparer, bool descending)
System\Linq\ExceptBy.cs (2)
29Func<TSource, TKey> keySelector, 43Func<TSource, TKey> keySelector,
System\Linq\FirstAsync.cs (5)
57Func<TSource, bool> predicate, 67Func<TSource, bool> predicate) 173Func<TSource, bool> predicate, 205Func<TSource, bool> predicate, 216Func<TSource, bool> predicate,
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\GroupJoin.cs (4)
39Func<TOuter, TKey> outerKeySelector, 40Func<TInner, TKey> innerKeySelector, 57Func<TOuter, TKey> outerKeySelector, 58Func<TInner, TKey> innerKeySelector,
System\Linq\IntersectBy.cs (2)
34Func<TSource, TKey> keySelector, 48Func<TSource, TKey> keySelector,
System\Linq\Join.cs (4)
36Func<TOuter, TKey> outerKeySelector, 37Func<TInner, TKey> innerKeySelector, 53Func<TOuter, TKey> outerKeySelector, 54Func<TInner, TKey> innerKeySelector,
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\LeftJoin.cs (4)
33Func<TOuter, TKey> outerKeySelector, 34Func<TInner, TKey> innerKeySelector, 50Func<TOuter, TKey> outerKeySelector, 51Func<TInner, TKey> innerKeySelector,
System\Linq\MaxByAsync.cs (2)
27Func<TSource, TKey> keySelector, 38Func<TSource, TKey> keySelector,
System\Linq\MinByAsync.cs (2)
27Func<TSource, TKey> keySelector, 38Func<TSource, TKey> keySelector,
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\RightJoin.cs (4)
33Func<TOuter, TKey> outerKeySelector, 34Func<TInner, TKey> innerKeySelector, 51Func<TOuter, TKey> outerKeySelector, 52Func<TInner, TKey> innerKeySelector,
System\Linq\Select.cs (2)
26Func<TSource, TResult> selector) 37Func<TSource, TResult> selector,
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\SkipWhile.cs (2)
29Func<TSource, bool> predicate) 40Func<TSource, bool> predicate,
System\Linq\TakeWhile.cs (2)
25Func<TSource, bool> predicate) 35IAsyncEnumerable<TSource> source, Func<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\UnionBy.cs (2)
26Func<TSource, TKey> keySelector, 40Func<TSource, TKey> keySelector,
System\Linq\Where.cs (2)
22Func<TSource, bool> predicate) 33Func<TSource, bool> predicate,
System.Linq.Expressions (37)
System\Dynamic\ExpandoObject.cs (1)
783private DynamicMetaObject BindGetOrInvokeMember(DynamicMetaObjectBinder binder, string name, bool ignoreCase, DynamicMetaObject fallback, Func<DynamicMetaObject, DynamicMetaObject>? fallbackInvoke)
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\Dynamic\Utils\Helpers.cs (1)
12internal static T? CommonNode<T>(T first, T second, Func<T, T> parent) where T : class
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (1)
195return typeof(Func<,>).MakeGenericType(types);
System\Linq\Expressions\ExpressionVisitor.cs (1)
91public static ReadOnlyCollection<T> Visit<T>(ReadOnlyCollection<T> nodes, Func<T, T> elementVisitor)
System\Linq\Expressions\Interpreter\CallInstruction.cs (2)
253var thunk = del.Target as Func<object[], object>;
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
419private readonly Func<T0, TRet> _target; 426_target = (Func<T0, TRet>)target.CreateDelegate(typeof(Func<T0, TRet>));
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (2)
37public override string ToDebugString(int instructionIndex, object? cookie, Func<int, int> labelIndexer, IReadOnlyList<object>? objects) 170public override string ToDebugString(int instructionIndex, object? cookie, Func<int, int> labelIndexer, IReadOnlyList<object>? objects)
System\Linq\Expressions\Interpreter\Instruction.cs (1)
26public virtual string ToDebugString(int instructionIndex, object? cookie, Func<int, int> labelIndexer, IReadOnlyList<object>? objects) => ToString();
System\Linq\Expressions\Interpreter\InstructionList.cs (1)
112Func<int, int> labelIndexer, IReadOnlyList<KeyValuePair<int, object?>>? debugCookies)
System\Linq\Expressions\Interpreter\LabelInfo.cs (1)
219internal static T? CommonNode<T>(T first, T second, Func<T, T> parent) where T : class
System\Linq\Expressions\Interpreter\LocalAccess.cs (1)
27public override string ToDebugString(int instructionIndex, object? cookie, Func<int, int> labelIndexer, IReadOnlyList<object>? objects)
System\Linq\Expressions\Interpreter\StackOperations.cs (1)
48public override string ToDebugString(int instructionIndex, object? cookie, Func<int, int> labelIndexer, IReadOnlyList<object>? objects) =>
System\Linq\Expressions\StackGuard.cs (1)
61private R RunOnEmptyStackCore<R>(Func<object, R> action, object state)
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\Enumerables\AggregationMinMaxHelpers.cs (2)
30Func<Pair<bool, T>, T> resultSelector = MakeResultSelectorFunction(); 110private static Func<Pair<bool, T>, T> MakeResultSelectorFunction()
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (2)
31private readonly Func<TInputOutput, THashKey>? _keySelector; // A key-selector function. 66Func<TInputOutput, THashKey>? keySelector, HashRepartitionStream<TInputOutput, THashKey, int> repartitionStream,
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (2)
31private readonly Func<TInputOutput, THashKey>? _keySelector; // A key-selector function. 68Func<TInputOutput, THashKey>? keySelector, OrderedHashRepartitionStream<TInputOutput, THashKey, TOrderKey> repartitionStream, CountdownEvent barrier,
System\Linq\Parallel\Partitioning\OrderedHashRepartitionStream.cs (1)
18PartitionedStream<TInputOutput, TOrderKey> inputStream, Func<TInputOutput, THashKey>? hashKeySelector,
System\Linq\Parallel\Partitioning\UnorderedHashRepartitionStream.cs (1)
23Func<TInputOutput, THashKey>? keySelector, IEqualityComparer<THashKey>? keyComparer, IEqualityComparer<TInputOutput>? elementComparer,
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (2)
60private readonly Func<TIntermediate, TOutput> _resultSelector; 75Func<TIntermediate, TOutput> resultSelector, bool throwIfEmpty, QueryAggregationOptions options)
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (4)
28private readonly Func<TLeftInput, TKey> _leftKeySelector; // The key selection routine for the outer (left) data source. 29private readonly Func<TRightInput, TKey> _rightKeySelector; // The key selection routine for the inner (right) data source. 38Func<TLeftInput, TKey> leftKeySelector, 39Func<TRightInput, TKey> rightKeySelector,
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (4)
44private readonly Func<TLeftInput, TKey> _leftKeySelector; // The key selection routine for the outer (left) data source. 45private readonly Func<TRightInput, TKey> _rightKeySelector; // The key selection routine for the inner (right) data source. 54Func<TLeftInput, TKey> leftKeySelector, 55Func<TRightInput, TKey> rightKeySelector,
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (4)
39private readonly Func<TInput, bool> _predicate; // The predicate used to test membership. 51internal AnyAllSearchOperator(IEnumerable<TInput> child, bool qualification, Func<TInput, bool> predicate) 152private readonly Func<TInput, bool> _predicate; // The predicate. 163Func<TInput, bool> predicate, int partitionIndex, Shared<bool> resultFoundFlag,
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (4)
26private readonly Func<TSource, bool>? _predicate; // The optional predicate used during the search. 36internal FirstQueryOperator(IEnumerable<TSource> child, Func<TSource, bool>? predicate) 124private readonly Func<TSource, bool>? _predicate; // The optional predicate used during the search. 139QueryOperatorEnumerator<TSource, TKey> source, Func<TSource, bool>? predicate,
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\LastQueryOperator.cs (4)
27private readonly Func<TSource, bool>? _predicate; // The optional predicate used during the search. 37internal LastQueryOperator(IEnumerable<TSource> child, Func<TSource, bool>? predicate) 120private readonly Func<TSource, bool>? _predicate; // The optional predicate used during the search. 135QueryOperatorEnumerator<TSource, TKey> source, Func<TSource, bool>? predicate,
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (2)
35private readonly Func<TLeftInput, IEnumerable<TRightInput>>? _rightChildSelector; // To select a new child each iteration. 53Func<TLeftInput, IEnumerable<TRightInput>>? rightChildSelector,
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (5)
26private readonly Func<TInput, TOutput> _selector; 39internal SelectQueryOperator(IEnumerable<TInput> child, Func<TInput, TOutput> selector) 96private readonly Func<TInput, TOutput> _selector; // The actual select function. 102internal SelectQueryOperatorEnumerator(QueryOperatorEnumerator<TInput, TKey> source, Func<TInput, TOutput> selector) 141private readonly Func<TInput, TOutput> _selector; // Selector function
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (4)
27private readonly Func<TSource, bool>? _predicate; // The optional predicate used during the search. 36internal SingleQueryOperator(IEnumerable<TSource> child, Func<TSource, bool>? predicate) 99private readonly Func<TSource, bool>? _predicate; // The optional predicate used during the search. 111Func<TSource, bool>? predicate, Shared<int> totalElementCount)
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\QueryOperators\Unary\WhereQueryOperator.cs (4)
25private readonly Func<TInputOutput, bool> _predicate; 38internal WhereQueryOperator(IEnumerable<TInputOutput> child, Func<TInputOutput, bool> predicate) 105private readonly Func<TInputOutput, bool> _predicate; // The predicate used for filtering. 113internal WhereQueryOperatorEnumerator(QueryOperatorEnumerator<TInputOutput, TKey> source, Func<TInputOutput, bool> predicate,
System\Linq\Parallel\Utils\ExceptionAggregator.cs (2)
120internal static Func<T, U> WrapFunc<T, U>(Func<T, U> f, CancellationState cancellationState)
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\Http\Headers\HttpRequestHeaders.cs (1)
28private T GetSpecializedCollection<T>(int slot, Func<HttpRequestHeaders, T> creationFunc)
System\Net\Http\Headers\HttpResponseHeaders.cs (1)
23private T GetSpecializedCollection<T>(int slot, Func<HttpResponseHeaders, T> creationFunc)
System\Net\Http\HttpContent.cs (1)
760private static async Task<TResult> WaitAndReturnAsync<TState, TResult>(Task waitTask, TState state, Func<TState, TResult> returnFunc)
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)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
52Func<TExteriorHandle, TInteriorHandle> accessor,
src\libraries\Common\src\System\Net\SafeHandleCache.cs (1)
51internal THandle GetOrCreate<TContext>(TKey key, Func<TContext, THandle> factory, TContext factoryContext)
System\Net\Quic\Internal\MsQuicBuffers.cs (1)
68public void Initialize<T>(IList<T> inputs, Func<T, ReadOnlyMemory<byte>> toBuffer)
System.Net.Security (2)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
52Func<TExteriorHandle, TInteriorHandle> accessor,
src\libraries\Common\src\System\Net\SafeHandleCache.cs (1)
51internal THandle GetOrCreate<TContext>(TKey key, Func<TContext, THandle> factory, TContext factoryContext)
System.Net.WebClient (1)
System\Net\WebClient.cs (1)
1790private void HandleCompletion<TAsyncCompletedEventArgs, TCompletionDelegate, T>(TaskCompletionSource<T> tcs, TAsyncCompletedEventArgs e, Func<TAsyncCompletedEventArgs, T> getResult, TCompletionDelegate handler, Action<WebClient, TCompletionDelegate> unregisterHandler)
System.Net.WebHeaderCollection (5)
System\Net\HeaderInfo.cs (2)
10internal readonly Func<string, string[]> Parser; 19internal HeaderInfo(string name, bool requestRestricted, bool responseRestricted, bool multi, Func<string, string[]> parser)
System\Net\HeaderInfoTable.cs (3)
12private static readonly Func<string, string[]> s_singleParser = value => new[] { value }; 13private static readonly Func<string, string[]> s_multiParser = value => ParseValueHelper(value, isSetCookie: false); 14private static readonly Func<string, string[]> s_setCookieParser = value => ParseValueHelper(value, isSetCookie: true);
System.Private.CoreLib (158)
src\libraries\System.Private.CoreLib\src\Internal\Runtime\InteropServices\ComponentActivator.cs (1)
310Func<AssemblyName, Assembly> resolver = alc.LoadFromAssemblyName;
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
262public void Handle(Func<Exception, bool> predicate)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\EqualityComparer.cs (3)
28public static EqualityComparer<T> Create(Func<T?, T?, bool> equals, Func<T, int>? getHashCode = null) 89private readonly Func<T, int> _getHashCode; 91public DelegateEqualityComparer(Func<T?, T?, bool> equals, Func<T, int> getHashCode)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyAnalysis.cs (1)
16internal readonly Func<PropertyValue, PropertyValue> getter;
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\Diagnostics\Tracing\TraceLogging\TraceLoggingTypeInfo.cs (2)
22private readonly Func<object?, PropertyValue> propertyValueFactory; 88internal Func<object?, PropertyValue> PropertyValueFactory => this.propertyValueFactory;
src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (3)
17private readonly Func<object, bool>? _callback1; 25private Gen2GcCallback(Func<object, bool> callback, object targetObj) 48public static void Register(Func<object, bool> callback, object targetObj)
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (1)
655Func<object?, int> function, object? state,
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (3)
168private static Func<string, AssemblyName>? s_getAssemblyName; 169private static Func<string, AssemblyName> InitGetAssemblyName() 182return s_getAssemblyName = getAssemblyNameMethod.CreateDelegate<Func<string, AssemblyName>>();
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (2)
230/// the table and returned by all the racing <see cref="GetOrAdd(TKey, Func{TKey, TValue})"/> calls. This rule permits the 233public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
src\libraries\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionHandling.cs (2)
10private static Func<Exception, bool>? s_handler; 32public static void SetUnhandledExceptionHandler(Func<Exception, bool> handler)
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (1)
22private static readonly Func<object, bool> s_spinWaitTryAcquireCallback = SpinWaitTryAcquireCallback;
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (1)
19public bool SpinWaitForCondition(Func<object, bool> condition, object state, int spinCount, int sleep0Threshold)
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,
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (1)
1087private static ReadOnlySpan<char> TZif_ParsePosixString(ReadOnlySpan<char> posixFormat, scoped ref int index, Func<char, bool> breakCondition)
src\System\Reflection\TypeNameResolver.CoreCLR.cs (2)
17private Func<AssemblyName, Assembly?>? _assemblyResolver; 41Func<AssemblyName, Assembly?>? assemblyResolver,
src\System\Type.CoreCLR.cs (3)
44Func<AssemblyName, Assembly?>? assemblyResolver, 56Func<AssemblyName, Assembly?>? assemblyResolver, 70Func<AssemblyName, Assembly?>? assemblyResolver,
System.Private.DataContractSerialization (11)
System\Runtime\Serialization\AccessorBuilder.cs (6)
72var createGetterGeneric = s_createGetterInternal.MakeGenericMethod(declaringType, propertyType).CreateDelegate<Func<PropertyInfo, Getter>>(); 129var createSetterGeneric = s_createSetterInternal.MakeGenericMethod(propInfo.DeclaringType!, propInfo.PropertyType).CreateDelegate<Func<PropertyInfo, Setter>>(); 179var getMethod = propInfo.GetMethod!.CreateDelegate<Func<DeclaringType, PropertyType>>();
System\Runtime\Serialization\ContextAware.cs (1)
58internal TValue GetOrAdd(TKey t, Func<TKey, TValue> f)
System\Runtime\Serialization\ReflectionReader.cs (4)
555Func<object, object?> objectToKeyValuePairGetKey = MakeGenericMethod(s_objectToKeyValuePairGetKey, keyType, valueType).CreateDelegate<Func<object, object?>>(); 556Func<object, object?> objectToKeyValuePairGetValue = MakeGenericMethod(s_objectToKeyValuePairGetValue, keyType, valueType).CreateDelegate<Func<object, object?>>();
System.Private.Windows.Core (15)
System\Collections\Generic\ListConverter.cs (2)
18private readonly Func<TIn, TOut> _converter; 20public ListConverter(IList values, Func<TIn, TOut> converter)
System\Private\Windows\Ole\Composition.cs (1)
159Func<TypeName, Type?> resolver,
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
591Func<TypeName, Type?> resolver,
System\Private\Windows\Ole\DataRequest.cs (1)
30public Func<TypeName, Type?>? Resolver { get; init; } = null;
System\Private\Windows\Ole\DataStore.cs (1)
178Func<TypeName, Type?> resolver,
System\Private\Windows\Ole\FormatEnumerator.cs (1)
27public FormatEnumerator(IDataObjectInternal dataObject, Func<string, int> getFormatId)
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,
System\Private\Windows\Ole\TypeBinder.cs (1)
35private readonly Func<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\Windows\Ole\BinaryFormatUtilitiesTests.cs (1)
23Func<TypeName, Type>? resolver,
System\Private\Windows\Ole\TestDataObject.cs (2)
89Func<TypeName, Type?> resolver, 96Func<TypeName, Type?>? resolver,
System\Private\Windows\Ole\TestDataObjectAdapter.cs (1)
44Func<TypeName, Type?> resolver,
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\Xml\Core\XmlWellFormedWriterAsync.cs (2)
151private Task SequenceRun<TArg>(Task task, Func<TArg, Task> nextTaskFun, TArg arg) 163private async Task _SequenceRun<TArg>(Task task, Func<TArg, Task> nextTaskFun, TArg arg)
System\Xml\Serialization\ContextAwareTables.cs (1)
23internal T GetOrCreateValue(Type t, Func<Type, T> f)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (6)
648var getSetMemberValueDelegateWithType = getSetMemberValueDelegateWithTypeMi.CreateDelegate<Func<MemberInfo, ReflectionXmlSerializationReaderHelper.SetMemberValueDelegate>>(); 901Func<object, string> readFunc = (state) => ((XmlReader)state).ReadElementContentAsString(); 1166private object WritePrimitive(TypeMapping mapping, Func<object, string> readFunc, object funcState) 1252private object WriteEnumMethod(EnumMapping mapping, Func<object, string> readFunc, object funcState) 1828Func<object, string> functor = (state) =>
System.Reflection.Context (9)
System\Reflection\Context\CustomReflectionContext.cs (2)
65Func<object, object?>? getter, 82Func<object, object?>? getter,
System\Reflection\Context\Projection\Projector.cs (4)
13public IList<T>? Project<T>(IList<T>? values, Func<T, T> project) 24public T[]? Project<T>(T[]? values, Func<T, T> project) 32public T Project<T>(T value, Func<T, T> project) 123private T[] ProjectAll<T>(IList<T> values, Func<T, T> project)
System\Reflection\Context\Virtual\VirtualPropertyInfo.cs (1)
20Func<object, object?>? getter,
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertyGetter.cs (2)
15private readonly Func<object, object?> _getter; 18public PropertyGetter(VirtualPropertyBase property, Func<object, object?> getter, IEnumerable<Attribute>? getterAttributes)
System.Reflection.Metadata (12)
System\Reflection\Internal\Utilities\EnumerableExtensions.cs (1)
15public static IEnumerable<TResult> Select<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)
System\Reflection\Metadata\BlobContentId.cs (1)
117public static Func<IEnumerable<Blob>, BlobContentId> GetTimeBasedProvider()
System\Reflection\Metadata\Ecma335\PortablePdbBuilder.cs (2)
23public Func<IEnumerable<Blob>, BlobContentId> IdProvider { get; } 51Func<IEnumerable<Blob>, BlobContentId>? idProvider = null)
System\Reflection\PortableExecutable\ManagedPEBuilder.cs (2)
48Func<IEnumerable<Blob>, BlobContentId>? deterministicIdProvider = null) 228public void Sign(BlobBuilder peImage, Func<IEnumerable<Blob>, byte[]> signatureProvider)
System\Reflection\PortableExecutable\PEBuilder.cs (3)
15public Func<IEnumerable<Blob>, BlobContentId> IdProvider { get; } 61protected PEBuilder(PEHeaderBuilder header, Func<IEnumerable<Blob>, BlobContentId>? deterministicIdProvider) 495internal void Sign(BlobBuilder peImage, Blob strongNameSignatureFixup, Func<IEnumerable<Blob>, byte[]> signatureProvider)
System\Reflection\PortableExecutable\PEReader.cs (3)
710public bool TryOpenAssociatedPortablePdb(string peImagePath, Func<string, Stream?> pdbFileStreamProvider, out MetadataReaderProvider? pdbReaderProvider, out string? pdbPath) 768private bool TryOpenCodeViewPortablePdb(DebugDirectoryEntry codeViewEntry, string peImageDirectory, Func<string, Stream?> pdbFileStreamProvider, out MetadataReaderProvider? provider, out string? pdbPath, ref Exception? errorToReport) 803private static bool TryOpenPortablePdbFile(string path, BlobContentId id, Func<string, Stream?> pdbFileStreamProvider, out MetadataReaderProvider? provider, ref Exception? errorToReport)
System.Reflection.MetadataLoadContext (9)
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (1)
83public QueriedMemberList<M> Filter(Func<M, bool> predicate)
System\Reflection\TypeLoading\General\Helpers.cs (1)
307Func<AssemblyName, Assembly> assemblyResolver =
System\Reflection\TypeLoading\Modules\RoModule.Unifier.cs (4)
20private static readonly Func<RoType, RoArrayType> s_szArrayTypeFactory = (e) => new RoArrayType(e, multiDim: false, rank: 1); 34private static readonly Func<RoArrayType.Key, RoArrayType> s_mdArrayTypeFactory = (k) => new RoArrayType(k.ElementType, multiDim: true, rank: k.Rank); 47private static readonly Func<RoType, RoByRefType> s_byrefTypeFactory = (e) => new RoByRefType(e); 68private static readonly Func<RoConstructedGenericType.Key, RoConstructedGenericType> s_constructedGenericTypeFactory =
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (1)
177private QueryResult<M> Query<M>(string? optionalName, BindingFlags bindingAttr, Func<M, bool>? optionalPredicate) where M : MemberInfo
System\Reflection\TypeLoading\RuntimeTypeInfo.GetMember.cs (2)
31Func<MemberInfo, bool>? predicate = null; 88private M[]? QuerySpecificMemberTypeIfRequested<M>(MemberTypes memberType, string? optionalName, BindingFlags bindingAttr, Func<MemberInfo, bool>? optionalPredicate, MemberTypes targetMemberType, out QueryResult<M> queryResult) where M : MemberInfo
System.Resources.Writer (1)
System\Resources\ResourceWriter.core.cs (1)
20public Func<Type, string>? TypeNameConverter { get; set; }
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
201[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<,>))]
System.Runtime.InteropServices.JavaScript (2)
artifacts\obj\System.Runtime.InteropServices.JavaScript\Debug\net10.0\System.Runtime.InteropServices.JavaScript.notsupported.cs (2)
292public void ToManaged<T, TResult>(out Func<T, TResult>? value, ArgumentToJSCallback<T> arg1Marshaler, ArgumentToManagedCallback<TResult> resMarshaler) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 293public void ToJS<T, TResult>(Func<T, TResult>? value, ArgumentToManagedCallback<T> arg1Marshaler, ArgumentToJSCallback<TResult> resMarshaler) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); }
System.Security.Claims (2)
System\Security\Claims\ClaimsPrincipal.cs (2)
30private static Func<IEnumerable<ClaimsIdentity>, ClaimsIdentity?> s_identitySelector = SelectPrimaryIdentity; 75public static Func<IEnumerable<ClaimsIdentity>, ClaimsIdentity?> PrimaryIdentitySelector
System.Security.Cryptography (11)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
52Func<TExteriorHandle, TInteriorHandle> accessor,
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (2)
319private T ExportPublicKey<T>(Func<ReadOnlyMemory<byte>, T> exporter) 337Func<ReadOnlyMemory<byte>, ReadOnlyMemory<byte>>? transform,
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (1)
911private T UseCertInteriorData<T>(Func<SafeX509Handle, T> callback)
System\Security\Cryptography\X509Certificates\OpenSslX509ChainEventSource.cs (2)
616internal void RawElementStatus(int chainDepth, object errorCollection, Func<object, string> toString) 635internal void FinalElementStatus(int chainDepth, object errorCollection, Func<object, string> toString)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (3)
1691Func<ReadOnlySpan<char>, TAlg> factory, 1692Func<TAlg, X509Certificate2> import) where TAlg : IDisposable 1724Func<TAlg, X509Certificate2> import) where TAlg : IDisposable
System\Security\Cryptography\XmlKeyHelper.cs (2)
263private static readonly Func<string, object> s_xDocumentCreate; 278.CreateDelegate<Func<string, object>>();
System.Security.Cryptography.Xml (3)
System\Security\Cryptography\Xml\SignedXml.cs (2)
33private Func<SignedXml, bool> _signatureFormatValidator = DefaultSignatureFormatValidator; 158public Func<SignedXml, bool> SignatureFormatValidator
System\Security\Cryptography\Xml\SignedXmlDebugLog.cs (1)
314internal static void LogBeginCheckSignatureFormat(SignedXml signedXml, Func<SignedXml, bool> formatValidator)
System.ServiceModel.Federation (2)
System\Runtime\OperationWithTimeoutAsyncResult.cs (2)
63private Func<IAsyncResult, bool> _checkSyncValidationFunc; 263protected void SetCheckSyncValidationFunc(Func<IAsyncResult, bool> checkSyncValidationFunc)
System.Text.Json (76)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
55internal static void StableSortByKey<T, TKey>(this List<T> items, Func<T, TKey> keySelector) 91public static T[] TraverseGraphWithTopologicalSort<T>(T entryNode, Func<T, ICollection<T>> getChildren, IEqualityComparer<T>? comparer = null)
System\Text\Json\Nodes\JsonArray.IList.cs (1)
125public int RemoveAll(Func<JsonNode?, bool> match)
System\Text\Json\Serialization\Converters\Collection\ImmutableDictionaryOfTKeyTValueConverter.cs (2)
31Func<IEnumerable<KeyValuePair<TKey, TValue>>, TDictionary>? creator = 32(Func<IEnumerable<KeyValuePair<TKey, TValue>>, TDictionary>?)state.Current.JsonTypeInfo.CreateObjectWithArgs;
System\Text\Json\Serialization\Converters\Collection\ImmutableEnumerableOfTConverter.cs (2)
32Func<IEnumerable<TElement>, TCollection>? creator = (Func<IEnumerable<TElement>, TCollection>?)typeInfo.CreateObjectWithArgs;
System\Text\Json\Serialization\Converters\FSharp\FSharpListConverter.cs (1)
14private readonly Func<IEnumerable<TElement>, TList> _listConstructor;
System\Text\Json\Serialization\Converters\FSharp\FSharpMapConverter.cs (1)
15private readonly Func<IEnumerable<Tuple<TKey, TValue>>, TMap> _mapConstructor;
System\Text\Json\Serialization\Converters\FSharp\FSharpOptionConverter.cs (2)
20private readonly Func<TOption, TElement> _optionValueGetter; 21private readonly Func<TElement?, TOption> _optionConstructor;
System\Text\Json\Serialization\Converters\FSharp\FSharpSetConverter.cs (1)
14private readonly Func<IEnumerable<TElement>, TSet> _setConstructor;
System\Text\Json\Serialization\Converters\FSharp\FSharpValueOptionConverter.cs (1)
21private readonly Func<TElement?, TValueOption> _optionConstructor;
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Large.cs (2)
44Func<object[], T> createObject = (Func<object[], T>)frame.JsonTypeInfo.CreateObjectWithArgs;
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\JsonMetadataServices.Collections.cs (2)
83Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection> createRangeFunc) 149Func<IEnumerable<TElement>, TCollection> createRangeFunc)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (1)
131internal static void PopulateProperties(JsonTypeInfo typeInfo, JsonTypeInfo.JsonPropertyInfoList propertyList, Func<JsonSerializerContext, JsonPropertyInfo[]> propInitFunc)
System\Text\Json\Serialization\Metadata\JsonObjectInfoValuesOfT.cs (2)
27public Func<object[], T>? ObjectWithParameterizedConstructorCreator { get; init; } 33public Func<JsonSerializerContext, JsonPropertyInfo[]>? PropertyMetadataInitializer { get; init; }
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (2)
69public Func<object, object?>? Get 99private protected Func<object, object?>? _untypedGet;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (8)
16private Func<object, T>? _typedGet; 24internal new Func<object, T>? Get 38Debug.Assert(getter is null or Func<object, object?> or Func<object, T>); 46else if (getter is Func<object, T> typedGetter) 49_untypedGet = getter is Func<object, object?> untypedGet ? untypedGet : obj => typedGetter(obj); 53Func<object, object?> untypedGet = (Func<object, object?>)getter;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs (1)
49public Func<object, T?>? Getter { get; init; }
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (2)
273internal Func<JsonSerializerContext, JsonPropertyInfo[]>? SourceGenDelayedPropertyInitializer 284private Func<JsonSerializerContext, JsonPropertyInfo[]>? _sourceGenDelayedPropertyInitializer;
System\Text\Json\Serialization\Metadata\MemberAccessor.cs (5)
14public abstract Func<object[], T> CreateParameterizedConstructor<T>(ConstructorInfo constructor); 20public abstract Func<IEnumerable<TElement>, TCollection> CreateImmutableEnumerableCreateRangeDelegate<TCollection, TElement>(); 22public abstract Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection> CreateImmutableDictionaryCreateRangeDelegate<TCollection, TKey, TValue>(); 24public abstract Func<object, TProperty> CreatePropertyGetter<TProperty>(PropertyInfo propertyInfo); 28public abstract Func<object, TProperty> CreateFieldGetter<TProperty>(FieldInfo fieldInfo);
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.Cache.cs (2)
29public TValue GetOrAdd<TValue>(TKey key, Func<TKey, TValue> valueFactory) where TValue : class? 34static (TKey key, Func<TKey, TValue> valueFactory) => new(valueFactory(key)),
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.cs (5)
36public override Func<object, TProperty> CreateFieldGetter<TProperty>(FieldInfo fieldInfo) => 46public override Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection> CreateImmutableDictionaryCreateRangeDelegate<TCollection, TKey, TValue>() => 51public override Func<IEnumerable<TElement>, TCollection> CreateImmutableEnumerableCreateRangeDelegate<TCollection, TElement>() => 56public override Func<object[], T> CreateParameterizedConstructor<T>(ConstructorInfo constructor) => 66public override Func<object, TProperty> CreatePropertyGetter<TProperty>(PropertyInfo propertyInfo) =>
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)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
55internal static void StableSortByKey<T, TKey>(this List<T> items, Func<T, TKey> keySelector) 91public static T[] TraverseGraphWithTopologicalSort<T>(T entryNode, Func<T, ICollection<T>> getChildren, IEqualityComparer<T>? comparer = null)
System.Text.RegularExpressions (1)
System\Threading\StackHelper.cs (1)
131public static TResult CallOnEmptyStack<TArg1, TResult>(Func<TArg1, TResult> func, TArg1 arg1) =>
System.Text.RegularExpressions.Generator (1)
src\libraries\System.Text.RegularExpressions\src\System\Threading\StackHelper.cs (1)
131public static TResult CallOnEmptyStack<TArg1, TResult>(Func<TArg1, TResult> func, TArg1 arg1) =>
System.Threading.RateLimiting (14)
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (3)
15private readonly Func<TResource, RateLimitPartition<TKey>> _partitioner; 35public DefaultPartitionedRateLimiter(Func<TResource, RateLimitPartition<TKey>> partitioner, 42private DefaultPartitionedRateLimiter(Func<TResource, RateLimitPartition<TKey>> partitioner,
System\Threading\RateLimiting\PartitionedRateLimiter.cs (1)
27Func<TResource, RateLimitPartition<TPartitionKey>> partitioner,
System\Threading\RateLimiting\PartitionedRateLimiter.T.cs (1)
135public PartitionedRateLimiter<TOuter> WithTranslatedKey<TOuter>(Func<TOuter, TResource> keyAdapter, bool leaveOpen)
System\Threading\RateLimiting\RateLimitPartition.cs (5)
23Func<TKey, RateLimiter> factory) 37Func<TKey, ConcurrencyLimiterOptions> factory) 66Func<TKey, TokenBucketRateLimiterOptions> factory) 100Func<TKey, SlidingWindowRateLimiterOptions> factory) 134Func<TKey, FixedWindowRateLimiterOptions> factory)
System\Threading\RateLimiting\RateLimitPartition.T.cs (2)
17public RateLimitPartition(TKey partitionKey, Func<TKey, RateLimiter> factory) 31public Func<TKey, RateLimiter> Factory { get; }
System\Threading\RateLimiting\TranslatingLimiter.cs (2)
11private readonly Func<TResource, TInner> _keyAdapter; 16public TranslatingLimiter(PartitionedRateLimiter<TInner> inner, Func<TResource, TInner> keyAdapter, bool leaveOpen)
System.Threading.Tasks.Dataflow (40)
Base\DataflowBlock.cs (2)
2067internal static readonly Func<object?, int> s_processBranchFunction = state => 2378Target = new ActionBlock<TOutput>((Func<TOutput, Task>)ProcessItemAsync, DataflowBlock._nonGreedyExecutionOptions);
Blocks\ActionBlock.cs (7)
48/// <summary>Initializes the <see cref="ActionBlock{T}"/> with the specified <see cref="System.Func{T,Task}"/>.</summary> 51public ActionBlock(Func<TInput, Task> action) : 55/// <summary>Initializes the <see cref="ActionBlock{T}"/> with the specified <see cref="System.Func{T,Task}"/> and <see cref="ExecutionDataflowBlockOptions"/>.</summary> 60public ActionBlock(Func<TInput, Task> action, ExecutionDataflowBlockOptions dataflowBlockOptions) : 105var asyncAction = action as Func<TInput, Task>; 151private void ProcessMessageWithTask(Func<TInput, Task> action, KeyValuePair<TInput, long> messageWithId)
Blocks\BroadcastBlock.cs (4)
54public BroadcastBlock(Func<T, T>? cloningFunction) : 65public BroadcastBlock(Func<T, T>? cloningFunction, DataflowBlockOptions dataflowBlockOptions) 515private readonly Func<TOutput, TOutput>? _cloningFunction; 543Func<TOutput, TOutput>? cloningFunction,
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)
Blocks\TransformManyBlock.IAsyncEnumerable.cs (3)
18public TransformManyBlock(Func<TInput, IAsyncEnumerable<TOutput>> transform) : 30public TransformManyBlock(Func<TInput, IAsyncEnumerable<TOutput>> transform, ExecutionDataflowBlockOptions dataflowBlockOptions) 54private async Task ProcessMessageAsync(Func<TInput, IAsyncEnumerable<TOutput>> transformFunction, KeyValuePair<TInput, long> messageWithId)
Blocks\WriteOnceBlock.cs (3)
30private readonly Func<T, T>? _cloningFunction; 52public WriteOnceBlock(Func<T, T>? cloningFunction) : 63public WriteOnceBlock(Func<T, T>? cloningFunction, DataflowBlockOptions dataflowBlockOptions)
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\Ribbon.cs (2)
2065Func<T, int> getFocusedItemIndex, 2157Func<T, int> getFocusedItemIndex) where T : Control
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)
misc\MultitargetUtil.cs (1)
15public static string? GetAssemblyQualifiedName(Type type, Func<Type, string>? typeNameConverter)
System\Resources\ResXDataNode.cs (4)
47private Func<Type?, string>? _typeNameConverter; 76public ResXDataNode(string name, object? value, Func<Type?, string>? typeNameConverter) 105public ResXDataNode(string name, ResXFileRef fileRef, Func<Type?, string>? typeNameConverter) 291Func<Type?, string>? typeNameConverter)
System\Resources\ResXResourceWriter.cs (4)
95private readonly Func<Type?, string>? _typeNameConverter; // no public property to be consistent with ResXDataNode class. 108public ResXResourceWriter(string fileName, Func<Type?, string> typeNameConverter) 119public ResXResourceWriter(Stream stream, Func<Type?, string> typeNameConverter) 131public ResXResourceWriter(TextWriter textWriter, Func<Type?, string> typeNameConverter)
System\Resources\ResXSerializationBinder.cs (3)
22private readonly Func<Type?, string>? _typeNameConverter; 32/// constructors on <see cref="ResXDataNode"/> such as <see cref="ResXDataNode(string, object?, Func{Type?, string}?)"/> 34internal ResXSerializationBinder(Func<Type?, string>? typeNameConverter) => _typeNameConverter = typeNameConverter;
System\Windows\Forms\Control_InvokeAsync.cs (6)
26/// <see cref="InvokeAsync(Func{CancellationToken, ValueTask}, CancellationToken)"/> or 27/// <see cref="InvokeAsync{T}(Func{CancellationToken, ValueTask{T}}, CancellationToken)"/>. 92/// <see cref="InvokeAsync(Func{CancellationToken, ValueTask}, CancellationToken)"/> or 93/// <see cref="InvokeAsync{T}(Func{CancellationToken, ValueTask{T}}, CancellationToken)"/>. 161public async Task InvokeAsync(Func<CancellationToken, ValueTask> callback, CancellationToken cancellationToken = default) 225public async Task<T> InvokeAsync<T>(Func<CancellationToken, ValueTask<T>> callback, CancellationToken cancellationToken = default)
System\Windows\Forms\OLE\Clipboard.cs (4)
164/// A <see cref="Func{Type, TypeName}"/> that is used only when deserializing non-OLE formats. It returns the type if 307Func<TypeName, Type?> resolver, 325/// You must use the <see cref="TryGetData{T}(string, Func{TypeName, Type?}, out T)"/> with an explicit resolver. 339/// <inheritdoc cref="TryGetData{T}(string, Func{TypeName, Type}, out T)"/>
System\Windows\Forms\OLE\DataObject.cs (5)
150/// <inheritdoc cref="Clipboard.TryGetData{T}(string, Func{TypeName, Type}, out T)"/> 154Func<TypeName, Type?> resolver, 183/// <inheritdoc cref="ITypedDataObject.TryGetData{T}(string, Func{TypeName, Type}, bool, out T)" /> 187Func<TypeName, Type?>? resolver, 264Func<TypeName, Type?>? resolver,
System\Windows\Forms\OLE\DataObjectAdapter.cs (1)
41Func<TypeName, Type?> resolver,
System\Windows\Forms\OLE\DataObjectExtensions.cs (2)
52/// <inheritdoc cref="ITypedDataObject.TryGetData{T}(string, Func{Reflection.Metadata.TypeName, Type}, bool, out T)"/> 59Func<Reflection.Metadata.TypeName, Type?> resolver,
System\Windows\Forms\OLE\ITypedDataObject.cs (2)
39/// <inheritdoc cref="IDataObjectInternal.TryGetData{T}(string, Func{TypeName, Type}, bool, out T)" /> 43Func<TypeName, Type?> resolver,
System.Windows.Forms.Primitives.TestUtilities (1)
Extensions\SpanExtensions.cs (1)
8public static T2[] Transform<T1, T2>(this ReadOnlySpan<T1> span, Func<T1, T2> transform)
System.Windows.Forms.Tests (42)
System\Resources\ResXResourceWriterTests.cs (1)
18private readonly Func<Type, string> _typeNameConverter = type => type?.AssemblyQualifiedName ?? string.Empty;
System\Windows\Forms\ControlTests.Methods.cs (7)
5467public Func<char, bool> IsInputCharAction { get; set; } 5471public Func<Keys, bool> IsInputKeyAction { get; set; } 5482public Func<char, bool> ProcessDialogCharAction { get; set; } 5486public Func<Keys, bool> ProcessDialogKeyAction { get; set; } 5490public Func<Message, bool> ProcessKeyPreviewAction { get; set; } 5947public Func<Message, bool> ProcessKeyEventArgsAction { get; set; } 14154public Func<Control, bool> ActivateControlAction { get; set; }
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (5)
1826public Func<Message, bool> ProcessKeyEventArgsAction { get; set; } 2083public Func<char, bool> ProcessDialogCharAction { get; set; } 2087public Func<Keys, bool> ProcessDialogKeyAction { get; set; } 2091public Func<Message, bool> ProcessKeyPreviewAction { get; set; } 2098public Func<DataGridViewDataErrorContexts, object> GetEditingControlFormattedValueAction { get; set; }
System\Windows\Forms\DataObjectExtensionsTests.cs (1)
252public bool TryGetData<T>(string format, Func<TypeName, Type?> resolver, bool autoConvert, [MaybeNullWhen(false), NotNullWhen(true)] out T data)
System\Windows\Forms\DataObjectTests.cs (3)
377private readonly Func<TypeName, Type>? _resolver; 381public DataObjectOverridesTryGetDataCore(string format, Func<TypeName, Type>? resolver, bool autoConvert) : base() 393Func<TypeName, Type?>? resolver,
System\Windows\Forms\FileDialogTests.cs (1)
840public Func<OPENFILENAME, bool> RunFileDialogAction { get; set; }
System\Windows\Forms\MenuStripTests.cs (1)
831public Func<char, bool> ProcessDialogCharAction { get; set; }
System\Windows\Forms\Mocks\DataBinding\RelayCommand.cs (2)
15private readonly Func<object?, bool>? _canExecute; 33public RelayCommand(Action<object?> execute, Func<object?, bool>? canExecute)
System\Windows\Forms\MonthCalendarTests.cs (2)
4576private void TestResetColorProperty(Func<MonthCalendar, Color> getColor, Action<MonthCalendar, Color> setColor, Action<dynamic> resetColor) 4625private void TestResetProperty<T>(MonthCalendar calendar, Action<MonthCalendar, T> setProperty, Func<MonthCalendar, T> getProperty, T testValue, T expectedValue, Action<dynamic> resetProperty)
System\Windows\Forms\Ole\BinaryFormatUtilitiesTests.cs (1)
19Func<TypeName, Type>? resolver,
System\Windows\Forms\ProfessionalColorTableTests.cs (5)
24static Func<ProfessionalColorTable, T> I<T>(Func<ProfessionalColorTable, T> t) => t; 85public void ProfessionalColorTable_Properties_Get_ReturnsExpected(Func<ProfessionalColorTable, Color> factory) 94public void ProfessionalColorTable_Properties_GetUseSystemColors_ReturnsExpected(Func<ProfessionalColorTable, Color> factory) 106public void ProfessionalColorTable_Properties_GetToolStripManagerVisualStylesEnabled_ReturnsExpected(Func<ProfessionalColorTable, Color> factory)
System\Windows\Forms\TextRendererTests.cs (2)
573public unsafe void TextRenderer_DrawText_DefaultBackground_RendersTransparent(Func<IDeviceContext, Action> func) 589public static TheoryData<Func<IDeviceContext, Action>> TextRenderer_DrawText_DefaultBackground_RendersTransparent_TestData
System\Windows\Forms\ToolStripControlHostTests.cs (2)
4378public Func<Keys, bool> ProcessDialogKeyAction { get; set; } 4382public Func<char, bool> ProcessMnemonicAction { get; set; }
System\Windows\Forms\ToolStripTests.cs (1)
7445public Func<char, bool> ProcessDialogCharAction { get; set; }
TestAccessorTests.cs (4)
123Assert.Equal(4, accessor.CreateDelegate<Func<int, int>>("ToStringLength")(2001)); 124Assert.Equal(7, accessor.CreateDelegate<Func<string, int>>("ToStringLength")("Flubber")); 149Assert.Equal(2000, testClass.TestAccessor().CreateDelegate<Func<int, int>>("AddOne")(1999)); 152Assert.Equal(21, typeof(PrivateStaticTestClass).TestAccessor().CreateDelegate<Func<int, int>>("AddOne")(20));
TextBoxBaseTests.cs (1)
5933public Func<Keys, bool> ProcessDialogKeyAction { get; set; }
WebBrowserBaseTests.cs (3)
867public Func<char, bool> ProcessDialogCharAction { get; set; } 871public Func<Keys, bool> ProcessDialogKeyAction { get; set; } 875public Func<Message, bool> ProcessKeyPreviewAction { get; set; }
System.Windows.Forms.TestUtilities (9)
AnchorLayoutV2Scope.cs (1)
38.CreateDelegate<Func<string, bool>>("GetSwitchDefaultValue")(WinFormsAppContextSwitchNames.AnchorLayoutV2);
ApplyParentFontToMenusScope.cs (1)
38.CreateDelegate<Func<string, bool>>("GetSwitchDefaultValue")(WinFormsAppContextSwitchNames.ApplyParentFontToMenus);
Data\TypedAndRuntimeDataObject.cs (1)
32Func<TypeName, Type?> resolver,
Data\TypedDataObject.cs (1)
31Func<TypeName, Type?> resolver,
DataGridViewUIAStartRowCountAtZeroScope.cs (1)
37.CreateDelegate<Func<string, bool>>("GetSwitchDefaultValue")(WinFormsAppContextSwitchNames.DataGridViewUIAStartRowCountAtZero);
NoClientNotificationsScope.cs (1)
38.CreateDelegate<Func<string, bool>>("GetSwitchDefaultValue")(WinFormsAppContextSwitchNames.NoClientNotifications);
ScaleTopLevelFormMinMaxSizeForDpiScope.cs (1)
38.CreateDelegate<Func<string, bool>>("GetSwitchDefaultValue")(WinFormsAppContextSwitchNames.ScaleTopLevelFormMinMaxSizeForDpi);
ServicePointManagerCheckCrlScope.cs (1)
38.CreateDelegate<Func<string, bool>>("GetSwitchDefaultValue")(WinFormsAppContextSwitchNames.ServicePointManagerCheckCrl);
TreeNodeCollectionAddRangeRespectsSortOrderScope.cs (1)
38.CreateDelegate<Func<string, bool>>("GetSwitchDefaultValue")(WinFormsAppContextSwitchNames.TreeNodeCollectionAddRangeRespectsSortOrder);
System.Windows.Forms.UI.IntegrationTests (5)
ApplicationTests.cs (1)
40private async Task RunTestAsync(Func<Form, Task> runTest)
DragDropTests.cs (1)
586private async Task RunTestAsync(Func<DragImageDropDescriptionForm, Task> runTest)
FormTests.cs (1)
142private async Task RunEmptyFormTestAsync(Func<Form, Task> testDriverAsync)
Infra\ControlTestBase.cs (1)
346protected async Task RunFormWithoutControlAsync<TForm>(Func<TForm> createForm, Func<TForm, Task> testDriverAsync)
MDITests.cs (1)
61private async Task RunTestAsync(Func<Form, Task> runTest)
System.Xaml (15)
System\Xaml\Context\XamlContext.cs (2)
16private Func<string, string> _resolvePrefixCachedDelegate; 294internal Func<string, string> ResolvePrefixCachedDelegate
System\Xaml\Context\XamlParserContext.cs (1)
19public Func<string, string> XmlNamespaceResolver { get; set; }
System\Xaml\InfosetObjects\XamlXmlReader.cs (1)
231Func<string, string> namespaceResolver = myXmlReader.LookupNamespace;
System\Xaml\Parser\GenericTypeNameParser.cs (3)
29private Func<string, string> _prefixResolver; 32public GenericTypeNameParser(Func<string, string> prefixResolver) 37public static XamlTypeName ParseIfTrivalName(string text, Func<string, string> prefixResolver, out string error)
System\Xaml\Parser\NamespacePrefixLookup.cs (2)
13private readonly Func<string, string> _nsResolver; 14public NamespacePrefixLookup(out IEnumerable<NamespaceDeclaration> newNamespaces, Func<string, string> nsResolver)
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)
Common\Optional.cs (1)
16public readonly T Or<TArg>(Func<TArg, T> valueFactory, TArg arg) => HasValue ? Value : valueFactory(arg);
System\Windows\Markup\NameReferenceConverterTests.cs (3)
203public Func<Type, object>? GetServiceAction { get; set; } 219public Func<string, object>? ResolveAction { get; set; } 254public Func<object, string>? GetNameAction { get; set; }
System\Windows\Markup\ReferenceTests.cs (2)
97public Func<Type, object>? ServiceAction { get; set; } 108public Func<string, object>? ResolveAction { get; set; }
System\Windows\Markup\StaticExtensionTests.cs (2)
248public Func<Type, object>? ServiceAction { get; set; } 256public Func<string, Type>? ResolveAction { get; set; }
System\Windows\Markup\TypeExtensionTests.cs (2)
209public Func<Type, object>? ServiceAction { get; set; } 217public Func<string, Type>? ResolveAction { get; set; }
System\Xaml\Replacements\EventConverterTests.cs (1)
200public Func<Type, object?>? GetServiceAction { get; set; }
System\Xaml\Replacements\TypeListConverterTests.cs (1)
92public Func<Type, object?>? GetServiceAction { get; set; }
System\Xaml\Replacements\TypeTypeConverterTests.cs (4)
290public Func<Type, object?>? GetServiceAction { get; set; } 316public Func<string, string>? LookupPrefixAction { get; set; } 331public Func<string, Type>? ResolveAction { get; set; } 346public Func<Type, XamlType>? GetXamlTypeAction { get; set; }
System\Xaml\Schema\XamlTypeNameTests.cs (2)
485public Func<string, string>? LookupPrefixAction { get; set; } 500public Func<string, string>? GetNamespaceAction { get; set; }
System\Xaml\Schema\XamlTypeTypeConverterTests.cs (3)
288public Func<Type, object?>? GetServiceAction { get; set; } 307public Func<string, string>? LookupPrefixAction { get; set; } 322public Func<string, string>? GetNamespaceAction { get; set; }
System\Xaml\XamlSchemaContextTests.cs (1)
1026public Func<Type, XamlType>? GetXamlTypeAction { get; set; }
System\Xaml\XamlTypeTests.cs (1)
5290public Func<Type, XamlType>? GetXamlTypeAction { get; set; }
Templates.Blazor.Tests (1)
BlazorTemplateTest.cs (1)
29Func<Project, Project> getTargetProject = null,
Test.Utilities (37)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (2)
116private readonly Func<INamedTypeSymbol, bool> _isDisallowedCatchType; 122public DisallowGeneralCatchUnlessRethrowWalker(Func<INamedTypeSymbol, bool> isDisallowedCatchType, bool checkAnonymousFunctions)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
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\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
20private static readonly Func<IOperation, ImmutableArray<IOperation>> ElementsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Elements), fallbackResult: default);
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\IUtf8StringOperationWrapper.cs (1)
19private static readonly Func<IOperation, string> ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, string>(WrappedType, nameof(Value), fallbackResult: null!);
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\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
458Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, 473static bool TryParse(string s, (Compilation compilation, Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, string? namePrefix, string? optionForcedValue) arg, out SymbolNamesWithValueOption<TValue> option)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
TestProject.IntegrationServiceA (1)
ResilienceUtils.cs (1)
11public static ResiliencePipelineBuilder GetDefaultResiliencePipelineBuilder<TException>(Func<OnRetryArguments<object>, ValueTask> onRetry, int overallTimeoutSecs = 90) where TException : Exception
Text.Analyzers (41)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
29public TValue GetOrCreateValue(TKey key, Func<TKey, TValue> valueFactory)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132private static int CalculateDepthOfInheritance(INamedTypeSymbol namedType, Func<INamedTypeSymbol, bool> isExcludedFromInheritanceCount)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (3)
17private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 20Func<INamedTypeSymbol, bool>? isExcludedFromInheritanceCountFunc = null) 34public Func<INamedTypeSymbol, bool> IsExcludedFromInheritanceCountFunc { get; }
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (2)
116private readonly Func<INamedTypeSymbol, bool> _isDisallowedCatchType; 122public DisallowGeneralCatchUnlessRethrowWalker(Func<INamedTypeSymbol, bool> isDisallowedCatchType, bool checkAnonymousFunctions)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (3)
61private static readonly Func<object?, bool> s_notNullTest = x => x != null; 70return source.Where((Func<T?, bool>)s_notNullTest)!; 73public static ImmutableArray<TSource> WhereAsArray<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> selector)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
20private static readonly Func<INamedTypeSymbol, bool> s_isFileLocal = LightupHelpers.CreateSymbolPropertyAccessor<INamedTypeSymbol, bool>(typeof(INamedTypeSymbol), nameof(IsFileLocal), fallbackResult: false);
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\Extensions\ITypeSymbolExtensions.cs (1)
71public static IEnumerable<INamedTypeSymbol> GetBaseTypes(this ITypeSymbol type, Func<INamedTypeSymbol, bool>? takeWhilePredicate = null)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\SourceTextExtensions.cs (1)
25public static T Parse<T>(this SourceText text, Func<StreamReader, T> parser)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\ICollectionExpressionOperationWrapper.cs (1)
20private static readonly Func<IOperation, ImmutableArray<IOperation>> ElementsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Elements), fallbackResult: default);
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\IUtf8StringOperationWrapper.cs (1)
19private static readonly Func<IOperation, string> ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, string>(WrappedType, nameof(Value), fallbackResult: null!);
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\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
458Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, 473static bool TryParse(string s, (Compilation compilation, Func<string, SymbolNamesWithValueOption<TValue>.NameParts> getTypeAndSuffixFunc, string? namePrefix, string? optionForcedValue) arg, out SymbolNamesWithValueOption<TValue> option)
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (1)
82Func<string, NameParts> getSymbolNamePartsFunc)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
388internal Dictionary<K, ImmutableArray<T>> ToDictionary<K>(Func<T, K> keySelector, IEqualityComparer<K>? comparer = null) 516public ImmutableArray<S> SelectDistinct<S>(Func<T, S> selector)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (2)
49Func<KeyValuePair<K, V>, TKey> keySelector, Func<KeyValuePair<K, V>, TValue> elementSelector, IEqualityComparer<TKey> comparer)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
201internal bool IsTaskOfType([NotNullWhen(returnValue: true)] ITypeSymbol? typeSymbol, Func<ITypeSymbol, bool> typeArgumentPredicate)
UnitTests.Common (1)
MockRequestChannel.cs (1)
20public Func<IAsyncResult, Message> EndRequestOverride { get; set; }
vbc (2)
src\Compilers\Core\CommandLine\ConsoleUtil.cs (2)
20internal static T RunWithUtf8Output<T>(Func<TextWriter, T> func) 41internal static T RunWithUtf8Output<T>(bool utf8Output, TextWriter textWriter, Func<TextWriter, T> func)
VBCSCompiler (2)
src\Compilers\Core\CommandLine\ConsoleUtil.cs (2)
20internal static T RunWithUtf8Output<T>(Func<TextWriter, T> func) 41internal static T RunWithUtf8Output<T>(bool utf8Output, TextWriter textWriter, Func<TextWriter, T> func)
VBCSCompiler.UnitTests (2)
CompilerServerTests.cs (1)
149private static (T Result, string Output) UseTextWriter<T>(Encoding encoding, Func<TextWriter, T> func)
TestableClientConnection.cs (1)
22public Func<CancellationToken, Task<BuildRequest>> ReadBuildRequestFunc = delegate { throw new Exception(); };
WindowsBase.Tests (1)
System\Windows\FreezableTests.cs (1)
7290public Func<bool, bool>? FreezeCoreAction { get; set; }
WsFedSample (1)
Startup.cs (1)
129private static async Task WriteHtmlAsync(HttpResponse response, Func<HttpResponse, Task> writeContent)
xunit.assert (11)
AsyncCollectionAsserts.cs (2)
63 Func<T, Task> action) => 102 params Func<T, Task>[] elementInspectors) =>
CollectionAsserts.cs (2)
104 Func<T, Task> action) 199 params Func<T, Task>[] elementInspectors)
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;
Sdk\Exceptions\AllException.cs (1)
35 /// <see cref="Assert.AllAsync{T}(IEnumerable{T}, Func{T, Task})"/>,
xunit.console (5)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (3)
158public Assembly LoadManagedDll(string assemblyName, Func<string, Assembly> managedAssemblyLoader) 179public IntPtr LoadUnmanagedLibrary(string unmanagedLibraryName, Func<string, IntPtr> unmanagedAssemblyLoader) 208Tuple<string, Assembly> ResolveManagedAssembly(string assemblyName, Func<string, Assembly> managedAssemblyLoader)
common\DictionaryExtensions.cs (2)
35Func<TInput, TKey> keySelector, 36Func<TInput, TValue> valueSelector,