2729 references to Func
Aspire.Cli.Tests (4)
TestServices\TestAppHostBackchannel.cs (1)
24public Func<string, CancellationToken, Task>? ConnectAsyncCallback { get; set; }
TestServices\TestDotNetCliRunner.cs (2)
14public Func<DotNetCliRunnerInvocationOptions, CancellationToken, int>? CheckHttpCertificateAsyncCallback { get; set; } 21public Func<DotNetCliRunnerInvocationOptions, CancellationToken, int>? TrustHttpCertificateAsyncCallback { get; set; }
TestServices\TestProjectLocator.cs (1)
10public Func<FileInfo?, CancellationToken, Task<FileInfo?>>? UseOrFindAppHostProjectFileAsyncCallback { get; set; }
Aspire.Dashboard (16)
Model\MetricsHelpers.cs (1)
20Func<string, string, OtlpSpan?> getSpan,
Model\Otlp\TelemetryFilter.cs (8)
58private static Func<string?, string, bool> ConditionToFuncString(FilterCondition c) => 72private static Func<DateTime, DateTime, bool> ConditionToFuncDate(FilterCondition c) => 86private static Func<double, double, bool> ConditionToFuncNumber(FilterCondition c) => 107var func = ConditionToFuncDate(Condition); 114var func = ConditionToFuncNumber(Condition); 121var func = ConditionToFuncString(Condition); 126var func = ConditionToFuncString(Condition); 165var func = ConditionToFuncString(condition);
Model\ResourceMenuItems.cs (1)
33Func<ResourceViewModel, CommandViewModel, bool> isCommandExecuting,
Model\TraceHelpers.cs (2)
13public static void VisitSpans<TState>(OtlpTrace trace, Func<OtlpSpan, TState, TState> spanAction, TState state) 28static void Visit(OtlpSpanCollection allSpans, OtlpSpan span, Func<OtlpSpan, TState, TState> spanAction, TState state, Func<OtlpSpan, DateTime> orderByFunc)
Telemetry\DashboardTelemetrySender.cs (3)
18private readonly Channel<(OperationContext, Func<HttpClient, Func<OperationContextProperty, object>, Task>)> _channel; 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);
Aspire.Dashboard.Components.Tests (5)
tests\Shared\Logging\TestLogger.cs (1)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (1)
30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (1)
16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (1)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\TestDashboardTelemetrySender.cs (1)
21public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc)
Aspire.Dashboard.Tests (7)
Telemetry\DashboardTelemetrySenderTests.cs (2)
151private readonly Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> _value; 153public TestHttpMessageHandler(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> value)
tests\Shared\Logging\TestLogger.cs (1)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (1)
30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (1)
16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (1)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\TestDashboardTelemetrySender.cs (1)
21public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc)
Aspire.Hosting (18)
ApplicationModel\ResourceLoggerService.cs (2)
117public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 577public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
ContainerResourceBuilderExtensions.cs (1)
817public static IResourceBuilder<T> WithContainerFiles<T>(this IResourceBuilder<T> builder, string destinationPath, Func<ContainerFileSystemCallbackContext, CancellationToken, Task<IEnumerable<ContainerFileSystemItem>>> callback, int? defaultOwner = null, int? defaultGroup = null, UnixFileMode? umask = null) where T : ContainerResource
Dcp\DcpExecutor.cs (2)
287async Task WatchKubernetesResourceAsync<T>(Func<WatchEventType, T, Task> handler) where T : CustomResource 325private async Task ProcessResourceChange<T>(WatchEventType watchEventType, T resource, ConcurrentDictionary<string, T> resourceByName, string resourceKind, Func<T, CustomResourceSnapshot, CustomResourceSnapshot> snapshotFactory) where T : CustomResource
Dcp\KubernetesService.cs (1)
247var innerWatchFactory = ((WatchEventType, T)? lastValue, CancellationToken restartCancellationToken) =>
Eventing\DistributedApplicationEventing.cs (5)
76/// <inheritdoc cref="IDistributedApplicationEventing.Subscribe{T}(Func{T, CancellationToken, Task})" /> 77public DistributedApplicationEventSubscription Subscribe<T>(Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationEvent 105/// <inheritdoc cref="IDistributedApplicationEventing.Subscribe{T}(Func{T, CancellationToken, Task})" /> 106public DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent 108var resourceFilteredCallback = async (T @event, CancellationToken cancellationToken) =>
Eventing\DistributedApplicationEventSubscription.cs (3)
12public class DistributedApplicationEventSubscription(Func<IDistributedApplicationEvent, CancellationToken, Task> callback) 17public Func<IDistributedApplicationEvent, CancellationToken, Task> Callback { get; } = callback; 23public class DistributedApplicationResourceEventSubscription(IResource? resource, Func<IDistributedApplicationResourceEvent, CancellationToken, Task> callback)
Eventing\IDistributedApplicationEventing.cs (2)
19DistributedApplicationEventSubscription Subscribe<T>(Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationEvent; 28DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent;
Utils\PeriodicRestartAsyncEnumerable.cs (2)
20public static async IAsyncEnumerable<T> CreateAsync<T>(Func<T?, CancellationToken, Task<IAsyncEnumerable<T>>> enumerableFactory, TimeSpan restartInterval, [EnumeratorCancellation] CancellationToken cancellationToken) where T : struct 76public static async IAsyncEnumerable<T> CreateAsync<T>(Func<T?, CancellationToken, Task<IAsyncEnumerable<T>>> enumerableFactory, TimeSpan restartInterval, [EnumeratorCancellation] CancellationToken cancellationToken) where T : class?
Aspire.Hosting.Azure (2)
AzureProvisioningResource.cs (1)
121public static T CreateExistingOrNewProvisionableResource<T>(AzureResourceInfrastructure infrastructure, Func<string, BicepValue<string>, T> createExisting, Func<AzureResourceInfrastructure, T> createNew)
IAzureKeyVaultResource.cs (1)
26Func<IAzureKeyVaultSecretReference, CancellationToken, Task<string?>>? SecretResolver { get; set; }
Aspire.Hosting.Azure.KeyVault (2)
AzureKeyVaultResource.cs (2)
37internal Func<IAzureKeyVaultSecretReference, CancellationToken, Task<string?>>? SecretResolver { get; set; } 39Func<IAzureKeyVaultSecretReference, CancellationToken, Task<string?>>? IAzureKeyVaultResource.SecretResolver
Aspire.Hosting.Testing (3)
DistributedApplicationEntryPointInvoker.cs (1)
18public static Func<string[], CancellationToken, Task<DistributedApplication>>? ResolveEntryPoint(
DistributedApplicationFactory.cs (2)
401var factory = DistributedApplicationEntryPointInvoker.ResolveEntryPoint( 421private async Task InvokeEntryPoint(Func<string[], CancellationToken, Task<DistributedApplication>> factory)
Aspire.Hosting.Testing.Tests (4)
tests\Shared\Logging\TestLogger.cs (1)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (1)
30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (1)
16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (1)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Aspire.Hosting.Tests (11)
Dashboard\DashboardResourceTests.cs (1)
554public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Dcp\TestKubernetesService.cs (2)
28private readonly Func<CustomResource, string, Stream> _startStream; 32public TestKubernetesService(Func<CustomResource, string, Stream>? startStream = null, bool ignoreDeletes = false)
Helpers\CallbackLifecycleHook.cs (2)
10private readonly Func<DistributedApplicationModel, CancellationToken, Task> _beforeStartCallback; 12public CallbackLifecycleHook(Func<DistributedApplicationModel, CancellationToken, Task> beforeStartCallback)
tests\Shared\Logging\TestLogger.cs (1)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (1)
30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (1)
16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (1)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Utils\PeriodicRestartAsyncEnumerableTests.cs (2)
21var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(CountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(50), cancellationToken)); 44var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(RefCountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(10), cancellationToken));
Aspire.NATS.Net (16)
AspireNatsClientExtensions.cs (16)
24/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 28/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 32/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 36/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 37public static void AddNatsClient(this IHostApplicationBuilder builder, string connectionName, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions) 40/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 54public static void AddNatsClient(this IHostApplicationBuilder builder, string connectionName, Action<NatsClientSettings>? configureSettings, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions) 59/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 67/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 75/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 83/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 84public static void AddKeyedNatsClient(this IHostApplicationBuilder builder, string name, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions) 91/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/> 110public static void AddKeyedNatsClient(this IHostApplicationBuilder builder, string name, Action<NatsClientSettings>? configureSettings, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions) 117private static void AddNatsClientInternal(this IHostApplicationBuilder builder, string connectionName, object? serviceKey, Action<NatsClientSettings>? configureSettings, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions) 206private static Func<IServiceProvider, NatsOpts, NatsOpts>? Wrap(Func<NatsOpts, NatsOpts>? func)
Aspire.NATS.Net.Tests (4)
NatsClientPublicApiTests.cs (4)
27Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptionsWithService = null; 63Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptionsWithService = null; 95Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptionsWithService = null; 131Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptionsWithService = null;
Aspire.Playground.Tests (4)
tests\Shared\Logging\TestLogger.cs (1)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (1)
30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (1)
16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (1)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Aspire.RabbitMQ.Client (1)
RabbitMQEventSourceLogForwarder.cs (1)
13private static readonly Func<ErrorEventSourceEvent, Exception?, string> s_formatErrorEvent = FormatErrorEvent;
Aspire.RabbitMQ.Client.Tests (1)
AspireRabbitMQLoggingTests.cs (1)
249public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Aspire.RabbitMQ.Client.v7.Tests (1)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (1)
249public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
BasicTestApp (1)
PrependMessageLoggerProvider.cs (1)
58public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Binding.Http.IntegrationTests (2)
HttpBindingTestHelpers.cs (2)
30public Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> OnSendingAsync { get; set; } 31public Func<HttpResponseMessage, CancellationToken, Task<HttpResponseMessage>> OnSentAsync { get; set; }
Binding.ReliableSession.IntegrationTests (2)
src\System.Private.ServiceModel\tests\Scenarios\Binding\Http\HttpBindingTestHelpers.cs (2)
30public Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> OnSendingAsync { get; set; } 31public Func<HttpResponseMessage, CancellationToken, Task<HttpResponseMessage>> OnSentAsync { get; set; }
BuildValidator (2)
DemoLogger.cs (2)
42public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 73public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
CodeGenerator (1)
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
313static string Each<T>(IEnumerable<T> values, Func<T, int, string> formatter)
csc (2)
src\Compilers\Shared\BuildServerConnection.cs (2)
175Func<string, ICompilerServerLogger, bool> tryCreateServerFunc, 204Func<string, ICompilerServerLogger, bool> tryCreateServerFunc,
Diagnostics.EFCore.FunctionalTests (1)
Helpers\TestLoggerProvider.cs (1)
43public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
IIS.LongTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
IIS.NewHandler.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
IIS.NewShim.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
IISExpress.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
InMemory.FunctionalTests (6)
Http2\Http2EndToEndTests.cs (1)
126public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
HttpsTests.cs (2)
824public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 852public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Servers\Kestrel\shared\test\MockLogger.cs (1)
21public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (1)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (1)
126Func<ListenOptions, CancellationToken, Task> createBinding)
Interop.FunctionalTests (1)
Http3\Http3RequestTests.cs (1)
209public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Metrics (9)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
Metrics.Legacy (9)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
Microsoft.Analyzers.Extra (5)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (5)
39internal Func<Document, CancellationToken, Task<SyntaxNode?>> GetSyntaxRootAsync = (d, t) => d.GetSyntaxRootAsync(t); 40internal Func<Document, CancellationToken, Task<SemanticModel?>> GetSemanticModelAsync = (d, t) => d.GetSemanticModelAsync(t); 42internal Func<Compilation, string, INamedTypeSymbol?> GetTypeByMetadataName1 = (c, n) => c.GetTypeByMetadataName(n); 43internal Func<Compilation, string, INamedTypeSymbol?> GetTypeByMetadataName2 = (c, n) => c.GetTypeByMetadataName(n); 44internal Func<Compilation, string, INamedTypeSymbol?> GetTypeByMetadataName3 = (c, n) => c.GetTypeByMetadataName(n);
Microsoft.Arcade.Test.Common (10)
AssertEx.cs (7)
152public static void Equal<T>(ImmutableArray<T> expected, IEnumerable<T> actual, Func<T, T, bool> comparer = null, string message = null) 164public static void Equal<T>(IEnumerable<T> expected, ImmutableArray<T> actual, Func<T, T, bool> comparer = null, string message = null, string itemSeparator = null) 176public static void Equal<T>(ImmutableArray<T> expected, ImmutableArray<T> actual, Func<T, T, bool> comparer = null, string message = null, string itemSeparator = null) 181public static void Equal<T>(IEnumerable<T> expected, IEnumerable<T> actual, Func<T, T, bool> comparer = null, string message = null, 210private static bool SequenceEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual, Func<T, T, bool> comparer = null) 432Func<T, T, bool> comparer = null, 478public static void AssertLinesEqual(string expected, string actual, string message = null, Func<string, string, bool> comparer = null)
DiffUtil.cs (3)
40private readonly Func<T, T, bool> _comparer; 42public LCS(Func<T, T, bool> comparer) 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.App.Analyzers (5)
Infrastructure\VirtualChars\VirtualCharSequence.Chunks.cs (1)
77internal static int BinarySearch<TElement, TValue>(ImmutableList<TElement> array, TValue value, Func<TElement, TValue, int> comparer)
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (2)
18private static readonly Func<SyntaxTriviaList, int, SyntaxToken> FindSkippedTokenBackwardFunc = FindSkippedTokenBackward; 83var findSkippedToken = includeSkipped ? FindSkippedTokenBackwardFunc : ((l, p) => default);
RouteEmbeddedLanguage\RoutePatternBraceMatcher.cs (1)
79private static TNode? FindNode<TNode>(RoutePatternNode node, VirtualChar ch, Func<TNode, VirtualChar, bool> predicate)
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (1)
111private static TNode? FindNode<TNode>(RoutePatternNode node, VirtualChar ch, Func<TNode, VirtualChar, bool> predicate)
Microsoft.AspNetCore.Authentication.Test (2)
JwtBearerTests.cs (1)
1159private static async Task<IHost> CreateHost(Action<JwtBearerOptions> options = null, Func<HttpContext, Func<Task>, Task> handlerBeforeAuth = null)
JwtBearerTests_Handler.cs (1)
1226private static async Task<IHost> CreateHost(Action<JwtBearerOptions> options = null, Func<HttpContext, Func<Task>, Task> handlerBeforeAuth = null)
Microsoft.AspNetCore.Authorization.Test (5)
DefaultAuthorizationServiceTests.cs (5)
1160private readonly Action<LogLevel, EventId, object, Exception, Func<object, Exception, string>> _assertion; 1162public DefaultAuthorizationServiceTestLogger(Action<LogLevel, EventId, object, Exception, Func<object, Exception, string>> assertion) 1177public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 1188static void Assertion(LogLevel level, EventId eventId, object state, Exception exception, Func<object, Exception, string> formatter) 1221static void Assertion(LogLevel level, EventId eventId, object state, Exception exception, Func<object, Exception, string> formatter)
Microsoft.AspNetCore.Components.QuickGrid (4)
Columns\GridSort.cs (4)
17private readonly Func<IQueryable<TGridItem>, bool, IOrderedQueryable<TGridItem>> _first; 18private List<Func<IOrderedQueryable<TGridItem>, bool, IOrderedQueryable<TGridItem>>>? _then; 26internal GridSort(Func<IQueryable<TGridItem>, bool, IOrderedQueryable<TGridItem>> first, (LambdaExpression, bool) firstExpression) 94foreach (var clause in _then)
Microsoft.AspNetCore.Components.Server (2)
Builder\ServerComponentsEndpointOptions.cs (1)
55public Func<HttpContext, WebSocketAcceptContext, Task>? ConfigureWebSocketAcceptContext { get; set; }
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
164Func<HttpContext, WebSocketAcceptContext, Task>? configureConnection,
Microsoft.AspNetCore.Components.Tests (1)
ComponentBaseTest.cs (1)
490public Func<TestComponent, bool, Task> OnAfterRenderAsyncLogic { get; set; }
Microsoft.AspNetCore.Components.WebAssembly (1)
Services\WebAssemblyConsoleLogger.cs (1)
44public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.AspNetCore.Components.WebView (2)
IpcReceiver.cs (2)
25private readonly Func<string, string, Task> _onAttachMessage; 27public IpcReceiver(Func<string, string, Task> onAttachMessage)
Microsoft.AspNetCore.Connections.Abstractions (4)
ConnectionBuilderExtensions.cs (3)
34/// Prefer using <see cref="Use(IConnectionBuilder, Func{ConnectionContext, ConnectionDelegate, Task})"/> for better performance as shown below: 46public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Func<Task>, Task> middleware) 65public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, ConnectionDelegate, Task> middleware)
TlsConnectionCallbackOptions.cs (1)
21public Func<TlsConnectionCallbackContext, CancellationToken, ValueTask<SslServerAuthenticationOptions>> OnConnection { get; set; } = default!;
Microsoft.AspNetCore.DataProtection.Tests (3)
StringLoggerFactory.cs (1)
61public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
XmlAssert.cs (2)
130private readonly Func<T, T, bool> _equalityCheck; 132public CallbackBasedEqualityComparer(Func<T, T, bool> equalityCheck)
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckOptions.cs (1)
71public Func<HttpContext, HealthReport, Task> ResponseWriter { get; set; } = HealthCheckResponseWriters.WriteMinimalPlaintext;
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Logging\AcceptanceTests.cs (1)
143private static Task RunAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func)
Logging\AcceptanceTests.Mvc.cs (1)
51private static Task RunControllerAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func)
Microsoft.AspNetCore.FunctionalTests (1)
WebHostFunctionalTests.cs (1)
205Func<DeploymentResult, ILogger, Task> assertAction,
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\Grpc\JsonTranscoding\src\Shared\Server\InterceptorPipelineBuilder.cs (1)
134private T BuildPipeline<T>(T innerInvoker, Func<InterceptorActivatorHandle, T, T> wrapInvoker)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
UnaryServerCallHandlerTests.cs (1)
1632Func<HelloRequest, ServerCallContext, Task<HelloReply>>? handler = null)
Microsoft.AspNetCore.Hosting (4)
GenericHostWebHostBuilderExtensions.cs (1)
62Func<IHostBuilder, WebHostBuilderOptions, IWebHostBuilder> createWebHostBuilder,
Internal\HostingRequestFinishedLog.cs (1)
14internal static readonly Func<object, Exception?, string> Callback = (state, exception) => ((HostingRequestFinishedLog)state).ToString();
Internal\HostingRequestStartingLog.cs (1)
15internal static readonly Func<object, Exception?, string> Callback = (state, exception) => ((HostingRequestStartingLog)state).ToString();
Internal\HostingRequestUnhandledLog.cs (1)
13internal static readonly Func<object, Exception?, string> Callback = (state, exception) => ((HostingRequestUnhandledLog)state).ToString();
Microsoft.AspNetCore.Hosting.Tests (3)
HostingApplicationDiagnosticsTests.cs (2)
1132public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 1155public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
WebHostTests.cs (1)
1358public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.Http.Abstractions (5)
Extensions\EndpointBuilder.cs (2)
13private List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>? _filterFactories; 18public IList<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>> FilterFactories => _filterFactories ??= new();
Extensions\UseExtensions.cs (3)
17/// Prefer using <see cref="Use(IApplicationBuilder, Func{HttpContext, RequestDelegate, Task})"/> for better performance as shown below: 29public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, Func<Task>, Task> middleware) 48public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, RequestDelegate, Task> middleware)
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
UseWhenExtensionsTests.cs (1)
123private static Func<HttpContext, Func<Task>, Task> Increment(string key, bool terminate = false)
Microsoft.AspNetCore.Http.Connections.Client (2)
HttpConnectionOptions.cs (1)
71public Func<WebSocketConnectionContext, CancellationToken, ValueTask<WebSocket>>? WebSocketFactory { get; set; }
Internal\WebSocketsTransport.cs (1)
305var factory = _httpConnectionOptions.WebSocketFactory ?? DefaultWebSocketFactory;
Microsoft.AspNetCore.Http.Extensions (12)
RequestDelegateFactory.cs (9)
189var targetableRequestDelegate = CreateTargetableRequestDelegate(handler.Method, targetExpression, factoryContext, targetFactory); 242var untargetableRequestDelegate = CreateTargetableRequestDelegate(methodInfo, targetExpression: null, factoryContext); 254var targetableRequestDelegate = CreateTargetableRequestDelegate(methodInfo, targetExpression, factoryContext, context => targetFactory(context)); 313private static Func<object?, HttpContext, Task>? CreateTargetableRequestDelegate( 1252private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegate(Expression responseWritingMethodCall, RequestDelegateFactoryContext factoryContext) 1279return Expression.Lambda<Func<object?, HttpContext, Task>>( 1293private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegateForJson(Expression responseWritingMethodCall, RequestDelegateFactoryContext factoryContext) 1426private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegateForForm( 1683var tryParseMethodCall = ParameterBindingMethodCache.Instance.FindTryParseMethod(nonNullableParameterType);
src\Shared\ParameterBindingMethodCache.cs (3)
46private readonly ConcurrentDictionary<Type, Func<ParameterExpression, Expression, Expression>?> _stringMethodCallCache = new(); 80public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type) 85Func<ParameterExpression, Expression, Expression>? Finder(Type type)
Microsoft.AspNetCore.Http.Extensions.Tests (12)
RequestDelegateFactoryTests.cs (11)
108EndpointBuilder = CreateEndpointBuilderFromFilterFactories(new List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>() 2168EndpointBuilder = CreateEndpointBuilderFromFilterFactories(new List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>() 2211EndpointBuilder = CreateEndpointBuilderFromFilterFactories(new List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>() 2283EndpointBuilder = CreateEndpointBuilderFromFilterFactories(new List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>() 2378EndpointBuilder = CreateEndpointBuilderFromFilterFactories(new List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>() 2412EndpointBuilder = CreateEndpointBuilderFromFilterFactories(new List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>() 2497EndpointBuilder = CreateEndpointBuilderFromFilterFactories(new List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>() 3051EndpointBuilder = CreateEndpointBuilderFromFilterFactories(new List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>() 3094EndpointBuilder = CreateEndpointBuilderFromFilterFactories(new List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>() 3331private EndpointBuilder CreateEndpointBuilderFromFilterFactories(IEnumerable<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>> filterFactories) 3334((List<Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate>>)builder.FilterFactories).AddRange(filterFactories);
ValidationsGenerator\ValidationsGeneratorTestBase.cs (1)
97internal static async Task VerifyEndpoint(Compilation compilation, string routePattern, Func<Endpoint, IServiceProvider, Task> verifyFunc)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (9)
StaticRouteHandlerModel\EndpointParameter.cs (9)
74IsParsable = TryGetParsability(Type, wellKnownTypes, out var preferredTryParseInvocation); 81IsParsable = TryGetParsability(Type, wellKnownTypes, out var preferredTryParseInvocation); 88IsParsable = TryGetParsability(Type, wellKnownTypes, out var preferredTryParseInvocation); 124IsParsable = TryGetParsability(Type, wellKnownTypes, out var preferredTryParseInvocation); 240else if (TryGetParsability(Type, wellKnownTypes, out var preferredTryParseInvocation)) 264|| TryGetParsability(Type, wellKnownTypes, out var _) 265|| (IsArray && TryGetParsability(ElementType, wellKnownTypes, out var _)); 298public Func<string, string, string>? PreferredTryParseInvocation { get; set; } 324private bool TryGetParsability(ITypeSymbol typeSymbol, WellKnownTypes wellKnownTypes, [NotNullWhen(true)] out Func<string, string, string>? preferredTryParseInvocation)
Microsoft.AspNetCore.HttpLogging (1)
HttpLog.cs (1)
15internal static readonly Func<object, Exception?, string> Callback = (state, exception) => ((HttpLog)state).ToString();
Microsoft.AspNetCore.Identity.Specification.Tests (1)
TestLogger.cs (1)
60public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.InternalTesting (4)
Logging\TestLogger.cs (1)
42public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Logging\TestLoggerT.cs (1)
32Func<TState, Exception, string> formatter)
Logging\WriteContext.cs (1)
18public Func<object, Exception, string> Formatter { get; set; }
Logging\XunitLoggerProvider.cs (1)
62LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.JsonPatch (1)
Internal\DynamicObjectAdapter.cs (1)
185var callsite = CallSite<Func<CallSite, object, object>>.Create(binder);
Microsoft.AspNetCore.Mvc.Abstractions (10)
Formatters\InputFormatterContext.cs (3)
36Func<Stream, Encoding, TextReader> readerFactory) 65Func<Stream, Encoding, TextReader> readerFactory, 120public Func<Stream, Encoding, TextReader> ReaderFactory { get; }
Formatters\OutputFormatterWriteContext.cs (2)
21public OutputFormatterWriteContext(HttpContext httpContext, Func<Stream, Encoding, TextWriter> writerFactory, Type? objectType, object? @object) 50public virtual Func<Stream, Encoding, TextWriter> WriterFactory { get; protected set; }
ModelBinding\Metadata\ModelBindingMessageProvider.cs (1)
47public virtual Func<string, string, string> AttemptedValueIsInvalidAccessor { get; } = default!;
ModelBinding\ModelMetadata.cs (1)
643internal static Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type modelType)
src\Shared\ParameterBindingMethodCache.cs (3)
46private readonly ConcurrentDictionary<Type, Func<ParameterExpression, Expression, Expression>?> _stringMethodCallCache = new(); 80public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type) 85Func<ParameterExpression, Expression, Expression>? Finder(Type type)
Microsoft.AspNetCore.Mvc.Core (27)
Controllers\ControllerActivatorProvider.cs (4)
16private static readonly Func<ControllerContext, object, ValueTask> _disposeAsync = DisposeAsync; 17private static readonly Func<ControllerContext, object, ValueTask> _syncDisposeAsync = SyncDisposeAsync; 20private readonly Func<ControllerContext, object, ValueTask>? _controllerActivatorReleaseAsync; 81public Func<ControllerContext, object, ValueTask>? CreateAsyncReleaser(ControllerActionDescriptor descriptor)
Controllers\ControllerFactoryProvider.cs (2)
14private readonly Func<ControllerContext, object, ValueTask>? _factoryReleaseControllerAsync; 94public Func<ControllerContext, object, ValueTask>? CreateAsyncControllerReleaser(ControllerActionDescriptor descriptor)
Controllers\IControllerActivatorProvider.cs (1)
30Func<ControllerContext, object, ValueTask>? CreateAsyncReleaser(ControllerActionDescriptor descriptor)
Controllers\IControllerFactoryProvider.cs (1)
30Func<ControllerContext, object, ValueTask>? CreateAsyncControllerReleaser(ControllerActionDescriptor descriptor)
Infrastructure\ActionSelectionTable.cs (1)
104Func<T, string, string> getRouteValue)
Infrastructure\AsyncEnumerableReader.cs (5)
34private readonly ConcurrentDictionary<Type, Func<object, CancellationToken, Task<ICollection>>?> _asyncEnumerableConverters = new(); 52public bool TryGetReader(Type type, [NotNullWhen(true)] out Func<object, CancellationToken, Task<ICollection>>? reader) 67var converter = (Func<object, CancellationToken, Task<ICollection>>)Converter 69.CreateDelegate(typeof(Func<object, CancellationToken, Task<ICollection>>), this);
Infrastructure\ControllerActionInvokerCache.cs (1)
63var controllerReleaser = _controllerFactoryProvider.CreateAsyncControllerReleaser(actionDescriptor);
Infrastructure\ControllerActionInvokerCacheEntry.cs (2)
15Func<ControllerContext, object, ValueTask>? controllerReleaser, 34public Func<ControllerContext, object, ValueTask>? ControllerReleaser { get; }
Infrastructure\ObjectResultExecutor.cs (1)
55protected Func<Stream, Encoding, TextWriter> WriterFactory { get; }
ModelBinding\Binders\BodyModelBinder.cs (1)
23private readonly Func<Stream, Encoding, TextReader> _readerFactory;
ModelBinding\Binders\TryParseModelBinder.cs (3)
25private readonly Func<ValueProviderResult, ModelBindingContext, object?> _tryParseOperation; 107private static Func<ValueProviderResult, ModelBindingContext, object?> CreateTryParseOperation(Type modelType) 139return Expression.Lambda<Func<ValueProviderResult, ModelBindingContext, object?>>(expression, new[] { ValueProviderResultExpression, BindingContextExpression }).Compile();
ModelBinding\Metadata\DefaultModelBindingMessageProvider.cs (3)
20private Func<string, string, string> _attemptedValueIsInvalidAccessor; 129public override Func<string, string, string> AttemptedValueIsInvalidAccessor => _attemptedValueIsInvalidAccessor; 136public void SetAttemptedValueIsInvalidAccessor(Func<string, string, string> attemptedValueIsInvalidAccessor)
Routing\ActionEndpointFactory.cs (1)
477var filterFactory = routeHandlerFilters[i];
src\Shared\PropertyActivator\PropertyActivator.cs (1)
65Func<PropertyInfo, TAttribute, PropertyActivator<TContext>> createActivateInfo,
Microsoft.AspNetCore.Mvc.Core.Test (19)
Controllers\ControllerFactoryProviderTest.cs (1)
81var releaser = provider.CreateAsyncControllerReleaser(descriptor);
Formatters\JsonOutputFormatterTestBase.cs (1)
179Func<Stream, Encoding, TextWriter> writerFactory = null)
Infrastructure\AsyncEnumerableReaderTest.cs (15)
23var result = readerFactory.TryGetReader(type, out var reader); 38var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 56var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 75Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader1)); 76Assert.True(readerFactory.TryGetReader(asyncEnumerable2.GetType(), out var reader2)); 92Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader1)); 93Assert.True(readerFactory.TryGetReader(asyncEnumerable2.GetType(), out var reader2)); 110Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader)); 127Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader)); 144Assert.True(readerFactory.TryGetReader(enumerable1.GetType(), out var reader1)); 145Assert.True(readerFactory.TryGetReader(enumerable2.GetType(), out var reader2)); 161var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 182Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader)); 198Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader)); 213Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader));
ModelBinding\Binders\BodyModelBinderTests.cs (2)
725private readonly Func<InputFormatterContext, Encoding, Task<InputFormatterResult>> _readRequestBodyAsync; 727public XyzFormatter(Func<InputFormatterContext, Encoding, Task<InputFormatterResult>> readRequestBodyAsync)
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
MvcDataAnnotationsLocalizationOptions.cs (1)
20public Func<Type, IStringLocalizerFactory, IStringLocalizer> DataAnnotationLocalizerProvider = null!;
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
BindPropertyIntegrationTest.cs (1)
222var pageBinder = PageBinderFactory.CreatePropertyBinder(
Microsoft.AspNetCore.Mvc.Localization.Test (2)
MvcLocalizationMvcBuilderExtensionsTest.cs (1)
109var dataAnnotationLocalizerProvider = new Func<Type, IStringLocalizerFactory, IStringLocalizer>((type, factory) =>
MvcLocalizationMvcCoreBuilderExtensionsTest.cs (1)
109var dataAnnotationLocalizerProvider = new Func<Type, IStringLocalizerFactory, IStringLocalizer>((type, factory) =>
Microsoft.AspNetCore.Mvc.NewtonsoftJson (7)
NewtonsoftJsonOutputFormatter.cs (1)
153if (value is not null && _asyncEnumerableReaderFactory.TryGetReader(value.GetType(), out var reader))
NewtonsoftJsonResultExecutor.cs (1)
105if (value != null && _asyncEnumerableReaderFactory.TryGetReader(value.GetType(), out var reader))
src\Mvc\Mvc.Core\src\Infrastructure\AsyncEnumerableReader.cs (5)
34private readonly ConcurrentDictionary<Type, Func<object, CancellationToken, Task<ICollection>>?> _asyncEnumerableConverters = new(); 52public bool TryGetReader(Type type, [NotNullWhen(true)] out Func<object, CancellationToken, Task<ICollection>>? reader) 67var converter = (Func<object, CancellationToken, Task<ICollection>>)Converter 69.CreateDelegate(typeof(Func<object, CancellationToken, Task<ICollection>>), this);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (16)
src\Mvc\Mvc.Core\test\Formatters\JsonOutputFormatterTestBase.cs (1)
179Func<Stream, Encoding, TextWriter> writerFactory = null)
src\Mvc\Mvc.Core\test\Infrastructure\AsyncEnumerableReaderTest.cs (15)
23var result = readerFactory.TryGetReader(type, out var reader); 38var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 56var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 75Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader1)); 76Assert.True(readerFactory.TryGetReader(asyncEnumerable2.GetType(), out var reader2)); 92Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader1)); 93Assert.True(readerFactory.TryGetReader(asyncEnumerable2.GetType(), out var reader2)); 110Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader)); 127Assert.True(readerFactory.TryGetReader(asyncEnumerable1.GetType(), out var reader)); 144Assert.True(readerFactory.TryGetReader(enumerable1.GetType(), out var reader1)); 145Assert.True(readerFactory.TryGetReader(enumerable2.GetType(), out var reader2)); 161var result = readerFactory.TryGetReader(asyncEnumerable.GetType(), out var reader); 182Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader)); 198Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader)); 213Assert.True(readerFactory.TryGetReader(enumerable.GetType(), out var reader));
Microsoft.AspNetCore.Mvc.Razor (1)
RazorPagePropertyActivator.cs (1)
19private readonly Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary> _rootFactory;
Microsoft.AspNetCore.Mvc.RazorPages (34)
Infrastructure\DefaultPageActivatorProvider.cs (4)
20public Func<PageContext, ViewContext, object> CreateActivator(CompiledPageActionDescriptor actionDescriptor) 65private static Func<PageContext, ViewContext, object> CreatePageFactory(Type pageTypeInfo) 74var pageFactory = Expression 75.Lambda<Func<PageContext, ViewContext, object>>(newExpression, parameter1, parameter2)
Infrastructure\DefaultPageFactoryProvider.cs (2)
42public Func<PageContext, ViewContext, object> CreatePageFactory(CompiledPageActionDescriptor actionDescriptor) 51var activatorFactory = _pageActivator.CreateActivator(actionDescriptor);
Infrastructure\DefaultPageModelActivatorProvider.cs (3)
15private readonly Func<PageContext, object, ValueTask> _asyncDisposer = DisposeAsync; 16private readonly Func<PageContext, object, ValueTask> _syncAsyncDisposer = SyncDisposeAsync; 48public Func<PageContext, object, ValueTask>? CreateAsyncReleaser(CompiledPageActionDescriptor actionDescriptor)
Infrastructure\DefaultPageModelFactoryProvider.cs (1)
60public Func<PageContext, object, ValueTask>? CreateAsyncModelDisposer(CompiledPageActionDescriptor descriptor)
Infrastructure\ExecutorFactory.cs (6)
79private readonly Func<object, object?[]?, Task> _thunk; 87_thunk = Expression.Lambda<Func<object, object?[]?, Task>>( 109private readonly Func<object, object?[]?, Task<object>> _thunk; 117_thunk = Expression.Lambda<Func<object, object?[]?, Task<object>>>( 171private readonly Func<object, object?[]?, IActionResult?> _thunk; 179_thunk = Expression.Lambda<Func<object, object?[]?, IActionResult?>>(
Infrastructure\PageActionInvokerCache.cs (4)
75var viewDataFactory = ViewDataDictionaryFactory.CreateFactory(compiledActionDescriptor.DeclaredModelTypeInfo); 77var pageFactory = _pageFactoryProvider.CreatePageFactory(compiledActionDescriptor); 79var propertyBinder = PageBinderFactory.CreatePropertyBinder( 86Func<PageContext, object, ValueTask>? modelReleaser = null;
Infrastructure\PageActionInvokerCacheEntry.cs (8)
16Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary> viewDataFactory, 17Func<PageContext, ViewContext, object> pageFactory, 20Func<PageContext, object, ValueTask>? releaseModel, 21Func<PageContext, object, Task> propertyBinder, 42public Func<PageContext, ViewContext, object> PageFactory { get; } 54public Func<PageContext, object, ValueTask>? ReleaseModel { get; } 60public Func<PageContext, object, Task> PropertyBinder { get; } 66public Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary> ViewDataFactory { get; }
Infrastructure\PageBinderFactory.cs (2)
10internal static readonly Func<PageContext, object, Task> NullPropertyBinder = (context, arguments) => Task.CompletedTask; 13public static Func<PageContext, object, Task> CreatePropertyBinder(
IPageActivatorProvider.cs (1)
18Func<PageContext, ViewContext, object> CreateActivator(CompiledPageActionDescriptor descriptor);
IPageFactoryProvider.cs (1)
18Func<PageContext, ViewContext, object> CreatePageFactory(CompiledPageActionDescriptor descriptor);
IPageModelActivatorProvider.cs (1)
30Func<PageContext, object, ValueTask>? CreateAsyncReleaser(CompiledPageActionDescriptor descriptor)
IPageModelFactoryProvider.cs (1)
30Func<PageContext, object, ValueTask>? CreateAsyncModelDisposer(CompiledPageActionDescriptor descriptor)
Microsoft.AspNetCore.Mvc.RazorPages.Test (34)
Infrastructure\DefaultPageActivatorProviderTest.cs (1)
43var factory = activator.CreateActivator(descriptor);
Infrastructure\DefaultPageFactoryProviderTest.cs (10)
57var factory = factoryProvider.CreatePageFactory(descriptor); 93var factory = factoryProvider.CreatePageFactory(pageContext.ActionDescriptor); 123var factory = CreatePageFactory().CreatePageFactory(descriptor); 150var factory = factoryProvider.CreatePageFactory(pageContext.ActionDescriptor); 177var factory = factoryProvider.CreatePageFactory(pageContext.ActionDescriptor); 202var factory = factoryProvider.CreatePageFactory(pageContext.ActionDescriptor); 236var factory = factoryProvider.CreatePageFactory(pageContext.ActionDescriptor); 274var factory = factoryProvider.CreatePageFactory(pageContext.ActionDescriptor); 317var factory = factoryProvider.CreatePageFactory(pageContext.ActionDescriptor); 355var factory = factoryProvider.CreatePageFactory(pageContext.ActionDescriptor);
Infrastructure\DefaultPageModelActivatorProviderTest.cs (4)
124var releaser = activator.CreateAsyncReleaser(actionDescriptor); 162var disposer = activator.CreateAsyncReleaser(new CompiledPageActionDescriptor 183var disposer = activator.CreateAsyncReleaser(new CompiledPageActionDescriptor 204var disposer = activator.CreateAsyncReleaser(new CompiledPageActionDescriptor
Infrastructure\DefaultPageModelFactoryProviderTest.cs (2)
114Func<PageContext, object, ValueTask> disposer = (_, __) => default; 120var actual = factoryProvider.CreateAsyncModelDisposer(descriptor);
Infrastructure\PageActionInvokerProviderTest.cs (3)
36Func<PageContext, ViewContext, object> factory = (a, b) => null; 88Func<PageContext, ViewContext, object> factory = (a, b) => null; 91Func<PageContext, object, ValueTask> modelDisposer = (_, __) => default;
Infrastructure\PageActionInvokerTest.cs (1)
1513var viewDataFactory = ViewDataDictionaryFactory.CreateFactory(actionDescriptor.ModelTypeInfo);
Infrastructure\PageBinderFactoryTest.cs (13)
42var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 68var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 93var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 119var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 144var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 170var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 218var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 278var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 328var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 391var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 450var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 500var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor); 552var factory = PageBinderFactory.CreatePropertyBinder(binder, modelMetadataProvider, modelBinderFactory, actionDescriptor);
Microsoft.AspNetCore.Mvc.TagHelpers (8)
AttributeMatcher.cs (1)
26Func<TMode, TMode, int> compare,
Cache\CacheTagKey.cs (5)
21private static readonly Func<IRequestCookieCollection, string, string> CookieAccessor = (c, key) => c[key]; 22private static readonly Func<IHeaderDictionary, string, string> HeaderAccessor = (c, key) => c[key]; 23private static readonly Func<IQueryCollection, string, string> QueryAccessor = (c, key) => c[key]; 24private static readonly Func<RouteValueDictionary, string, string> RouteValueAccessor = (c, key) => 268Func<TSourceCollection, string, string> accessor)
LinkTagHelper.cs (1)
52private static readonly Func<Mode, Mode, int> Compare = (a, b) => a - b;
ScriptTagHelper.cs (1)
50private static readonly Func<Mode, Mode, int> Compare = (a, b) => a - b;
Microsoft.AspNetCore.Mvc.TagHelpers.Test (3)
AttributeMatcherTest.cs (1)
10private static readonly Func<Mode, Mode, int> Compare = (a, b) => a - b;
CacheTagHelperTest.cs (1)
906Func<bool, HtmlEncoder, Task<TagHelperContent>> getChildContentAsync = (useCachedResult, _) =>
TagHelperLogger.cs (1)
22public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
RemoteAttributeBase.cs (1)
183var provider = options.Value.DataAnnotationLocalizerProvider;
ViewDataDictionaryFactory.cs (2)
12public static Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary> CreateFactory(Type modelType) 24Expression.Lambda<Func<IModelMetadataProvider, ModelStateDictionary, ViewDataDictionary>>(
Microsoft.AspNetCore.OpenApi (3)
src\Shared\ParameterBindingMethodCache.cs (3)
46private readonly ConcurrentDictionary<Type, Func<ParameterExpression, Expression, Expression>?> _stringMethodCallCache = new(); 80public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type) 85Func<ParameterExpression, Expression, Expression>? Finder(Type type)
Microsoft.AspNetCore.OutputCaching (8)
DispatcherExtensions.cs (1)
51public async Task<TValue?> ScheduleAsync<TState>(TKey key, TState state, Func<TKey, TState, Task<TValue?>> valueFactory)
OutputCachePolicyBuilder.cs (5)
20private List<Func<OutputCacheContext, CancellationToken, ValueTask<bool>>>? _requirements; 64public OutputCachePolicyBuilder With(Func<OutputCacheContext, CancellationToken, ValueTask<bool>> predicate) 198public OutputCachePolicyBuilder SetCacheKeyPrefix(Func<HttpContext, CancellationToken, ValueTask<string>> keyPrefix) 243public OutputCachePolicyBuilder VaryByValue(Func<HttpContext, CancellationToken, ValueTask<KeyValuePair<string, string>>> varyBy) 334foreach (var r in _requirements)
Policies\SetCacheKeyPrefixPolicy.cs (1)
18public SetCacheKeyPrefixPolicy(Func<HttpContext, CancellationToken, ValueTask<string>> varyBy)
Policies\VaryByValuePolicy.cs (1)
18public VaryByValuePolicy(Func<HttpContext, CancellationToken, ValueTask<KeyValuePair<string, string>>> varyBy)
Microsoft.AspNetCore.Owin (4)
WebSockets\OwinWebSocketAdapter.cs (3)
15Func<ArraySegment<byte> /* data */, 35private readonly WebSocketReceiveAsync _receiveAsync; 49_receiveAsync = (WebSocketReceiveAsync)websocketContext[OwinConstants.WebSocket.ReceiveAsync];
WebSockets\WebSocketAdapter.cs (1)
15Func<ArraySegment<byte> /* data */,
Microsoft.AspNetCore.RateLimiting (9)
DefaultRateLimiterPolicy.cs (3)
12private readonly Func<OnRejectedContext, CancellationToken, ValueTask>? _onRejected; 14public DefaultRateLimiterPolicy(Func<HttpContext, RateLimitPartition<DefaultKeyType>> partitioner, Func<OnRejectedContext, CancellationToken, ValueTask>? onRejected) 20public Func<OnRejectedContext, CancellationToken, ValueTask>? OnRejected => _onRejected;
IRateLimiterPolicy.cs (2)
15/// Gets the <see cref="Func{OnRejectedContext, CancellationToken, ValueTask}"/> that handles requests rejected by this middleware. 17Func<OnRejectedContext, CancellationToken, ValueTask>? OnRejected { get; }
RateLimiterOptions.cs (2)
29/// Gets or sets a <see cref="Func{OnRejectedContext, CancellationToken, ValueTask}"/> that handles requests rejected by this middleware. 31public Func<OnRejectedContext, CancellationToken, ValueTask>? OnRejected { get; set; }
RateLimitingMiddleware.cs (2)
18private readonly Func<OnRejectedContext, CancellationToken, ValueTask>? _defaultOnRejected; 119var thisRequestOnRejected = _defaultOnRejected;
Microsoft.AspNetCore.RateLimiting.Tests (2)
TestRateLimiterPolicy.cs (2)
12private readonly Func<OnRejectedContext, CancellationToken, ValueTask> _onRejected; 26public Func<OnRejectedContext, CancellationToken, ValueTask> OnRejected { get => _onRejected; }
Microsoft.AspNetCore.Razor (2)
TagHelpers\TagHelperOutput.cs (2)
14private readonly Func<bool, HtmlEncoder, Task<TagHelperContent>> _getChildContentAsync; 43Func<bool, HtmlEncoder, Task<TagHelperContent>> getChildContentAsync)
Microsoft.AspNetCore.Razor.Test (1)
TagHelpers\TagHelperOutputTest.cs (1)
22Func<bool, HtmlEncoder, Task<TagHelperContent>> initialGetChildContentAsync =
Microsoft.AspNetCore.Routing (8)
Builder\EndpointFilterExtensions.cs (2)
92public static TBuilder AddEndpointFilter<TBuilder>(this TBuilder builder, Func<EndpointFilterInvocationContext, EndpointFilterDelegate, ValueTask<object?>> routeHandlerFilter) 104public static TBuilder AddEndpointFilterFactory<TBuilder>(this TBuilder builder, Func<EndpointFilterFactoryContext, EndpointFilterDelegate, EndpointFilterDelegate> filterFactory)
Builder\RouteHandlerServices.cs (2)
39Func<MethodInfo, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult> populateMetadata, 69Func<MethodInfo, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult> populateMetadata,
Matching\ILEmitTrieJumpTable.cs (1)
32internal Func<string, PathSegment, int> _getDestination;
Patterns\RoutePatternFactory.cs (1)
1104Func<int, string, Action<T>>? checkDuplicates = null,
RequestDelegateFilterPipelineBuilder.cs (1)
44var currentFilterFactory = options.EndpointBuilder.FilterFactories[i];
RouteEndpointDataSource.cs (1)
63Func<MethodInfo, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult>? inferMetadataFunc,
Microsoft.AspNetCore.Routing.Tests (2)
Logging\WriteContext.cs (1)
18public Func<object, Exception, string> Formatter { get; set; }
Matching\ILEmitTrieJumpTableTest.cs (1)
31var original = table._getDestination;
Microsoft.AspNetCore.Server.HttpSys (1)
RequestProcessing\TlsListener.cs (1)
55Func<IFeatureCollection, Action<IFeatureCollection, ReadOnlySpan<byte>>, bool> invokeTlsClientHelloCallback)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
IISDeploymentParameterExtensions.cs (2)
206public static void TransformPath(this IISDeploymentParameters parameters, Func<string, string, string> transformation) 216public static void TransformArguments(this IISDeploymentParameters parameters, Func<string, string, string> transformation)
Microsoft.AspNetCore.Server.Kestrel.Core (6)
HttpsConnectionAdapterOptions.cs (1)
56public Func<ConnectionContext?, string?, X509Certificate2?>? ServerCertificateSelector { get; set; }
Internal\AddressBindContext.cs (2)
14Func<ListenOptions, CancellationToken, Task> createBinding) 28public Func<ListenOptions, CancellationToken, Task> CreateBinding { get; }
Internal\Infrastructure\KestrelTrace.cs (1)
25public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Internal\SniOptionsSelector.cs (1)
25private readonly Func<ConnectionContext, string?, X509Certificate2?>? _fallbackServerCertificateSelector;
Middleware\HttpsConnectionMiddleware.cs (1)
41private readonly Func<ConnectionContext, string?, X509Certificate2?>? _serverCertificateSelector;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (5)
LoggingStreamTests.cs (1)
66public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
313static string Each<T>(IEnumerable<T> values, Func<T, int, string> formatter)
src\Servers\Kestrel\shared\test\MockLogger.cs (1)
21public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (1)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (1)
126Func<ListenOptions, CancellationToken, Task> createBinding)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (1)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (1)
126Func<ListenOptions, CancellationToken, Task> createBinding)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (1)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\PropertyActivator\PropertyActivator.cs (1)
65Func<PropertyInfo, TAttribute, PropertyActivator<TContext>> createActivateInfo,
Microsoft.AspNetCore.SignalR.Client.Core (7)
HubConnection.cs (4)
355public virtual IDisposable On(string methodName, Type[] parameterTypes, Func<object?[], object, Task<object?>> handler, object state) 388public virtual IDisposable On(string methodName, Type[] parameterTypes, Func<object?[], object, Task> handler, object state) 2106private readonly Func<object?[], object, Task> _callback; 2109public InvocationHandler(Type[] parameterTypes, Func<object?[], object, Task> callback, object state)
HubConnectionExtensions.cs (1)
260public static IDisposable On<T1, T2>(this HubConnection hubConnection, string methodName, Func<T1, T2, Task> handler)
HubConnectionExtensions.OnResult.cs (2)
108public static IDisposable On<T1, T2, TResult>(this HubConnection hubConnection, string methodName, Func<T1, T2, TResult> handler) 288public static IDisposable On<T1, T2, TResult>(this HubConnection hubConnection, string methodName, Func<T1, T2, Task<TResult>> handler)
Microsoft.AspNetCore.SignalR.Client.Tests (38)
HttpConnectionFactoryTests.cs (1)
81Func<WebSocketConnectionContext, CancellationToken, ValueTask<WebSocket>> webSocketFactory = (context, token) => ValueTask.FromResult<WebSocket>(null);
HubClientProxyGeneratorTests.cs (20)
78It.IsAny<Func<object[], object, Task>>(), 86It.IsAny<Func<object[], object, Task>>(), 94It.IsAny<Func<object[], object, Task>>(), 102It.IsAny<Func<object[], object, Task>>(), 129It.IsAny<Func<object[], object, Task>>(), 137It.IsAny<Func<object[], object, Task>>(), 145It.IsAny<Func<object[], object, Task>>(), 153It.IsAny<Func<object[], object, Task>>(), 176Func<object[], object, Task> noArgFunc = null; 182It.IsAny<Func<object[], object, Task>>(), 185(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) => 191Func<object[], object, Task> singleArgFunc = null; 198It.IsAny<Func<object[], object, Task>>(), 201(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) => 207Func<object[], object, Task> manyArgsFunc = null; 214It.IsAny<Func<object[], object, Task>>(), 217(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) => 224Func<object[], object, Task> returnTaskFunc = null; 230It.IsAny<Func<object[], object, Task>>(), 233(string methodName, Type[] parameterTypes, Func<object[], object, Task> handler, object state) =>
HubConnectionTests.cs (3)
850mockConnection.Setup(c => c.On(It.IsAny<string>(), It.IsAny<Type[]>(), It.IsAny<Func<object[], object, Task>>(), It.IsAny<object>())); 871mockConnection.Verify(c => c.On("someMethod", It.IsAny<Type[]>(), It.IsAny<Func<object[], object, Task>>(), It.IsAny<object>()), Times.Once); 872mockConnection.Verify(c => c.On("someMethod2", It.IsAny<Type[]>(), It.IsAny<Func<object[], object, Task>>(), 2), Times.Once);
TestHttpMessageHandler.cs (14)
151public void OnGet(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Get, pathAndQuery, handler); 152public void OnPost(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Post, pathAndQuery, handler); 153public void OnPut(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Put, pathAndQuery, handler); 154public void OnDelete(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Delete, pathAndQuery, handler); 155public void OnHead(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Head, pathAndQuery, handler); 156public void OnOptions(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Options, pathAndQuery, handler); 157public void OnTrace(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Trace, pathAndQuery, handler); 159public void OnRequest(HttpMethod method, string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) 175public void OnNegotiate(Func<HttpRequestMessage, CancellationToken, HttpResponseMessage> handler) => OnNegotiate((req, cancellationToken) => Task.FromResult(handler(req, cancellationToken))); 177public void OnNegotiate(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) 216public void OnLongPoll(Func<HttpRequestMessage, CancellationToken, HttpResponseMessage> handler) 221public void OnLongPoll(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) 236public void OnSocketSend(Func<byte[], CancellationToken, HttpResponseMessage> handler) => OnSocketSend((data, cancellationToken) => Task.FromResult(handler(data, cancellationToken))); 238public void OnSocketSend(Func<byte[], CancellationToken, Task<HttpResponseMessage>> handler)
Microsoft.AspNetCore.SignalR.Core (10)
DefaultHubLifetimeManager.cs (2)
99private Task SendToAllConnections(string methodName, object?[] args, Func<HubConnectionContext, object?, bool>? include, object? state = null, CancellationToken cancellationToken = default) 147private static void SendToGroupConnections(string methodName, object?[] args, ConcurrentDictionary<string, HubConnectionContext> connections, Func<HubConnectionContext, object?, bool>? include, object? state, ref List<Task>? tasks, ref SerializedHubMessage? message, CancellationToken cancellationToken)
IHubFilter.cs (1)
34Task OnDisconnectedAsync(HubLifetimeContext context, Exception? exception, Func<HubLifetimeContext, Exception?, Task> next) => next(context, exception);
Internal\DefaultHubDispatcher.cs (2)
33private readonly Func<HubLifetimeContext, Exception?, Task>? _onDisconnectedMiddleware; 77var disconnectedFilter = _onDisconnectedMiddleware;
Internal\HubFilterFactory.cs (1)
56public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception? exception, Func<HubLifetimeContext, Exception?, Task> next)
Internal\HubMethodDescriptor.cs (4)
29private Func<object, CancellationToken, IAsyncEnumerator<object?>>? _makeCancelableEnumerator; 225private static Func<object, CancellationToken, IAsyncEnumerator<object?>> CompileConvertToEnumerator(MethodInfo adapterMethodInfo, Type streamReturnType) 246var lambda = Expression.Lambda<Func<object, CancellationToken, IAsyncEnumerator<object?>>>(methodCall, parameters); 254private static Func<object, CancellationToken, IAsyncEnumerator<object?>> ConvertToEnumeratorWithReflection(MethodInfo adapterMethodInfo, Type streamReturnType)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (2)
Internal\RedisSubscriptionManager.cs (2)
13public async Task AddSubscriptionAsync(string id, HubConnectionContext connection, Func<string, HubConnectionStore, Task> subscribeMethod) 42public async Task RemoveSubscriptionAsync(string id, HubConnectionContext connection, object state, Func<object, string, Task> unsubscribeMethod)
Microsoft.AspNetCore.SignalR.Tests (6)
NativeAotTests.cs (1)
417public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
TestFilters.cs (5)
35public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 66public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 97public Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 121public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 165public Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next)
Microsoft.AspNetCore.SignalR.Tests.Utils (3)
src\Shared\SignalR\LogSinkProvider.cs (2)
32public void Log<TState>(string categoryName, LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 71public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Shared\SignalR\WrappingLoggerFactory.cs (1)
73public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
ListLoggerFactory.cs (1)
80LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.TestHost.Tests (3)
ClientHandlerTests.cs (1)
719public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) => formatter(state, exception);
HttpContextBuilderTests.cs (1)
355public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) => formatter(state, exception);
TestClientTests.cs (1)
744public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) => formatter(state, exception);
Microsoft.Build (18)
BackEnd\Components\Scheduler\Scheduler.cs (1)
933private void AssignUnscheduledRequestsWithPlan(List<ScheduleResponse> responses, HashSet<int> idleNodes, Func<SchedulingPlan.PlanConfigData, SchedulingPlan.PlanConfigData, bool> comparisonFunction)
BuildCheck\Infrastructure\ConfigurationProvider.cs (1)
142private TConfig[] FillConfiguration<TConfig, TRule>(string projectFullPath, IReadOnlyList<TRule> ruleIds, Func<string, TRule, TConfig> configurationProvider)
Evaluation\Expander\ArgumentParser.cs (2)
397internal static bool TryExecuteArithmeticOverload(object[] args, Func<long, long, long> integerOperation, Func<double, double, double> realOperation, out object? resultValue)
Instance\TaskRegistry.cs (1)
1114private static readonly Func<Type, object, bool> s_taskFactoryTypeFilter = IsTaskFactoryClass;
Logging\LoggerDescription.cs (2)
245private static readonly Func<Type, object, bool> s_forwardingLoggerClassFilter = IsForwardingLoggerClass; 250private static readonly Func<Type, object, bool> s_loggerClassFilter = IsLoggerClass;
TaskEngineAssemblyResolver.cs (1)
164private Func<AssemblyLoadContext, AssemblyName, Assembly> _eventHandler = null;
TypeLoader.cs (9)
34private static readonly ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>(); 39private static readonly ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfReflectionOnlyLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>(); 44private Func<Type, object, bool> _isDesiredType; 65internal TypeLoader(Func<Type, object, bool> isDesiredType) 238private LoadedType GetLoadedType(ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> cache, string typeName, AssemblyLoadInfo assembly, bool useTaskHost) 270private Func<Type, object, bool> _isDesiredType; 304internal AssemblyInfoToLoadedTypes(Func<Type, object, bool> typeFilter, AssemblyLoadInfo loadInfo)
Utilities\ImmutableCollectionsExtensions.cs (1)
29public static bool Any<TElement, TArg>(this ImmutableArray<TElement> immutableArray, Func<TElement, TArg, bool> predicate, TArg arg)
Microsoft.Build.Engine.OM.UnitTests (17)
Definition\ProjectItem_Tests.cs (1)
748Func<string, char, string> setSlashes = (s, c) => s.Replace('/', c).Replace('\\', c);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (16)
25public ElementLinkPair<CT> AppendNewChaildWithVerify<CT>(ObjectType where, string id, Func<ProjectRootElement, string, CT> adder, Func<CT, string, bool> matcher) 41public ElementLinkPair<CT> AppendNewNamedChaildWithVerify<CT>(ObjectType where, string name, Func<ProjectRootElement, string, CT> adder) 45public ElementLinkPair<CT> AppendNewLabeledChaildWithVerify<CT>(ObjectType where, string label, Func<ProjectRootElement, string, CT> adder) 58public ElementLinkPair<CT> AddNewChaildWithVerify<CT>(ObjectType where, string id, Func<T, string, CT> adder, Func<CT, string, bool> matcher) 70public ElementLinkPair<CT> AddNewNamedChaildWithVerify<CT>(ObjectType where, string name, Func<T, string, CT> adder) 74public ElementLinkPair<CT> AddNewLabeledChaildWithVerify<CT>(ObjectType where, string label, Func<T, string, CT> adder) 86public void Append2NewChildrenWithVerify<CT>(string id, Func<ProjectRootElement, string, CT> adder, Func<CT, string, bool> matcher, out ElementLinkPair<CT> c1, out ElementLinkPair<CT> c2) 93public void Append2NewNamedChildrenWithVerify<CT>(string name, Func<ProjectRootElement, string, CT> adder, out ElementLinkPair<CT> c1, out ElementLinkPair<CT> c2) 100public void Append2NewLabeledChildrenWithVerify<CT>(string label, Func<ProjectRootElement, string, CT> adder, out ElementLinkPair<CT> c1, out ElementLinkPair<CT> c2) 107public void Add2NewChildrenWithVerify<CT>(string id, Func<T, string, CT> adder, Func<CT, string, bool> matcher, out ElementLinkPair<CT> c1, out ElementLinkPair<CT> c2) 114public void Add2NewNamedChildrenWithVerify<CT>(string name, Func<T, string, CT> adder, out ElementLinkPair<CT> c1, out ElementLinkPair<CT> c2) 121public void Add2NewLabeledChildrenWithVerify<CT>(string label, Func<T, string, CT> adder, out ElementLinkPair<CT> c1, out ElementLinkPair<CT> c2)
Microsoft.Build.Engine.UnitTests (2)
BackEnd\SdkResolverLoader_Tests.cs (1)
457public Func<string, ElementLocation, IReadOnlyList<string>> FindPotentialSdkResolversFunc { get; set; }
Graph\ResultCacheBasedBuilds_Tests.cs (1)
430Func<ProjectGraphNode, ExpectedNodeBuildOutput, string[]> expectedOutputProducer = null,
Microsoft.Build.Framework (19)
BuildCheck\EnumerableExtensions.cs (2)
87Func<TValue, TValue, TValue> mergeValues) 115Func<TValue, TValue, TValue> mergeValues)
BuildEventArgs.cs (1)
287internal static Func<string, string?[], string> ResourceStringFormatter = (resourceName, arguments) =>
BuildException\BuildExceptionSerializationHelper.cs (8)
14public TypeConstructionTuple(Type type, Func<string, Exception?, BuildExceptionBase> factory) 21public Func<string, Exception?, BuildExceptionBase> Factory { get; } 24private static Dictionary<string, Func<string, Exception?, BuildExceptionBase>>? s_exceptionFactories; 26private static readonly Func<string, Exception?, BuildExceptionBase> s_defaultFactory = 49var exceptionFactories = new Dictionary<string, Func<string, Exception?, BuildExceptionBase>>(); 54Func<string, Exception?, BuildExceptionBase> exceptionFactory = typeConstructionTuple.Factory; 76internal static Func<string, Exception?, BuildExceptionBase> CreateExceptionFactory(string serializationType) 78Func<string, Exception?, BuildExceptionBase>? factory = null;
RoslynImmutableInterlocked.cs (8)
71public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 195public static bool Update<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, TArg, ImmutableSegmentedDictionary<TKey, TValue>> transformer, TArg transformerArgument) 266/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 267public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 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) 372/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 373public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
Microsoft.Build.Tasks.CodeAnalysis (2)
src\Compilers\Shared\BuildServerConnection.cs (2)
175Func<string, ICompilerServerLogger, bool> tryCreateServerFunc, 204Func<string, ICompilerServerLogger, bool> tryCreateServerFunc,
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
TestUtilities\EnumerableExtensions.cs (1)
12public static IEnumerable<S> SelectWithIndex<T, S>(this IEnumerable<T> items, Func<T, int, S> selector)
Microsoft.Build.Tasks.UnitTests (3)
DownloadFile_Tests.cs (2)
391private readonly Func<HttpRequestMessage, CancellationToken, HttpResponseMessage> _func; 393public MockHttpMessageHandler(Func<HttpRequestMessage, CancellationToken, HttpResponseMessage> func)
Unzip_Tests.cs (1)
460var ExecuteCommand = (string command, string filePath) =>
Microsoft.Build.UnitTests.Shared (1)
ObjectModelHelpers.cs (1)
137public static void AssertItemEvaluationFromGenericItemEvaluator(Func<string, ProjectCollection, IList<ITestItem>> itemEvaluator, [StringSyntax(StringSyntaxAttribute.Xml)] string projectContents, string[] inputFiles, string[] expectedInclude, bool makeExpectedIncludeAbsolute = false, Dictionary<string, string>[] expectedMetadataPerItem = null, bool normalizeSlashes = false)
Microsoft.Cci.Extensions (4)
Extensions\CSharp\CSharpCciExtensions.cs (4)
856public static object GetInterfaceImplementationAttributeConstructorArgument(this ITypeReference interfaceImplementation, uint typeDefinitionToken, string assemblyPath, SRMetadataPEReaderCache metadataReaderCache, Func<SRMetadataReader, CustomAttribute, (bool, object)> argumentResolver) 880public static object GetGenericParameterConstraintConstructorArgument(this IGenericParameter parameter, int constraintIndex, string assemblyPath, SRMetadataPEReaderCache metadataReaderCache, Func<SRMetadataReader, CustomAttribute, (bool, object)> argumentResolver) 895private static object GetCustomAttributeArgument(SRMetadataReader metadataReader, CustomAttributeHandleCollection customAttributeHandles, Func<SRMetadataReader, CustomAttribute, (bool, object)> argumentResolver) 956internal static readonly Func<SRMetadataReader, CustomAttribute, (bool, object)> NullableConstructorArgumentParser = (reader, attribute) =>
Microsoft.CodeAnalysis (157)
Collections\ArrayBuilderExtensions.cs (3)
27public static bool Any<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 51public static bool All<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 111public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TArg, TResult> map, TArg arg)
Collections\CachingFactory.cs (2)
47private readonly Func<TKey, TValue, bool> _keyValueEquality; 52Func<TKey, TValue, bool> keyValueEquality) :
Collections\ImmutableArrayExtensions.cs (18)
156public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> items, Func<TItem, TArg, TResult> map, TArg arg) 240public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, Func<TItem, TArg, TResult> selector, TArg arg) 403public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, Func<TItem, TArg, OneOrMany<TResult>> selector, TArg arg) 421public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, CancellationToken, ValueTask<TResult>> selector, CancellationToken cancellationToken) 485public static ImmutableArray<TResult> ZipAsArray<T1, T2, TResult>(this ImmutableArray<T1> self, ImmutableArray<T2> other, Func<T1, T2, TResult> map) 545public static ImmutableArray<T> WhereAsArray<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 548private static ImmutableArray<T> WhereAsArrayImpl<T, TArg>(ImmutableArray<T> array, Func<T, bool>? predicateWithoutArg, Func<T, TArg, bool>? predicateWithArg, TArg arg) 617public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 633public static bool All<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 665public static async Task<bool> AnyAsync<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, Task<bool>> predicateAsync, TArg arg) 697public static TValue? FirstOrDefault<TValue, TArg>(this ImmutableArray<TValue> array, Func<TValue, TArg, bool> predicate, TArg arg) 710public static TValue Single<TValue, TArg>(this ImmutableArray<TValue> array, Func<TValue, TArg, bool> predicate, TArg arg) 1138public static int Sum<T>(this ImmutableArray<T> items, Func<T, int, int> selector) 1315internal static int BinarySearch<TElement, TValue>(this ImmutableArray<TElement> array, TValue value, Func<TElement, TValue, int> comparer) 1318internal static int BinarySearch<TElement, TValue>(this ReadOnlySpan<TElement> array, TValue value, Func<TElement, TValue, int> comparer) 1346internal static int BinarySearch<TElement, TValue>(this ImmutableSegmentedList<TElement> array, TValue value, Func<TElement, TValue, int> comparer)
Collections\OrderPreservingMultiDictionary.cs (2)
112public bool TryGetValue<TArg>(K key, Func<V, TArg, bool> predicate, TArg arg, [MaybeNullWhen(false)] out V value) 232public bool TryGetValue<TArg>(Func<V, TArg, bool> predicate, TArg arg, [MaybeNullWhen(false)] out V value)
Collections\TemporaryArrayExtensions.cs (3)
89public static T? SingleOrDefault<T, TArg>(this in TemporaryArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 113public static T? FirstOrDefault<T, TArg>(this in TemporaryArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 124public static int IndexOf<T, TArg>(this in TemporaryArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
CommandLine\CommonCompiler.cs (1)
209internal virtual Func<string, MetadataReferenceProperties, PortableExecutableReference> GetMetadataProvider()
CommandLine\CommonCompiler.LoggingMetadataFileReferenceResolver.cs (2)
17private readonly Func<string, MetadataReferenceProperties, PortableExecutableReference> _provider; 19public LoggingMetadataFileReferenceResolver(RelativePathResolver pathResolver, Func<string, MetadataReferenceProperties, PortableExecutableReference> provider, TouchedFileLogger? logger)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
40private readonly Func<SyntaxTree, CancellationToken, bool> _isGeneratedCode;
DiagnosticAnalyzer\AnalyzerExecutor.cs (15)
334out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 388out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 498out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 547out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 600out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 645out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 672Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 696Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 920Action<AnalyzerDiagnosticReporter, Func<Diagnostic, CancellationToken, bool>, ExecutionData, TArgs, CancellationToken> executeActions, 921Action<HashSet<TBlockAction>, AnalyzerDiagnosticReporter, Func<Diagnostic, CancellationToken, bool>, ExecutionData, TArgs, CancellationToken> executeBlockActions, 960out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 1020out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 1036Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1119out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 1134Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic,
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (19)
563private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 592Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 686private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 731Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 770private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 807internal Func<Diagnostic, CancellationToken, bool> IsSupportedDiagnostic => _isSupportedDiagnostic; 825Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1133private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1190Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1381private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1450Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1513private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1555Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1592private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1625Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1665private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1733Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1775private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1840Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic,
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (1)
43internal static void VerifyArguments(Diagnostic diagnostic, Compilation? compilation, Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, CancellationToken cancellationToken)
InternalUtilities\ArrayExtensions.cs (1)
156public static bool SequenceEqual<T>(this T[]? first, T[]? second, Func<T, T, bool> comparer)
InternalUtilities\ConcurrentDictionaryExtensions.cs (2)
28public static TValue GetOrAdd<TKey, TArg, TValue>(this ConcurrentDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 47Func<TKey, TArg, TValue> addValueFactory,
InternalUtilities\EnumerableExtensions.cs (12)
23public static int Count<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 184public static T? FirstOrDefault<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 195public static bool Any<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 233public static T? FirstOrNull<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 367public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, int, TResult> selector) 400public static ImmutableArray<TResult> SelectAsArray<TSource, TResult, TArg>(this IReadOnlyCollection<TSource>? source, Func<TSource, TArg, TResult> selector, TArg arg) 428public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this IEnumerable<TItem>? source, Func<TItem, TArg, IEnumerable<TResult>> selector, TArg arg) 453public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this IReadOnlyCollection<TItem>? source, Func<TItem, TArg, IEnumerable<TResult>> selector, TArg arg) 496public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this IEnumerable<TItem> source, Func<TItem, CancellationToken, ValueTask<TResult>> selector, CancellationToken cancellationToken) 537Func<TItem, CancellationToken, Task<IEnumerable<TResult>>> selector, 862public static bool SequenceEqual<T>(this IEnumerable<T>? first, IEnumerable<T>? second, Func<T, T, bool> comparer) 896public static T? AggregateOrDefault<T>(this IEnumerable<T> source, Func<T, T, T> func)
InternalUtilities\OneOrMany.cs (4)
130public OneOrMany<TResult> Select<TResult, TArg>(Func<T, TArg, TResult> selector, TArg arg) 152public T? FirstOrDefault<TArg>(Func<T, TArg, bool> predicate, TArg arg) 172public bool All<TArg>(Func<T, TArg, bool> predicate, TArg arg) 181public bool Any<TArg>(Func<T, TArg, bool> predicate, TArg arg)
InternalUtilities\SpanUtilities.cs (1)
11public static bool All<TElement, TParam>(this ReadOnlySpan<TElement> span, TParam param, Func<TElement, TParam, bool> predicate)
MetadataReader\MetadataReaderExtensions.cs (1)
177internal static bool DeclaresType(this MetadataReader reader, Func<MetadataReader, TypeDefinition, bool> predicate)
PEWriter\CustomDebugInfoWriter.cs (1)
167Func<LocalScope, ILocalDefinition, T> getInfo)
SourceGeneration\Nodes\PredicateSyntaxStrategy.cs (5)
18private readonly Func<GeneratorSyntaxContext, CancellationToken, T> _transformFunc; 20private readonly Func<SyntaxNode, CancellationToken, bool> _filterFunc; 24Func<SyntaxNode, CancellationToken, bool> filterFunc, 25Func<GeneratorSyntaxContext, CancellationToken, T> transformFunc, 118static ImmutableArray<SyntaxNode> getFilteredNodes(SyntaxNode root, Func<SyntaxNode, CancellationToken, bool> func, CancellationToken token)
SourceGeneration\Nodes\SyntaxValueProvider.cs (2)
42public IncrementalValuesProvider<T> CreateSyntaxProvider<T>(Func<SyntaxNode, CancellationToken, bool> predicate, Func<GeneratorSyntaxContext, CancellationToken, T> transform)
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (2)
80Func<SyntaxNode, CancellationToken, bool> predicate, 81Func<GeneratorAttributeSyntaxContext, CancellationToken, T> transform)
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (2)
57Func<SyntaxNode, CancellationToken, bool> predicate) 156Func<SyntaxNode, CancellationToken, bool> predicate,
SourceGeneration\Nodes\TransformNode.cs (3)
20private readonly Func<TInput, CancellationToken, ImmutableArray<TOutput>> _func; 26public TransformNode(IIncrementalGeneratorNode<TInput> sourceNode, Func<TInput, CancellationToken, TOutput> userFunc, bool wrapUserFunc = false, IEqualityComparer<TOutput>? comparer = null, string? name = null) 31public TransformNode(IIncrementalGeneratorNode<TInput> sourceNode, Func<TInput, CancellationToken, ImmutableArray<TOutput>> userFunc, bool wrapUserFunc = false, IEqualityComparer<TOutput>? comparer = null, string? name = null)
SourceGeneration\Nodes\ValueSourceExtensions.cs (7)
16public static IncrementalValueProvider<TResult> Select<TSource, TResult>(this IncrementalValueProvider<TSource> source, Func<TSource, CancellationToken, TResult> selector) => new IncrementalValueProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions); 18public static IncrementalValuesProvider<TResult> Select<TSource, TResult>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, TResult> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions); 21public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValueProvider<TSource> source, Func<TSource, CancellationToken, ImmutableArray<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions); 23public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValueProvider<TSource> source, Func<TSource, CancellationToken, IEnumerable<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector.WrapUserFunctionAsImmutableArray(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions); 25public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, ImmutableArray<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector, wrapUserFunc: source.CatchAnalyzerExceptions), source.CatchAnalyzerExceptions); 27public static IncrementalValuesProvider<TResult> SelectMany<TSource, TResult>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, IEnumerable<TResult>> selector) => new IncrementalValuesProvider<TResult>(new TransformNode<TSource, TResult>(source.Node, selector.WrapUserFunctionAsImmutableArray(source.CatchAnalyzerExceptions)), source.CatchAnalyzerExceptions); 38internal static IncrementalValuesProvider<TSource> Where<TSource>(this IncrementalValuesProvider<TSource> source, Func<TSource, CancellationToken, bool> predicate) => source.SelectMany((item, c) => predicate(item, c) ? ImmutableArray.Create(item) : ImmutableArray<TSource>.Empty);
SourceGeneration\UserFunction.cs (4)
62internal static Func<TInput, CancellationToken, TOutput> WrapUserFunction<TInput, TOutput>(this Func<TInput, CancellationToken, TOutput> userFunction, bool catchAnalyzerExceptions) 77internal static Func<TInput, CancellationToken, ImmutableArray<TOutput>> WrapUserFunctionAsImmutableArray<TInput, TOutput>(this Func<TInput, CancellationToken, IEnumerable<TOutput>> userFunction, bool catchAnalyzerExceptions)
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (3)
340Func<int, TArg, byte[]> getMethodCustomDebugInfo, 341Func<int, TArg, ImmutableArray<string>> getMethodImportStrings, 488Func<int, TArg, ImmutableArray<string>> getMethodImportStrings)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
57public bool All<TArg>(Func<TKey, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
57public bool All<TArg>(Func<TValue, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (9)
72public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 193public static bool Update<T, TArg>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, TArg, ImmutableSegmentedHashSet<T>> transformer, TArg transformerArgument) 317public static bool Update<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, TArg, ImmutableSegmentedDictionary<TKey, TValue>> transformer, TArg transformerArgument) 388/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 389public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 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) 494/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 495public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\ArrayBuilder.cs (4)
235public int FindIndex<TArg>(Func<T, TArg, bool> match, TArg arg) 238public int FindIndex<TArg>(int startIndex, Func<T, TArg, bool> match, TArg arg) 241public int FindIndex<TArg>(int startIndex, int count, Func<T, TArg, bool> match, TArg arg) 280public void RemoveAll<TArg>(Func<T, TArg, bool> match, TArg arg)
src\Dependencies\PooledObjects\PooledDelegates.cs (11)
207Func<TKey, TArg, TValue> unboundFunction, TArg argument, 211return GetPooledDelegate<CreateValueCallbackWithBoundArgument<TKey, TArg, TValue>, TArg, Func<TKey, TArg, TValue>, ConditionalWeakTable<TKey, TValue>.CreateValueCallback>(unboundFunction, argument, out boundFunction); 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); 248/// Gets a <see cref="Func{T1, T2, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 279public static Releaser GetPooledFunction<T1, T2, TArg, TResult>(Func<T1, T2, TArg, TResult> unboundFunction, TArg argument, out Func<T1, T2, TResult> boundFunction) 280=> GetPooledDelegate<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>>(unboundFunction, argument, out boundFunction); 420Func<TKey, TArg, TValue>, 430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>> 437: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>> 439protected override Func<T1, T2, TResult> Bind()
Symbols\Attributes\MarshalPseudoCustomAttributeData.cs (1)
194Func<TTypeSymbol, TArg, TTypeSymbol> translator, TArg arg)
Syntax\SyntaxList.cs (3)
29protected internal override SyntaxNode ReplaceCore<TNode>(IEnumerable<TNode>? nodes = null, Func<TNode, TNode, SyntaxNode>? computeReplacementNode = null, IEnumerable<SyntaxToken>? tokens = null, Func<SyntaxToken, SyntaxToken, SyntaxToken>? computeReplacementToken = null, IEnumerable<SyntaxTrivia>? trivia = null, Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>? computeReplacementTrivia = null)
Syntax\SyntaxNode.cs (4)
854public TNode? FirstAncestorOrSelf<TNode, TArg>(Func<TNode, TArg, bool> predicate, TArg argument, bool ascendOutOfTrivia = true) 1580Func<TNode, TNode, SyntaxNode>? computeReplacementNode = null, 1582Func<SyntaxToken, SyntaxToken, SyntaxToken>? computeReplacementToken = null, 1584Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>? computeReplacementTrivia = null)
Syntax\SyntaxNodeExtensions.cs (6)
33Func<SyntaxNode, SyntaxNode, SyntaxNode>? computeReplacementNode, 35Func<SyntaxToken, SyntaxToken, SyntaxToken>? computeReplacementToken, 37Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>? computeReplacementTrivia) 56public static TRoot ReplaceNodes<TRoot, TNode>(this TRoot root, IEnumerable<TNode> nodes, Func<TNode, TNode, SyntaxNode> computeReplacementNode) 207public static TRoot ReplaceTokens<TRoot>(this TRoot root, IEnumerable<SyntaxToken> tokens, Func<SyntaxToken, SyntaxToken, SyntaxToken> computeReplacementToken) 236public static TRoot ReplaceTrivia<TRoot>(this TRoot root, IEnumerable<SyntaxTrivia> trivia, Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia> computeReplacementTrivia)
Microsoft.CodeAnalysis.Analyzers (10)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (1)
116ImmutableArray<IArgumentOperation> arguments, bool isUsedAsExtensionMethod, Func<SyntaxGenerator, IEnumerable<SyntaxNode>, SyntaxNode> getReplacementNode,
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
Microsoft.CodeAnalysis.AnalyzerUtilities (16)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
src\RoslynAnalyzers\Utilities\FlowAnalysis\Extensions\ListExtensions.cs (1)
24public static ImmutableArray<T> ExtractAll<T, TArg>(this List<T> list, Func<T, TArg, bool> predicate, TArg argument)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysisData.cs (1)
184public override void Reset(Func<AnalysisEntity, CopyAbstractValue, CopyAbstractValue> getResetValue)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (1)
796Func<TOperation, object?, PointsToAbstractValue?> baseVisit)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisData.cs (1)
88public override void Reset(Func<AnalysisEntity, PointsToAbstractValue, PointsToAbstractValue> getResetValue)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityBasedPredicateAnalysisData.cs (1)
131public virtual void Reset(Func<AnalysisEntity, TValue, TValue> getResetValue)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResultBuilder.cs (1)
45Func<BasicBlock, TAnalysisData, TBlockAnalysisResult> getBlockResult,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\MapAbstractDomain.cs (1)
128Func<TValue, TValue, TValue> intersect)
Microsoft.CodeAnalysis.BannedApiAnalyzers (9)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
Microsoft.CodeAnalysis.CodeStyle (172)
src\Analyzers\Core\Analyzers\UseAutoProperty\AccessedFields.cs (1)
28public AccessedFields Where<TArg>(Func<IFieldSymbol, TArg, bool> predicate, TArg arg)
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (3)
27public static bool Any<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 51public static bool All<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 111public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TArg, TResult> map, TArg arg)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (18)
156public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> items, Func<TItem, TArg, TResult> map, TArg arg) 240public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, Func<TItem, TArg, TResult> selector, TArg arg) 403public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, Func<TItem, TArg, OneOrMany<TResult>> selector, TArg arg) 421public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, CancellationToken, ValueTask<TResult>> selector, CancellationToken cancellationToken) 485public static ImmutableArray<TResult> ZipAsArray<T1, T2, TResult>(this ImmutableArray<T1> self, ImmutableArray<T2> other, Func<T1, T2, TResult> map) 545public static ImmutableArray<T> WhereAsArray<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 548private static ImmutableArray<T> WhereAsArrayImpl<T, TArg>(ImmutableArray<T> array, Func<T, bool>? predicateWithoutArg, Func<T, TArg, bool>? predicateWithArg, TArg arg) 617public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 633public static bool All<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 665public static async Task<bool> AnyAsync<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, Task<bool>> predicateAsync, TArg arg) 697public static TValue? FirstOrDefault<TValue, TArg>(this ImmutableArray<TValue> array, Func<TValue, TArg, bool> predicate, TArg arg) 710public static TValue Single<TValue, TArg>(this ImmutableArray<TValue> array, Func<TValue, TArg, bool> predicate, TArg arg) 1138public static int Sum<T>(this ImmutableArray<T> items, Func<T, int, int> selector) 1315internal static int BinarySearch<TElement, TValue>(this ImmutableArray<TElement> array, TValue value, Func<TElement, TValue, int> comparer) 1318internal static int BinarySearch<TElement, TValue>(this ReadOnlySpan<TElement> array, TValue value, Func<TElement, TValue, int> comparer) 1346internal static int BinarySearch<TElement, TValue>(this ImmutableSegmentedList<TElement> array, TValue value, Func<TElement, TValue, int> comparer)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
112public bool TryGetValue<TArg>(K key, Func<V, TArg, bool> predicate, TArg arg, [MaybeNullWhen(false)] out V value) 232public bool TryGetValue<TArg>(Func<V, TArg, bool> predicate, TArg arg, [MaybeNullWhen(false)] out V value)
src\Compilers\Core\Portable\Collections\TemporaryArrayExtensions.cs (3)
89public static T? SingleOrDefault<T, TArg>(this in TemporaryArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 113public static T? FirstOrDefault<T, TArg>(this in TemporaryArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 124public static int IndexOf<T, TArg>(this in TemporaryArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (1)
156public static bool SequenceEqual<T>(this T[]? first, T[]? second, Func<T, T, bool> comparer)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (3)
28public static TValue GetOrAdd<TKey, TArg, TValue>(this ConcurrentDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 47Func<TKey, TArg, TValue> addValueFactory, 56using var _b = PooledDelegates.GetPooledFunction(updateValueFactory, factoryArgument, out var pooledUpdateValueFactory);
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (12)
23public static int Count<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 184public static T? FirstOrDefault<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 195public static bool Any<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 233public static T? FirstOrNull<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 367public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, int, TResult> selector) 400public static ImmutableArray<TResult> SelectAsArray<TSource, TResult, TArg>(this IReadOnlyCollection<TSource>? source, Func<TSource, TArg, TResult> selector, TArg arg) 428public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this IEnumerable<TItem>? source, Func<TItem, TArg, IEnumerable<TResult>> selector, TArg arg) 453public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this IReadOnlyCollection<TItem>? source, Func<TItem, TArg, IEnumerable<TResult>> selector, TArg arg) 496public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this IEnumerable<TItem> source, Func<TItem, CancellationToken, ValueTask<TResult>> selector, CancellationToken cancellationToken) 537Func<TItem, CancellationToken, Task<IEnumerable<TResult>>> selector, 862public static bool SequenceEqual<T>(this IEnumerable<T>? first, IEnumerable<T>? second, Func<T, T, bool> comparer) 896public static T? AggregateOrDefault<T>(this IEnumerable<T> source, Func<T, T, T> func)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (4)
130public OneOrMany<TResult> Select<TResult, TArg>(Func<T, TArg, TResult> selector, TArg arg) 152public T? FirstOrDefault<TArg>(Func<T, TArg, bool> predicate, TArg arg) 172public bool All<TArg>(Func<T, TArg, bool> predicate, TArg arg) 181public bool Any<TArg>(Func<T, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
57public bool All<TArg>(Func<TKey, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
57public bool All<TArg>(Func<TValue, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (9)
72public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 193public static bool Update<T, TArg>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, TArg, ImmutableSegmentedHashSet<T>> transformer, TArg transformerArgument) 317public static bool Update<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, TArg, ImmutableSegmentedDictionary<TKey, TValue>> transformer, TArg transformerArgument) 388/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 389public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 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) 494/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 495public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\ArrayBuilder.cs (4)
235public int FindIndex<TArg>(Func<T, TArg, bool> match, TArg arg) 238public int FindIndex<TArg>(int startIndex, Func<T, TArg, bool> match, TArg arg) 241public int FindIndex<TArg>(int startIndex, int count, Func<T, TArg, bool> match, TArg arg) 280public void RemoveAll<TArg>(Func<T, TArg, bool> match, TArg arg)
src\Dependencies\PooledObjects\PooledDelegates.cs (11)
207Func<TKey, TArg, TValue> unboundFunction, TArg argument, 211return GetPooledDelegate<CreateValueCallbackWithBoundArgument<TKey, TArg, TValue>, TArg, Func<TKey, TArg, TValue>, ConditionalWeakTable<TKey, TValue>.CreateValueCallback>(unboundFunction, argument, out boundFunction); 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); 248/// Gets a <see cref="Func{T1, T2, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 279public static Releaser GetPooledFunction<T1, T2, TArg, TResult>(Func<T1, T2, TArg, TResult> unboundFunction, TArg argument, out Func<T1, T2, TResult> boundFunction) 280=> GetPooledDelegate<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>>(unboundFunction, argument, out boundFunction); 420Func<TKey, TArg, TValue>, 430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>> 437: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>> 439protected override Func<T1, T2, TResult> Bind()
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
21private static Func<ImmutableSegmentedList<VoidResult>, CancellationToken, ValueTask> Convert(Func<CancellationToken, ValueTask> processBatchAsync)
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (4)
17Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync, 24Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync, 35private static Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<VoidResult>> Convert(Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync)
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
43private readonly Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<TResult>> _processBatchAsync; 106Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<TResult>> processBatchAsync,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICollectionExtensions.cs (1)
14public static ImmutableArray<T> WhereAsArray<T, TState>(this IEnumerable<T> values, Func<T, TState, bool> predicate, TState state)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (9)
84Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 153Func<INamedTypeSymbol, ISymbol, bool> isValid, 267Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 327Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 328Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 329Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 402Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 403Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 404Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (5)
24public static void RemoveOrTransformAll<T, TArg>(this List<T> list, Func<T, TArg, T?> transform, TArg arg) 43public static void RemoveOrTransformAll<T, TArg>(this List<T> list, Func<T, TArg, T?> transform, TArg arg) 62public static void RemoveOrTransformAll<T, TArg>(this ArrayBuilder<T> list, Func<T, TArg, T?> transform, TArg arg) 87public static bool TryRemoveFirst<T, TArg>(this IList<T> list, Func<T, TArg, bool> selector, TArg arg, [NotNullWhen(true)] out T? removedItem) 116public static int IndexOf<T, TArg>(this IList<T> list, Func<T, TArg, bool> predicate, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ObjectWriterExtensions.cs (1)
26public static ImmutableArray<T> ReadArray<T, TArg>(this ObjectReader reader, Func<ObjectReader, TArg, T> read, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (2)
32this SourceText text, TextSpan span, Func<int, CancellationToken, bool> isPositionHidden, CancellationToken cancellationToken) 44this SourceText text, TextSpan span, Func<int, CancellationToken, bool> isPositionHidden,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (4)
540private static readonly Func<SyntaxTriviaList, int, SyntaxToken> s_findSkippedTokenForward = FindSkippedTokenForward; 570private static readonly Func<SyntaxTriviaList, int, SyntaxToken> s_findSkippedTokenBackward = FindSkippedTokenBackward; 620var findSkippedToken = includeSkipped ? s_findSkippedTokenForward : ((l, p) => default); 659var findSkippedToken = includeSkipped ? s_findSkippedTokenBackward : ((l, p) => default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (1)
86public bool ForEachCurrentWrite<TArg>(ISymbol symbol, Func<IOperation, TArg, bool> action, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
192Func<FormattingContext, IndentBlockOperation, SyntaxToken> effectiveBaseTokenGetter = operation.Option.IsOn(IndentBlockOption.RelativeToFirstTokenOnBaseTokenLine) 203Func<FormattingContext, SyntaxToken, int> relativeIndentationBaseIndentationGetter =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.IndentationData.cs (6)
43private readonly Func<FormattingContext, IndentBlockOperation, SyntaxToken> _effectiveBaseTokenGetter; 45private readonly Func<FormattingContext, SyntaxToken, int> _baseIndentationGetter; 56public RelativeIndentationData(FormattingContext formattingContext, int inseparableRegionSpanStart, TextSpan textSpan, IndentBlockOperation operation, Func<FormattingContext, IndentBlockOperation, SyntaxToken> effectiveBaseTokenGetter, Func<FormattingContext, IndentBlockOperation, SyntaxToken, int> indentationDeltaGetter, Func<FormattingContext, SyntaxToken, int> baseIndentationGetter) 70private RelativeIndentationData(FormattingContext formattingContext, int inseparableRegionSpanStart, TextSpan textSpan, IndentBlockOperation operation, Func<FormattingContext, IndentBlockOperation, SyntaxToken> effectiveBaseTokenGetter, Func<FormattingContext, IndentBlockOperation, SyntaxToken, int> indentationDeltaGetter, Func<FormattingContext, SyntaxToken, int> baseIndentationGetter, int lazyIndentationDelta)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (4)
46private readonly Func<TokenData, TokenData, TriviaData> _getTriviaData; 47private readonly Func<TokenData, TokenData, TriviaData> _getOriginalTriviaData; 200private bool TwoTokensOnSameLineWorker(SyntaxToken token1, SyntaxToken token2, Func<TokenData, TokenData, TriviaData> triviaDataGetter) 282private int GetColumn(TokenData tokenData, Func<TokenData, TokenData, TriviaData> triviaDataGetter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
100public static void Log<TArg0, TArg1>(FunctionId functionId, Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, LogLevel logLevel = LogLevel.Debug) 192public static IDisposable LogBlock<TArg0, TArg1>(FunctionId functionId, Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
26public static LogMessage Create<TArg0, TArg1>(Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, LogLevel logLevel) 154private Func<TArg0, TArg1, string>? _messageGetter; 158internal static LogMessage Construct(Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (7)
179private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 180private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 182private static readonly Func<string, TextSpan, bool> s_wordIsAllUpperCase = (val, span) => 195private static readonly Func<string, TextSpan, bool> s_wordIsAllLowerCase = (val, span) => 209string name, TextSpan nameSpan, Func<string, TextSpan, bool> wordCheck, 248Func<string, TextSpan, bool> firstWordCheck, 249Func<string, TextSpan, bool> restWordCheck,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
383Func<TOwningSymbol, int, ITypeSymbol?> getContextualType, 539Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 591Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (4)
13public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, Func<TArg, CancellationToken, T>? synchronousComputeFunction, TArg arg) 16public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, TArg arg) 22public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, T> synchronousComputeFunction, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (10)
22Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, 23Func<TData, CancellationToken, T>? synchronousComputeFunction, 50private Func<TData, CancellationToken, Task<T>>? _asynchronousComputeFunction; 57private Func<TData, CancellationToken, T>? _synchronousComputeFunction; 112Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, 113Func<TData, CancellationToken, T>? synchronousComputeFunction, 126Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, 127Func<TData, CancellationToken, T>? synchronousComputeFunction, 386private readonly struct AsynchronousComputationToStart(Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, CancellationTokenSource cancellationTokenSource) 388public readonly Func<TData, CancellationToken, Task<T>> AsynchronousComputeFunction = asynchronousComputeFunction;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ComparerWithState.cs (2)
12public static int CompareTo<T, S>(T first, T second, S state, ImmutableArray<Func<T, S, IComparable>> comparableMethods) 14foreach (var comparableMethod in comparableMethods)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
28public static V GetOrAdd<K, V, TArg>(this IDictionary<K, V> dictionary, K key, Func<K, TArg, V> function, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ReferenceCountedDisposableCache.cs (1)
21public IReferenceCountedDisposable<ICacheEntry<TKey, TValue>> GetOrCreate<TArg>(TKey key, Func<TKey, TArg, TValue> valueCreator, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.cs (4)
22Func<TSource, CancellationToken, ValueTask> body) 34Func<TSource, CancellationToken, ValueTask> body) 46Func<TSource, CancellationToken, ValueTask> body) 58Func<TSource, CancellationToken, ValueTask> body)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (13)
41public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 59public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 76public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 113private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 219public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 237public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 254public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 278private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 417public readonly Func<TSource, CancellationToken, ValueTask> LoopBody; 422protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 590Func<TSource, CancellationToken, ValueTask> body) : 616Func<TSource, CancellationToken, ValueTask> body) : 643Func<T, CancellationToken, ValueTask> body) :
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (3)
121Func<TArg, CancellationToken, ValueTask<TIntermediate>> func, 122Func<TIntermediate, TArg, TResult> transform, 152static ValueTask<TResult> UnwrapAndTransformAsync(ValueTask<TIntermediate> intermediateResult, Func<TIntermediate, TArg, TResult> transform, TArg arg, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (3)
20private readonly Func<int, IParameterSymbol, int> _parameterAggregator; 21private readonly Func<int, ISymbol, int> _symbolAggregator; 106private static int CombineHashCodes<T>(ImmutableArray<T> array, int currentHash, Func<int, T, int> func)
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
249Func<SyntaxNode, SyntaxNode, SyntaxNode> createAddOrRemoveHandler)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
331Func<SyntaxNode, SyntaxNode, SyntaxNode> createAddOrRemoveHandler)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (3)
75Func<SemanticModel, TNode, bool> canReplace, 119Func<SemanticModel, TNode, bool> canReplace, 154Func<ISyntaxFactsService, SyntaxNode, SyntaxNode> getSemanticBoundary,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\OptionsProvider.cs (2)
21private sealed class OptionsReaderProvider<TOptions>(IOptionsReader optionsReader, Func<IOptionsReader, string, TOptions> reader) : OptionsProvider<TOptions> 27public static OptionsProvider<TOptions> GetProvider<TOptions>(this IOptionsReader optionsReader, Func<IOptionsReader, string, TOptions> reader)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
src\Features\DiagnosticsTestUtilities\CodeActions\SharedVerifierState.cs (1)
31private Func<Solution, ProjectId, Solution>? _remainingOptionsSolutionTransform;
Microsoft.CodeAnalysis.Collections.Package (11)
ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
57public bool All<TArg>(Func<TKey, TArg, bool> predicate, TArg arg)
ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
57public bool All<TArg>(Func<TValue, TArg, bool> predicate, TArg arg)
RoslynImmutableInterlocked.cs (9)
72public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 193public static bool Update<T, TArg>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, TArg, ImmutableSegmentedHashSet<T>> transformer, TArg transformerArgument) 317public static bool Update<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, TArg, ImmutableSegmentedDictionary<TKey, TValue>> transformer, TArg transformerArgument) 388/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 389public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 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) 494/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 495public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
Microsoft.CodeAnalysis.CSharp (51)
Binder\Binder_Conversions.cs (2)
595Func<TArg, MethodSymbol, bool> predicate) 686private static MethodSymbol? TryFindSingleMethod<TArg>(TypeSymbol type, string name, TArg arg, Func<TArg, MethodSymbol, bool> predicate)
Binder\PatternExplainer.cs (1)
111Func<ImmutableArray<BoundDecisionDagNode>, bool, bool> handler)
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (1)
804private static int? UniqueBestValidIndex<T>(ImmutableArray<T> items, Func<T, bool> valid, Func<T, T, BetterResult> better)
BoundTree\BoundDecisionDag.cs (2)
93public BoundDecisionDag Rewrite(Func<BoundDecisionDagNode, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode>, BoundDecisionDagNode> makeReplacement) 120/// A trivial node replacement function for use with <see cref="Rewrite(Func{BoundDecisionDagNode, IReadOnlyDictionary{BoundDecisionDagNode, BoundDecisionDagNode}, BoundDecisionDagNode})"/>.
BoundTree\BoundNodeExtensions.cs (1)
110Func<TInterpolatedStringType, TArg, bool> stringCallback,
CSharpExtensions.cs (1)
304public static SyntaxToken ReplaceTrivia(this SyntaxToken token, IEnumerable<SyntaxTrivia> trivia, Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia> computeReplacementTrivia)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (2)
531private Symbol? VisitNamedTypeMember<T>(T member, Func<T, T, bool> predicate) 546private T? FindMatchingMember<T>(ISymbolInternal otherTypeOrNamespace, T sourceMember, Func<T, T, bool> predicate)
Emitter\Model\PEModuleBuilder.cs (1)
1833private MethodSymbol EnsurePrivateImplClassMethodExists<TArg>(SyntaxNode syntaxNode, string methodName, Func<SynthesizedPrivateImplementationDetailsType, TArg, MethodSymbol> createMethodSymbol, TArg arg, DiagnosticBag diagnostics)
FlowAnalysis\NullableWalker.cs (5)
4027(int slot, NullableFlowState resultState, Func<TypeSymbol, MethodSymbol?, int>? initialStateInferenceCompletion) = 4045Func<TypeSymbol, MethodSymbol?, int>? initialStateInferenceCompletion, 4074Func<TypeSymbol, MethodSymbol?, int> initialStateInferenceCompletion, 4110(int slot, NullableFlowState resultState, Func<TypeSymbol, MethodSymbol?, int>? completion) inferInitialObjectState( 4181Func<TypeSymbol, MethodSymbol?, int> inferInitialObjectStateAsContinuation(
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
33private static readonly Func<(int position, Snapshot snapshot), int, int> BinarySearchComparer = (current, target) => current.position.CompareTo(target);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
236public static bool CheckNestedFunctions(Scope scope, Func<Scope, NestedFunction, bool> func)
Lowering\ClosureConversion\ClosureConversion.cs (1)
664private BoundNode IntroduceFrame(BoundNode node, Analysis.ClosureEnvironment env, Func<ArrayBuilder<BoundExpression>, ArrayBuilder<LocalSymbol>, BoundNode> F)
Lowering\StateMachineRewriter\CapturedSymbol.cs (4)
26public abstract BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg); 39public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg) 57public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg) 77public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg)
Parser\LanguageParser.cs (3)
4297Func<LanguageParser, SyntaxKind, bool> abortFunction, 4339Func<LanguageParser, SyntaxKind, bool> abortFunction, 4387Func<LanguageParser, SyntaxKind, bool> abortFunction,
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
60Func<SyntaxNode, int?, bool> shouldSkip,
Symbols\FunctionTypeSymbol.cs (3)
40private readonly Func<Binder, BoundExpression, NamedTypeSymbol?>? _calculateDelegate; 45internal static FunctionTypeSymbol? CreateIfFeatureEnabled(SyntaxNode syntax, Binder binder, Func<Binder, BoundExpression, NamedTypeSymbol?> calculateDelegate) 52private FunctionTypeSymbol(Binder binder, Func<Binder, BoundExpression, NamedTypeSymbol?> calculateDelegate)
Symbols\Source\SourceAssemblySymbol.cs (1)
1669Func<AttributeSyntax, Binder?, bool> attributeMatches = attribute switch
Symbols\SubstitutedNamedTypeSymbol.cs (1)
28private static readonly Func<Symbol, NamedTypeSymbol, Symbol> s_symbolAsMemberFunc = SymbolExtensions.SymbolAsMember;
Symbols\Symbol_Attributes.cs (2)
305Func<AttributeSyntax, Binder?, bool>? attributeMatchesOpt = null, 589Func<AttributeSyntax, Binder, bool> attributeMatchesOpt,
Syntax\CSharpSyntaxNode.cs (3)
466Func<TNode, TNode, SyntaxNode>? computeReplacementNode = null, 468Func<SyntaxToken, SyntaxToken, SyntaxToken>? computeReplacementToken = null, 470Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>? computeReplacementTrivia = null)
Syntax\SyntaxReplacer.cs (12)
18Func<TNode, TNode, SyntaxNode>? computeReplacementNode = null, 20Func<SyntaxToken, SyntaxToken, SyntaxToken>? computeReplacementToken = null, 22Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>? computeReplacementTrivia = null) 43Func<SyntaxNode, SyntaxNode, SyntaxNode>? computeReplacementNode = null, 45Func<SyntaxToken, SyntaxToken, SyntaxToken>? computeReplacementToken = null, 47Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>? computeReplacementTrivia = null) 66private readonly Func<TNode, TNode, SyntaxNode>? _computeReplacementNode; 67private readonly Func<SyntaxToken, SyntaxToken, SyntaxToken>? _computeReplacementToken; 68private readonly Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>? _computeReplacementTrivia; 81Func<TNode, TNode, SyntaxNode>? computeReplacementNode, 83Func<SyntaxToken, SyntaxToken, SyntaxToken>? computeReplacementToken, 85Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>? computeReplacementTrivia)
Utilities\FirstAmongEqualsSet.cs (2)
43private readonly Func<T, T, int> _canonicalComparer; 48Func<T, T, int> canonicalComparer)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
231private static SyntaxKind Aggregate<T>(SyntaxKind seed, SyntaxList<T> nodes, Func<SyntaxKind, T, SyntaxKind> func)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
39Func<TParentExpression, InitializerExpressionSyntax, TParentExpression> withInitializer,
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
39Func<TMatch?, ExpressionSyntax, TElementSyntax> createElement)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
233Func<string, T, SyntaxToken> tokenFactory) 244Func<string, T, SyntaxToken> tokenFactory,
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
Completion\CompletionProviders\ConversionCompletionProviderTests.cs (1)
148Func<string, string, Task> verifyFunc = shouldSuggestConversion
TextStructureNavigation\TextStructureNavigatorTests.cs (2)
463Func<ITextStructureNavigator, SnapshotSpan, SnapshotSpan> func, 475Func<ITextStructureNavigator, SnapshotSpan, SnapshotSpan> func,
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
31internal Func<int, CSharpSyntaxContext, Task<ImmutableArray<RecommendedKeyword>>>? RecommendKeywordsAsync;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\NumericIntPtrTests.cs (1)
1592static void verifyOperators<T>(ImmutableArray<T> operators, Func<T, bool, bool> predicate, int expectedSigned, int expectedUnsigned)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (6)
FlowAnalysis\FlowTestBase.cs (6)
137protected T CompileAndGetModelAndConstructorInitializer<T>(string program, Func<SemanticModel, ConstructorInitializerSyntax, T> analysisDelegate, params MetadataReference[] references) 158protected T CompileAndGetModelAndPrimaryConstructorInitializer<T>(string program, Func<SemanticModel, PrimaryConstructorBaseTypeSyntax, T> analysisDelegate, params MetadataReference[] references) 179protected T CompileAndGetModelAndExpression<T>(string program, Func<SemanticModel, ExpressionSyntax, T> analysisDelegate, params MetadataReference[] references) 184protected T CompileAndGetModelAndExpression<T>(string program, Func<SemanticModel, ExpressionSyntax, T> analysisDelegate, TargetFramework targetFramework, bool assertNoDiagnostics, params MetadataReference[] references) 284protected IEnumerable<T> CompileAndGetModelAndMultipleExpressions<T>(string program, Func<SemanticModel, ExpressionSyntax, T> analysisDelegate, int treeindex = 0, int which = -1) 295protected IEnumerable<T> CompileAndGetModelAndMultipleStatements<T>(string program, Func<SemanticModel, StatementSyntax, T> analysisDelegate, int treeindex = 0, int which = -1)
Microsoft.CodeAnalysis.CSharp.Features (11)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (3)
37protected override SyntaxTriviaList CreatePragmaRestoreDirectiveTrivia(Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken) 44Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken) 51SyntaxToken disableOrRestoreKeyword, Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
532Func<IdentifierNameSyntax, TArg, bool> canConvertToSubpattern,
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
377Func<ExpressionSyntax, ExpressionSyntax, StatementSyntax> leafExpressionCreationMethod,
Copilot\CSharpCopilotCodeFixProvider.DocumentChangeCodeAction.cs (1)
23Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument,
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1480internal override Func<SyntaxToken, SyntaxToken, bool> AreTokensEquivalent
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
231private static SyntaxKind Aggregate<T>(SyntaxKind seed, SyntaxList<T> nodes, Func<SyntaxKind, T, SyntaxKind> func)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
39Func<TParentExpression, InitializerExpressionSyntax, TParentExpression> withInitializer,
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
39Func<TMatch?, ExpressionSyntax, TElementSyntax> createElement)
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
60Func<SyntaxNode, int?, bool> shouldSkip,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (3)
EnableNullable\EnableNullableTests.cs (3)
27private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolution = 43private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolutionFromRestoreKeyword = 59private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolutionFromDisableKeyword =
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Semantics\DelegateTypeTests.cs (1)
681private static IEnumerable<object?[]> GetMethodGroupData(Func<string, string, DiagnosticDescription[]> getExpectedDiagnostics)
Semantics\NativeIntegerTests.cs (1)
4833static void verifyOperators<T>(ImmutableArray<T> operators, Func<T, bool, bool> predicate, int expectedSigned, int expectedUnsigned)
Semantics\NullableReferenceTypesTests.cs (7)
126841Func<int, int, NullableAnnotation> getResult = (i, j) => NullableAnnotationExtensions.Join(inputs[i], inputs[j]); 126858Func<int, int, NullableFlowState> getResult = (i, j) => inputs[i].Join(inputs[j]); 126873Func<int, int, NullableAnnotation> getResult = (i, j) => NullableAnnotationExtensions.Meet(inputs[i], inputs[j]); 126889Func<int, int, NullableFlowState> getResult = (i, j) => inputs[i].Meet(inputs[j]); 126904Func<int, int, NullableAnnotation> getResult = (i, j) => NullableAnnotationExtensions.EnsureCompatible(inputs[i], inputs[j]); 126916private static void AssertEqual(NullableAnnotation[,] expected, Func<int, int, NullableAnnotation> getResult, int size) 126921private static void AssertEqual(NullableFlowState[,] expected, Func<int, int, NullableFlowState> getResult, int size)
SourceGeneration\GeneratorDriverTests.cs (4)
1683Func<int, CancellationToken, int> func = (input, _) => input; 1684Func<int, CancellationToken, int> throwsFunc = (input, _) => throw new InvalidOperationException("user code exception"); 1685Func<int, CancellationToken, int> timeoutFunc = (input, ct) => { ct.ThrowIfCancellationRequested(); return input; }; 1686Func<int, CancellationToken, int> otherTimeoutFunc = (input, _) => throw new OperationCanceledException();
SourceGeneration\StateTableTests.cs (2)
1363private readonly Func<DriverStateTable.Builder, NodeStateTable<T>, NodeStateTable<T>> _callback; 1365public CallbackNode(Func<DriverStateTable.Builder, NodeStateTable<T>, NodeStateTable<T>> callback)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\CSharpCompilationOptionsTests.cs (3)
34Func<CompilationOptions, T, CompilationOptions> factory, 41private static void TestPropertyGeneric<TOptions, T>(TOptions oldOptions, Func<TOptions, T, TOptions> factory, 99Func<CSharpCompilationOptions, T, CSharpCompilationOptions> factory,
Symbols\EnumTests.cs (1)
294private static string GenerateEnum(int n, Func<int, int, string> getMemberValue)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\CSharpParseOptionsTests.cs (1)
20private void TestProperty<T>(Func<CSharpParseOptions, T, CSharpParseOptions> factory, Func<CSharpParseOptions, T> getter, T validValue)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
1106internal CompilationVerifier CompileAndVerifyFieldMarshal(CSharpTestSource source, Func<string, PEAssembly, byte[]> getExpectedBlob, bool isField = true) =>
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
233Func<string, T, SyntaxToken> tokenFactory) 244Func<string, T, SyntaxToken> tokenFactory,
Microsoft.CodeAnalysis.Debugging.Package (3)
CustomDebugInfoReader.cs (3)
340Func<int, TArg, byte[]> getMethodCustomDebugInfo, 341Func<int, TArg, ImmutableArray<string>> getMethodImportStrings, 488Func<int, TArg, ImmutableArray<string>> getMethodImportStrings)
Microsoft.CodeAnalysis.EditorFeatures (12)
Classification\CopyPasteAndPrintingClassificationBufferTaggerProvider.Tagger.cs (2)
181bool requireSingleSpan, Func<TextSpan, SegmentedList<ClassifiedSpan>, Task> addTagsAsync) 190Func<TextSpan, SegmentedList<ClassifiedSpan>, Task> addAsync)
IntelliSense\ModelComputation.cs (1)
99Func<TModel, CancellationToken, Task<TModel>> transformModelAsync,
Organizing\OrganizeDocumentCommandHandler.cs (4)
96Func<ITextSnapshot, IUIThreadOperationContext, Task<Document?>> getCurrentDocumentAsync, 97Func<Document, CancellationToken, Task<Document>> getChangedDocumentAsync) 112Func<ITextSnapshot, IUIThreadOperationContext, Task<Document?>> getCurrentDocumentAsync, 113Func<Document, CancellationToken, Task<Document>> getChangedDocumentAsync)
Preview\AbstractPreviewFactoryService.cs (2)
276Func<TDocument, CancellationToken, ValueTask<ITextDocument>> createEditorDocumentAsync, 348Func<TDocument, CancellationToken, ValueTask<ITextDocument>> createEditorDocumentAsync,
Shared\Extensions\ITextViewExtensions.cs (2)
198Func<TTextView, ITextBuffer, TProperty> valueCreator) where TTextView : class, ITextView 212Func<TTextView, ITextBuffer, TProperty> valueCreator,
Shared\Extensions\ITextViewExtensions.PerSubjectBufferProperty.cs (1)
32Func<TTextView, ITextBuffer, TProperty> valueCreator,
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (6)
AbstractCommandHandlerTestState.cs (6)
268public bool SendEscape(Func<EscapeKeyCommandArgs, CommandExecutionContext, bool> commandHandler) 280public bool SendTab(Func<TabKeyCommandArgs, CommandExecutionContext, bool> commandHandler) 286public bool SendBackTab(Func<BackTabKeyCommandArgs, CommandExecutionContext, bool> commandHandler) 292public bool SendReturn(Func<ReturnKeyCommandArgs, CommandExecutionContext, bool> commandHandler) 319public bool SendInsertSnippetCommand(Func<InsertSnippetCommandArgs, CommandExecutionContext, bool> commandHandler) 325public bool SendSurroundWithCommand(Func<SurroundWithCommandArgs, CommandExecutionContext, bool> commandHandler)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
ITextImageHelpers.cs (1)
16private static readonly Func<int, int, string> s_textLog = (v1, v2) => string.Format("FullRange : from {0} to {1}", v1, v2);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Tagging\AsynchronousTaggerTests.cs (1)
248Func<TaggerContext<TextMarkerTag>, DocumentSnapshotSpan, IEnumerable<TagSpan<TextMarkerTag>>> callback,
Microsoft.CodeAnalysis.EditorFeatures.Wpf (5)
Lightup\ISmartRenameSessionFactoryWrapper.cs (1)
19private static readonly Func<object, SnapshotSpan, object?> s_createSmartRenameSession;
Lightup\ISmartRenameSessionWrapper.cs (1)
37private static readonly Func<object, CancellationToken, Task<IReadOnlyList<string>>> s_getSuggestionsAsync;
Lightup\LightupHelpers.cs (3)
353public static Func<T, TArg, TResult> CreateFunctionAccessor<T, TArg, TResult>(Type? type, string methodName, Type? argType, TResult defaultValue) 399Expression.Lambda<Func<T, TArg, TResult>>( 570private static Func<T, TArg, TResult> CreateFallbackFunction<T, TArg, TResult>(TResult defaultValue)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
ImmutableArrayExtensions.cs (1)
12internal static int IndexOf<TItem, TArg>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, TArg arg)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (3)
Completion\IContextProvider.cs (1)
19Func<ImmutableArray<IContextItem>, CancellationToken, ValueTask> callback,
Internal\RelatedDocuments\CSharpCopilotRelatedDocumentsService.cs (1)
26public ValueTask GetRelatedDocumentIdsAsync(Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken)
RelatedDocuments\ICopilotRelatedDocumentsService.cs (1)
16Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.ExternalAccess.Extensions (1)
Internal\ExtensionMessageHandlerFactory.cs (1)
39Func<object, Type, IExtensionMessageHandlerWrapper<TArgument>> wrapperCreator,
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
InlineHints\FSharpInlineHint.cs (2)
20private readonly Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? _getDescriptionAsync; 25Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? getDescriptionAsync = null)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
InlineHints\OmniSharpInlineHintsService.cs (2)
34private readonly Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>> _getDescriptionAsync; 41Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>> getDescriptionAsync)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (6)
Remote\RazorRemoteCallbackWrapper.cs (2)
20public ValueTask InvokeAsync(Func<T, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 23public ValueTask<TResult> InvokeAsync<TResult>(Func<T, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
Remote\RazorRemoteHostClient.cs (2)
40public async ValueTask<bool> TryInvokeAsync<TService>(Func<TService, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) where TService : class 46public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Func<TService, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) where TService : class
Remote\RazorRemoteServiceConnectionWrapper.cs (2)
25public ValueTask<bool> TryInvokeAsync(Func<TService, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 28public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Func<TService, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (52)
AddFileBanner\AddFileBannerHelpers.cs (1)
52Func<SyntaxTrivia, string, SyntaxTrivia> createTrivia)
AddImport\References\Reference.cs (1)
57private static readonly ImmutableArray<Func<Reference, Document, IComparable>> s_comparers
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (2)
46protected abstract SyntaxTriviaList CreatePragmaDisableDirectiveTrivia(Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken); 47protected abstract SyntaxTriviaList CreatePragmaRestoreDirectiveTrivia(Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
57Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (4)
28Func<SyntaxToken, TextSpan, SyntaxToken> getNewStartToken, 29Func<SyntaxToken, TextSpan, SyntaxToken> getNewEndToken, 107Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, 159Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode,
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionCacheServiceFactory.cs (2)
18Func<ImmutableSegmentedList<Project>, CancellationToken, ValueTask> processBatchAsync, 25private readonly Func<ImmutableSegmentedList<Project>, CancellationToken, ValueTask> _processBatchAsync = processBatchAsync;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (5)
436internal abstract Func<SyntaxToken, SyntaxToken, bool> AreTokensEquivalent { get; } 1855Func<TSyntaxNode, TSyntaxNode, bool> areEquivalent, 1856Func<TSyntaxNode, TSyntaxNode, bool>? areSimilar, 1923Func<TSyntaxNode, TSyntaxNode, bool> comparer, 2013private static int IndexOfEquivalent<TSyntaxNode>(SyntaxNode newNode, List<SyntaxNode?> oldNodes, int startIndex, Func<TSyntaxNode, TSyntaxNode, bool> comparer)
EditAndContinue\ActiveStatementsMap.cs (1)
298Func<TElement, TPosition, int> startPositionComparer)
EditAndContinue\RudeEditDiagnosticsBuilder.cs (1)
44public ImmutableArray<RudeEditDiagnostic> GetAllDiagnostics(Func<RudeEditDiagnostic, RudeEditReportingCondition, bool> includeDeferred)
EditAndContinue\TraceLog.cs (1)
92public async ValueTask WriteAsync(Func<Stream, CancellationToken, ValueTask> writer, DebuggingSessionId sessionId, string directory, string fileName, CancellationToken cancellationToken)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexBraceMatcher.cs (1)
109private static TNode? FindNode<TNode>(RegexNode node, VirtualChar ch, Func<TNode, VirtualChar, bool> predicate)
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
279Func<DocumentId, TextSpan, bool> filter,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (1)
212private static async Task<TResult?> GetOrDefaultAsync<TData, TResult>(TData value, Func<TData, CancellationToken, Task<TResult?>> funcAsync, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (1)
323private static readonly Func<int, ProjectId, string> s_enqueueLogger = (t, i) => string.Format("[{0}] {1}", t, i.ToString());
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
51Func<SyntaxToken, SyntaxToken, SyntaxToken> computeReplacementToken)
ExtractMethod\SelectionResult.cs (1)
127private bool CheckNodesInSelection(Func<ISyntaxFacts, SyntaxNode, bool> predicate)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
389Func<SemanticModel, SyntaxGenerator, TStatementSyntax> generateNullCheck,
InlineHints\InlineHint.cs (4)
20private readonly Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? _getDescriptionAsync; 25Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? getDescriptionAsync = null) 34Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? getDescriptionAsync = null) 44Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? getDescriptionAsync = null)
InlineHints\InlineHintHelpers.cs (1)
19public static Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? GetDescriptionFunction(int position, SymbolKey symbolKey, SymbolDescriptionOptions options)
Navigation\INavigableLocation.cs (2)
23internal sealed class NavigableLocation(Func<NavigationOptions, CancellationToken, Task<bool>> callback) : INavigableLocation 25private readonly Func<NavigationOptions, CancellationToken, Task<bool>> _callback = callback;
RelatedDocuments\AbstractRelatedDocumentsService.cs (2)
37Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken) 67Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync,
RelatedDocuments\IRelatedDocumentsService.cs (1)
22Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken);
RelatedDocuments\IRemoteRelatedDocumentsService.cs (1)
39Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> onRelatedDocumentFoundAsync,
Shared\Extensions\DocumentExtensions.cs (2)
44Func<SyntaxNode, SyntaxNode, SyntaxNode> computeReplacementNode, 73Func<Document, CancellationToken, Task<bool>> contextChecker,
SignatureHelp\CommonSignatureHelpUtilities.cs (1)
109Func<TSyntax, SyntaxToken, bool> isArgumentListToken,
src\Analyzers\Core\Analyzers\UseAutoProperty\AccessedFields.cs (1)
28public AccessedFields Where<TArg>(Func<IFieldSymbol, TArg, bool> predicate, TArg arg)
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
249Func<SyntaxNode, SyntaxNode, SyntaxNode> createAddOrRemoveHandler)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
331Func<SyntaxNode, SyntaxNode, SyntaxNode> createAddOrRemoveHandler)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (2)
127private ProjectOptionsChangeAction(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution) 132public static ProjectOptionsChangeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution)
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (3)
340Func<int, TArg, byte[]> getMethodCustomDebugInfo, 341Func<int, TArg, ImmutableArray<string>> getMethodImportStrings, 488Func<int, TArg, ImmutableArray<string>> getMethodImportStrings)
SymbolSearch\Windows\SymbolSearchUpdateEngine.cs (2)
59Func<Exception, CancellationToken, bool> reportAndSwallowExceptionUnlessCanceled) 118Func<AddReferenceDatabase, Symbol, TResult> createResult,
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (1)
58private readonly Func<Exception, CancellationToken, bool> _reportAndSwallowExceptionUnlessCanceled;
Wrapping\WrapItemsAction.cs (1)
20internal sealed class WrapItemsAction(string title, string parentTitle, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument)
Microsoft.CodeAnalysis.Features.Test.Utilities (6)
EditAndContinue\ActiveStatementsDescription.cs (1)
132Func<string, string, SyntaxTree> syntaxTreeFactory,
EditAndContinue\MockActiveStatementSpanProvider.cs (2)
14public Func<Solution, ImmutableArray<DocumentId>, ImmutableArray<ImmutableArray<ActiveStatementSpan>>>? GetBaseActiveStatementSpansImpl; 15public Func<TextDocument, ActiveStatementSpanProvider, ImmutableArray<ActiveStatementSpan>>? GetAdjustedActiveStatementSpansImpl;
EditAndContinue\MockEditAndContinueService.cs (3)
20public Func<Solution, ImmutableArray<DocumentId>, ImmutableArray<ImmutableArray<ActiveStatementSpan>>>? GetBaseActiveStatementSpansImpl; 22public Func<TextDocument, ActiveStatementSpanProvider, ImmutableArray<ActiveStatementSpan>>? GetAdjustedActiveStatementSpansImpl; 32public Func<Document, ActiveStatementSpanProvider, ImmutableArray<Diagnostic>>? GetDocumentDiagnosticsImpl;
Microsoft.CodeAnalysis.InteractiveHost (39)
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (3)
27public static bool Any<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 51public static bool All<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 111public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TArg, TResult> map, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
57public bool All<TArg>(Func<TKey, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
57public bool All<TArg>(Func<TValue, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (9)
72public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 193public static bool Update<T, TArg>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, TArg, ImmutableSegmentedHashSet<T>> transformer, TArg transformerArgument) 317public static bool Update<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, TArg, ImmutableSegmentedDictionary<TKey, TValue>> transformer, TArg transformerArgument) 388/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 389public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 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) 494/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 495public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\ArrayBuilder.cs (4)
235public int FindIndex<TArg>(Func<T, TArg, bool> match, TArg arg) 238public int FindIndex<TArg>(int startIndex, Func<T, TArg, bool> match, TArg arg) 241public int FindIndex<TArg>(int startIndex, int count, Func<T, TArg, bool> match, TArg arg) 280public void RemoveAll<TArg>(Func<T, TArg, bool> match, TArg arg)
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
21private static Func<ImmutableSegmentedList<VoidResult>, CancellationToken, ValueTask> Convert(Func<CancellationToken, ValueTask> processBatchAsync)
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (4)
17Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync, 24Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync, 35private static Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<VoidResult>> Convert(Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync)
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
43private readonly Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<TResult>> _processBatchAsync; 106Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<TResult>> processBatchAsync,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (4)
13public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, Func<TArg, CancellationToken, T>? synchronousComputeFunction, TArg arg) 16public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, TArg arg) 22public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, T> synchronousComputeFunction, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (10)
22Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, 23Func<TData, CancellationToken, T>? synchronousComputeFunction, 50private Func<TData, CancellationToken, Task<T>>? _asynchronousComputeFunction; 57private Func<TData, CancellationToken, T>? _synchronousComputeFunction; 112Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, 113Func<TData, CancellationToken, T>? synchronousComputeFunction, 126Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, 127Func<TData, CancellationToken, T>? synchronousComputeFunction, 386private readonly struct AsynchronousComputationToStart(Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, CancellationTokenSource cancellationTokenSource) 388public readonly Func<TData, CancellationToken, Task<T>> AsynchronousComputeFunction = asynchronousComputeFunction;
Microsoft.CodeAnalysis.LanguageServer (1)
Logging\LspLogMessageLogger.cs (1)
24public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Extensions\Extensions.cs (1)
151public static T FindDocumentInProjectContext<T>(this ImmutableArray<T> documents, TextDocumentIdentifier documentIdentifier, Func<Solution, DocumentId, T> documentGetter) where T : TextDocument
Workspaces\LspWorkspaceManager.cs (1)
142private static async ValueTask ApplyChangeToMutatingWorkspaceAsync(Workspace workspace, Uri uri, Func<ILspWorkspace, DocumentId, ValueTask> change)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
src\Workspaces\CoreTestUtilities\Logging\TestOutputLoggerProvider.cs (1)
30public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.CodeAnalysis.PooledObjects.Package (15)
ArrayBuilder.cs (4)
235public int FindIndex<TArg>(Func<T, TArg, bool> match, TArg arg) 238public int FindIndex<TArg>(int startIndex, Func<T, TArg, bool> match, TArg arg) 241public int FindIndex<TArg>(int startIndex, int count, Func<T, TArg, bool> match, TArg arg) 280public void RemoveAll<TArg>(Func<T, TArg, bool> match, TArg arg)
PooledDelegates.cs (11)
207Func<TKey, TArg, TValue> unboundFunction, TArg argument, 211return GetPooledDelegate<CreateValueCallbackWithBoundArgument<TKey, TArg, TValue>, TArg, Func<TKey, TArg, TValue>, ConditionalWeakTable<TKey, TValue>.CreateValueCallback>(unboundFunction, argument, out boundFunction); 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); 248/// Gets a <see cref="Func{T1, T2, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 279public static Releaser GetPooledFunction<T1, T2, TArg, TResult>(Func<T1, T2, TArg, TResult> unboundFunction, TArg argument, out Func<T1, T2, TResult> boundFunction) 280=> GetPooledDelegate<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>>(unboundFunction, argument, out boundFunction); 420Func<TKey, TArg, TValue>, 430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>> 437: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>> 439protected override Func<T1, T2, TResult> Bind()
Microsoft.CodeAnalysis.PublicApiAnalyzers (9)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
Microsoft.CodeAnalysis.Rebuild (1)
CompilationOptionsReader.cs (1)
289Func<string, SourceText, SyntaxTree> createSyntaxTreeFunc)
Microsoft.CodeAnalysis.Remote.ServiceHub (7)
Host\RemoteWorkspace.InFlightSolution.cs (1)
103public void TryKickOffPrimaryBranchWork_NoLock(Func<Solution, CancellationToken, Task<Solution>> updatePrimaryBranchAsync)
Host\RemoteWorkspace.SolutionCreator.cs (4)
428Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 429Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 473Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 474Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments,
Services\BrokeredServiceBase.cs (1)
149Func<Solution, Solution, ValueTask> implementation,
Services\RelatedDocuments\RemoteRelatedDocumentsService.cs (1)
28private Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> GetCallbackFunction(RemoteServiceCallbackId callbackId)
Microsoft.CodeAnalysis.Remote.Workspaces (18)
BrokeredServiceConnection.cs (2)
98public override async ValueTask<bool> TryInvokeAsync(Func<TService, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 113public override async ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Func<TService, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
ExternalAccess\Pythia\Api\PythiaRemoteHostClient.cs (2)
40public async ValueTask<bool> TryInvokeAsync<TService>(Func<TService, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) where TService : class 46public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Func<TService, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) where TService : class
ExternalAccess\Pythia\Api\PythiaRemoteServiceConnectionWrapper.cs (2)
25public ValueTask<bool> TryInvokeAsync(Func<TService, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 28public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Func<TService, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Api\UnitTestingRemoteCallbackWrapper.cs (2)
20public ValueTask InvokeAsync(Func<T, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 23public ValueTask<TResult> InvokeAsync<TResult>(Func<T, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Api\UnitTestingRemoteHostClient.cs (2)
40public async ValueTask<bool> TryInvokeAsync<TService>(Func<TService, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) where TService : class 46public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Func<TService, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) where TService : class
ExternalAccess\UnitTesting\Api\UnitTestingRemoteServiceConnectionWrapper.cs (2)
25public ValueTask<bool> TryInvokeAsync(Func<TService, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 28public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Func<TService, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
RemoteCallback.cs (4)
37Func<RemoteCallback<T>, CancellationToken, ValueTask> invocation, 61public async ValueTask InvokeAsync(Func<T, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 76public async ValueTask<TResult> InvokeAsync<TResult>(Func<T, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) 100Func<PipeReader, CancellationToken, ValueTask> reader,
ServiceBrokerExtensions.cs (2)
14protected async ValueTask InvokeAsync(Func<TService, CancellationToken, ValueTask> operation, CancellationToken cancellationToken) 24protected async ValueTask<TResult> InvokeAsync<TResult>(Func<TService, CancellationToken, ValueTask<TResult>> operation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ResxSourceGenerator (9)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
Microsoft.CodeAnalysis.Scripting (4)
Hosting\Resolvers\RuntimeMetadataReferenceResolver.cs (4)
41private readonly Func<string, MetadataReferenceProperties, PortableExecutableReference> _createFromFileFunc; 55Func<string, MetadataReferenceProperties, PortableExecutableReference>? createFromFileFunc = null) 72Func<string, MetadataReferenceProperties, PortableExecutableReference>? createFromFileFunc = null) 86Func<string, MetadataReferenceProperties, PortableExecutableReference>? createFromfileFunc = null)
Microsoft.CodeAnalysis.Test.Utilities (16)
Assert\AssertEx.cs (3)
912public static void Equal(bool[,] expected, Func<int, int, bool> getResult, int size) 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)
Assert\EqualityUtil.cs (2)
14Func<T, T, bool> compEqualsOperator, 15Func<T, T, bool> compNotEqualsOperator,
Assert\EqualityUtil`1.cs (4)
23private readonly Func<T, T, bool> _compareWithEqualityOperator; 24private readonly Func<T, T, bool> _compareWithInequalityOperator; 28Func<T, T, bool> compEquality = null, 29Func<T, T, bool> compInequality = null)
CommonTestBase.cs (1)
143internal CompilationVerifier CompileAndVerifyFieldMarshalCommon(Compilation compilation, Func<string, PEAssembly, byte[]> getExpectedBlob, bool isField = true)
Metadata\AggregatedMetadataReader.cs (1)
34private TEntity GetValue<TEntity>(Handle handle, Func<MetadataReader, Handle, TEntity> getter)
Metadata\MetadataValidation.cs (1)
65internal static void MarshalAsMetadataValidator(PEAssembly assembly, Func<string, PEAssembly, byte[]> getExpectedBlob, bool isField = true)
Mocks\TestEqualityComparer.cs (1)
13public class TestEqualityComparer<T>(Func<T?, T?, bool>? equals = null, Func<T, int>? getHashCode = null) : IEqualityComparer<T>
ObjectReference.cs (1)
186public ObjectReference<TResult> GetObjectReference<TResult, TArg>(Func<T, TArg, TResult> function, TArg argument) where TResult : class
SourceGeneration\LambdaComparer.cs (2)
13private readonly Func<T?, T?, bool> _equal; 16public LambdaComparer(Func<T?, T?, bool> equal, int? hashCode = null)
Microsoft.CodeAnalysis.Threading.Package (33)
AsyncBatchingWorkQueue`0.cs (1)
21private static Func<ImmutableSegmentedList<VoidResult>, CancellationToken, ValueTask> Convert(Func<CancellationToken, ValueTask> processBatchAsync)
AsyncBatchingWorkQueue`1.cs (4)
17Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync, 24Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync, 35private static Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<VoidResult>> Convert(Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync)
AsyncBatchingWorkQueue`2.cs (2)
43private readonly Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<TResult>> _processBatchAsync; 106Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<TResult>> processBatchAsync,
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
57public bool All<TArg>(Func<TKey, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
57public bool All<TArg>(Func<TValue, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (9)
72public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 193public static bool Update<T, TArg>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, TArg, ImmutableSegmentedHashSet<T>> transformer, TArg transformerArgument) 317public static bool Update<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, TArg, ImmutableSegmentedDictionary<TKey, TValue>> transformer, TArg transformerArgument) 388/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 389public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 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) 494/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 495public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\ArrayBuilder.cs (4)
235public int FindIndex<TArg>(Func<T, TArg, bool> match, TArg arg) 238public int FindIndex<TArg>(int startIndex, Func<T, TArg, bool> match, TArg arg) 241public int FindIndex<TArg>(int startIndex, int count, Func<T, TArg, bool> match, TArg arg) 280public void RemoveAll<TArg>(Func<T, TArg, bool> match, TArg arg)
src\Dependencies\PooledObjects\PooledDelegates.cs (11)
207Func<TKey, TArg, TValue> unboundFunction, TArg argument, 211return GetPooledDelegate<CreateValueCallbackWithBoundArgument<TKey, TArg, TValue>, TArg, Func<TKey, TArg, TValue>, ConditionalWeakTable<TKey, TValue>.CreateValueCallback>(unboundFunction, argument, out boundFunction); 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); 248/// Gets a <see cref="Func{T1, T2, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 279public static Releaser GetPooledFunction<T1, T2, TArg, TResult>(Func<T1, T2, TArg, TResult> unboundFunction, TArg argument, out Func<T1, T2, TResult> boundFunction) 280=> GetPooledDelegate<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>>(unboundFunction, argument, out boundFunction); 420Func<TKey, TArg, TValue>, 430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>> 437: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>> 439protected override Func<T1, T2, TResult> Bind()
Microsoft.CodeAnalysis.UnitTests (9)
Collections\ImmutableListTestBase.cs (5)
24protected static readonly Func<IList, object?, object> IndexOfFunc = (l, v) => l.IndexOf(v); 25protected static readonly Func<IList, object?, object> ContainsFunc = (l, v) => l.Contains(v); 26protected static readonly Func<IList, object?, object> RemoveFunc = (l, v) => { l.Remove(v); return l.Count; }; 539protected void AssertIListBaselineBothDirections<T1, T2>(Func<IList, object?, object> operation, T1 item, T2 other) 559protected void AssertIListBaseline<T>(Func<IList, object?, object> operation, T item, object? other)
Collections\ImmutablesTestBase.nonnetstandard.cs (1)
29protected static void StructuralEqualityHelper<TCollection, TElement>(TCollection objectUnderTest, TElement additionalItem, Func<TCollection, IEnumerable<TElement>?, bool> equalsStructurally)
Collections\IndexOfTests.cs (2)
24Func<TCollection, int, int> indexOfItem, 93Func<TCollection, int, int> lastIndexOfItem,
Emit\EmitOptionsTests.cs (1)
21Func<EmitOptions, T, EmitOptions> factory,
Microsoft.CodeAnalysis.VisualBasic (14)
Parser\ParseScan.vb (1)
205Private Function PeekAheadFor(Of TArg)(predicate As Func(Of SyntaxToken, TArg, Boolean), arg As TArg, <Out()> ByRef token As SyntaxToken) As Integer
Symbols\SynthesizedSymbols\SynthesizedClonedTypeParameterSymbol.vb (1)
36mapFunction As Func(Of TypeParameterSymbol, Symbol, TypeParameterSymbol)) As ImmutableArray(Of TypeParameterSymbol)
Syntax\SyntaxReplacer.vb (12)
18Optional computeReplacementNode As Func(Of TNode, TNode, SyntaxNode) = Nothing, 20Optional computeReplacementToken As Func(Of SyntaxToken, SyntaxToken, SyntaxToken) = Nothing, 22Optional computeReplacementTrivia As Func(Of SyntaxTrivia, SyntaxTrivia, SyntaxTrivia) = Nothing) As SyntaxNode 36Optional computeReplacementNode As Func(Of SyntaxNode, SyntaxNode, SyntaxNode) = Nothing, 38Optional computeReplacementToken As Func(Of SyntaxToken, SyntaxToken, SyntaxToken) = Nothing, 40Optional computeReplacementTrivia As Func(Of SyntaxTrivia, SyntaxTrivia, SyntaxTrivia) = Nothing) As SyntaxToken 54Private ReadOnly _computeReplacementNode As Func(Of TNode, TNode, SyntaxNode) 55Private ReadOnly _computeReplacementToken As Func(Of SyntaxToken, SyntaxToken, SyntaxToken) 56Private ReadOnly _computeReplacementTrivia As Func(Of SyntaxTrivia, SyntaxTrivia, SyntaxTrivia) 69computeReplacementNode As Func(Of TNode, TNode, SyntaxNode), 71computeReplacementToken As Func(Of SyntaxToken, SyntaxToken, SyntaxToken), 73computeReplacementTrivia As Func(Of SyntaxTrivia, SyntaxTrivia, SyntaxTrivia))
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
ExpressionTrees\Sources\ExprLambdaUtils.vb (1)
25Public Shared Sub Check(Of T1, T2, T3)(e As Expression(Of Func(Of T1, T2, T3)), expected As String)
ExpressionTrees\Sources\QueryHelper.vb (2)
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) 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 (253)
Classification\ClassifierHelper.cs (1)
237Func<TClassifiedSpan, TextSpan, TClassifiedSpan> createSpan)
CodeActions\CodeAction.cs (13)
501internal static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey) 512public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 547public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 659private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> _createChangedDocument; 660private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>>? _createChangedDocumentPreview; 664Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, 665Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>>? createChangedDocumentPreview, 677Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, 686Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, 706private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution; 710Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 721Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 730Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (1)
76FixAllContext fixAllContext, Func<Document, Document?, ValueTask> onDocumentFixed)
CodeFixesAndRefactorings\DefaultFixAllProviderHelpers.cs (4)
26Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 53Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 59Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 65Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync)
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (2)
28Func<TFixAllContext, Func<Document, Document?, ValueTask>, Task> getFixedDocumentsAsync)
CodeRefactorings\FixAllOccurences\DocumentBasedFixAllProvider.cs (1)
82FixAllContext fixAllContext, Func<Document, Document?, ValueTask> onDocumentFixed)
Editing\SyntaxEditor.cs (5)
149public void ReplaceNode(SyntaxNode node, Func<SyntaxNode, SyntaxGenerator, SyntaxNode> computeReplacement) 158internal void ReplaceNode(SyntaxNode node, Func<SyntaxNode, SyntaxGenerator, IEnumerable<SyntaxNode>> computeReplacement) 278private readonly Func<SyntaxNode, SyntaxGenerator, SyntaxNode?> _modifier; 282Func<SyntaxNode, SyntaxGenerator, SyntaxNode?> modifier) 295Func<SyntaxNode, SyntaxGenerator, IEnumerable<SyntaxNode>> modifier) : Change(node)
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
64Func<INamedTypeSymbol, SymbolSet, bool> typeMatches,
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (1)
331Func<SyntaxTreeIndex, T, bool> predicate,
Remote\RemoteHostClient.cs (2)
61Func<TService, CancellationToken, ValueTask> invocation, 70Func<TService, CancellationToken, ValueTask<TResult>> invocation,
Remote\RemoteServiceConnection.cs (2)
23Func<TService, CancellationToken, ValueTask> invocation, 27Func<TService, CancellationToken, ValueTask<TResult>> invocation,
Rename\LightweightRenameLocations.cs (1)
120public LightweightRenameLocations Filter(Func<DocumentId, TextSpan, bool> filter)
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (3)
27public static bool Any<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 51public static bool All<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 111public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TArg, TResult> map, TArg arg)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (18)
156public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> items, Func<TItem, TArg, TResult> map, TArg arg) 240public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, Func<TItem, TArg, TResult> selector, TArg arg) 403public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, Func<TItem, TArg, OneOrMany<TResult>> selector, TArg arg) 421public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, CancellationToken, ValueTask<TResult>> selector, CancellationToken cancellationToken) 485public static ImmutableArray<TResult> ZipAsArray<T1, T2, TResult>(this ImmutableArray<T1> self, ImmutableArray<T2> other, Func<T1, T2, TResult> map) 545public static ImmutableArray<T> WhereAsArray<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 548private static ImmutableArray<T> WhereAsArrayImpl<T, TArg>(ImmutableArray<T> array, Func<T, bool>? predicateWithoutArg, Func<T, TArg, bool>? predicateWithArg, TArg arg) 617public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 633public static bool All<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 665public static async Task<bool> AnyAsync<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, Task<bool>> predicateAsync, TArg arg) 697public static TValue? FirstOrDefault<TValue, TArg>(this ImmutableArray<TValue> array, Func<TValue, TArg, bool> predicate, TArg arg) 710public static TValue Single<TValue, TArg>(this ImmutableArray<TValue> array, Func<TValue, TArg, bool> predicate, TArg arg) 1138public static int Sum<T>(this ImmutableArray<T> items, Func<T, int, int> selector) 1315internal static int BinarySearch<TElement, TValue>(this ImmutableArray<TElement> array, TValue value, Func<TElement, TValue, int> comparer) 1318internal static int BinarySearch<TElement, TValue>(this ReadOnlySpan<TElement> array, TValue value, Func<TElement, TValue, int> comparer) 1346internal static int BinarySearch<TElement, TValue>(this ImmutableSegmentedList<TElement> array, TValue value, Func<TElement, TValue, int> comparer)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
112public bool TryGetValue<TArg>(K key, Func<V, TArg, bool> predicate, TArg arg, [MaybeNullWhen(false)] out V value) 232public bool TryGetValue<TArg>(Func<V, TArg, bool> predicate, TArg arg, [MaybeNullWhen(false)] out V value)
src\Compilers\Core\Portable\Collections\TemporaryArrayExtensions.cs (3)
89public static T? SingleOrDefault<T, TArg>(this in TemporaryArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 113public static T? FirstOrDefault<T, TArg>(this in TemporaryArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 124public static int IndexOf<T, TArg>(this in TemporaryArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (1)
156public static bool SequenceEqual<T>(this T[]? first, T[]? second, Func<T, T, bool> comparer)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (2)
28public static TValue GetOrAdd<TKey, TArg, TValue>(this ConcurrentDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 47Func<TKey, TArg, TValue> addValueFactory,
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (12)
23public static int Count<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 184public static T? FirstOrDefault<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 195public static bool Any<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 233public static T? FirstOrNull<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 367public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, int, TResult> selector) 400public static ImmutableArray<TResult> SelectAsArray<TSource, TResult, TArg>(this IReadOnlyCollection<TSource>? source, Func<TSource, TArg, TResult> selector, TArg arg) 428public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this IEnumerable<TItem>? source, Func<TItem, TArg, IEnumerable<TResult>> selector, TArg arg) 453public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this IReadOnlyCollection<TItem>? source, Func<TItem, TArg, IEnumerable<TResult>> selector, TArg arg) 496public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this IEnumerable<TItem> source, Func<TItem, CancellationToken, ValueTask<TResult>> selector, CancellationToken cancellationToken) 537Func<TItem, CancellationToken, Task<IEnumerable<TResult>>> selector, 862public static bool SequenceEqual<T>(this IEnumerable<T>? first, IEnumerable<T>? second, Func<T, T, bool> comparer) 896public static T? AggregateOrDefault<T>(this IEnumerable<T> source, Func<T, T, T> func)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (4)
130public OneOrMany<TResult> Select<TResult, TArg>(Func<T, TArg, TResult> selector, TArg arg) 152public T? FirstOrDefault<TArg>(Func<T, TArg, bool> predicate, TArg arg) 172public bool All<TArg>(Func<T, TArg, bool> predicate, TArg arg) 181public bool Any<TArg>(Func<T, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
57public bool All<TArg>(Func<TKey, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
57public bool All<TArg>(Func<TValue, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (9)
72public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 193public static bool Update<T, TArg>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, TArg, ImmutableSegmentedHashSet<T>> transformer, TArg transformerArgument) 317public static bool Update<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, TArg, ImmutableSegmentedDictionary<TKey, TValue>> transformer, TArg transformerArgument) 388/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 389public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 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) 494/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 495public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\ArrayBuilder.cs (4)
235public int FindIndex<TArg>(Func<T, TArg, bool> match, TArg arg) 238public int FindIndex<TArg>(int startIndex, Func<T, TArg, bool> match, TArg arg) 241public int FindIndex<TArg>(int startIndex, int count, Func<T, TArg, bool> match, TArg arg) 280public void RemoveAll<TArg>(Func<T, TArg, bool> match, TArg arg)
src\Dependencies\PooledObjects\PooledDelegates.cs (11)
207Func<TKey, TArg, TValue> unboundFunction, TArg argument, 211return GetPooledDelegate<CreateValueCallbackWithBoundArgument<TKey, TArg, TValue>, TArg, Func<TKey, TArg, TValue>, ConditionalWeakTable<TKey, TValue>.CreateValueCallback>(unboundFunction, argument, out boundFunction); 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); 248/// Gets a <see cref="Func{T1, T2, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 279public static Releaser GetPooledFunction<T1, T2, TArg, TResult>(Func<T1, T2, TArg, TResult> unboundFunction, TArg argument, out Func<T1, T2, TResult> boundFunction) 280=> GetPooledDelegate<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>>(unboundFunction, argument, out boundFunction); 420Func<TKey, TArg, TValue>, 430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>> 437: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>> 439protected override Func<T1, T2, TResult> Bind()
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
21private static Func<ImmutableSegmentedList<VoidResult>, CancellationToken, ValueTask> Convert(Func<CancellationToken, ValueTask> processBatchAsync)
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (4)
17Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync, 24Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync, 35private static Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<VoidResult>> Convert(Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask> processBatchAsync)
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
43private readonly Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<TResult>> _processBatchAsync; 106Func<ImmutableSegmentedList<TItem>, CancellationToken, ValueTask<TResult>> processBatchAsync,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICollectionExtensions.cs (1)
14public static ImmutableArray<T> WhereAsArray<T, TState>(this IEnumerable<T> values, Func<T, TState, bool> predicate, TState state)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (9)
84Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 153Func<INamedTypeSymbol, ISymbol, bool> isValid, 267Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 327Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 328Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 329Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 402Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 403Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 404Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (5)
24public static void RemoveOrTransformAll<T, TArg>(this List<T> list, Func<T, TArg, T?> transform, TArg arg) 43public static void RemoveOrTransformAll<T, TArg>(this List<T> list, Func<T, TArg, T?> transform, TArg arg) 62public static void RemoveOrTransformAll<T, TArg>(this ArrayBuilder<T> list, Func<T, TArg, T?> transform, TArg arg) 87public static bool TryRemoveFirst<T, TArg>(this IList<T> list, Func<T, TArg, bool> selector, TArg arg, [NotNullWhen(true)] out T? removedItem) 116public static int IndexOf<T, TArg>(this IList<T> list, Func<T, TArg, bool> predicate, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ObjectWriterExtensions.cs (1)
26public static ImmutableArray<T> ReadArray<T, TArg>(this ObjectReader reader, Func<ObjectReader, TArg, T> read, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (2)
32this SourceText text, TextSpan span, Func<int, CancellationToken, bool> isPositionHidden, CancellationToken cancellationToken) 44this SourceText text, TextSpan span, Func<int, CancellationToken, bool> isPositionHidden,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (4)
540private static readonly Func<SyntaxTriviaList, int, SyntaxToken> s_findSkippedTokenForward = FindSkippedTokenForward; 570private static readonly Func<SyntaxTriviaList, int, SyntaxToken> s_findSkippedTokenBackward = FindSkippedTokenBackward; 620var findSkippedToken = includeSkipped ? s_findSkippedTokenForward : ((l, p) => default); 659var findSkippedToken = includeSkipped ? s_findSkippedTokenBackward : ((l, p) => default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (1)
86public bool ForEachCurrentWrite<TArg>(ISymbol symbol, Func<IOperation, TArg, bool> action, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
192Func<FormattingContext, IndentBlockOperation, SyntaxToken> effectiveBaseTokenGetter = operation.Option.IsOn(IndentBlockOption.RelativeToFirstTokenOnBaseTokenLine) 203Func<FormattingContext, SyntaxToken, int> relativeIndentationBaseIndentationGetter =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.IndentationData.cs (6)
43private readonly Func<FormattingContext, IndentBlockOperation, SyntaxToken> _effectiveBaseTokenGetter; 45private readonly Func<FormattingContext, SyntaxToken, int> _baseIndentationGetter; 56public RelativeIndentationData(FormattingContext formattingContext, int inseparableRegionSpanStart, TextSpan textSpan, IndentBlockOperation operation, Func<FormattingContext, IndentBlockOperation, SyntaxToken> effectiveBaseTokenGetter, Func<FormattingContext, IndentBlockOperation, SyntaxToken, int> indentationDeltaGetter, Func<FormattingContext, SyntaxToken, int> baseIndentationGetter) 70private RelativeIndentationData(FormattingContext formattingContext, int inseparableRegionSpanStart, TextSpan textSpan, IndentBlockOperation operation, Func<FormattingContext, IndentBlockOperation, SyntaxToken> effectiveBaseTokenGetter, Func<FormattingContext, IndentBlockOperation, SyntaxToken, int> indentationDeltaGetter, Func<FormattingContext, SyntaxToken, int> baseIndentationGetter, int lazyIndentationDelta)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (4)
46private readonly Func<TokenData, TokenData, TriviaData> _getTriviaData; 47private readonly Func<TokenData, TokenData, TriviaData> _getOriginalTriviaData; 200private bool TwoTokensOnSameLineWorker(SyntaxToken token1, SyntaxToken token2, Func<TokenData, TokenData, TriviaData> triviaDataGetter) 282private int GetColumn(TokenData tokenData, Func<TokenData, TokenData, TriviaData> triviaDataGetter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
100public static void Log<TArg0, TArg1>(FunctionId functionId, Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, LogLevel logLevel = LogLevel.Debug) 192public static IDisposable LogBlock<TArg0, TArg1>(FunctionId functionId, Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
26public static LogMessage Create<TArg0, TArg1>(Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, LogLevel logLevel) 154private Func<TArg0, TArg1, string>? _messageGetter; 158internal static LogMessage Construct(Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (7)
179private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 180private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 182private static readonly Func<string, TextSpan, bool> s_wordIsAllUpperCase = (val, span) => 195private static readonly Func<string, TextSpan, bool> s_wordIsAllLowerCase = (val, span) => 209string name, TextSpan nameSpan, Func<string, TextSpan, bool> wordCheck, 248Func<string, TextSpan, bool> firstWordCheck, 249Func<string, TextSpan, bool> restWordCheck,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
383Func<TOwningSymbol, int, ITypeSymbol?> getContextualType, 539Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 591Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (4)
13public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, Func<TArg, CancellationToken, T>? synchronousComputeFunction, TArg arg) 16public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, TArg arg) 22public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, T> synchronousComputeFunction, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (10)
22Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, 23Func<TData, CancellationToken, T>? synchronousComputeFunction, 50private Func<TData, CancellationToken, Task<T>>? _asynchronousComputeFunction; 57private Func<TData, CancellationToken, T>? _synchronousComputeFunction; 112Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, 113Func<TData, CancellationToken, T>? synchronousComputeFunction, 126Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, 127Func<TData, CancellationToken, T>? synchronousComputeFunction, 386private readonly struct AsynchronousComputationToStart(Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, CancellationTokenSource cancellationTokenSource) 388public readonly Func<TData, CancellationToken, Task<T>> AsynchronousComputeFunction = asynchronousComputeFunction;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ComparerWithState.cs (2)
12public static int CompareTo<T, S>(T first, T second, S state, ImmutableArray<Func<T, S, IComparable>> comparableMethods) 14foreach (var comparableMethod in comparableMethods)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
28public static V GetOrAdd<K, V, TArg>(this IDictionary<K, V> dictionary, K key, Func<K, TArg, V> function, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ReferenceCountedDisposableCache.cs (1)
21public IReferenceCountedDisposable<ICacheEntry<TKey, TValue>> GetOrCreate<TArg>(TKey key, Func<TKey, TArg, TValue> valueCreator, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.cs (4)
22Func<TSource, CancellationToken, ValueTask> body) 34Func<TSource, CancellationToken, ValueTask> body) 46Func<TSource, CancellationToken, ValueTask> body) 58Func<TSource, CancellationToken, ValueTask> body)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (3)
121Func<TArg, CancellationToken, ValueTask<TIntermediate>> func, 122Func<TIntermediate, TArg, TResult> transform, 152static ValueTask<TResult> UnwrapAndTransformAsync(ValueTask<TIntermediate> intermediateResult, Func<TIntermediate, TArg, TResult> transform, TArg arg, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (3)
20private readonly Func<int, IParameterSymbol, int> _parameterAggregator; 21private readonly Func<int, ISymbol, int> _symbolAggregator; 106private static int CombineHashCodes<T>(ImmutableArray<T> array, int currentHash, Func<int, T, int> func)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (3)
75Func<SemanticModel, TNode, bool> canReplace, 119Func<SemanticModel, TNode, bool> canReplace, 154Func<ISyntaxFactsService, SyntaxNode, SyntaxNode> getSemanticBoundary,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\OptionsProvider.cs (2)
21private sealed class OptionsReaderProvider<TOptions>(IOptionsReader optionsReader, Func<IOptionsReader, string, TOptions> reader) : OptionsProvider<TOptions> 27public static OptionsProvider<TOptions> GetProvider<TOptions>(this IOptionsReader optionsReader, Func<IOptionsReader, string, TOptions> reader)
Storage\SQLite\v2\Interop\SqlConnection.cs (1)
361Func<SqlConnection, SafeSqliteBlobHandle, Optional<T>> readBlob)
Workspace\Host\Metadata\MetadataReferenceCache.cs (2)
18internal sealed class MetadataReferenceCache(Func<string, MetadataReferenceProperties, MetadataReference> createReference) 23private readonly Func<string, MetadataReferenceProperties, MetadataReference> _createReference = createReference ?? throw new ArgumentNullException(nameof(createReference));
Workspace\IsolatedAnalyzerFileReference.cs (3)
78private ImmutableArray<DiagnosticAnalyzer> PinAnalyzers<TArg>(Func<AnalyzerReference, TArg, ImmutableArray<DiagnosticAnalyzer>> getItems, TArg arg) 81private ImmutableArray<ISourceGenerator> PinGenerators<TArg>(Func<AnalyzerReference, TArg, ImmutableArray<ISourceGenerator>> getItems, TArg arg) 86Func<AnalyzerReference, TArg, ImmutableArray<TItem>> getItems,
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (2)
50private readonly Func<string, CancellationToken, Task> _callback; 55Func<string, CancellationToken, Task> callback,
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (6)
66private readonly Func<Solution, DocumentId, bool> _documentAlreadyInWorkspace; 73Func<Solution, DocumentId, bool> documentAlreadyInWorkspace, 541Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 543Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 556Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 558Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments,
Workspace\ProjectSystem\ProjectSystemProject.cs (2)
77private readonly List<Func<SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState>> _projectPropertyModificationsInBatch = []; 639foreach (var propertyModification in _projectPropertyModificationsInBatch)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (12)
50private readonly Func<bool, ImmutableArray<string>, Task> _onDocumentsAddedMaybeAsync; 80Func<bool, ImmutableArray<string>, Task> onDocumentsAddedMaybeAsync, 253public void ApplyChangeToWorkspaceWithProjectUpdateState(Func<Workspace, ProjectUpdateState, ProjectUpdateState> action) 276/// <inheritdoc cref="ApplyBatchChangeToWorkspaceAsync(Func{SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState}, Action{ProjectUpdateState}?)"/> 277public void ApplyBatchChangeToWorkspace(Func<SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState> mutation, Action<ProjectUpdateState>? onAfterUpdateAlways) 282/// <inheritdoc cref="ApplyBatchChangeToWorkspaceAsync(Func{SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState}, Action{ProjectUpdateState}?)"/> 283public Task ApplyBatchChangeToWorkspaceAsync(Func<SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState> mutation, Action<ProjectUpdateState>? onAfterUpdateAlways) 288/// <inheritdoc cref="ApplyBatchChangeToWorkspaceAsync(Func{SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState}, Action{ProjectUpdateState}?)"/> 289public async Task ApplyBatchChangeToWorkspaceMaybeAsync(bool useAsync, Func<SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState> mutation, Action<ProjectUpdateState>? onAfterUpdateAlways) 305public async Task ApplyBatchChangeToWorkspaceMaybe_NoLockAsync(bool useAsync, Func<SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState> mutation, Action<ProjectUpdateState>? onAfterUpdateAlways) 352Func<SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState> mutation, Action<ProjectUpdateState>? onAfterUpdateAlways) 872Func<SolutionServices, TReference, TReference> createNewReference,
Workspace\Solution\DocumentState.cs (1)
24private static readonly Func<string?, PreservationMode, string> s_fullParseLog = (path, mode) => $"{path} : {mode}";
Workspace\Solution\Project.cs (6)
436Func<SyntaxTreeIndex, CancellationToken, bool> predicate, CancellationToken cancellationToken) 446Func<TopLevelSyntaxTreeIndex, CancellationToken, bool> predicate, CancellationToken cancellationToken) 464private static readonly Func<DocumentId, Project, Document?> s_tryCreateDocumentFunction = 467private static readonly Func<DocumentId, Project, AdditionalDocument?> s_tryCreateAdditionalDocumentFunction = 470private static readonly Func<DocumentId, Project, AnalyzerConfigDocument?> s_tryCreateAnalyzerConfigDocumentFunction = 473private static readonly Func<DocumentId, (SourceGeneratedDocumentState state, Project project), SourceGeneratedDocument> s_createSourceGeneratedDocumentFunction =
Workspace\Solution\Solution.cs (1)
161private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject;
Workspace\Solution\SolutionCompilationState.cs (6)
160Func<StateChange, TArg, TranslationAction?> translate, 172/// Same as <see cref="ForkProject{TArg}(StateChange, Func{StateChange, TArg, TranslationAction?}, bool, TArg)"/> 276Func<ProjectId, TArgCanReuse, bool> canReuse, 776Func<DocumentInfo.DocumentAttributes, TArg, DocumentInfo.DocumentAttributes> updateAttributes) 870Func<ProjectState, ImmutableArray<TDocumentState>, TranslationAction> getTranslationAction) 1157private static readonly Func<ProjectId, SolutionState, RegularCompilationTracker> s_createCompilationTrackerFunction = CreateCompilationTracker;
Workspace\Solution\SolutionState.cs (1)
952Func<DocumentInfo.DocumentAttributes, TArg, DocumentInfo.DocumentAttributes> updateAttributes)
Workspace\Solution\StateChecksums.cs (3)
544public static Checksum GetOrCreate<TValue, TArg>(TValue value, Func<TValue, TArg, Checksum> checksumCreator, TArg arg) 594public static TResult GetOrCreate<TArg>(TValue value, Func<TValue, TArg, TResult> checksumCreator, TArg arg) 601static TResult GetOrCreateSlow(TValue value, Func<TValue, TArg, TResult> checksumCreator, TArg arg)
Workspace\Solution\TextDocumentStates.cs (2)
133public ImmutableArray<TValue> SelectAsArray<TValue, TArg>(Func<TState, TArg, TValue> selector, TArg arg) 200public TextDocumentStates<TState> UpdateStates<TArg>(Func<TState, TArg, TState> transformation, TArg arg)
Workspace\Solution\VersionSource\SimpleTreeAndVersionSource.cs (2)
36Func<TArg, CancellationToken, Task<TreeAndVersion>> asynchronousComputeFunction, 37Func<TArg, CancellationToken, TreeAndVersion>? synchronousComputeFunction, TArg arg)
Workspace\Workspace.cs (7)
199/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/> 231Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 251Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 474Func<Solution, TData, Solution> transformation, 493/// <inheritdoc cref="SetCurrentSolution{TData}(TData, Func{Solution, TData, Solution}, bool, Action{Solution, Solution, TData}?, Action{Solution, Solution, TData}?)"/> 497Func<Solution, TData, Solution> transformation, 1253Func<Solution, DocumentId, TextDocument?> getDocumentInSolution,
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\DiagnosticReporterLoggerProvider.cs (1)
40public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (67)
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (3)
27public static bool Any<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 51public static bool All<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 111public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TArg, TResult> map, TArg arg)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (18)
156public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> items, Func<TItem, TArg, TResult> map, TArg arg) 240public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, Func<TItem, TArg, TResult> selector, TArg arg) 403public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, Func<TItem, TArg, OneOrMany<TResult>> selector, TArg arg) 421public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, CancellationToken, ValueTask<TResult>> selector, CancellationToken cancellationToken) 485public static ImmutableArray<TResult> ZipAsArray<T1, T2, TResult>(this ImmutableArray<T1> self, ImmutableArray<T2> other, Func<T1, T2, TResult> map) 545public static ImmutableArray<T> WhereAsArray<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 548private static ImmutableArray<T> WhereAsArrayImpl<T, TArg>(ImmutableArray<T> array, Func<T, bool>? predicateWithoutArg, Func<T, TArg, bool>? predicateWithArg, TArg arg) 617public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 633public static bool All<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg) 665public static async Task<bool> AnyAsync<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, Task<bool>> predicateAsync, TArg arg) 697public static TValue? FirstOrDefault<TValue, TArg>(this ImmutableArray<TValue> array, Func<TValue, TArg, bool> predicate, TArg arg) 710public static TValue Single<TValue, TArg>(this ImmutableArray<TValue> array, Func<TValue, TArg, bool> predicate, TArg arg) 1138public static int Sum<T>(this ImmutableArray<T> items, Func<T, int, int> selector) 1315internal static int BinarySearch<TElement, TValue>(this ImmutableArray<TElement> array, TValue value, Func<TElement, TValue, int> comparer) 1318internal static int BinarySearch<TElement, TValue>(this ReadOnlySpan<TElement> array, TValue value, Func<TElement, TValue, int> comparer) 1346internal static int BinarySearch<TElement, TValue>(this ImmutableSegmentedList<TElement> array, TValue value, Func<TElement, TValue, int> comparer)
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (1)
156public static bool SequenceEqual<T>(this T[]? first, T[]? second, Func<T, T, bool> comparer)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (2)
28public static TValue GetOrAdd<TKey, TArg, TValue>(this ConcurrentDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 47Func<TKey, TArg, TValue> addValueFactory,
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (12)
23public static int Count<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 184public static T? FirstOrDefault<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 195public static bool Any<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 233public static T? FirstOrNull<T, TArg>(this IEnumerable<T> source, Func<T, TArg, bool> predicate, TArg arg) 367public static ImmutableArray<TResult> SelectAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, int, TResult> selector) 400public static ImmutableArray<TResult> SelectAsArray<TSource, TResult, TArg>(this IReadOnlyCollection<TSource>? source, Func<TSource, TArg, TResult> selector, TArg arg) 428public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this IEnumerable<TItem>? source, Func<TItem, TArg, IEnumerable<TResult>> selector, TArg arg) 453public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this IReadOnlyCollection<TItem>? source, Func<TItem, TArg, IEnumerable<TResult>> selector, TArg arg) 496public static async ValueTask<ImmutableArray<TResult>> SelectAsArrayAsync<TItem, TResult>(this IEnumerable<TItem> source, Func<TItem, CancellationToken, ValueTask<TResult>> selector, CancellationToken cancellationToken) 537Func<TItem, CancellationToken, Task<IEnumerable<TResult>>> selector, 862public static bool SequenceEqual<T>(this IEnumerable<T>? first, IEnumerable<T>? second, Func<T, T, bool> comparer) 896public static T? AggregateOrDefault<T>(this IEnumerable<T> source, Func<T, T, T> func)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (4)
130public OneOrMany<TResult> Select<TResult, TArg>(Func<T, TArg, TResult> selector, TArg arg) 152public T? FirstOrDefault<TArg>(Func<T, TArg, bool> predicate, TArg arg) 172public bool All<TArg>(Func<T, TArg, bool> predicate, TArg arg) 181public bool Any<TArg>(Func<T, TArg, bool> predicate, TArg arg)
src\Compilers\Core\Portable\InternalUtilities\SpanUtilities.cs (1)
11public static bool All<TElement, TParam>(this ReadOnlySpan<TElement> span, TParam param, Func<TElement, TParam, bool> predicate)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
57public bool All<TArg>(Func<TKey, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
57public bool All<TArg>(Func<TValue, TArg, bool> predicate, TArg arg)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (9)
72public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 193public static bool Update<T, TArg>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, TArg, ImmutableSegmentedHashSet<T>> transformer, TArg transformerArgument) 317public static bool Update<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, Func<ImmutableSegmentedDictionary<TKey, TValue>, TArg, ImmutableSegmentedDictionary<TKey, TValue>> transformer, TArg transformerArgument) 388/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 389public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 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) 494/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 495public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableSegmentedDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
src\Dependencies\PooledObjects\ArrayBuilder.cs (4)
235public int FindIndex<TArg>(Func<T, TArg, bool> match, TArg arg) 238public int FindIndex<TArg>(int startIndex, Func<T, TArg, bool> match, TArg arg) 241public int FindIndex<TArg>(int startIndex, int count, Func<T, TArg, bool> match, TArg arg) 280public void RemoveAll<TArg>(Func<T, TArg, bool> match, TArg arg)
src\Dependencies\PooledObjects\PooledDelegates.cs (11)
207Func<TKey, TArg, TValue> unboundFunction, TArg argument, 211return GetPooledDelegate<CreateValueCallbackWithBoundArgument<TKey, TArg, TValue>, TArg, Func<TKey, TArg, TValue>, ConditionalWeakTable<TKey, TValue>.CreateValueCallback>(unboundFunction, argument, out boundFunction); 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); 248/// Gets a <see cref="Func{T1, T2, TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 279public static Releaser GetPooledFunction<T1, T2, TArg, TResult>(Func<T1, T2, TArg, TResult> unboundFunction, TArg argument, out Func<T1, T2, TResult> boundFunction) 280=> GetPooledDelegate<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>>(unboundFunction, argument, out boundFunction); 420Func<TKey, TArg, TValue>, 430: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, TArg, TResult>, TArg, Func<T1, TArg, TResult>, Func<T1, TResult>> 437: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<T1, T2, TArg, TResult>, TArg, Func<T1, T2, TArg, TResult>, Func<T1, T2, TResult>> 439protected override Func<T1, T2, TResult> Bind()
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Logging\TestOutputLoggerProvider.cs (1)
30public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.CodeAnalysis.Workspaces.UnitTests (45)
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)
SolutionTests\TryApplyChangesTests.cs (4)
21private readonly Func<ParseOptions, ParseOptions, bool>? _canApplyParseOptions; 22private readonly Func<CompilationOptions, CompilationOptions, bool>? _canApplyCompilationOptions; 30Func<ParseOptions, ParseOptions, bool>? canApplyParseOptions = null, 31Func<CompilationOptions, CompilationOptions, bool>? canApplyCompilationOptions = null)
UtilityTest\AsyncLazyTests.cs (1)
148Func<ManualResetEvent?, CancellationToken, object>? synchronousComputation = null;
UtilityTest\SpecializedTasksTests.cs (38)
75Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => new(new IntermediateType()); 76Func<IntermediateType, StateType, ResultType> transform = (_, _) => new(); 89Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => new(new IntermediateType()); 90Func<IntermediateType, StateType, ResultType> transform = (_, _) => new(); 108Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => new(new IntermediateType()); 109Func<IntermediateType, StateType, ResultType> transform = (_, _) => 127Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = async (_, _) => 133Func<IntermediateType, StateType, ResultType> transform = (_, _) => new(); 154Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = async (_, _) => 160Func<IntermediateType, StateType, ResultType> transform = (_, _) => 185Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => new(Task.FromCanceled<IntermediateType>(cancellationToken)); 186Func<IntermediateType, StateType, ResultType> transform = (_, _) => 210Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = async (_, _) => 217Func<IntermediateType, StateType, ResultType> transform = (_, _) => 242Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => new(Task.FromCanceled<IntermediateType>(unexpectedCts.Token)); 243Func<IntermediateType, StateType, ResultType> transform = (_, _) => 270Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = async (_, _) => 277Func<IntermediateType, StateType, ResultType> transform = (_, _) => 309Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => new(Task.FromCanceled<IntermediateType>(unexpectedCts.Token)); 310Func<IntermediateType, StateType, ResultType> transform = (_, _) => 337Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = async (_, _) => 344Func<IntermediateType, StateType, ResultType> transform = (_, _) => 368Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => throw fault; 369Func<IntermediateType, StateType, ResultType> transform = (_, _) => 390Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => new(Task.FromException<IntermediateType>(fault)); 391Func<IntermediateType, StateType, ResultType> transform = (_, _) => 413Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = async (_, _) => 419Func<IntermediateType, StateType, ResultType> transform = (_, _) => 445Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => throw fault; 446Func<IntermediateType, StateType, ResultType> transform = (_, _) => 470Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => new(Task.FromException<IntermediateType>(fault)); 471Func<IntermediateType, StateType, ResultType> transform = (_, _) => 496Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = async (_, _) => 502Func<IntermediateType, StateType, ResultType> transform = (_, _) => 523Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = (_, _) => new(new IntermediateType()); 524Func<IntermediateType, StateType, ResultType> transform = (_, _) => throw fault; 539Func<StateType, CancellationToken, ValueTask<IntermediateType>> func = async (_, _) => 545Func<IntermediateType, StateType, ResultType> transform = (_, _) => throw fault;
Microsoft.CSharp (11)
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (5)
144var trueFalseSite = CallSite<Func<CallSite, T, bool>> 152var site = CallSite<Func<CallSite, T, object>> 164var site = CallSite<Func<CallSite, T, K>>.Create(Binder.Convert(kind, type, accessibilityContext)); 306var site = CallSite<Func<CallSite, T, object>>.Create(binder); 419var site = CallSite<Func<CallSite, object, object>>.Create(new GetMemberValueBinder(name, ignoreCase));
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (6)
250private static Func<MemberInfo, MemberInfo, bool> s_MemberEquivalence = (m1, m2) => 265Func<MemberInfo, MemberInfo, bool> apiDelegate = apiMethod.CreateDelegate<Func<MemberInfo, MemberInfo, bool>>(); 287var memberEquivalence = Expression.Lambda<Func<MemberInfo, MemberInfo, bool>>( 307Func<MemberInfo, MemberInfo, bool> fallbackMemberEquivalence = (m1param, m2param) => m1param.IsEquivalentTo(m2param);
Microsoft.Data.Analysis (2)
PrimitiveColumnContainer.cs (1)
178public void ApplyElementwise(Func<T?, long, T?> func)
PrimitiveDataFrameColumn.cs (1)
659public void ApplyElementwise(Func<T?, long, T?> func) => _columnContainer.ApplyElementwise(func);
Microsoft.DotNet.Build.Tasks.Feed (2)
src\MSBuildLogger.cs (1)
20public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\PublishArtifactsInManifestBase.cs (1)
1767Func<string, string, Task<ProcessExecutionResult>> RunProcessAndGetOutputsCallBack = null
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
PublishArtifactsInManifestTests.cs (1)
146Func<string, string, Task<ProcessExecutionResult>> testRunAndLogProcess = (string fakeExePath, string fakeExeArgs) =>
Microsoft.DotNet.Helix.Client (3)
generated-code\PagedResponse.cs (3)
29public static AsyncPageable<T> Create<T>(Func<string, int?, IAsyncEnumerable<Page<T>>> pageFunc) 36private readonly Func<string, int?, IAsyncEnumerable<Page<T>>> _pageFunc; 38public FuncAsyncPageable(Func<string, int?, IAsyncEnumerable<Page<T>>> pageFunc)
Microsoft.DotNet.NuGetRepack.Tests (6)
TestHelpers\AssertEx.cs (6)
168public static void Equal<T>(ImmutableArray<T> expected, IEnumerable<T> actual, Func<T, T, bool> comparer = null, string message = null) 180public static void Equal<T>(IEnumerable<T> expected, ImmutableArray<T> actual, Func<T, T, bool> comparer = null, string message = null, string itemSeparator = null) 192public static void Equal<T>(ImmutableArray<T> expected, ImmutableArray<T> actual, Func<T, T, bool> comparer = null, string message = null, string itemSeparator = null) 197public static void Equal<T>(IEnumerable<T> expected, IEnumerable<T> actual, Func<T, T, bool> comparer = null, string message = null, 226private static bool SequenceEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual, Func<T, T, bool> comparer = null) 431Func<T, T, bool> comparer = null,
Microsoft.DotNet.RemoteExecutor (3)
RemoteExecutor.cs (3)
211public static RemoteInvokeHandle Invoke(Func<string, string, Task<int>> method, string arg1, string arg2, 279public static RemoteInvokeHandle Invoke(Func<string, string, Task> method, string arg1, string arg2, 347public static RemoteInvokeHandle Invoke(Func<string, string, int> method, string arg1, string arg2,
Microsoft.DotNet.XUnitAssert.Tests (4)
AsyncCollectionAssertsTests.cs (1)
75 await Assert.ThrowsAsync<ArgumentNullException>("action", () => Assert.AllAsync(new object[0].ToAsyncEnumerable(), (Func<object, int, Task>)null!));
CollectionAssertsTests.cs (1)
73 await Assert.ThrowsAsync<ArgumentNullException>("action", () => Assert.AllAsync(new object[0], (Func<object, int, Task>)null!));
EqualityAssertsTests.cs (2)
155 Assert.Throws<ArgumentNullException>("comparer", () => Assert.Equal(1, 2, default(Func<int, int, bool>)!)); 2462 Assert.Throws<ArgumentNullException>("comparer", () => Assert.NotEqual(1, 2, default(Func<int, int, bool>)!));
Microsoft.Extensions.AI (12)
ChatCompletion\ChatClientBuilder.cs (2)
18private List<Func<IChatClient, IServiceProvider, IChatClient>>? _clientFactories; 80public ChatClientBuilder Use(Func<IChatClient, IServiceProvider, IChatClient> clientFactory)
Embeddings\EmbeddingGeneratorBuilder.cs (2)
21private List<Func<IEmbeddingGenerator<TInput, TEmbedding>, IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>>>? _generatorFactories; 86Func<IEmbeddingGenerator<TInput, TEmbedding>, IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>> generatorFactory)
Functions\AIFunctionFactory.cs (5)
788ParameterMarshallers = parameters.Length > 0 ? new Func<AIFunctionArguments, CancellationToken, object?>[parameters.Length] : []; 819public Func<AIFunctionArguments, CancellationToken, object?>[] ParameterMarshallers { get; } 820public Func<object?, CancellationToken, ValueTask<object?>> ReturnParameterMarshaller { get; } 863private static Func<AIFunctionArguments, CancellationToken, object?> GetParameterMarshaller( 1015private static Func<object?, CancellationToken, ValueTask<object?>> GetReturnParameterMarshaller(
Functions\AIFunctionFactoryOptions.cs (1)
134public Func<ParameterInfo, AIFunctionArguments, object?>? BindParameter { get; init; }
SpeechToText\SpeechToTextClientBuilder.cs (2)
18private List<Func<ISpeechToTextClient, IServiceProvider, ISpeechToTextClient>>? _clientFactories; 74public SpeechToTextClientBuilder Use(Func<ISpeechToTextClient, IServiceProvider, ISpeechToTextClient> clientFactory)
Microsoft.Extensions.AI.Abstractions (2)
src\Shared\JsonSchemaExporter\JsonSchemaExporterOptions.cs (1)
36public Func<JsonSchemaExporterContext, JsonNode, JsonNode>? TransformSchemaNode { get; init; }
Utilities\AIJsonSchemaCreateOptions.cs (1)
26public Func<AIJsonSchemaCreateContext, JsonNode, JsonNode>? TransformSchemaNode { get; init; }
Microsoft.Extensions.AI.Abstractions.Tests (5)
TestChatClient.cs (1)
24public Func<Type, object?, object?> GetServiceCallback { get; set; }
TestEmbeddingGenerator.cs (1)
24public Func<Type, object?, object?> GetServiceCallback { get; set; }
TestSpeechToTextClient.cs (1)
36public Func<Type, object?, object?> GetServiceCallback { get; set; }
Utilities\AIJsonUtilitiesTests.cs (2)
97case null when property.PropertyType == typeof(Func<AIJsonSchemaCreateContext, JsonNode, JsonNode>): 98Func<AIJsonSchemaCreateContext, JsonNode, JsonNode> transformer = static (context, schema) => (JsonNode)true;
Microsoft.Extensions.AI.Integration.Tests (2)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestChatClient.cs (1)
24public Func<Type, object?, object?> GetServiceCallback { get; set; }
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestSpeechToTextClient.cs (1)
36public Func<Type, object?, object?> GetServiceCallback { get; set; }
Microsoft.Extensions.AI.Tests (4)
Functions\AIFunctionFactoryTest.cs (1)
157Func<string, string, string> dotnetFunc3 = [Description("This is a test function")] ([Description("This is A")] a, [Description("This is B")] b) => b + " " + a;
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestChatClient.cs (1)
24public Func<Type, object?, object?> GetServiceCallback { get; set; }
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestEmbeddingGenerator.cs (1)
24public Func<Type, object?, object?> GetServiceCallback { get; set; }
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestSpeechToTextClient.cs (1)
36public Func<Type, object?, object?> GetServiceCallback { get; set; }
Microsoft.Extensions.AmbientMetadata.Application.Tests (1)
AcceptanceTests.cs (1)
42private static async Task RunAsync(Func<ApplicationMetadata, IHostEnvironment, Task> func, string? sectionName)
Microsoft.Extensions.Caching.Abstractions (2)
Hybrid\HybridCache.cs (2)
31public abstract ValueTask<T> GetOrCreateAsync<TState, T>(string key, TState state, Func<TState, CancellationToken, ValueTask<T>> factory, 51public static readonly Func<Func<CancellationToken, ValueTask<T>>, CancellationToken, ValueTask<T>> Instance = static (callback, ct) => callback(ct);
Microsoft.Extensions.Caching.Hybrid (5)
Internal\DefaultHybridCache.cs (2)
131public override ValueTask<T> GetOrCreateAsync<TState, T>(string key, TState state, Func<TState, CancellationToken, ValueTask<T>> underlyingDataCallback, 225Func<TState, CancellationToken, ValueTask<T>> underlyingDataCallback,
Internal\DefaultHybridCache.StampedeStateT.cs (3)
25private Func<TState, CancellationToken, ValueTask<T>>? _underlying; // main data factory 47public void QueueUserWorkItem(in TState state, Func<TState, CancellationToken, ValueTask<T>> underlying, HybridCacheEntryOptions? options) 65public Task ExecuteDirectAsync(in TState state, Func<TState, CancellationToken, ValueTask<T>> underlying, HybridCacheEntryOptions? options)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
LogCollector.cs (1)
76void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (1)
CacheServiceExtensionsTests.cs (1)
187public override ValueTask<T> GetOrCreateAsync<TState, T>(string key, TState state, Func<TState, CancellationToken, ValueTask<T>> factory, HybridCacheEntryOptions options = null, IEnumerable<string> tags = null, CancellationToken cancellationToken = default)
Microsoft.Extensions.DependencyInjection (5)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (1)
47private readonly Func<ServiceCacheKey, ServiceCallSite, Func<ServiceProviderEngineScope, object>> _buildTypeDelegate;
ServiceLookup\FactoryCallSite.cs (1)
18public FactoryCallSite(ResultCache cache, Type serviceType, object serviceKey, Func<IServiceProvider, object, object> factory) : base(cache, serviceKey)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (1)
57private readonly Func<ServiceCacheKey, ServiceCallSite, GeneratedMethod> _buildTypeDelegate;
ServiceLookup\StackGuard.cs (2)
43public TR RunOnEmptyStack<T1, T2, TR>(Func<T1, T2, TR> action, T1 arg1, T2 arg2) 55var t = ((Func<T1, T2, TR>, T1, T2))s;
Microsoft.Extensions.DependencyInjection.Abstractions (29)
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (6)
67Func<IServiceProvider, object?, object> implementationFactory) 122Func<IServiceProvider, object?, TService> implementationFactory) 183Func<IServiceProvider, object?, object> implementationFactory) 238Func<IServiceProvider, object?, TService> implementationFactory) 299Func<IServiceProvider, object?, object> implementationFactory) 373Func<IServiceProvider, object?, TService> implementationFactory)
ServiceCollectionServiceExtensions.Keyed.cs (10)
53Func<IServiceProvider, object?, object> implementationFactory) 137Func<IServiceProvider, object?, TService> implementationFactory) 162Func<IServiceProvider, object?, TImplementation> implementationFactory) 211Func<IServiceProvider, object?, object> implementationFactory) 295Func<IServiceProvider, object?, TService> implementationFactory) 320Func<IServiceProvider, object?, TImplementation> implementationFactory) 369Func<IServiceProvider, object?, object> implementationFactory) 453Func<IServiceProvider, object?, TService> implementationFactory) 478Func<IServiceProvider, object?, TImplementation> implementationFactory) 552Func<IServiceProvider, object?, object> implementationFactory,
ServiceDescriptor.cs (13)
111Func<IServiceProvider, object?, object> factory, 233public Func<IServiceProvider, object?, object>? KeyedImplementationFactory 241return (Func<IServiceProvider, object?, object>?)_implementationFactory; 454Func<IServiceProvider, object?, TImplementation> implementationFactory) 488public static ServiceDescriptor KeyedTransient<TService>(object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory) 521public static ServiceDescriptor KeyedTransient(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory) 625Func<IServiceProvider, object?, TImplementation> implementationFactory) 659public static ServiceDescriptor KeyedScoped<TService>(object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory) 692public static ServiceDescriptor KeyedScoped(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory) 803Func<IServiceProvider, object?, TImplementation> implementationFactory) 839Func<IServiceProvider, object?, TService> implementationFactory) 877Func<IServiceProvider, object?, object> implementationFactory) 1031public static ServiceDescriptor DescribeKeyed(Type serviceType, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory, ServiceLifetime lifetime)
Microsoft.Extensions.DependencyInjection.AutoActivation (5)
AutoActivationExtensions.Keyed.cs (5)
105Func<IServiceProvider, object?, TImplementation> implementationFactory) 147Func<IServiceProvider, object?, TService> implementationFactory) 204Func<IServiceProvider, object?, object> implementationFactory) 286Func<IServiceProvider, object?, object> implementationFactory) 339Func<IServiceProvider, object?, TService> implementationFactory)
Microsoft.Extensions.DependencyModel (1)
LinqHelpers.cs (1)
15Func<TSource, TParam1, IEnumerable<TResult>> func, TParam1 param1)
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLogger.cs (1)
72public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Extensions.FileSystemGlobbing (2)
Internal\MatcherContext.cs (2)
174private bool MatchPatternContexts<TFileInfoBase>(TFileInfoBase fileinfo, Func<IPatternContext, TFileInfoBase, bool> test) 191private PatternTestResult MatchPatternContexts<TFileInfoBase>(TFileInfoBase fileinfo, Func<IPatternContext, TFileInfoBase, PatternTestResult> test)
Microsoft.Extensions.Hosting (1)
Internal\Host.cs (1)
313Func<T, CancellationToken, Task> operation)
Microsoft.Extensions.Http (5)
DependencyInjection\HttpClientBuilderExtensions.cs (3)
518/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(IHttpClientBuilder,Func{HttpClient,IServiceProvider,TClient})"/> 522public static IHttpClientBuilder AddTypedClient<TClient>(this IHttpClientBuilder builder, Func<HttpClient, IServiceProvider, TClient> factory) 531internal static IHttpClientBuilder AddTypedClientCore<TClient>(this IHttpClientBuilder builder, Func<HttpClient, IServiceProvider, TClient> factory, bool validateSingleType)
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (2)
786public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, Func<HttpClient, IServiceProvider, TImplementation> factory) 823public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, string name, Func<HttpClient, IServiceProvider, TImplementation> factory)
Microsoft.Extensions.Http.Diagnostics (1)
Logging\Internal\Log.cs (1)
39private static readonly Func<LoggerMessageState, Exception?, string> _originalFormatValueFmtFunc = OriginalFormatValueFmt;
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (1)
DropMessageLogger.cs (1)
23public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\Internal\TestingHandlerStub.cs (2)
13private readonly Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> _handlerFunc; 15public TestingHandlerStub(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handlerFunc)
Microsoft.Extensions.Http.Polly (2)
DependencyInjection\PollyHttpClientBuilderExtensions.cs (2)
95Func<IServiceProvider, HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> policySelector) 167Func<IReadOnlyPolicyRegistry<string>, HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> policySelector)
Microsoft.Extensions.Http.Polly.Tests (1)
PolicyHttpMessageHandlerTest.cs (1)
440public Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> OnSendAsync { get; set; }
Microsoft.Extensions.Http.Resilience (2)
Hedging\Internals\RequestMessageSnapshotStrategy.cs (1)
19Func<ResilienceContext, TState, ValueTask<Outcome<TResult>>> callback,
Routing\Internal\RoutingResilienceStrategy.cs (1)
26Func<ResilienceContext, TState, ValueTask<Outcome<TResult>>> callback,
Microsoft.Extensions.Http.Resilience.Tests (3)
Hedging\HedgingTests.cs (1)
41private protected HedgingTests(Func<IHttpClientBuilder, Func<RequestRoutingStrategy>, TBuilder> createDefaultBuilder)
Helpers\TestHandlerStub.cs (2)
14private readonly Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> _handlerFunc; 21public TestHandlerStub(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handlerFunc)
Microsoft.Extensions.Logging (6)
FilterLoggingBuilderExtensions.cs (4)
29public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, Func<string?, LogLevel, bool> categoryLevelFilter) => 39public static ILoggingBuilder AddFilter<T>(this ILoggingBuilder builder, Func<string?, LogLevel, bool> categoryLevelFilter) where T : ILoggerProvider => 118public static LoggerFilterOptions AddFilter(this LoggerFilterOptions builder, Func<string?, LogLevel, bool> categoryLevelFilter) => 128public static LoggerFilterOptions AddFilter<T>(this LoggerFilterOptions builder, Func<string?, LogLevel, bool> categoryLevelFilter) where T : ILoggerProvider =>
Logger.cs (2)
27public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 52static void LoggerLog(LogLevel logLevel, EventId eventId, ILogger logger, Exception? exception, Func<TState, Exception?, string> formatter, ref List<Exception>? exceptions, in TState state)
Microsoft.Extensions.Logging.Abstractions (15)
ILogger.cs (1)
23void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter);
LogEntry.cs (2)
22public LogEntry(LogLevel logLevel, string category, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 60public Func<TState, Exception?, string> Formatter { get; }
LoggerExtensions.cs (1)
13private static readonly Func<FormattedLogValues, Exception?, string> _messageFormatter = MessageFormatter;
LoggerMessage.cs (8)
36public static Func<ILogger, T1, IDisposable?> DefineScope<T1>(string formatString) 468public static readonly Func<LogValues, Exception?, string> Callback = (state, exception) => state.ToString(); 506public static readonly Func<LogValues<T0>, Exception?, string> Callback = (state, exception) => state.ToString(); 554public static readonly Func<LogValues<T0, T1>, Exception?, string> Callback = (state, exception) => state.ToString(); 605public static readonly Func<LogValues<T0, T1, T2>, Exception?, string> Callback = (state, exception) => state.ToString(); 660public static readonly Func<LogValues<T0, T1, T2, T3>, Exception?, string> Callback = (state, exception) => state.ToString(); 721public static readonly Func<LogValues<T0, T1, T2, T3, T4>, Exception?, string> Callback = (state, exception) => state.ToString(); 786public static readonly Func<LogValues<T0, T1, T2, T3, T4, T5>, Exception?, string> Callback = (state, exception) => state.ToString();
LoggerT.cs (1)
45void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
NullLogger.cs (1)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
NullLoggerT.cs (1)
34Func<TState, Exception?, string> formatter)
Microsoft.Extensions.Logging.AzureAppServices (2)
BatchingLogger.cs (2)
31public void Log<TState>(DateTimeOffset timestamp, LogLevel logLevel, EventId _, TState state, Exception exception, Func<TState, Exception, string> formatter) 70public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.Extensions.Logging.Console (3)
ConsoleLogger.cs (1)
46public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
ConsoleLoggerExtensions.Obsolete.cs (2)
96public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, System.Func<string, Logging.LogLevel, bool> filter, bool includeScopes) 110public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, System.Func<string, Logging.LogLevel, bool> filter)
Microsoft.Extensions.Logging.Debug (2)
DebugLogger.cs (1)
39public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
DebugLoggerFactoryExtensions.cs (1)
33public static ILoggerFactory AddDebug(this ILoggerFactory factory, Func<string, LogLevel, bool> filter) => AddDebug(factory);
Microsoft.Extensions.Logging.EventLog (2)
EventLogLogger.cs (1)
75Func<TState, Exception?, string> formatter)
EventLogSettings.cs (1)
33public Func<string, LogLevel, bool>? Filter { get; set; }
Microsoft.Extensions.Logging.EventSource (1)
EventSourceLogger.cs (1)
55public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Extensions.Logging.Generators (4)
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithMetadataName.cs (2)
92Func<SyntaxNode, CancellationToken, bool> predicate, 93Func<GeneratorAttributeSyntaxContext, CancellationToken, T> transform)
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithSimpleName.cs (2)
91Func<SyntaxNode, CancellationToken, bool> predicate) 194Func<SyntaxNode, CancellationToken, bool> predicate,
Microsoft.Extensions.Logging.TraceSource (1)
TraceSourceLogger.cs (1)
27public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Extensions.ML.Tests (1)
UriLoaderTests.cs (1)
83public Func<Uri, string, bool> ETagMatches { get; set; } = delegate { return false; };
Microsoft.Extensions.Options (6)
OptionsBuilder.cs (2)
366public virtual OptionsBuilder<TOptions> Validate<TDep>(Func<TOptions, TDep, bool> validation) where TDep : notnull 376public virtual OptionsBuilder<TOptions> Validate<TDep>(Func<TOptions, TDep, bool> validation, string failureMessage) where TDep : notnull
OptionsCache.cs (2)
50internal TOptions GetOrAdd<TArg>(string? name, Func<string, TArg, TOptions> createOptions, TArg factoryArgument) 60Func<string, TArg, TOptions> localCreateOptions = createOptions;
ValidateOptions.cs (2)
81public ValidateOptions(string? name, TDep dependency, Func<TOptions, TDep, bool> validation, string failureMessage) 99public Func<TOptions, TDep, bool> Validation { get; }
Microsoft.Extensions.Options.Contextual (5)
ContextualOptionsServiceCollectionExtensions.cs (3)
45Func<IOptionsContext, CancellationToken, ValueTask<IConfigureContextualOptions<TOptions>>> loadOptions) 60Func<IOptionsContext, CancellationToken, ValueTask<IConfigureContextualOptions<TOptions>>> loadOptions) 112Func<IOptionsContext, CancellationToken, ValueTask<IConfigureContextualOptions<TOptions>>> loadOptions)
Internal\LoadContextualOptions.cs (2)
24public LoadContextualOptions(string? name, Func<IOptionsContext, CancellationToken, ValueTask<IConfigureContextualOptions<TOptions>>> load) 38public Func<IOptionsContext, CancellationToken, ValueTask<IConfigureContextualOptions<TOptions>>> LoadAction { get; }
Microsoft.Extensions.Options.Contextual.Tests (2)
ContextualOptionsServiceCollectionExtensionsTests.cs (2)
32Func<IOptionsContext, CancellationToken, ValueTask<IConfigureContextualOptions<string>>> loadOptions = 54Func<IOptionsContext, CancellationToken, ValueTask<IConfigureContextualOptions<string>>> loadOptions =
Microsoft.Extensions.Resilience.PerformanceTests (1)
ResilienceEnrichmentBenchmark.cs (1)
60Func<ResilienceContext, TState, ValueTask<Outcome<TResult>>> callback,
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
77private sealed class FakeEndpointResolver(Func<IServiceEndpointBuilder, CancellationToken, ValueTask> resolveAsync, Func<ValueTask> disposeAsync) : IServiceEndpointProvider
Microsoft.Extensions.Telemetry (19)
Logging\ExtendedLogger.cs (13)
54public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 61ModernPath(logLevel, eventId, msgState, exception, (Func<LoggerMessageState, Exception?, string>)(object)formatter); 222private void ModernPath(LogLevel logLevel, EventId eventId, LoggerMessageState msgState, Exception? exception, Func<LoggerMessageState, Exception?, string> formatter) 297Func<LoggerMessageState, Exception?, string> fmt = s.Formatter!; 322Func<LoggerMessageState, Exception?, string>? fmt = s.Formatter!; 343Func<LoggerMessageState, Exception?, string>? fmt = s.Formatter!; 368private void LegacyPath<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 437var fmt = (Func<TState, Exception?, string>)s.Formatter!; 462var fmt = (Func<TState, Exception?, string>)s.Formatter!; 483var fmt = (Func<TState, Exception?, string>)s.Formatter!;
Logging\ExtendedLogger.ModernTagJoiner.cs (1)
19public Func<LoggerMessageState, Exception?, string>? Formatter;
Logging\Import\LoggerInformation.cs (1)
35public Action<LogLevel, EventId, ExtendedLogger.ModernTagJoiner, Exception?, Func<ExtendedLogger.ModernTagJoiner, Exception?, string>> LoggerLog { get; }
src\Shared\Memoization\Memoize.cs (2)
57public static Func<TParameter1, TParameter2, TResult> Function<TParameter1, TParameter2, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TResult>( 58Func<TParameter1, TParameter2, TResult> f)
src\Shared\Memoization\MemoizedFunction.cs (2)
133private readonly Func<TParameter1, TParameter2, TResult> _function; 139public MemoizedFunction(Func<TParameter1, TParameter2, TResult> function)
Microsoft.Extensions.Telemetry.PerformanceTests (1)
BenchLogger.cs (1)
35public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Extensions.Telemetry.Tests (6)
Logging\ExtendedLoggerFactoryTests.cs (2)
554public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 592public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Logging\ExtendedLoggerTests.cs (2)
1093Func<TState, Exception?, string> formatter) 1156public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) => _provider.State = state?.ToString();
Sampling\RandomProbabilisticSamplerTests.cs (1)
18private readonly Func<IReadOnlyList<KeyValuePair<string, object?>>, Exception?, string> _dummyFormatter = (_, _) => string.Empty;
Sampling\TraceBasedSamplerTests.cs (1)
18private readonly Func<IReadOnlyList<KeyValuePair<string, object?>>, Exception?, string> _dummyFormatter = (_, _) => string.Empty;
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
379Func<TReceiver, Compilation, TParserOutput> parser,
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
379Func<TReceiver, Compilation, TParserOutput> parser,
Microsoft.Gen.Logging.Generated.Tests (1)
Utils.cs (1)
63public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
379Func<TReceiver, Compilation, TParserOutput> parser,
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
379Func<TReceiver, Compilation, TParserOutput> parser,
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
379Func<TReceiver, Compilation, TParserOutput> parser,
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
379Func<TReceiver, Compilation, TParserOutput> parser,
Microsoft.Interop.ComInterfaceGenerator (12)
Analyzers\AddGeneratedComClassFixer.cs (1)
43protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (2)
188private readonly Func<TypePositionInfo, StubCodeContext, ResolvedGenerator> _func; 190public CallbackGeneratorResolver(Func<TypePositionInfo, StubCodeContext, ResolvedGenerator> func)
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (1)
35protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (4)
33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 164protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions); 204var documentBasedFix = codeFixProvider.CreateFixForSelectedOptions(node, codeFixProvider.GetOptionsForIndividualFix(options, diagnostic));
VirtualMethodPointerStubGenerator.cs (4)
25Func<EnvironmentFlags, MarshalDirection, IMarshallingGeneratorResolver> generatorResolverCreator) 132Func<EnvironmentFlags, MarshalDirection, IMarshallingGeneratorResolver> generatorResolverCreator) 237Func<EnvironmentFlags, MarshalDirection, IMarshallingGeneratorResolver> generatorResolverCreator) 262Func<EnvironmentFlags, MarshalDirection, IMarshallingGeneratorResolver> generatorResolverCreator)
Microsoft.Interop.LibraryImportGenerator (6)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
230private sealed class CallbackGeneratorResolver(Func<TypePositionInfo, StubCodeContext, ResolvedGenerator> func) : IMarshallingGeneratorResolver
Analyzers\ConvertToLibraryImportFixer.cs (1)
129protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (4)
33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 164protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions); 204var documentBasedFix = codeFixProvider.CreateFixForSelectedOptions(node, codeFixProvider.GetOptionsForIndividualFix(options, diagnostic));
Microsoft.Maui (1)
Hosting\MauiAppBuilder.cs (1)
200 public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Maui.Controls (5)
AnimationExtensions.cs (2)
191 public static void AnimateKinetic(this IAnimatable self, string name, Func<double, double, bool> callback, double velocity, double drag, Action finished = null, IAnimationManager animationManager = null) 286 static void AnimateKineticInternal(IAnimatable self, IAnimationManager animationManager, string name, Func<double, double, bool> callback, double velocity, double drag, Action finished = null)
DependencyResolver.cs (2)
13 static Func<Type, object[], object> Resolver { get; set; } 16 public static void ResolveUsing(Func<Type, object[], object> resolver)
LegacyLayouts\Constraint.cs (1)
47 public static Constraint RelativeToView(View view, Func<RelativeLayout, View, double> measure)
Microsoft.Maui.Controls.Build.Tasks (1)
TypeReferenceExtensions.cs (1)
275 Func<MethodDefinition, TypeReference, bool> predicate, ModuleDefinition module)
Microsoft.ML.AutoML (3)
API\AutoCatalog.cs (1)
301public SweepableEstimator CreateSweepableEstimator<T>(Func<MLContext, T, IEstimator<ITransformer>> factory, SearchSpace<T> ss = null)
SweepableEstimator\SweepableEstimator.cs (2)
19private readonly Func<MLContext, Parameter, IEstimator<ITransformer>> _factory; 21public SweepableEstimator(Func<MLContext, Parameter, IEstimator<ITransformer>> factory, SearchSpace.SearchSpace ss)
Microsoft.ML.Core (37)
ComponentModel\ComponentFactory.cs (3)
67public static IComponentFactory<TArg1, TComponent> CreateFromFunction<TArg1, TComponent>(Func<IHostEnvironment, TArg1, TComponent> factory) 116private readonly Func<IHostEnvironment, TArg1, TComponent> _factory; 118public SimpleComponentFactory(Func<IHostEnvironment, TArg1, TComponent> factory)
Data\AnnotationUtils.cs (1)
220public static uint GetMaxAnnotationKind(this DataViewSchema schema, out int colMax, string annotationKind, Func<DataViewSchema, int, bool> filterFunc = null)
Data\ServerChannel.cs (2)
102public void Register<T1, T2, TRet>(string name, Func<T1, T2, TRet> func) 224/// <see cref="Func{T1, T2, TResult}"/>, etc.
Utilities\FuncInstanceMethodInfo1`4.cs (4)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>, 33public FuncInstanceMethodInfo1(Func<T1, T2, TResult> function) 58public static FuncInstanceMethodInfo1<TTarget, T1, T2, TResult> Create(Expression<Func<TTarget, Func<T1, T2, TResult>>> expression) 76Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T1, T2, TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo2`4.cs (4)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>, 33public FuncInstanceMethodInfo2(Func<T1, T2, TResult> function) 58public static FuncInstanceMethodInfo2<TTarget, T1, T2, TResult> Create(Expression<Func<TTarget, Func<T1, T2, TResult>>> expression) 76Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T1, T2, TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`4.cs (4)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>, 33public FuncInstanceMethodInfo3(Func<T1, T2, TResult> function) 58public static FuncInstanceMethodInfo3<TTarget, T1, T2, TResult> Create(Expression<Func<TTarget, Func<T1, T2, TResult>>> expression) 76Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<T1, T2, TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncMethodInfo1`3.cs (1)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>,
Utilities\FuncMethodInfo2`3.cs (1)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>,
Utilities\FuncMethodInfo3`3.cs (1)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>,
Utilities\FuncStaticMethodInfo1`3.cs (2)
14/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>, 28public FuncStaticMethodInfo1(Func<T1, T2, TResult> function)
Utilities\FuncStaticMethodInfo2`3.cs (2)
14/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>, 28public FuncStaticMethodInfo2(Func<T1, T2, TResult> function)
Utilities\FuncStaticMethodInfo3`3.cs (2)
14/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{T1, T2, TResult}"/>, 28public FuncStaticMethodInfo3(Func<T1, T2, TResult> function)
Utilities\Heap.cs (8)
20private readonly Func<T, T, bool> _fnReverse; 27public Heap(Func<T, T, bool> fnReverse) 44public Heap(Func<T, T, bool> fnReverse, int capacity) 66public Func<T, T, bool> FnReverse 220private readonly Func<T, T, bool> _fnReverse; 227public Heap(Func<T, T, bool> fnReverse) 244public Heap(Func<T, T, bool> fnReverse, int capacity) 266public Func<T, T, bool> FnReverse
Utilities\Utils.cs (1)
423public static int FindIndexSorted<T, TValue>(this T[] input, int min, int lim, Func<T, TValue, bool> func, TValue value)
Utilities\VBufferUtils.cs (1)
1125public static void ApplyIntoEitherDefined<TSrc, TDst>(in VBuffer<TSrc> src, ref VBuffer<TDst> dst, Func<int, TSrc, TDst> func)
Microsoft.ML.Core.Tests (7)
UnitTests\CoreBaseTestClass.cs (2)
45protected Func<bool> GetComparerOne<T>(DataViewRow r1, DataViewRow r2, int col, Func<T, T, bool> fn) 68protected Func<bool> GetComparerVec<T>(DataViewRow r1, DataViewRow r2, int col, int size, Func<T, T, bool> fn)
UnitTests\TestVBuffer.cs (5)
469private static void NaiveApplyInto<T, TDst>(ref VBuffer<T> a, ref VBuffer<TDst> dst, Func<int, T, TDst> func) 489Func<int, float, float> func = (int ind, float av) => av - ind; 1027private static void TestSame<T>(ref VBuffer<T> expected, ref VBuffer<T> actual, Func<T, T, bool> equalityFunc) 1044private static Func<float, float, bool> FloatEquality(float tol) 1170private static void TestEquivalent<T>(ref VBuffer<T> expected, ref VBuffer<T> actual, Func<T, T, bool> equalityFunc)
Microsoft.ML.Data (22)
Commands\DataCommand.cs (3)
215protected ILegacyDataLoader CreateAndSaveLoader(Func<IHostEnvironment, IMultiStreamSource, ILegacyDataLoader> defaultLoaderFactory = null) 319protected ILegacyDataLoader CreateLoader(Func<IHostEnvironment, IMultiStreamSource, ILegacyDataLoader> defaultLoaderFactory = null) 332Func<IHostEnvironment, IMultiStreamSource, ILegacyDataLoader> defaultLoaderFactory = null,
DataLoadSave\LegacyCompositeDataLoader.cs (1)
276string tag, string creationArgs, Func<IHostEnvironment, IDataView, IDataView> createTransform)
Evaluators\EvaluatorUtils.cs (2)
758Func<RoleMappedData, int, IDataView> getPerInstance = 903Func<IDataView, int, IDataView> keyToValue =
Scorers\MulticlassClassificationScorer.cs (6)
85private readonly Func<ISchemaBoundMapper, DataViewType, bool> _canWrap; 108string metadataKind, Func<ISchemaBoundMapper, DataViewType, bool> canWrap) 114string metadataKind, Func<ISchemaBoundMapper, DataViewType, bool> canWrap) 239string metadataKind, Func<ISchemaBoundMapper, DataViewType, bool> canWrap) 262private readonly Func<ISchemaBoundMapper, DataViewType, bool> _canWrap; 283string metadataKind, Func<ISchemaBoundMapper, DataViewType, bool> canWrap)
Scorers\PredictedLabelScorerBase.cs (3)
121Func<DataViewType, bool> outputTypeMatches, Func<DataViewType, ISchemaBoundRowMapper, DataViewType> getPredColType) 278Func<DataViewType, bool> outputTypeMatches, Func<DataViewType, ISchemaBoundRowMapper, DataViewType> getPredColType, string predictedLabelColumnName = DefaultColumnNames.PredictedLabel) 312Func<DataViewType, bool> outputTypeMatches, Func<DataViewType, ISchemaBoundRowMapper, DataViewType> getPredColType)
Transforms\MetadataDispatcher.cs (5)
31public readonly Func<string, int, bool> FilterSrc; 47public ColInfo(DataViewSchema schemaSrc, int indexSrc, Func<string, int, bool> filterSrc, 159Func<string, int, bool> filterSrc = null) 339public Builder BuildMetadata(int index, DataViewSchema schemaSrc, int indexSrc, Func<string, int, bool> filterSrc) 390DataViewSchema schemaSrc = null, int indexSrc = -1, Func<string, int, bool> filterSrc = null)
Transforms\ValueMapping.cs (1)
809Func<DataViewSchema.Column, DataViewSchema.Column, ValueMap> del = CreateValueMapInvoke<int, int>;
Utilities\ColumnCursor.cs (1)
79Func<IDataView, int, IEnumerable<int[]>> del = GetColumnArrayDirect<int>;
Microsoft.ML.DataView (1)
Utils.cs (1)
25public static TRet MarshalInvoke<TArg1, TArg2, TRet>(Func<TArg1, TArg2, TRet> func, Type genArg, TArg1 arg1, TArg2 arg2)
Microsoft.ML.FastTree (1)
SumupPerformanceCommand.cs (1)
160Func<IChannel, Random, IEnumerable<int>> createIntArray;
Microsoft.ML.StandardTrainers (4)
Standard\SdcaBinary.cs (3)
569Func<DataViewRowId, long, long> getIndexFromIdAndRow = GetIndexFromIdAndRowGetter(idToIdx, biasReg.Length); 974Func<DataViewRowId, long, long> getIndexFromIdAndRow = GetIndexFromIdAndRowGetter(idToIdx, biasReg.Length); 1141private protected Func<DataViewRowId, long, long> GetIndexFromIdAndRowGetter(IdToIdxLookup idToIdx, int biasLength)
Standard\SdcaMulticlass.cs (1)
375Func<DataViewRowId, long, long> getIndexFromIdAndRow = GetIndexFromIdAndRowGetter(idToIdx, biasReg.Length);
Microsoft.ML.TestFramework (4)
BaseTestBaseline.cs (1)
438private bool FirstIsSuffix<T>(IEnumerator<T> suffix, IEnumerator<T> seq, Func<T, T, bool> equalFunc = null)
DataPipe\TestDataPipe.cs (1)
228Func<float, float, bool> fn = (x, y) => FloatUtils.GetBits(x) == FloatUtils.GetBits(y);
DataPipe\TestDataPipeBase.cs (2)
1000protected Func<bool> GetComparerOne<T>(DataViewRow r1, DataViewRow r2, int col, Func<T, T, bool> fn) 1017protected Func<bool> GetComparerVec<T>(DataViewRow r1, DataViewRow r2, int col, int size, Func<T, T, bool> fn)
Microsoft.ML.TestFrameworkCommon (1)
TestCommon.cs (1)
131public static bool CompareVec<T>(in VBuffer<T> v1, in VBuffer<T> v2, int size, Func<T, T, bool> fn)
Microsoft.ML.TimeSeries (2)
SsaAnomalyDetectionBase.cs (2)
57public static Func<Double, Double, Double> GetErrorFunction(ErrorFunction errorFunction) 188internal readonly Func<Double, Double, Double> ErrorFunc;
Microsoft.ML.Transforms (15)
CustomMappingCatalog.cs (1)
95public static IDataView FilterByStatefulCustomPredicate<TSrc, TState>(this DataOperationsCatalog catalog, IDataView input, Func<TSrc, TState, bool> filterPredicate,
CustomMappingFilter.cs (3)
133private readonly Func<TSrc, TState, bool> _predicate; 138public StatefulCustomMappingFilter(IHostEnvironment env, IDataView input, Func<TSrc, TState, bool> predicate, Action<TState> stateInitAction) 182var predicate = parent._predicate;
Expression\BuiltinFunctions.cs (1)
92public static MethodInfo Fn<T1, T2, T3>(Func<T1, T2, T3> fn)
Expression\CodeGen.cs (3)
52{ typeFn = typeof(Func<,,>); break; } 682private void CallFnc<T1, T2, TDst>(Func<T1, T2, TDst> fn) 687private void CallBin<T>(Func<T, T, T> fn)
ExpressionTransformer.cs (4)
478var fn = (Func<T0, T1, TDst>)del; 672var fn = (Func<T0, T1, TDst>)del;
LambdaTransform.cs (1)
140Func<TSrc, TState, bool> filterFunc, Action<TState> initStateAction, SchemaDefinition inputSchemaDefinition = null)
PermutationFeatureImportance.cs (1)
27Func<TMetric, TMetric, TMetric> deltaFunc,
PermutationFeatureImportanceExtensions.cs (1)
658Func<TMetric, TMetric, TMetric> deltaFunc,
Microsoft.VisualBasic.Core (6)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (2)
1418Dim c As CallSite(Of Func(Of CallSite, Object, Object)) = 1419CallSite(Of Func(Of CallSite, Object, Object)).Create(action)
Microsoft\VisualBasic\CompilerServices\Utils.vb (4)
346Private s_MemberEquivalence As Func(Of MethodBase, MethodBase, Boolean) = 357Dim memberEquivalence As Func(Of MethodBase, MethodBase, Boolean) = Expression.Lambda(Of Func(Of MethodBase, MethodBase, Boolean))( 375Dim fallbackMemberEquivalence As Func(Of MethodBase, MethodBase, Boolean) = Function(m1param, m2param) m1param.IsEquivalentTo(m2param)
Microsoft.VisualStudio.LanguageServices (9)
CodeCleanup\AbstractCodeCleanUpFixer.cs (1)
170Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> applyFixAsync,
LanguageService\PackageLoadTasks.cs (5)
14using WorkTask = Func<PackageLoadTasks, CancellationToken, Task>; 27private readonly ConcurrentQueue<WorkTask> _backgroundThreadWorkTasks = []; 28private readonly ConcurrentQueue<WorkTask> _mainThreadWorkTasks = []; 31public void AddTask(bool isMainThreadTask, WorkTask task) 51private ConcurrentQueue<WorkTask> GetWorkTasks(bool isMainThreadTask)
Packaging\PackageInstallerServiceFactory.cs (1)
496Func<INuGetProjectService, CancellationToken, ValueTask<T?>> doWorkAsync, CancellationToken cancellationToken)
Workspace\VisualStudioDocumentNavigationService.cs (2)
161Func<SourceText, TextSpan, VsTextSpan> getVsTextSpanForMapping, 185Func<SourceText, TextSpan, VsTextSpan> getVsTextSpanForMapping,
MSBuild (9)
TypeLoader.cs (9)
34private static readonly ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>(); 39private static readonly ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfReflectionOnlyLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>(); 44private Func<Type, object, bool> _isDesiredType; 65internal TypeLoader(Func<Type, object, bool> isDesiredType) 238private LoadedType GetLoadedType(ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> cache, string typeName, AssemblyLoadInfo assembly, bool useTaskHost) 270private Func<Type, object, bool> _isDesiredType; 304internal AssemblyInfoToLoadedTypes(Func<Type, object, bool> typeFilter, AssemblyLoadInfo loadInfo)
MSBuildTaskHost (8)
BuildExceptionSerializationHelper.cs (8)
14public TypeConstructionTuple(Type type, Func<string, Exception?, BuildExceptionBase> factory) 21public Func<string, Exception?, BuildExceptionBase> Factory { get; } 24private static Dictionary<string, Func<string, Exception?, BuildExceptionBase>>? s_exceptionFactories; 26private static readonly Func<string, Exception?, BuildExceptionBase> s_defaultFactory = 49var exceptionFactories = new Dictionary<string, Func<string, Exception?, BuildExceptionBase>>(); 54Func<string, Exception?, BuildExceptionBase> exceptionFactory = typeConstructionTuple.Factory; 76internal static Func<string, Exception?, BuildExceptionBase> CreateExceptionFactory(string serializationType) 78Func<string, Exception?, BuildExceptionBase>? factory = null;
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
236[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<,,>))]
netstandard (1)
netstandard.cs (1)
804[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<,,>))]
PresentationFramework (1)
MS\Internal\Data\RBTree.cs (1)
453internal int IndexOf(T item, Func<T, T, bool> AreEqual)
PresentationFramework-SystemCore (2)
DynamicAccessorImpl.cs (2)
29_getter = CallSite<Func<CallSite, object, object>>.Create(binder); 46private CallSite<Func<CallSite, object, object>> _getter;
RateLimitingSample (2)
SampleRateLimiterPolicy.cs (2)
11private Func<OnRejectedContext, CancellationToken, ValueTask>? _onRejected; 23public Func<OnRejectedContext, CancellationToken, ValueTask>? OnRejected { get => _onRejected; }
Replay (2)
src\Compilers\Shared\BuildServerConnection.cs (2)
175Func<string, ICompilerServerLogger, bool> tryCreateServerFunc, 204Func<string, ICompilerServerLogger, bool> tryCreateServerFunc,
Roslyn.Diagnostics.Analyzers (15)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
src\RoslynAnalyzers\Utilities\Refactoring\Extensions\SourceTextExtensions.cs (2)
16Func<int, CancellationToken, bool> isPositionHidden, 31Func<int, CancellationToken, bool> isPositionHidden,
src\RoslynAnalyzers\Utilities\Refactoring\Extensions\SyntaxNodeExtensions.cs (4)
17private static readonly Func<SyntaxTriviaList, int, SyntaxToken> s_findSkippedTokenForward = FindSkippedTokenForward; 22private static readonly Func<SyntaxTriviaList, int, SyntaxToken> s_findSkippedTokenBackward = FindSkippedTokenBackward; 46var findSkippedToken = includeSkipped ? s_findSkippedTokenForward : ((l, p) => default); 85var findSkippedToken = includeSkipped ? s_findSkippedTokenBackward : ((l, p) => default);
Roslyn.Test.PdbUtilities (1)
EditAndContinue\EditAndContinueTestUtilities.cs (1)
104Func<MetadataReader, Handle, StringHandle> getName,
Roslyn.VisualStudio.Next.UnitTests (2)
Options\VisualStudioSettingsOptionPersisterTests.cs (1)
37public Func<string, Type, (GetValueResult, object?)>? GetValueImpl;
Services\ServiceHubServicesTests_ExtensionMessageHandler.cs (1)
764public Func<string, CancellationToken, (IExtensionAssemblyLoader? assemblyLoader, Exception? extensionException)>? CreateNewShadowCopyLoaderCallback { get; set; }
ServerComparison.FunctionalTests (2)
ResponseCompressionTests.cs (1)
84Func<HttpClient, ILogger, Task> scenario,
ResponseTests.cs (1)
79private async Task ResponseFormats(TestVariant variant, Func<HttpClient, ILogger, Task> scenario, [CallerMemberName] string testName = null)
Shared (4)
Memoization\Memoize.cs (2)
57public static Func<TParameter1, TParameter2, TResult> Function<TParameter1, TParameter2, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TResult>( 58Func<TParameter1, TParameter2, TResult> f)
Memoization\MemoizedFunction.cs (2)
133private readonly Func<TParameter1, TParameter2, TResult> _function; 139public MemoizedFunction(Func<TParameter1, TParameter2, TResult> function)
Shared.Tests (3)
Memoization\MemoizeTests.cs (3)
33Func<int, int, int> adder = (x, y) => x + y; 82Func<int, int, int> adder = (x, y) => 102Func<object?, object?, string> toString = (_, _) =>
Sockets.BindTests (1)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (1)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Sockets.FunctionalTests (1)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (1)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
System.Collections.Concurrent (4)
System\Collections\Concurrent\ConcurrentDictionary.cs (4)
1248public TValue GetOrAdd<TArg>(TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) 1327TKey key, Func<TKey, TArg, TValue> addValueFactory, Func<TKey, TValue, TArg, TValue> updateValueFactory, TArg factoryArgument) 1401public TValue AddOrUpdate(TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory) 1472public TValue AddOrUpdate(TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
System.Collections.Immutable (8)
System\Collections\Immutable\ImmutableArray.cs (1)
342public static ImmutableArray<TResult> CreateRange<TSource, TArg, TResult>(ImmutableArray<TSource> items, Func<TSource, TArg, TResult> selector, TArg arg)
System\Collections\Immutable\ImmutableInterlocked.cs (1)
78public static bool Update<T, TArg>(ref T location, Func<T, TArg, T> transformer, TArg transformerArgument) where T : class?
System\Linq\ImmutableArrayExtensions.cs (6)
54Func<TSource, TCollection, TResult> resultSelector) 219public static bool SequenceEqual<TDerived, TBase>(this ImmutableArray<TBase> immutableArray, ImmutableArray<TDerived> items, Func<TBase, TBase, bool> predicate) where TDerived : TBase 250public static T? Aggregate<T>(this ImmutableArray<T> immutableArray, Func<T, T, T> func) 273public static TAccumulate Aggregate<TAccumulate, T>(this ImmutableArray<T> immutableArray, TAccumulate seed, Func<TAccumulate, T, TAccumulate> func) 296public static TResult Aggregate<TAccumulate, TResult, T>(this ImmutableArray<T> immutableArray, TAccumulate seed, Func<TAccumulate, T, TAccumulate> func, Func<TAccumulate, TResult> resultSelector) 701Func<TSource, TCollection, TResult> resultSelector)
System.ComponentModel.TypeConverter (4)
MS\Internal\Xml\Linq\ComponentModel\XComponentModel.cs (4)
499private readonly Func<XElement, XName?, IEnumerable<T>> _func; 503public XDeferredAxis(Func<XElement, XName?, IEnumerable<T>> func, XElement element, XName? name) 543private readonly Func<XElement, XName, T?> _func; 547public XDeferredSingleton(Func<XElement, XName, T?> func, XElement element, XName? name)
System.Composition.Hosting (8)
System\Composition\Hosting\Providers\ExportFactory\ExportFactoryExportDescriptorProvider.cs (2)
22var gldm = gld.CreateStaticDelegate<Func<CompositionContract, DependencyAccessor, object>>();
System\Composition\Hosting\Providers\ExportFactory\ExportFactoryWithMetadataExportDescriptorProvider.cs (2)
25var gldm = gld.CreateStaticDelegate<Func<CompositionContract, DependencyAccessor, object>>();
System\Composition\Hosting\Providers\Lazy\LazyExportDescriptorProvider.cs (2)
23var gldm = gld.CreateStaticDelegate<Func<CompositionContract, DependencyAccessor, object>>();
System\Composition\Hosting\Providers\Lazy\LazyWithMetadataExportDescriptorProvider.cs (2)
24var gldm = gld.CreateStaticDelegate<Func<CompositionContract, DependencyAccessor, object>>();
System.Core (1)
System.Core.cs (1)
94[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<,,>))]
System.Data.Common (2)
System\Data\LinqDataView.cs (2)
23internal Func<object, DataRow, int>? comparerKeyRow; // comparer for DataView.Find(.. 59Func<object, DataRow, int>? comparerKeyRow,
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\DiagLinkedList.cs (2)
74public bool AddIfNotExist(T value, Func<T, T, bool> compare) 96public T? Remove(T value, Func<T, T, bool> compare)
System.Formats.Asn1 (1)
System\Formats\Asn1\AsnWriter.cs (1)
274public TReturn Encode<TState, TReturn>(TState state, Func<TState, ReadOnlySpan<byte>, TReturn> encodeCallback)
System.Linq (50)
System\Linq\Aggregate.cs (3)
10public static TSource Aggregate<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, TSource> func) 55public static TAccumulate Aggregate<TSource, TAccumulate>(this IEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func) 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 (6)
31Func<TAccumulate, TSource, TAccumulate> func, 75Func<TAccumulate, TSource, TAccumulate> func, 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\Grouping.cs (8)
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) 130private readonly Func<TKey, IEnumerable<TElement>, TResult> _resultSelector; 135public GroupByResultIterator(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector, IEqualityComparer<TKey>? comparer) 187private readonly Func<TKey, IEnumerable<TSource>, TResult> _resultSelector; 192public GroupByResultIterator(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector, IEqualityComparer<TKey>? comparer)
System\Linq\GroupJoin.cs (3)
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\Join.cs (3)
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\LeftJoin.cs (3)
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 (2)
154internal List<TResult> ToList<TResult>(Func<TKey, IEnumerable<TElement>, TResult> resultSelector) 179public IEnumerable<TResult> ApplyResultSelector<TResult>(Func<TKey, IEnumerable<TElement>, TResult> resultSelector)
System\Linq\Lookup.SpeedOpt.cs (1)
11internal TResult[] ToArray<TResult>(Func<TKey, IEnumerable<TElement>, TResult> resultSelector)
System\Linq\RightJoin.cs (3)
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 (2)
66public static IEnumerable<TResult> Select<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, int, TResult> selector) 86private static IEnumerable<TResult> SelectIterator<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, int, TResult> selector)
System\Linq\SelectMany.cs (8)
31public static IEnumerable<TResult> SelectMany<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, int, IEnumerable<TResult>> selector) 51private static IEnumerable<TResult> SelectManyIterator<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, int, IEnumerable<TResult>> selector) 68public static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult>(this IEnumerable<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector) 93private static IEnumerable<TResult> SelectManyIterator<TSource, TCollection, TResult>(IEnumerable<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector) 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)
System\Linq\Skip.cs (2)
80public static IEnumerable<TSource> SkipWhile<TSource>(this IEnumerable<TSource> source, Func<TSource, int, bool> predicate) 100private static IEnumerable<TSource> SkipWhileIterator<TSource>(IEnumerable<TSource> source, Func<TSource, int, bool> predicate)
System\Linq\Take.cs (2)
232public static IEnumerable<TSource> TakeWhile<TSource>(this IEnumerable<TSource> source, Func<TSource, int, bool> predicate) 252private static IEnumerable<TSource> TakeWhileIterator<TSource>(IEnumerable<TSource> source, Func<TSource, int, bool> predicate)
System\Linq\Where.cs (2)
47public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> source, Func<TSource, int, bool> predicate) 67private static IEnumerable<TSource> WhereIterator<TSource>(IEnumerable<TSource> source, Func<TSource, int, bool> predicate)
System\Linq\Zip.cs (2)
10public static IEnumerable<TResult> Zip<TFirst, TSecond, TResult>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector) 85private static IEnumerable<TResult> ZipIterator<TFirst, TSecond, TResult>(IEnumerable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector)
System.Linq.AsyncEnumerable (156)
System\Linq\AggregateAsync.cs (8)
24Func<TSource, TSource, TSource> func, 34Func<TSource, TSource, TSource> func, 108Func<TAccumulate, TSource, TAccumulate> func, 119Func<TAccumulate, TSource, TAccumulate> func) 188Func<TAccumulate, TSource, TAccumulate> func, 201Func<TAccumulate, TSource, TAccumulate> func, 236Func<TAccumulate, CancellationToken, ValueTask<TResult>> resultSelector, 249Func<TAccumulate, CancellationToken, ValueTask<TResult>> resultSelector,
System\Linq\AggregateBy.cs (10)
37Func<TAccumulate, TSource, TAccumulate> func, 53Func<TAccumulate, TSource, TAccumulate> func, 106Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 122Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 175Func<TAccumulate, TSource, TAccumulate> func, 191Func<TAccumulate, TSource, TAccumulate> func, 245Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 246Func<TKey, CancellationToken, ValueTask<TAccumulate>> seedSelector, 261Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 262Func<TKey, CancellationToken, ValueTask<TAccumulate>> seedSelector,
System\Linq\AllAsync.cs (2)
63Func<TSource, CancellationToken, 74Func<TSource, CancellationToken, ValueTask<bool>> predicate,
System\Linq\AnyAsync.cs (2)
87Func<TSource, CancellationToken, ValueTask<bool>> predicate, 97Func<TSource, CancellationToken, ValueTask<bool>> predicate,
System\Linq\CountAsync.cs (4)
89Func<TSource, CancellationToken, ValueTask<bool>> predicate, 99Func<TSource, CancellationToken, ValueTask<bool>> predicate, 188Func<TSource, CancellationToken, ValueTask<bool>> predicate, 198Func<TSource, CancellationToken, ValueTask<bool>> predicate,
System\Linq\CountBy.cs (2)
76Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 87IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey>? keyComparer, [EnumeratorCancellation] CancellationToken cancellationToken)
System\Linq\DistinctBy.cs (3)
73/// <para>The <see cref="DistinctBy{TSource, TKey}(IAsyncEnumerable{TSource}, Func{TSource, CancellationToken, ValueTask{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> 79Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 91Func<TSource, CancellationToken, ValueTask<TKey>> keySelector,
System\Linq\Empty.cs (1)
42public IOrderedAsyncEnumerable<TResult> CreateOrderedAsyncEnumerable<TKey>(Func<TResult, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey>? comparer, bool descending)
System\Linq\ExceptBy.cs (2)
89Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 103Func<TSource, CancellationToken, ValueTask<TKey>> keySelector,
System\Linq\FirstAsync.cs (5)
96Func<TSource, CancellationToken, ValueTask<bool>> predicate, 106Func<TSource, CancellationToken, ValueTask<bool>> predicate, 190Func<TSource, CancellationToken, ValueTask<bool>> predicate, 242Func<TSource, CancellationToken, ValueTask<bool>> predicate, 253Func<TSource, CancellationToken, ValueTask<bool>> predicate,
System\Linq\GroupBy.cs (16)
66Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 78Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 157Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 158Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, 171Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 172Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, 204Func<TKey, IEnumerable<TSource>, TResult> resultSelector, 218Func<TKey, IEnumerable<TSource>, TResult> resultSelector, 252Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 266Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 305Func<TKey, IEnumerable<TElement>, TResult> resultSelector, 321Func<TKey, IEnumerable<TElement>, TResult> resultSelector, 357Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 358Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, 373Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 374Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector,
System\Linq\GroupJoin.cs (6)
41Func<TOuter, IEnumerable<TInner>, TResult> resultSelector, 59Func<TOuter, IEnumerable<TInner>, TResult> resultSelector, 104Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, 105Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector, 122Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, 123Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector,
System\Linq\IntersectBy.cs (2)
99Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 113Func<TSource, CancellationToken, ValueTask<TKey>> keySelector,
System\Linq\Join.cs (6)
38Func<TOuter, TInner, TResult> resultSelector, 55Func<TOuter, TInner, TResult> resultSelector, 109Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, 110Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector, 127Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, 128Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector,
System\Linq\LastAsync.cs (5)
117Func<TSource, CancellationToken, ValueTask<bool>> predicate, 127Func<TSource, CancellationToken, ValueTask<bool>> predicate, 230Func<TSource, CancellationToken, ValueTask<bool>> predicate, 298Func<TSource, CancellationToken, ValueTask<bool>> predicate, 308IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<bool>> predicate, TSource defaultValue, CancellationToken cancellationToken)
System\Linq\LeftJoin.cs (6)
35Func<TOuter, TInner?, TResult> resultSelector, 52Func<TOuter, TInner?, TResult> resultSelector, 104Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, 105Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector, 122Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, 123Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector,
System\Linq\MaxByAsync.cs (2)
137Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 148Func<TSource, CancellationToken, ValueTask<TKey>> keySelector,
System\Linq\MinByAsync.cs (2)
137Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 148Func<TSource, CancellationToken, ValueTask<TKey>> keySelector,
System\Linq\OrderBy.cs (9)
57Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 112Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 153Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 191Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 213public IOrderedAsyncEnumerable<TElement> CreateOrderedAsyncEnumerable<TKey>(Func<TElement, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey>? comparer, bool descending) => 229Debug.Assert(keySelector is Func<TElement, TKey> or Func<TElement, CancellationToken, ValueTask<TKey>>); 342var asyncSelector = (Func<TElement, CancellationToken, ValueTask<TKey>>)keySelector; 451IOrderedAsyncEnumerable<TElement> CreateOrderedAsyncEnumerable<TKey>(Func<TElement, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey>? comparer, bool descending);
System\Linq\RightJoin.cs (6)
35Func<TOuter?, TInner, TResult> resultSelector, 53Func<TOuter?, TInner, TResult> resultSelector, 105Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, 106Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector, 123Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, 124Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector,
System\Linq\Select.cs (4)
60Func<TSource, CancellationToken, ValueTask<TResult>> selector) 71Func<TSource, CancellationToken, ValueTask<TResult>> selector, 97Func<TSource, int, TResult> selector) 108Func<TSource, int, TResult> selector,
System\Linq\SelectMany.cs (18)
69Func<TSource, CancellationToken, ValueTask<IEnumerable<TResult>>> selector) 80Func<TSource, CancellationToken, ValueTask<IEnumerable<TResult>>> selector, 150Func<TSource, int, IEnumerable<TResult>> selector) 161Func<TSource, int, IEnumerable<TResult>> selector, 234Func<TSource, int, IAsyncEnumerable<TResult>> selector) 245Func<TSource, int, IAsyncEnumerable<TResult>> selector, 283Func<TSource, TCollection, TResult> resultSelector) 296Func<TSource, TCollection, TResult> resultSelector, 332Func<TSource, CancellationToken, ValueTask<IEnumerable<TCollection>>> collectionSelector, 345Func<TSource, CancellationToken, ValueTask<IEnumerable<TCollection>>> collectionSelector, 383Func<TSource, TCollection, TResult> resultSelector) 396Func<TSource, TCollection, TResult> resultSelector, 481Func<TSource, int, IEnumerable<TCollection>> collectionSelector, 482Func<TSource, TCollection, TResult> resultSelector) 494Func<TSource, int, IEnumerable<TCollection>> collectionSelector, 495Func<TSource, TCollection, TResult> resultSelector, 581Func<TSource, int, IAsyncEnumerable<TCollection>> collectionSelector, 594Func<TSource, int, IAsyncEnumerable<TCollection>> collectionSelector,
System\Linq\SingleAsync.cs (5)
120Func<TSource, CancellationToken, ValueTask<bool>> predicate, 130Func<TSource, CancellationToken, ValueTask<bool>> predicate, 254Func<TSource, CancellationToken, ValueTask<bool>> predicate, 320Func<TSource, CancellationToken, ValueTask<bool>> predicate, 331Func<TSource, CancellationToken, ValueTask<bool>> predicate,
System\Linq\SkipWhile.cs (4)
78Func<TSource, CancellationToken, ValueTask<bool>> predicate) 89Func<TSource, CancellationToken, ValueTask<bool>> predicate, 131Func<TSource, int, bool> predicate) 142Func<TSource, int, bool> predicate,
System\Linq\TakeWhile.cs (4)
62Func<TSource, CancellationToken, ValueTask<bool>> predicate) 73Func<TSource, CancellationToken, ValueTask<bool>> predicate, 103Func<TSource, int, bool> predicate) 114Func<TSource, int, bool> predicate,
System\Linq\ToDictionaryAsync.cs (6)
117Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 128Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 206Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 207Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, 219Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 220Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector,
System\Linq\ToLookupAsync.cs (8)
78Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 89Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 182Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 183Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, 195Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 196Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, 304Func<TElement, CancellationToken, ValueTask<TKey>> keySelector, 408Func<TKey, IEnumerable<TElement>, TResult> resultSelector)
System\Linq\UnionBy.cs (2)
77Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, 91Func<TSource, CancellationToken, ValueTask<TKey>> keySelector,
System\Linq\Where.cs (4)
55Func<TSource, CancellationToken, ValueTask<bool>> predicate) 66Func<TSource, CancellationToken, ValueTask<bool>> predicate, 94Func<TSource, int, bool> predicate) 105Func<TSource, int, bool> predicate,
System\Linq\Zip.cs (2)
30Func<TFirst, TSecond, TResult> resultSelector) 43Func<TFirst, TSecond, TResult> resultSelector,
System.Linq.Expressions (12)
System\Dynamic\UpdateDelegates.Generated.cs (3)
19var @this = (CallSite<Func<CallSite, T0, TRet>>)site; 20Func<CallSite, T0, TRet>[] applicable; 21Func<CallSite, T0, TRet> rule, originalRule = @this.Target;
System\Dynamic\Utils\DelegateHelpers.cs (3)
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>>();
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (1)
197return typeof(Func<,,>).MakeGenericType(types);
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
460private readonly Func<T0, T1, TRet> _target; 467_target = (Func<T0, T1, TRet>)target.CreateDelegate(typeof(Func<T0, T1, TRet>));
System\Linq\Expressions\StackGuard.cs (2)
47public R RunOnEmptyStack<T1, T2, R>(Func<T1, T2, R> action, T1 arg1, T2 arg2) => 50var t = ((Func<T1, T2, R>, T1, T2))s;
System.Linq.Parallel (70)
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (4)
28Func<Pair<bool, T>, T, Pair<bool, T>> intermediateReduce = MakeIntermediateReduceFunction(sign); 29Func<Pair<bool, T>, Pair<bool, T>, Pair<bool, T>> finalReduce = MakeFinalReduceFunction(sign); 61private static Func<Pair<bool, T>, T, Pair<bool, T>> MakeIntermediateReduceFunction(int sign) 85private static Func<Pair<bool, T>, Pair<bool, T>, Pair<bool, T>> MakeFinalReduceFunction(int sign)
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (4)
54private readonly Func<TIntermediate, TInput, TIntermediate> _intermediateReduce; 57private readonly Func<TIntermediate, TIntermediate, TIntermediate> _finalReduce; 73Func<TIntermediate, TInput, TIntermediate> intermediateReduce, 74Func<TIntermediate, TIntermediate, TIntermediate> finalReduce,
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (2)
30private readonly Func<TLeftInput, IEnumerable<TRightInput>, TOutput> _resultSelector; // The result selection routine. 40Func<TLeftInput, IEnumerable<TRightInput>, TOutput> resultSelector,
System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs (2)
43private readonly Func<TLeftInput, TRightInput, TOutput> _resultSelector; // Result selector. 65Func<TLeftInput, TRightInput, TOutput> resultSelector,
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (2)
46private readonly Func<TLeftInput, TRightInput, TOutput> _resultSelector; // The result selection routine. 56Func<TLeftInput, TRightInput, TOutput> resultSelector,
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (5)
30private readonly Func<TLeftInput, TRightInput, TOutput> _resultSelector; // To select result elements. 47Func<TLeftInput, TRightInput, TOutput> resultSelector) 57Func<TLeftInput, TRightInput, TOutput> resultSelector) 166private readonly Func<TLeftInput, TRightInput, TOutput> _resultSelector; // To select result elements. 173Func<TLeftInput, TRightInput, TOutput> resultSelector, int partitionCount, bool preferStriping)
System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs (4)
28private readonly Func<TInput, int, TOutput> _selector; 44Func<TInput, int, TOutput> selector) 137private readonly Func<TInput, int, TOutput> _selector; // The actual select function. 143internal IndexedSelectQueryOperatorEnumerator(QueryOperatorEnumerator<TInput, int> source, Func<TInput, int, TOutput> selector)
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (4)
27private readonly Func<TInputOutput, int, bool> _predicate; 43Func<TInputOutput, int, bool> predicate) 142private readonly Func<TInputOutput, int, bool> _predicate; // The predicate used for filtering. 149internal IndexedWhereQueryOperatorEnumerator(QueryOperatorEnumerator<TInputOutput, int> source, Func<TInputOutput, int, bool> predicate,
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (4)
36private readonly Func<TLeftInput, int, IEnumerable<TRightInput>>? _indexedRightChildSelector; // To select a new child each iteration. 37private readonly Func<TLeftInput, TRightInput, TOutput>? _resultSelector; // An optional result selection function. 54Func<TLeftInput, int, IEnumerable<TRightInput>>? indexedRightChildSelector, 55Func<TLeftInput, TRightInput, TOutput>? resultSelector)
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (6)
46private readonly Func<TResult, int, bool>? _indexedPredicate; 68Func<TResult, int, bool>? indexedPredicate, bool take) 138Func<TResult, TKey, bool>? convertedIndexedPredicate = (Func<TResult, TKey, bool>?)(object?)_indexedPredicate; 209private readonly Func<TResult, TKey, bool>? _indexedPredicate; // The actual index-based predicate function. 229QueryOperatorEnumerator<TResult, TKey> source, Func<TResult, bool>? predicate, Func<TResult, TKey, bool>? indexedPredicate, bool take,
System\Linq\ParallelEnumerable.cs (33)
545public static ParallelQuery<TSource> Where<TSource>(this ParallelQuery<TSource> source, Func<TSource, int, bool> predicate) 592this ParallelQuery<TSource> source, Func<TSource, int, TResult> selector) 622this ParallelQuery<TFirst> first, ParallelQuery<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector) 651this ParallelQuery<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector) 685Func<TOuter, TInner, TResult> resultSelector) 715Func<TOuter, TInner, TResult> resultSelector) 745Func<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey>? comparer) 782Func<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey>? comparer) 817Func<TOuter, IEnumerable<TInner>, TResult> resultSelector) 848Func<TOuter, IEnumerable<TInner>, TResult> resultSelector) 879Func<TOuter, IEnumerable<TInner>, TResult> resultSelector, IEqualityComparer<TKey>? comparer) 917Func<TOuter, IEnumerable<TInner>, TResult> resultSelector, IEqualityComparer<TKey>? comparer) 965this ParallelQuery<TSource> source, Func<TSource, int, IEnumerable<TResult>> selector) 995Func<TSource, TCollection, TResult> resultSelector) 1030this ParallelQuery<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector, 1031Func<TSource, TCollection, TResult> resultSelector) 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) 1522Func<T, T, T> reduce, T seed, bool seedIsSpecified, bool throwIfEmpty, QueryAggregationOptions options) 1545this ParallelQuery<TSource> source, TAccumulate seed, bool seedIsSpecified, Func<TAccumulate, TSource, TAccumulate> func) 1612this ParallelQuery<TSource> source, Func<TSource, TSource, TSource> func) 1618this ParallelQuery<TSource> source, Func<TSource, TSource, TSource> func, QueryAggregationOptions options) 1660this ParallelQuery<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func) 1666this ParallelQuery<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, QueryAggregationOptions options) 1700this ParallelQuery<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, 1756this ParallelQuery<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> updateAccumulatorFunc, 1757Func<TAccumulate, TAccumulate, TAccumulate> combineAccumulatorsFunc, Func<TAccumulate, TResult> resultSelector) 1811Func<TAccumulate, TSource, TAccumulate> updateAccumulatorFunc, 1812Func<TAccumulate, TAccumulate, TAccumulate> combineAccumulatorsFunc, 4158public static ParallelQuery<TSource> TakeWhile<TSource>(this ParallelQuery<TSource> source, Func<TSource, int, bool> predicate) 4242public static ParallelQuery<TSource> SkipWhile<TSource>(this ParallelQuery<TSource> source, Func<TSource, int, bool> predicate)
System.Linq.Queryable (52)
System\Linq\Queryable.cs (52)
61public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate) 69new Func<IQueryable<TSource>, Expression<Func<TSource, int, bool>>, IQueryable<TSource>>(Where).Method, 111public static IQueryable<TResult> Select<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, int, TResult>> selector) 119new Func<IQueryable<TSource>, Expression<Func<TSource, int, TResult>>, IQueryable<TResult>>(Select).Method, 137public static IQueryable<TResult> SelectMany<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, int, IEnumerable<TResult>>> selector) 145new Func<IQueryable<TSource>, Expression<Func<TSource, int, IEnumerable<TResult>>>, IQueryable<TResult>>(SelectMany).Method, 150public static IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, int, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector) 159new Func<IQueryable<TSource>, Expression<Func<TSource, int, IEnumerable<TCollection>>>, Expression<Func<TSource, TCollection, 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, 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, 605public static IQueryable<TSource> TakeWhile<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate) 613new Func<IQueryable<TSource>, Expression<Func<TSource, int, bool>>, IQueryable<TSource>>(TakeWhile).Method, 643public static IQueryable<TSource> SkipWhile<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate) 651new Func<IQueryable<TSource>, Expression<Func<TSource, int, bool>>, IQueryable<TSource>>(SkipWhile).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, 882public static IQueryable<TResult> Zip<TFirst, TSecond, TResult>(this IQueryable<TFirst> source1, IEnumerable<TSecond> source2, Expression<Func<TFirst, TSecond, TResult>> resultSelector) 891new Func<IQueryable<TFirst>, IEnumerable<TSecond>, Expression<Func<TFirst, TSecond, TResult>>, IQueryable<TResult>>(Zip).Method, 2449public static TSource Aggregate<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, TSource, TSource>> func) 2457new Func<IQueryable<TSource>, Expression<Func<TSource, TSource, TSource>>, TSource>(Aggregate).Method, 2462public static TAccumulate Aggregate<TSource, TAccumulate>(this IQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> func) 2470new Func<IQueryable<TSource>, TAccumulate, Expression<Func<TAccumulate, TSource, TAccumulate>>, TAccumulate>(Aggregate).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, 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, 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 (8)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (3)
1170private readonly Func<T, Memory<byte>, bool> _writeAction; 1172public WriteQueueEntry(int writeBytes, T state, Func<T, Memory<byte>, bool> writeAction, CancellationToken cancellationToken) 1185private Task PerformWriteAsync<T>(int writeBytes, T state, Func<T, Memory<byte>, bool> writeAction, CancellationToken cancellationToken = default)
System\Net\Http\SocketsHttpHandler\HttpConnectionSettings.cs (2)
66internal Func<SocketsHttpConnectionContext, CancellationToken, ValueTask<Stream>>? _connectCallback; 67internal Func<SocketsHttpPlaintextStreamFilterContext, CancellationToken, ValueTask<Stream>>? _plaintextStreamFilter;
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (3)
23private Func<HttpConnectionSettings, HttpMessageHandlerStage, HttpMessageHandlerStage>? _decompressionHandlerFactory; 401public Func<SocketsHttpConnectionContext, CancellationToken, ValueTask<Stream>>? ConnectCallback 414public Func<SocketsHttpPlaintextStreamFilterContext, CancellationToken, ValueTask<Stream>>? PlaintextStreamFilter
System.Net.HttpListener (4)
src\libraries\Common\src\System\Net\CookieParser.cs (4)
527private static Func<Cookie, string?, bool>? s_internalSetNameMethod; 528private static Func<Cookie, string?, bool> InternalSetNameMethod 540s_internalSetNameMethod = (Func<Cookie, string?, bool>)Delegate.CreateDelegate(typeof(Func<Cookie, string?, bool>), method);
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
725private static Task<TResult> RunAsync<TResult>(Func<object, NameResolutionActivity, TResult> func, object key, CancellationToken cancellationToken)
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.cs (1)
706Func<TArg, CancellationToken, ValueTask<IPAddress>> getAddress,
System.Net.Quic (1)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
68Func<TExteriorHandle, TArg1, TInteriorHandle> accessor,
System.Net.Security (1)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
68Func<TExteriorHandle, TArg1, TInteriorHandle> accessor,
System.Private.CoreLib (49)
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) 88private readonly Func<T?, T?, bool> _equals; 91public DelegateEqualityComparer(Func<T?, T?, bool> equals, Func<T, int> getHashCode)
src\libraries\System.Private.CoreLib\src\System\ComponentModel\DefaultValueAttribute.cs (2)
90s_convertFromInvariantString = mi == null ? new object() : mi.CreateDelegate<Func<Type, string, object>>(); 93if (s_convertFromInvariantString is not Func<Type, string?, object> convertFromInvariantString)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (7)
26private static Func<object?, Stream, object>? s_deserializeMethod; 106Func<object?, Stream, object>? deserializeMethod = (Func<object?, Stream, object>?) 124private static Func<object, Stream, object> CreateUntypedDelegate<TInstance>(MethodInfo method) 126Func<TInstance, Stream, object> typedDelegate = (Func<TInstance, Stream, object>)Delegate.CreateDelegate(typeof(Func<TInstance, Stream, object>), null, method);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (2)
262/// returned by all the racing <see cref="GetOrAdd{TArg}(TKey, Func{TKey, TArg, TValue}, TArg)"/> calls. This rule permits the 265public TValue GetOrAdd<TArg>(TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument)
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (6)
54private event Func<Assembly, string, IntPtr>? _resolvingUnmanagedDll; 56private event Func<AssemblyLoadContext, AssemblyName, Assembly>? _resolving; 189public event Func<Assembly, string, IntPtr>? ResolvingUnmanagedDll 210public event Func<AssemblyLoadContext, AssemblyName, Assembly?>? Resolving 619foreach (Func<AssemblyLoadContext, AssemblyName, Assembly> handler in Delegate.EnumerateInvocationList(_resolving)) 795foreach (Func<Assembly, string, IntPtr> handler in Delegate.EnumerateInvocationList(_resolvingUnmanagedDll))
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (6)
1212public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state) 1242public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state, 1274public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state, 1318public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state, 1373public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state, 1380internal Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (8)
714Func<AsyncCallback, object?, IAsyncResult> beginMethod, 743Func<AsyncCallback, object?, IAsyncResult> beginMethod, 751internal static Task<TResult> FromAsyncImpl(Func<AsyncCallback, object?, IAsyncResult> beginMethod, 1193Func<TInstance, IAsyncResult, TResult> endMethod) 1233private Func<TInstance, IAsyncResult, TResult>? m_endMethod; 1238internal FromAsyncTrimPromise(TInstance thisRef, Func<TInstance, IAsyncResult, TResult> endMethod) 1261Func<TInstance, IAsyncResult, TResult>? endMethod = promise.m_endMethod; 1284TInstance thisRef, Func<TInstance, IAsyncResult, TResult> endMethod, IAsyncResult asyncResult,
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (6)
4203public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state) 4233public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken) 4264public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler) 4301public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskContinuationOptions continuationOptions) 4348public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken, 4355private Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, 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>, 92if (m_action is Func<Task, object?, TResult> funcWithState) 156Debug.Assert(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object?, TResult>, 184if (m_action is Func<Task<TAntecedentResult>, object?, TResult> funcWithState)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (4)
876Func<AsyncCallback, object?, IAsyncResult> beginMethod, 906Func<AsyncCallback, object?, IAsyncResult> beginMethod, 1240Func<AsyncCallback, object?, IAsyncResult> beginMethod, 1272Func<AsyncCallback, object?, IAsyncResult> beginMethod,
src\System\Runtime\InteropServices\Marshal.CoreCLR.cs (1)
100private static unsafe T ReadValueSlow<T>(object ptr, int ofs, Func<IntPtr, int, T> readValueHelper)
System.Private.Windows.Core (1)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
791public static bool TryWrite<T>(Func<Stream, T, bool> func, Stream stream, T value)
System.Private.Windows.Core.Tests (2)
System\TypeExtensionsTests.cs (2)
133private readonly Func<string, string, Type?> _bindToType; 134public BindToTypeBinder(Func<string, string, Type?> bindToType) => _bindToType = bindToType;
System.Reflection.MetadataLoadContext (5)
System\Reflection\TypeLoading\General\Ecma\EcmaResolver.cs (4)
36private static readonly Func<EntityHandle, EcmaModule, EcmaDefinitionType> s_resolveTypeDef = 47private static readonly Func<EntityHandle, EcmaModule, RoDefinitionType> s_resolveTypeRef = 134private static readonly Func<EntityHandle, EcmaModule, EcmaGenericParameterType> s_resolveGenericParam = 173private static readonly Func<EntityHandle, EcmaModule, RoAssembly> s_resolveAssembly =
System\Reflection\TypeLoading\General\Ecma\MetadataTable.cs (1)
29public T GetOrAdd(EntityHandle handle, C context, Func<EntityHandle, C, T> factory)
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
202[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)
294public void ToManaged<T1, T2, TResult>(out Func<T1, T2, TResult>? value, ArgumentToJSCallback<T1> arg1Marshaler, ArgumentToJSCallback<T2> arg2Marshaler, ArgumentToManagedCallback<TResult> resMarshaler) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 295public void ToJS<T1, T2, TResult>(Func<T1, T2, TResult>? value, ArgumentToManagedCallback<T1> arg1Marshaler, ArgumentToManagedCallback<T2> arg2Marshaler, ArgumentToJSCallback<TResult> resMarshaler) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); }
System.Security.Cryptography (5)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
68Func<TExteriorHandle, TArg1, TInteriorHandle> accessor,
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (1)
408Func<Pkcs12LoaderLimits, string, bool> filter)
System\Security\Cryptography\FixedMemoryKeyBox.cs (1)
33Func<TState, ReadOnlySpan<byte>, TRet> func)
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (1)
336private void FindCore<TState>(TState state, Func<TState, X509Certificate2, bool> predicate)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
1723Func<ReadOnlySpan<char>, ReadOnlySpan<char>, TAlg> factory,
System.ServiceModel.Primitives.Tests (7)
Channels\CustomChannelTest.cs (5)
33Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 123Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 217Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 268Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 325Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) =>
ServiceModel\MessageContractTest.4.4.0.cs (2)
151Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) => 251Func<Type, BindingContext, IChannelFactory> buildFactoryAction = (Type type, BindingContext context) =>
System.ServiceModel.Syndication (2)
System\ServiceModel\Syndication\ExtensibleSyndicationObject.cs (1)
99internal void WriteElementExtensions(XmlWriter writer, Func<string, string, bool> shouldSkipElement = null)
System\ServiceModel\Syndication\SyndicationElementExtensionCollection.cs (1)
114internal void WriteTo(XmlWriter writer, Func<string, string, bool> shouldSkipElement)
System.Text.Json (11)
System\Text\Json\Schema\JsonSchemaExporterOptions.cs (1)
31public Func<JsonSchemaExporterContext, JsonNode, JsonNode>? TransformSchemaNode { get; init; }
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (2)
120public Func<object, object?, bool>? ShouldSerialize 133private protected Func<object, object?, bool>? _shouldSerialize;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (8)
82internal new Func<object, T?, bool>? ShouldSerialize 88private Func<object, T?, bool>? _shouldSerializeTyped; 92Debug.Assert(predicate is null or Func<object, object?, bool> or Func<object, T?, bool>); 100else if (predicate is Func<object, T?, bool> typedPredicate) 103_shouldSerialize = typedPredicate is Func<object, object?, bool> untypedPredicate ? untypedPredicate : (obj, value) => typedPredicate(obj, (T?)value); 107Func<object, object?, bool> untypedPredicate = (Func<object, object?, bool>)predicate;
System.Text.RegularExpressions (2)
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (1)
283internal SymbolicRegexNode<TNewSet> Transform<TNewSet>(SymbolicRegexNode<TSet> node, SymbolicRegexBuilder<TNewSet> builder, Func<SymbolicRegexBuilder<TNewSet>, TSet, TNewSet> setTransformer)
System\Threading\StackHelper.cs (1)
143public static TResult CallOnEmptyStack<TArg1, TArg2, TResult>(Func<TArg1, TArg2, TResult> func, TArg1 arg1, TArg2 arg2) =>
System.Text.RegularExpressions.Generator (1)
src\libraries\System.Text.RegularExpressions\src\System\Threading\StackHelper.cs (1)
143public static TResult CallOnEmptyStack<TArg1, TArg2, TResult>(Func<TArg1, TArg2, TResult> func, TArg1 arg1, TArg2 arg2) =>
System.Threading.Tasks.Parallel (17)
System\Threading\Tasks\Parallel.ForEachAsync.cs (17)
20public static Task ForAsync<T>(T fromInclusive, T toExclusive, Func<T, CancellationToken, ValueTask> body) 38public static Task ForAsync<T>(T fromInclusive, T toExclusive, CancellationToken cancellationToken, Func<T, CancellationToken, ValueTask> body) 56public static Task ForAsync<T>(T fromInclusive, T toExclusive, ParallelOptions parallelOptions, Func<T, CancellationToken, ValueTask> body) 77private static Task ForAsync<T>(T fromInclusive, T toExclusive, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<T, CancellationToken, ValueTask> body) 198public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 214public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 229public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 247private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 353public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 369public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 384public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 402private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 535public readonly Func<TSource, CancellationToken, ValueTask> LoopBody; 540protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 693Func<TSource, CancellationToken, ValueTask> body) : 715Func<TSource, CancellationToken, ValueTask> body) : 738Func<T, CancellationToken, ValueTask> body) :
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (1)
2066Func<T, int, bool> trySetFocusAtItemIndex) where T : Control
System.Windows.Forms.Design.Tests (2)
System\Windows\Forms\Design\ImageListImageEditorTests.cs (2)
17var editor_LoadImageFromStream = editor.TestAccessor().CreateDelegate<Func<Stream, bool, ImageListImage>>("LoadImageFromStream");
System.Windows.Forms.Tests (17)
System\Windows\Forms\AccessibleObjects\ButtonBase.ButtonBaseAccessibleObjectTests.cs (4)
282private readonly Func<UIA_PROPERTY_ID, VARIANT, bool> _checkRaisedEvent; 284public ButtonWithCustomAccessibleObject(Func<UIA_PROPERTY_ID, VARIANT, bool> checkRaisedEvent) 294private readonly Func<UIA_PROPERTY_ID, VARIANT, bool> _checkRaisedEvent; 296public ControlAccessibleObjectWithNotificationCounter(Control ownerControl, Func<UIA_PROPERTY_ID, VARIANT, bool> checkRaisedEvent) : base(ownerControl)
System\Windows\Forms\AccessibleObjects\LabelAccessibleObjectTests.cs (4)
187private readonly Func<UIA_PROPERTY_ID, VARIANT, bool> _checkRaisedEvent; 189public LabelWithCustomAccessibleObject(Func<UIA_PROPERTY_ID, VARIANT, bool> checkRaisedEvent) 199private readonly Func<UIA_PROPERTY_ID, VARIANT, bool> _checkRaisedEvent; 201public ControlAccessibleObjectWithNotificationCounter(Control ownerControl, Func<UIA_PROPERTY_ID, VARIANT, bool> checkRaisedEvent) : base(ownerControl)
System\Windows\Forms\ControlTests.Methods.cs (1)
5478public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; }
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (1)
2079public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; }
System\Windows\Forms\Design\PropertyTabTests.cs (1)
192public Func<object, Attribute[], PropertyDescriptorCollection> GetPropertiesAction { get; set; }
System\Windows\Forms\MenuStripTests.cs (1)
827public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; }
System\Windows\Forms\ToolStripControlHostTests.cs (1)
4374public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; }
System\Windows\Forms\ToolStripTests.cs (1)
7441public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; }
System\Windows\Forms\TrackBarRendererTests.cs (1)
89void TestGetThumbSize(Func<Graphics, TrackBarThumbState, Size> getThumbSize)
TextBoxBaseTests.cs (1)
5929public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; }
WebBrowserBaseTests.cs (1)
863public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; }
System.Windows.Forms.UI.IntegrationTests (12)
ButtonTests.cs (1)
395private async Task RunTestAsync(Func<Form, Button, Task> runTest)
DataGridViewTests.cs (1)
73private async Task RunTestAsync(Func<Form, DataGridView, Task> runTest)
Infra\ControlTestBase.cs (4)
224protected async Task RunSingleControlTestAsync<T>(Func<Form, T, Task> testDriverAsync) 243protected async Task RunSingleControlTestAsync<T>(Func<Form, T, Task> testDriverAsync, Func<T> createControl, Func<Form>? createForm = null) 271protected async Task RunControlPairTestAsync<T1, T2>(Func<Form, (T1 control1, T2 control2), Task> testDriverAsync) 300protected async Task RunFormAsync<T>(Func<(Form dialog, T control)> createDialog, Func<Form, T, Task> testDriverAsync)
ListViewTests.cs (1)
622private async Task RunTestAsync(Func<Form, ListView, Task> runTest)
MonthCalendarAccessibleObjectTests.cs (1)
38private async Task RunTestAsync(Func<Form, MonthCalendar, Task> runTest)
MonthCalendarTests.cs (2)
200private async Task RunClickTestAsync(Func<Form, MonthCalendar, Task> runTest) 224private async Task RunTestAsync(Func<Form, MonthCalendar, Task> runTest)
RichTextBoxTests.cs (1)
234private async Task RunTestAsync(Func<Form, RichTextBox, Task> runTest)
TabControlTests.cs (1)
77private async Task RunTestAsync(Func<Form, TabControl, Task> runTest)
System.Xaml.Tests (7)
Common\Optional.cs (1)
18public readonly T Or<TArg1, TArg2>(Func<TArg1, TArg2, T> valueFactory, TArg1 arg1, TArg2 arg2) => HasValue ? Value : valueFactory(arg1, arg2);
System\Windows\Markup\NameReferenceConverterTests.cs (1)
230public Func<IEnumerable<string>, bool, object>? GetFixupTokenAction { get; set; }
System\Windows\Markup\ReferenceTests.cs (1)
117public Func<IEnumerable<string>, bool, object>? GetFixupTokenAction { get; set; }
System\Xaml\XamlMemberTests.cs (2)
2337public Func<Type, bool, object[]>? GetCustomAttributesAction { get; set; } 2351public Func<Type, bool, bool>? IsDefinedAction { get; set; }
System\Xaml\XamlTypeTests.cs (2)
5261public Func<Type, bool, object[]>? GetCustomAttributesAction { get; set; } 5275public Func<Type, bool, bool>? IsDefinedAction { get; set; }
Test.Utilities (9)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
Text.Analyzers (9)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableArrayExtensions.cs (1)
53public static bool Any<T, TArg>(this ImmutableArray<T> array, Func<T, TArg, bool> predicate, TArg arg)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (8)
94internal static Func<TSyntax, TProperty, TSyntax> CreateSyntaxWithPropertyAccessor<TSyntax, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 98internal static Func<TSymbol, TProperty, TSymbol> CreateSymbolWithPropertyAccessor<TSymbol, TProperty>(Type? type, string propertyName, TProperty fallbackResult) 102private static Func<T, TProperty, T> CreateWithPropertyAccessor<T, TProperty>(Type? type, string parameterName, string propertyName, TProperty fallbackResult) 127Expression<Func<T, TProperty, T>> expression = 128Expression.Lambda<Func<T, TProperty, T>>( 153internal static Func<T, TArg, TValue> CreateAccessorWithArgument<T, TArg, TValue>(Type? type, string parameterName, Type argumentType, string argumentName, string methodName, TValue fallbackResult) 177Expression<Func<T, TArg, TValue>> expression = Expression.Lambda<Func<T, TArg, TValue>>(result, parameter, argument);
UnitTests.Common (3)
MockChannelFactory.cs (1)
46public Func<EndpointAddress, Uri, IChannel> OnCreateChannelOverride { get; set; }
MockRequestChannel.cs (1)
18public Func<Message, TimeSpan, Message> RequestOverride { get; set; }
MockTransportBindingElement.cs (1)
17public Func<Type,BindingContext,IChannelFactory> BuildChannelFactoryOverride { get; set; }
vbc (2)
src\Compilers\Shared\BuildServerConnection.cs (2)
175Func<string, ICompilerServerLogger, bool> tryCreateServerFunc, 204Func<string, ICompilerServerLogger, bool> tryCreateServerFunc,
VBCSCompiler (12)
src\Compilers\Server\VBCSCompiler\CompilerRequestHandler.cs (2)
46public static Func<string, MetadataReferenceProperties, PortableExecutableReference> SharedAssemblyReferenceProvider { get; } = (path, properties) => new CachingMetadataReference(path, properties); 51private Func<string, MetadataReferenceProperties, PortableExecutableReference> AssemblyReferenceProvider { get; } = SharedAssemblyReferenceProvider;
src\Compilers\Server\VBCSCompiler\CSharpCompilerServer.cs (4)
17private readonly Func<string, MetadataReferenceProperties, PortableExecutableReference> _metadataProvider; 19internal CSharpCompilerServer(Func<string, MetadataReferenceProperties, PortableExecutableReference> metadataProvider, string[] args, BuildPaths buildPaths, string? libDirectory, IAnalyzerAssemblyLoader analyzerLoader, GeneratorDriverCache driverCache) 24internal CSharpCompilerServer(Func<string, MetadataReferenceProperties, PortableExecutableReference> metadataProvider, string? responseFile, string[] args, BuildPaths buildPaths, string? libDirectory, IAnalyzerAssemblyLoader analyzerLoader, GeneratorDriverCache driverCache) 30internal override Func<string, MetadataReferenceProperties, PortableExecutableReference> GetMetadataProvider()
src\Compilers\Server\VBCSCompiler\VisualBasicCompilerServer.cs (4)
19private readonly Func<string, MetadataReferenceProperties, PortableExecutableReference> _metadataProvider; 21internal VisualBasicCompilerServer(Func<string, MetadataReferenceProperties, PortableExecutableReference> metadataProvider, string[] args, BuildPaths buildPaths, string? libDirectory, IAnalyzerAssemblyLoader analyzerLoader, GeneratorDriverCache driverCache) 26internal VisualBasicCompilerServer(Func<string, MetadataReferenceProperties, PortableExecutableReference> metadataProvider, string? responseFile, string[] args, BuildPaths buildPaths, string? libDirectory, IAnalyzerAssemblyLoader analyzerLoader, GeneratorDriverCache driverCache) 32internal override Func<string, MetadataReferenceProperties, PortableExecutableReference> GetMetadataProvider()
src\Compilers\Shared\BuildServerConnection.cs (2)
175Func<string, ICompilerServerLogger, bool> tryCreateServerFunc, 204Func<string, ICompilerServerLogger, bool> tryCreateServerFunc,
VBCSCompiler.UnitTests (3)
TestableClientConnection.cs (1)
23public Func<BuildResponse, CancellationToken, Task> WriteBuildResponseFunc = delegate { throw new Exception(); };
TestableCompilerServerHost.cs (2)
15internal Func<RunRequest, CancellationToken, BuildResponse> RunCompilation { get; } 18internal TestableCompilerServerHost(Func<RunRequest, CancellationToken, BuildResponse> runCompilation = null, ICompilerServerLogger logger = null)
xunit.assert (14)
AsyncCollectionAsserts.cs (5)
76 Func<T, int, Task> action) => 299 Func<T, T, bool> comparer) => 318 Func<T, T, bool> comparer) => 418 Func<T, T, bool> comparer) => 437 Func<T, T, bool> comparer) =>
CollectionAsserts.cs (3)
122 Func<T, int, Task> action) 528 Func<T, T, bool> comparer) => 610 Func<T, T, bool> comparer) =>
EqualityAsserts.cs (2)
119 Func<T, T, bool> comparer) => 638 Func<T, T, bool> comparer) =>
Sdk\AssertEqualityComparer.cs (3)
378 public static IEqualityComparer<T?> FromComparer(Func<T, T, bool> comparer) => 394 readonly Func<T, T, bool> comparer; 396 public FuncEqualityComparer(Func<T, T, bool> comparer)
Sdk\Exceptions\AllException.cs (1)
36 /// or <see cref="Assert.AllAsync{T}(IEnumerable{T}, Func{T, int, Task})"/>.