2458 references to Func
aspire (3)
DotNetCliRunner.cs (1)
41internal Func<int> GetCurrentProcessId { get; set; } = () => Environment.ProcessId;
Interaction\IInteractionService.cs (1)
11Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action);
Interaction\InteractionService.cs (1)
20public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
Aspire.Azure.AI.OpenAI.Tests (10)
AIOpenAIPublicApiTests.cs (10)
19var action = () => new AspireAzureOpenAIClientBuilder(hostBuilder, connectionName, serviceKey, disableTracing); 35var action = () => new AspireAzureOpenAIClientBuilder(hostBuilder, connectionName, serviceKey, disableTracing); 49var action = () => builder.AddAzureOpenAIClient(connectionName); 63var action = () => builder.AddAzureOpenAIClient(connectionName); 77var action = () => builder.AddKeyedAzureOpenAIClient(name); 91var action = () => builder.AddKeyedAzureOpenAIClient(name); 105var action = () => builder.AddOpenAIClientFromConfiguration(connectionName); 119var action = () => builder.AddOpenAIClientFromConfiguration(connectionName); 133var action = () => builder.AddKeyedOpenAIClientFromConfiguration(name); 147var action = () => builder.AddKeyedOpenAIClientFromConfiguration(name);
Aspire.Cli.Tests (1)
TestServices\TestAppHostBackchannel.cs (1)
15public Func<Task>? RequestStopAsyncCallback { get; set; }
Aspire.Dashboard (29)
Components\Layout\AspirePageContentLayout.razor.cs (1)
55public Dictionary<string, Func<Task>> DialogCloseListeners { get; } = new();
Components\Layout\MobileNavMenuEntry.cs (1)
9internal record MobileNavMenuEntry(string Text, Func<Task> OnClick, Icon? Icon = null, Regex? LinkMatchRegex = null);
DashboardWebApplication.cs (8)
53private readonly List<Func<EndpointInfo>> _frontendEndPointAccessor = new(); 54private Func<EndpointInfo>? _otlpServiceGrpcEndPointAccessor; 55private Func<EndpointInfo>? _otlpServiceHttpEndPointAccessor; 57public List<Func<EndpointInfo>> FrontendEndPointsAccessor 70public Func<EndpointInfo> FrontendSingleEndPointAccessor 87public Func<EndpointInfo> OtlpServiceGrpcEndPointAccessor 92public Func<EndpointInfo> OtlpServiceHttpEndPointAccessor 640static Func<EndpointInfo> CreateEndPointAccessor(EndpointConfiguration endpointConfiguration)
Model\BrowserLinkOutgoingPeerResolver.cs (1)
10public IDisposable OnPeerChanges(Func<Task> callback)
Model\ConsoleLogsManager.cs (1)
54public IDisposable OnFiltersChanged(Func<Task> callback)
Model\GridColumn.cs (1)
6public record GridColumn(string Name, string? DesktopWidth, string? MobileWidth = null, Func<bool>? IsVisible = null);
Model\InstrumentViewModel.cs (2)
14public List<Func<Task>> DataUpdateSubscriptions { get; } = []; 23foreach (var subscription in DataUpdateSubscriptions)
Model\IOutgoingPeerResolver.cs (1)
9IDisposable OnPeerChanges(Func<Task> callback);
Model\MenuButtonItem.cs (1)
14public Func<Task>? OnClick { get; set; }
Model\MetricsHelpers.cs (1)
22Func<Func<Task>, Task> dispatcher,
Model\ModelSubscription.cs (2)
6public sealed class ModelSubscription(Func<Task> callback, Action<ModelSubscription> onDispose) : IDisposable 8private readonly Func<Task> _callback = callback;
Model\ResourceOutgoingPeerResolver.cs (1)
171public IDisposable OnPeerChanges(Func<Task> callback)
Model\ThemeManager.cs (1)
114public IDisposable OnThemeChanged(Func<Task> callback)
Otlp\Storage\Subscription.cs (2)
13private readonly Func<Task> _callback; 30public Subscription(string name, ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback, Action unsubscribe, ExecutionContext? executionContext, TelemetryRepository telemetryRepository)
Otlp\Storage\TelemetryRepository.cs (5)
250public Subscription OnNewApplications(Func<Task> callback) 255public Subscription OnNewLogs(ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback) 260public Subscription OnNewMetrics(ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback) 265public Subscription OnNewTraces(ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback) 270private Subscription AddSubscription(string name, ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback, List<Subscription> subscriptions)
Aspire.Dashboard.Components.Tests (4)
Shared\TestDashboardClient.cs (2)
14private readonly Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? _resourceChannelProvider; 25Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? resourceChannelProvider = null,
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null)
Aspire.Dashboard.Tests (7)
Integration\StartupTests.cs (2)
769private static void AssertIPv4OrIPv6Endpoint(Func<EndpointInfo> endPointAccessor) 776private static void AssertDynamicIPEndpoint(Func<EndpointInfo> endPointAccessor)
TelemetryRepositoryTests\TraceTests.cs (3)
1935private readonly List<Func<Task>> _callbacks; 1947public IDisposable OnPeerChanges(Func<Task> callback) 1955foreach (var callback in _callbacks)
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null)
Aspire.EndToEnd.Tests (1)
IntegrationServicesTests.cs (1)
54private async Task RunTestAsync(Func<Task> test)
Aspire.Hosting (12)
ApplicationModel\EnvironmentCallbackAnnotation.cs (1)
21public EnvironmentCallbackAnnotation(string name, Func<string> callback)
ApplicationModel\HttpCommandContext.cs (2)
9/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?, HttpCommandOptions?)"/>. 47/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?, HttpCommandOptions?)"/>.
ApplicationModel\HttpCommandOptions.cs (1)
16public Func<EndpointReference>? EndpointSelector { get; set; }
ApplicationModel\ParameterDefault.cs (1)
167class ConstantParameterDefault(Func<string> valueGetter) : ParameterDefault
ParameterResourceBuilderExtensions.cs (1)
68public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, string name, Func<string> valueGetter, bool publishValueAsDefault = false, bool secret = false)
Publishing\ManifestPublishingContext.cs (1)
126async Task WriteResourceObjectAsync<T>(T resource, Func<Task> action) where T : IResource
ResourceBuilderExtensions.cs (4)
95public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, Func<string> callback) where T : IResourceWithEnvironment 1604Func<EndpointReference>? endpointSelector, 1704private static Func<EndpointReference> NamedEndpointSelector<TResource>(IResourceBuilder<TResource> builder, string[] endpointNames) 1730private static Func<EndpointReference> DefaultEndpointSelector<TResource>(IResourceBuilder<TResource> builder)
src\Shared\SecretsStore.cs (1)
100public static void GetOrSetUserSecret(IConfigurationManager configuration, Assembly? appHostAssembly, string name, Func<string> valueGenerator)
Aspire.Hosting.Azure (3)
AzureBicepResource.cs (1)
181object? inputValue = input.Value is Func<object?> f ? f() : input.Value;
AzureBicepResourceExtensions.cs (1)
193public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, Func<object?> valueCallback)
Provisioning\Provisioners\BicepProvisioner.cs (1)
475var parameterValue = parameter.Value is Func<object?> f ? f() : parameter.Value;
Aspire.Hosting.Azure.ServiceBus (4)
ServiceBusHealthCheck.cs (4)
15private readonly Func<ServiceBusClient> _clientFactory; 16private readonly Func<string?> _nameFactory; 18public ServiceBusHealthCheck(Func<ServiceBusClient> clientFactory, Func<string?> nameFactory)
Aspire.Hosting.Azure.Tests (154)
PublicApiTests\AppConfigurationPublicApiTests.cs (4)
17var action = () => builder.AddAzureAppConfiguration(name); 31var action = () => builder.AddAzureAppConfiguration(name); 47var action = () => new AzureAppConfigurationResource(name, configureInfrastructure); 61var action = () => new AzureAppConfigurationResource(name, configureInfrastructure);
PublicApiTests\AppContainersPublicApiTests.cs (7)
20var action = () => container.PublishAsAzureContainerApp(configure); 33var action = () => container.PublishAsAzureContainerApp(configure); 44var action = () => new AzureContainerAppCustomizationAnnotation(configure); 56var action = () => executable.PublishAsAzureContainerApp(configure); 69var action = () => executable.PublishAsAzureContainerApp(configure); 97var action = () => project.PublishAsAzureContainerApp(configure); 110var action = () => project.PublishAsAzureContainerApp(configure);
PublicApiTests\ApplicationInsightsPublicApiTests.cs (2)
64var action = () => new AzureApplicationInsightsResource(name, configureInfrastructure); 78var action = () => new AzureApplicationInsightsResource(name, configureInfrastructure);
PublicApiTests\CognitiveServicesPublicApiTests.cs (7)
23var action = () => new AzureOpenAIDeployment(name, modelName, modelVersion); 40var action = () => new AzureOpenAIDeployment(name, modelName, modelVersion); 57var action = () => new AzureOpenAIDeployment(name, modelName, modelVersion); 71var action = () => builder.AddAzureOpenAI(name); 85var action = () => builder.AddAzureOpenAI(name); 99var action = () => builder.AddDeployment(deployment); 112var action = () => builder.AddDeployment(deployment);
PublicApiTests\CosmosDBPublicApiTests.cs (25)
25var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 45var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 65var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 81var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 97var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent.Resource); 115var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent.Resource); 130var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent); 141var action = () => new AzureCosmosDBEmulatorResource(innerResource); 155var action = () => new AzureCosmosDBResource(name, configureInfrastructure); 169var action = () => new AzureCosmosDBResource(name, configureInfrastructure); 181var action = () => builder.AddAzureCosmosDB(name); 195var action = () => builder.AddAzureCosmosDB(name); 209var action = () => builder.RunAsEmulator(configureContainer); 222var action = () => builder.RunAsPreviewEmulator(configureContainer); 233var action = () => builder.WithDataVolume(); 245var action = () => builder.WithGatewayPort(port); 257var action = () => builder.WithPartitionCount(count); 270var action = () => builder.AddDatabase(databaseName); 286var action = () => cosmos.AddDatabase(databaseName); 300var action = () => builder.AddCosmosDatabase(name); 315var action = () => cosmos.AddCosmosDatabase(name); 330var action = () => builder.AddContainer(name, partitionKeyPath); 347var action = () => cosmos.AddContainer(name, partitionKeyPath); 366var action = () => cosmos.AddContainer(name, partitionKeyPath); 380var action = () => builder.WithDataExplorer();
PublicApiTests\EventHubsPublicApiTests.cs (28)
24var action = () => new AzureEventHubConsumerGroupResource(name, consumerGroupName, parent); 43var action = () => new AzureEventHubConsumerGroupResource(name, consumerGroupName, parent); 58var action = () => new AzureEventHubConsumerGroupResource(name, consumerGroupName, parent); 73var action = () => new AzureEventHubResource(name, hubName, parent); 90var action = () => new AzureEventHubResource(name, hubName, parent); 105var action = () => new AzureEventHubResource(name, hubName, parent); 116var action = () => new AzureEventHubsEmulatorResource(innerResource); 128var action = () => builder.AddAzureEventHubs(name); 142var action = () => builder.AddAzureEventHubs(name); 157var action = () => builder.AddEventHub(name); 173var action = () => builder.AddEventHub(name); 187var action = () => builder.AddHub(name); 202var action = () => builder.AddHub(name); 216var action = () => builder.WithProperties(configure); 229var action = () => builder.WithProperties(configure); 241var action = () => builder.AddConsumerGroup(name); 256var action = () => builder.AddConsumerGroup(name); 269var action = () => builder.RunAsEmulator(); 281var action = () => builder.WithDataBindMount(); 294var action = () => builder.WithDataVolume(); 308var action = () => builder.WithGatewayPort(port); 320var action = () => builder.WithHostPort(port); 332var action = () => builder.WithConfigurationFile(path); 348var action = () => builder.RunAsEmulator(configure => configure.WithConfigurationFile(path)); 362var action = () => builder.WithConfiguration(configJson); 375var action = () => builder.RunAsEmulator(configure => configure.WithConfiguration(configJson)); 389var action = () => new AzureEventHubsResource(name, configureInfrastructure); 403var action = () => new AzureEventHubsResource(name, configureInfrastructure);
PublicApiTests\FunctionsPublicApiTests.cs (5)
18var action = () => builder.AddAzureFunctionsProject<TestProject>(name); 32var action = () => builder.AddAzureFunctionsProject<TestProject>(name); 47var action = () => builder.WithHostStorage(storage); 60var action = () => builder.WithHostStorage(storage); 89var action = () => new AzureFunctionsProjectResource(name);
PublicApiTests\KeyVaultPublicApiTests.cs (4)
19var action = () => new AzureKeyVaultResource(name, configureInfrastructure); 33var action = () => new AzureKeyVaultResource(name, configureInfrastructure); 45var action = () => builder.AddAzureKeyVault(name); 59var action = () => builder.AddAzureKeyVault(name);
PublicApiTests\OperationalInsightsPublicApiTests.cs (4)
19var action = () => new AzureLogAnalyticsWorkspaceResource(name, configureInfrastructure); 33var action = () => new AzureLogAnalyticsWorkspaceResource(name, configureInfrastructure); 45var action = () => builder.AddAzureLogAnalyticsWorkspace(name); 59var action = () => builder.AddAzureLogAnalyticsWorkspace(name);
PublicApiTests\PostgreSQLPublicApiTests.cs (13)
49var action = () => builder.AddAzurePostgresFlexibleServer(name); 63var action = () => builder.AddAzurePostgresFlexibleServer(name); 77var action = () => builder.AddDatabase(name); 92var action = () => builder.AddDatabase(name); 105var action = () => builder.RunAsContainer(); 116var action = () => builder.WithPasswordAuthentication(); 129var action = () => new AzurePostgresResource(innerResource, configureInfrastructure); 144var action = () => new AzurePostgresResource(innerResource, configureInfrastructure); 159var action = () => new AzurePostgresFlexibleServerDatabaseResource(name, databaseName, postgresParentResource); 176var action = () => new AzurePostgresFlexibleServerDatabaseResource(name, databaseName, postgresParentResource); 191var action = () => new AzurePostgresFlexibleServerDatabaseResource(name, databaseName, postgresParentResource); 205var action = () => new AzurePostgresFlexibleServerResource(name, configureInfrastructure); 219var action = () => new AzurePostgresFlexibleServerResource(name, configureInfrastructure);
PublicApiTests\RedisPublicApiTests.cs (7)
20var action = () => new AzureRedisCacheResource(name, configureInfrastructure); 34var action = () => new AzureRedisCacheResource(name, configureInfrastructure); 76var action = () => builder.AddAzureRedis(name); 90var action = () => builder.AddAzureRedis(name); 103var action = () => builder.RunAsContainer(); 130var action = () => new AzureRedisResource(innerResource, configureInfrastructure); 143var action = () => new AzureRedisResource(innerResource, configureInfrastructure);
PublicApiTests\SearchPublicApiTests.cs (4)
17var action = () => builder.AddAzureSearch(name); 31var action = () => builder.AddAzureSearch(name); 47var action = () => new AzureSearchResource(name, configureInfrastructure); 61var action = () => new AzureSearchResource(name, configureInfrastructure);
PublicApiTests\ServiceBusPublicApiTests.cs (23)
18var action = () => new AzureServiceBusEmulatorResource(innerResource); 30var action = () => builder.AddAzureServiceBus(name); 44var action = () => builder.AddAzureServiceBus(name); 59var action = () => builder.AddQueue(name); 75var action = () => builder.AddQueue(name); 89var action = () => builder.AddServiceBusQueue(name); 104var action = () => builder.AddServiceBusQueue(name); 118var action = () => builder.WithProperties(configure); 131var action = () => builder.WithProperties(configure); 143var action = () => builder.AddServiceBusTopic(name); 158var action = () => builder.AddServiceBusTopic(name); 172var action = () => builder.WithProperties(configure); 185var action = () => builder.WithProperties(configure); 197var action = () => builder.AddServiceBusSubscription(name); 213var action = () => builder.AddServiceBusSubscription(name); 227var action = () => builder.WithProperties(configure); 242var action = () => builder.WithProperties(configure); 253var action = () => builder.RunAsEmulator(); 265var action = () => builder.WithConfigurationFile(path); 280var action = () => builder.RunAsEmulator(configure => configure.WithConfigurationFile(path)); 294var action = () => builder.WithConfiguration(configJson); 307var action = () => builder.RunAsEmulator(configure => configure.WithConfiguration(configJson)); 319var action = () => builder.WithHostPort(port);
PublicApiTests\SignalRPublicApiTests.cs (4)
17var action = () => new AzureSignalREmulatorResource(innerResource); 72var action = () => builder.RunAsEmulator(); 86var action = () => new AzureSignalRResource(name, configureInfrastructure); 100var action = () => new AzureSignalRResource(name, configureInfrastructure);
PublicApiTests\SqlPublicApiTests.cs (8)
21var action = () => new AzureSqlDatabaseResource(name, databaseName, parent); 38var action = () => new AzureSqlDatabaseResource(name, databaseName, parent); 53var action = () => new AzureSqlDatabaseResource(name, databaseName, parent); 95var action = () => builder.AddAzureSqlServer(name); 109var action = () => builder.AddAzureSqlServer(name); 123var action = () => builder.AddDatabase(name); 138var action = () => builder.AddDatabase(name); 151var action = () => builder.RunAsContainer();
PublicApiTests\WebPubSubPublicApiTests.cs (9)
19var action = () => builder.AddAzureWebPubSub(name); 33var action = () => builder.AddAzureWebPubSub(name); 47var action = () => builder.AddHub(hubName); 62var action = () => builder.AddHub(name); 122var action = () => builder.AddEventHandler(urlExpression); 136var action = () => new AzureWebPubSubHubResource(name, name, webpubsub); 150var action = () => new AzureWebPubSubHubResource(name, name, webpubsub); 164var action = () => new AzureWebPubSubResource(name, configureInfrastructure); 178var action = () => new AzureWebPubSubResource(name, configureInfrastructure);
Aspire.Hosting.Elasticsearch.Tests (7)
ElasticsearchPublicApiTests.cs (7)
18var action = () => builder.AddElasticsearch(name); 32var action = () => builder.AddElasticsearch(name); 45var action = () => builder.WithDataVolume(); 57var action = () => builder.WithDataBindMount(source); 72var action = () => builder.WithDataBindMount(source); 89var action = () => new ElasticsearchResource(name, password.Resource); 102var action = () => new ElasticsearchResource(name, password);
Aspire.Hosting.Garnet.Tests (8)
GarnetPublicApiTests.cs (8)
18var action = () => builder.AddGarnet(name); 32var action = () => builder.AddGarnet(name); 45var action = () => builder.WithDataVolume(); 57var action = () => builder.WithDataBindMount(source); 72var action = () => builder.WithDataBindMount(source); 85var action = () => builder.WithPersistence(); 99var action = () => builder.WithPersistence(interval, keysChangedThreshold); 114var action = () => new GarnetResource(name);
Aspire.Hosting.Kafka.Tests (11)
KafkaPublicApiTests.cs (9)
18var action = () => builder.AddKafka(name); 32var action = () => builder.AddKafka(name); 45var action = () => builder.WithKafkaUI(); 57var action = () => builder.WithHostPort(port); 68var action = () => builder.WithDataVolume(); 80var action = () => builder.WithDataBindMount(source); 95var action = () => builder.WithDataBindMount(source); 110var action = () => new KafkaServerResource(name); 125var action = () => new KafkaUIContainerResource(name);
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null)
Aspire.Hosting.Keycloak.Tests (10)
KeycloakPublicApiTests.cs (10)
21var action = () => new KeycloakResource(name, admin, adminPassword); 36var action = () => new KeycloakResource(name, admin, adminPassword); 48var action = () => builder.AddKeycloak(name); 62var action = () => builder.AddKeycloak(name); 75var action = () => builder.WithDataVolume(); 87var action = () => builder.WithDataBindMount(source); 102var action = () => builder.WithDataBindMount(source); 116var action = () => builder.WithRealmImport(importDirectory); 131var action = () => builder.WithRealmImport(import); 145var action = () => builder.WithRealmImport("does-not-exist");
Aspire.Hosting.Milvus.Tests (16)
MilvusPublicApiTests.cs (16)
19var action = () => new AttuResource(name); 33var action = () => builder.AddMilvus(name); 47var action = () => builder.AddMilvus(name); 61var action = () => builder.AddDatabase(name); 76var action = () => builder.AddDatabase(name); 89var action = () => builder.WithAttu(); 100var action = () => builder.WithDataVolume(); 112var action = () => builder.WithDataBindMount(source); 127var action = () => builder.WithDataBindMount(source); 141var action = () => builder.WithConfigurationBindMount(configurationFilePath); 156var action = () => builder.WithConfigurationBindMount(configurationFilePath); 174var action = () => new MilvusDatabaseResource(name, databaseName, parent); 192var action = () => new MilvusDatabaseResource(name, databaseName, parent); 207var action = () => new MilvusDatabaseResource(name, databaseName, parent); 221var action = () => new MilvusServerResource(name, apiKey); 235var action = () => new MilvusServerResource(name, apiKey);
Aspire.Hosting.MongoDB.Tests (18)
MongoDBPublicApiTests.cs (18)
19var action = () => builder.AddMongoDB(name, port); 34var action = () => builder.AddMongoDB(name, port); 49var action = () => builder.AddMongoDB(name, userName: userName, password: password); 65var action = () => builder.AddMongoDB(name, userName: userName, password: password); 79var action = () => builder.AddDatabase(name); 94var action = () => builder.AddDatabase(name); 107var action = () => builder.WithMongoExpress(); 121var action = () => builder.WithHostPort(port); 132var action = () => builder.WithDataVolume(); 144var action = () => builder.WithDataBindMount(source); 159var action = () => builder.WithDataBindMount(source); 172var action = () => builder.WithInitBindMount("init.js"); 187var action = () => builder.WithInitBindMount(source); 204var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 221var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 236var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 249var action = () => new MongoDBServerResource(name); 264var action = () => new MongoExpressContainerResource(name);
Aspire.Hosting.MySql.Tests (19)
MySqlPublicApiTests.cs (17)
18var action = () => builder.AddMySql(name); 32var action = () => builder.AddMySql(name); 46var action = () => builder.AddDatabase(name); 61var action = () => builder.AddDatabase(name); 74var action = () => builder.WithPhpMyAdmin(); 88var action = () => builder.WithHostPort(port); 99var action = () => builder.WithDataVolume(); 111var action = () => builder.WithDataBindMount(source); 126var action = () => builder.WithDataBindMount(source); 140var action = () => builder.WithInitBindMount(source); 155var action = () => builder.WithInitBindMount(source); 176var action = () => new MySqlDatabaseResource(name, databaseName, parent); 197var action = () => new MySqlDatabaseResource(name, databaseName, parent); 213var action = () => new MySqlDatabaseResource(name, databaseName, parent); 229var action = () => new MySqlServerResource(name, password); 243var action = () => new MySqlServerResource(name, password); 256var action = () => new PhpMyAdminContainerResource(name);
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null)
Aspire.Hosting.Nats.Tests (11)
NatsPublicApiTests.cs (11)
20var action = () => includePort ? builder.AddNats(name, 4222) : builder.AddNats(name); 36var action = () => includePort ? builder.AddNats(name, 4222) : builder.AddNats(name); 54var action = () => includePort 74var action = () => includePort 91var action = () => builder.WithJetStream(srcMountPath); 102var action = () => builder.WithJetStream(); 113var action = () => builder.WithDataVolume(); 125var action = () => builder.WithDataBindMount(source); 140var action = () => builder.WithDataBindMount(source); 155var action = () => new NatsServerResource(name); 179var action = () => new NatsServerResource(name, user?.Resource, password?.Resource);
Aspire.Hosting.NodeJs.Tests (10)
NodeJsPublicApiTests.cs (10)
20var action = () => new NodeAppResource(name, command, workingDirectory); 37var action = () => new NodeAppResource(name, command, workingDirectory); 52var action = () => new NodeAppResource(name, command, workingDirectory); 65var action = () => builder.AddNodeApp(name, scriptPath); 80var action = () => builder.AddNodeApp(name, scriptPath); 97var action = () => builder.AddNodeApp(name, scriptPath); 112var action = () => builder.AddNpmApp(name: name, workingDirectory: workingDirectory); 127var action = () => builder.AddNpmApp(name: name, workingDirectory); 142var action = () => builder.AddNpmApp(name, workingDirectory); 158var action = () => builder.AddNpmApp(name, workingDirectory, scriptName);
Aspire.Hosting.Oracle.Tests (16)
OraclePublicApiTests.cs (16)
18var action = () => builder.AddOracle(name); 32var action = () => builder.AddOracle(name); 46var action = () => builder.AddDatabase(name); 61var action = () => builder.AddDatabase(name); 74var action = () => builder.WithDataVolume(); 86var action = () => builder.WithDataBindMount(source); 101var action = () => builder.WithDataBindMount(source); 115var action = () => builder.WithInitBindMount(source); 130var action = () => builder.WithInitBindMount(source); 144var action = () => builder.WithDbSetupBindMount(source); 159var action = () => builder.WithDbSetupBindMount(source); 178var action = () => new OracleDatabaseResource(name, databaseName, parent); 197var action = () => new OracleDatabaseResource(name, databaseName, parent); 212var action = () => new OracleDatabaseResource(name, databaseName, parent); 226var action = () => new OracleDatabaseServerResource(name, password); 240var action = () => new OracleDatabaseServerResource(name, password);
Aspire.Hosting.PostgreSQL.Tests (22)
PostgrePublicApiTests.cs (20)
20var action = () => new PgAdminContainerResource(name); 35var action = () => new PgWebContainerResource(name); 49var action = () => builder.AddPostgres(name); 63var action = () => builder.AddPostgres(name); 77var action = () => builder.AddDatabase(name); 92var action = () => builder.AddDatabase(name); 105var action = () => builder.WithPgAdmin(); 117var action = () => builder.WithHostPort(port); 129var action = () => builder.WithHostPort(port); 140var action = () => builder.WithPgWeb(); 151var action = () => builder.WithDataVolume(); 163var action = () => builder.WithDataBindMount(source); 178var action = () => builder.WithDataBindMount(source); 192var action = () => builder.WithInitBindMount(source); 207var action = () => builder.WithInitBindMount(source); 227var action = () => new PostgresDatabaseResource(name, databaseName, postgresParentResource); 247var action = () => new PostgresDatabaseResource(name, databaseName, postgresParentResource); 262var action = () => new PostgresDatabaseResource(name, databaseName, postgresParentResource); 278var action = () => new PostgresServerResource(name, userName, builder.Resource); 293var action = () => new PostgresServerResource(name, userName, password);
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null)
Aspire.Hosting.Python.Tests (30)
PythonPublicApiTests.cs (30)
20var action = () => new PythonAppResource(name, executablePath, appDirectory); 37var action = () => new PythonAppResource(name, executablePath, appDirectory); 51var action = () => new PythonAppResource(name, executablePath, appDirectory: null!); 66var action = () => builder.AddPythonApp( 87var action = () => builder.AddPythonApp( 110var action = () => builder.AddPythonApp( 133var action = () => builder.AddPythonApp( 154var action = () => builder.AddPythonApp( 175var action = () => builder.AddPythonApp( 201var action = () => builder.AddPythonApp( 224var action = () => builder.AddPythonApp( 249var action = () => builder.AddPythonApp( 274var action = () => builder.AddPythonApp( 299var action = () => builder.AddPythonApp( 324var action = () => builder.AddPythonApp( 351var action = () => new PythonProjectResource(name, executablePath, appDirectory); 369var action = () => new PythonProjectResource(name, executablePath, appDirectory); 384var action = () => new PythonProjectResource(name, executablePath, projectDirectory: null!); 400var action = () => builder.AddPythonProject( 422var action = () => builder.AddPythonProject( 446var action = () => builder.AddPythonProject( 470var action = () => builder.AddPythonProject( 492var action = () => builder.AddPythonProject( 514var action = () => builder.AddPythonProject( 541var action = () => builder.AddPythonProject( 565var action = () => builder.AddPythonProject( 591var action = () => builder.AddPythonProject( 617var action = () => builder.AddPythonProject( 643var action = () => builder.AddPythonProject( 669var action = () => builder.AddPythonProject(
Aspire.Hosting.Qdrant.Tests (9)
QdrantPublicApiTests.cs (9)
18var action = () => builder.AddQdrant(name); 32var action = () => builder.AddQdrant(name); 45var action = () => builder.WithDataVolume(); 57var action = () => builder.WithDataBindMount(source); 72var action = () => qdrant.WithDataBindMount(source); 87var action = () => builder.WithReference(qdrantResource); 100var action = () => qdrant.WithReference(qdrantResource); 116var action = () => new QdrantServerResource(name, apiKey); 130var action = () => new QdrantServerResource(name, apiKey);
Aspire.Hosting.RabbitMQ.Tests (11)
RabbitMQPublicApiTests.cs (9)
18var action = () => builder.AddRabbitMQ(name); 32var action = () => builder.AddRabbitMQ(name); 45var action = () => builder.WithDataVolume(); 57var action = () => builder.WithDataBindMount(source); 72var action = () => rabbitMQ.WithDataBindMount(source); 85var action = () => builder.WithManagementPlugin(); 97var action = () => builder.WithManagementPlugin(port); 114var action = () => new RabbitMQServerResource(name: name, userName: userName, password: password); 129var action = () => new RabbitMQServerResource(name: name, userName: userName, password: password);
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null)
Aspire.Hosting.Redis.Tests (16)
RedisPublicApiTests.cs (16)
18var action = () => builder.AddRedis(name); 32var action = () => builder.AddRedis(name); 45var action = () => builder.WithRedisCommander(); 56var action = () => builder.WithRedisInsight(); 68var action = () => builder.WithHostPort(port); 80var action = () => builder.WithHostPort(port); 91var action = () => builder.WithDataVolume(); 103var action = () => builder.WithDataBindMount(source); 118var action = () => redis.WithDataBindMount(source); 131var action = () => builder.WithPersistence(); 142var action = () => builder.WithDataVolume(); 154var action = () => builder.WithDataBindMount(source); 171var action = () => redisInsightBuilder.WithDataBindMount(source); 186var action = () => new RedisCommanderResource(name); 201var action = () => new RedisInsightResource(name); 216var action = () => new RedisResource(name);
Aspire.Hosting.Seq.Tests (6)
SeqPublicApiTests.cs (6)
18var action = () => builder.AddSeq(name); 30var action = () => builder.AddSeq(name); 41var action = () => builder.WithDataVolume(); 53var action = () => builder.WithDataBindMount(source); 66var action = () => qdrant.WithDataBindMount(source); 78var action = () => new SeqResource(name);
Aspire.Hosting.SqlServer.Tests (12)
SqlServerPublicApiTests.cs (12)
18var action = () => builder.AddSqlServer(name); 32var action = () => builder.AddSqlServer(name); 46var action = () => builder.AddDatabase(name); 61var action = () => builder.AddDatabase(name); 74var action = () => builder.WithDataVolume(); 86var action = () => builder.WithDataBindMount(source); 101var action = () => builder.WithDataBindMount(source); 122var action = () => new SqlServerDatabaseResource(name, databaseName, parent); 143var action = () => new SqlServerDatabaseResource(name, databaseName, parent); 158var action = () => new SqlServerDatabaseResource(name, databaseName, parent); 174var action = () => new SqlServerServerResource(name, password); 188var action = () => new SqlServerServerResource(name, password);
Aspire.Hosting.Testing.Tests (31)
TestingPublicApiTests.cs (31)
17var action = () => new DistributedApplicationFactory(entryPoint); 29var action = () => new DistributedApplicationFactory(entryPoint, args); 41var action = () => new DistributedApplicationFactory(entryPoint, args); 55var action = () => new DistributedApplicationFactory(entryPoint, args); 76var action = () => distributedApplicationFactory.CreateHttpClient(resourceName); 93var action = async () => await distributedApplicationFactory.GetConnectionString(resourceName); 110var action = () => distributedApplicationFactory.GetEndpoint(resourceName); 124var action = () => app.CreateHttpClient(resourceName); 138var action = () => distributedApplication.CreateHttpClient(resourceName); 152var action = async () => await app.GetConnectionStringAsync(resourceName); 166var action = async () => await distributedApplication.GetConnectionStringAsync(resourceName); 180var action = () => app.GetEndpoint(resourceName); 194var action = () => distributedApplication.GetEndpoint(resourceName); 207var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint); 218var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args); 231var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args); 249var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args); 261var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args); 275var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args); 293var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args, configureBuilder); 305var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args, configureBuilder); 319var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args, configureBuilder); 338var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 351var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 364var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 379var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 396var action = () => DistributedApplicationTestingBuilder.Create(args); 409var action = () => DistributedApplicationTestingBuilder.Create(args); 427var action = () => DistributedApplicationTestingBuilder.Create(args, configureBuilder); 439var action = () => DistributedApplicationTestingBuilder.Create(args, configureBuilder); 453var action = () => DistributedApplicationTestingBuilder.Create(args, configureBuilder);
Aspire.Hosting.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null)
Aspire.Hosting.Valkey.Tests (9)
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null)
ValkeyPublicApiTests.cs (7)
18var action = () => builder.AddValkey(name); 32var action = () => builder.AddValkey(name); 45var action = () => builder.WithDataVolume(); 57var action = () => builder.WithDataBindMount(source); 72var action = () => builder.WithDataBindMount(source); 85var action = () => builder.WithPersistence(); 98var action = () => new ValkeyResource(name);
Aspire.Keycloak.Authentication.Tests (28)
KeycloakAuthenticationPublicApiTests.cs (28)
21var action = () => builder.AddKeycloakJwtBearer(serviceName, realm); 37var action = () => builder.AddKeycloakJwtBearer(serviceName, realm); 55var action = () => builder.AddKeycloakJwtBearer(serviceName, realm); 71var action = () => builder.AddKeycloakJwtBearer(serviceName, realm, authenticationScheme); 88var action = () => builder.AddKeycloakJwtBearer(serviceName, realm, authenticationScheme); 107var action = () => builder.AddKeycloakJwtBearer(serviceName, realm, authenticationScheme); 126var action = () => builder.AddKeycloakJwtBearer(serviceName, realm, authenticationScheme); 142var action = () => builder.AddKeycloakJwtBearer(serviceName, realm, configureOptions); 159var action = () => builder.AddKeycloakJwtBearer(serviceName, realm, configureOptions); 178var action = () => builder.AddKeycloakJwtBearer(serviceName, realm, configureOptions); 195var action = () => builder.AddKeycloakJwtBearer( 217var action = () => builder.AddKeycloakJwtBearer( 241var action = () => builder.AddKeycloakJwtBearer( 265var action = () => builder.AddKeycloakJwtBearer( 284var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm); 300var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm); 318var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm); 334var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm, authenticationScheme); 351var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm, authenticationScheme); 370var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm, authenticationScheme); 389var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm, authenticationScheme); 405var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm, configureOptions); 422var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm, configureOptions); 441var action = () => builder.AddKeycloakOpenIdConnect(serviceName, realm, configureOptions); 458var action = () => builder.AddKeycloakOpenIdConnect( 480var action = () => builder.AddKeycloakOpenIdConnect( 504var action = () => builder.AddKeycloakOpenIdConnect( 528var action = () => builder.AddKeycloakOpenIdConnect(
Aspire.OpenAI.Tests (12)
OpenAIPublicApiTests.cs (12)
19var action = () => new AspireOpenAIClientBuilder(hostBuilder, connectionName, serviceKey, disableTracing); 35var action = () => new AspireOpenAIClientBuilder(hostBuilder, connectionName, serviceKey, disableTracing); 48var action = () => builder.AddChatClient(); 60var action = () => builder.AddKeyedChatClient(serviceKey); 78var action = () => builder.AddKeyedChatClient(serviceKey); 91var action = () => builder.AddEmbeddingGenerator(); 103var action = () => builder.AddKeyedEmbeddingGenerator(serviceKey); 121var action = () => builder.AddKeyedEmbeddingGenerator(serviceKey); 135var action = () => builder.AddOpenAIClient(connectionName); 149var action = () => builder.AddOpenAIClient(connectionName); 163var action = () => builder.AddKeyedOpenAIClient(name); 177var action = () => builder.AddKeyedOpenAIClient(name);
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
68public Func<ProfilingSession?> GetProfilerSessionsFactory()
Aspire.StackExchange.Redis.Tests (2)
AspireRedisExtensionsTests.cs (2)
240static extern ref Func<ProfilingSession>? GetProfiler(ConnectionMultiplexer? @this); 258var profiler = GetProfiler(connectionMultiplexer as ConnectionMultiplexer);
BinaryFormatTests (2)
FormatTests\FormattedObject\CountTests.cs (1)
11Func<Count> func = () => (Count)(-1);
FormatTests\FormattedObject\RecordMapTests.cs (1)
30Func<object> func = () => map[(Id)0];
Client.ClientBase.IntegrationTests (1)
MessageInspectorTestHelpers.cs (1)
49public TResult Call<TResult>(Func<TResult> action) where TResult : class
Client.ExpectedExceptions.IntegrationTests (2)
ExpectedExceptionTests.4.0.0.cs (1)
295Func<string> callFunc = () =>
ExpectedExceptionTests.4.1.0.cs (1)
545Func<string> callFunc = () =>
ClientSample (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
DefaultBuilder.SampleApp (1)
Program.cs (1)
15app.MapGet("/", (Func<string>)(() => "Hello, World!"));
dotnet-dev-certs (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-getdocument (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-openapi (8)
Commands\BaseCommand.cs (1)
298Func<Task<IHttpResponseMessageWrapper>> retryBlock,
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-sql-cache (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-svcutil-lib (17)
FrameworkFork\Microsoft.Xml\Xml\AsyncHelper.cs (6)
65public static Task CallTaskFuncWhenFinish(this Task task, Func<Task> func) 77private static async Task _CallTaskFuncWhenFinish(Task task, Func<Task> func) 83public static Task<bool> CallBoolTaskFuncWhenFinish(this Task task, Func<Task<bool>> func) 95private static async Task<bool> _CallBoolTaskFuncWhenFinish(this Task task, Func<Task<bool>> func) 101public static Task<bool> ContinueBoolTaskFuncWhenFalse(this Task<bool> task, Func<Task<bool>> func) 116private static async Task<bool> _ContinueBoolTaskFuncWhenFalse(Task<bool> task, Func<Task<bool>> func)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InputQueue.cs (3)
38public InputQueue(Func<Action<AsyncCallback, IAsyncResult>> asyncCallbackGenerator) 64private Func<Action<AsyncCallback, IAsyncResult>> AsyncCallbackGenerator 356public void Shutdown(Func<Exception> pendingExceptionGenerator)
FrameworkFork\System.ServiceModel\System\IdentityModel\CryptoHelper.cs (2)
16private static Dictionary<string, Func<object>> s_algorithmDelegateDictionary = new Dictionary<string, Func<object>>();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (3)
26private Func<IEnumerable<DelegatingHandler>> _handlerFunc; 92public HttpMessageHandlerFactory(Func<IEnumerable<DelegatingHandler>> handlers) 194private static string GetFuncDetails(Func<IEnumerable<DelegatingHandler>> func)
Shared\Options\OptionValueParser.cs (1)
246public static object CreateValue<TValue>(Func<object> GetValueFunc, OptionBase option, object originalValue)
Shared\Utilities\AsyncHelper.cs (2)
38public static async Task<T> RunAsync<T>(Func<T> func, CancellationToken cancellationToken) 43public static async Task<T> RunAsync<T>(Func<T> func, Action onCancellation, CancellationToken cancellationToken)
dotnet-user-jwts (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-user-secrets (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
ExceptionHandlerSample (1)
StartupWithWebSocket.cs (1)
25app.Use(async (HttpContext context, Func<Task> next) =>
GetDocument.Insider (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
IIS.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.LongTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.NewHandler.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.NewShim.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.ShadowCopy.Tests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
Infrastructure.Common (1)
ConditionalWcfTest.cs (1)
29private static bool GetConditionValue(string conditionName, Func<bool> detectFunc = null)
InMemory.FunctionalTests (4)
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
76public Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
InteractiveHost32 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
54var invokeOnMainThread = new Func<Func<object>, object>(operation => control!.Invoke(operation));
InteractiveHost64 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
54var invokeOnMainThread = new Func<Func<object>, object>(operation => control!.Invoke(operation));
Interop.FunctionalTests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
InteropClient (1)
Assert.cs (1)
62public static async Task<TException> ThrowsAsync<TException>(Func<Task> action) where TException : Exception
Microsoft.Arcade.Common (12)
Helpers.cs (6)
34public T MutexExec<T>(Func<T> function, string mutexName) 61public T MutexExec<T>(Func<Task<T>> function, string mutexName) => 65public void MutexExec(Func<Task> function, string mutexName) => 68public T DirectoryMutexExec<T>(Func<T> function, string path) => 71public T DirectoryMutexExec<T>(Func<Task<T>> function, string path) => 75public void DirectoryMutexExec(Func<Task> function, string path) =>
IHelpers.cs (6)
13T MutexExec<T>(Func<T> function, string mutexName); 14T MutexExec<T>(Func<Task<T>> function, string mutexName); 15void MutexExec(Func<Task> function, string mutexName); 17T DirectoryMutexExec<T>(Func<T> function, string path); 18T DirectoryMutexExec<T>(Func<Task<T>> function, string path); 19void DirectoryMutexExec(Func<Task> function, string path);
Microsoft.AspNetCore.Analyzer.Testing (1)
DiagnosticProject.cs (1)
31public static Project Create(Assembly testAssembly, string[] sources, Func<Workspace> workspaceFactory = null, Type[] analyzerReferences = null)
Microsoft.AspNetCore.App.Analyzers.Test (1)
TestDiagnosticAnalyzer.cs (1)
152Func<Workspace> createWorkspace = CreateWorkspace;
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.Policy (1)
src\Http\Routing\src\DataSourceDependentCache.cs (1)
17private readonly Func<T> _initializer;
Microsoft.AspNetCore.Components (29)
CascadingValueSource.cs (3)
25private Func<TValue>? _initialValueFactory; 54public CascadingValueSource(Func<TValue> initialValueFactory, bool isFixed) : this(isFixed) 65public CascadingValueSource(string name, Func<TValue> initialValueFactory, bool isFixed) : this(initialValueFactory, isFixed)
CompilerServices\RuntimeHelpers.cs (1)
153public static Task InvokeAsynchronousDelegate(Func<Task> callback)
ComponentBase.cs (1)
213protected Task InvokeAsync(Func<Task> workItem)
Dispatcher.cs (6)
62/// Invokes the given <see cref="Func{TResult}"/> in the context of the associated <see cref="Renderer"/>. 66public abstract Task InvokeAsync(Func<Task> workItem); 69/// Invokes the given <see cref="Func{TResult}"/> in the context of the associated <see cref="Renderer"/>. 73public abstract Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem); 76/// Invokes the given <see cref="Func{TResult}"/> in the context of the associated <see cref="Renderer"/>. 80public abstract Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem);
EventCallbackFactory.cs (2)
63public EventCallback Create(object receiver, Func<Task> callback) 147public EventCallback<TValue> Create<TValue>(object receiver, Func<Task> callback)
EventCallbackWorkItem.cs (1)
54case Func<Task> func:
PersistComponentStateRegistration.cs (2)
7Func<Task> callback, 10public Func<Task> Callback { get; } = callback;
PersistentComponentState.cs (2)
45public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback) 55public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback, IComponentRenderMode? renderMode)
PersistentState\ComponentStatePersistenceManager.cs (1)
226static Task<bool> TryExecuteCallback(Func<Task> callback, ILogger<ComponentStatePersistenceManager> logger)
Rendering\RendererSynchronizationContext.cs (4)
80public Task<TResult> InvokeAsync<TResult>(Func<TResult> function) 99static void Execute((AsyncTaskMethodBuilder<TResult> Completion, Func<TResult> Func, RendererSynchronizationContext Context) state) 118public Task InvokeAsync(Func<Task> asyncAction) 139public Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> asyncFunction)
Rendering\RendererSynchronizationContextDispatcher.cs (3)
33public override Task InvokeAsync(Func<Task> workItem) 44public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 55public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
RenderTree\StackObjectPool.cs (2)
13private readonly Func<T> _instanceFactory; 18public StackObjectPool(int maxPreservedItems, Func<T> instanceFactory)
src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
27private readonly Func<Regex>? _regexFactory;
Microsoft.AspNetCore.Components.Authorization.Tests (5)
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.Forms (15)
EditContext.cs (3)
178public IEnumerable<string> GetValidationMessages(Expression<Func<object>> accessor) 195public bool IsModified(Expression<Func<object>> accessor) 210public bool IsValid(Expression<Func<object>> accessor)
FieldIdentifier.cs (8)
31public static FieldIdentifier Create<TField>(Expression<Func<TField>> accessor) 95private static void ParseAccessor<T>(Expression<Func<T>> accessor, out object model, out string fieldName) 129var modelLambda = Expression.Lambda(typeof(Func<object?>), memberExpression.Expression); 130var modelLambdaCompiled = (Func<object?>)modelLambda.Compile(); 204var methodCallObjectLambda = Expression.Lambda(typeof(Func<object?>), methodCallExpression!); 205var methodCallObjectLambdaCompiled = (Func<object?>)methodCallObjectLambda.Compile();
ValidationMessageStore.cs (4)
38public void Add(Expression<Func<object>> accessor, string message) 54public void Add(Expression<Func<object>> accessor, IEnumerable<string> messages) 74public IEnumerable<string> this[Expression<Func<object>> accessor] 94public void Clear(Expression<Func<object>> accessor)
Microsoft.AspNetCore.Components.Forms.Tests (6)
FieldIdentifierTest.cs (1)
184Expression<Func<object>> accessor = () => model.IntProperty;
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.Server (6)
Circuits\CircuitHost.cs (4)
28private Func<Func<Task>, Task> _dispatchInboundActivity; 630internal Task HandleInboundActivityAsync(Func<Task> handler) 634internal async Task<TResult> HandleInboundActivityAsync<TResult>(Func<Task<TResult>> handler) 641private static Func<Func<Task>, Task> BuildInboundActivityDispatcher(IReadOnlyList<CircuitHandler> circuitHandlers, Circuit circuit)
Circuits\CircuitInboundActivityContext.cs (2)
11internal Func<Task> Handler { get; } 18internal CircuitInboundActivityContext(Func<Task> handler, Circuit circuit)
Microsoft.AspNetCore.Components.Tests (46)
EventCallbackFactoryTest.cs (14)
166var @delegate = (Func<Task>)component.SomeFuncTask; 182var @delegate = (Func<Task>)component.SomeFuncTask; 200var @delegate = (Func<Task>)(() => Task.CompletedTask); 236var callback = EventCallback.Factory.Create(component, (Func<Task>)null); 453var @delegate = (Func<Task>)component.SomeFuncTask; 469var @delegate = (Func<Task>)component.SomeFuncTask; 487var @delegate = (Func<Task>)(() => Task.CompletedTask); 507var callback = EventCallback.Factory.Create<string>(component, (Func<Task>)null);
EventCallbackTest.cs (4)
173var callback = new EventCallback(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 190var callback = new EventCallback(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 371var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 388var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; }));
RendererTest.cs (19)
629OnArbitraryDelegateEvent = (Func<Task>)(() => Task.CompletedTask), 1183builder.AddComponentParameter(1, nameof(EventComponent.OnClickEventCallback), EventCallback.Factory.Create(parentComponent, (Func<Task>)(() => 1302builder.AddComponentParameter(1, nameof(EventComponent.OnClickEventCallbackOfT), EventCallback.Factory.Create<DerivedEventArgs>(parentComponent, (Func<Task>)(() => 1648builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 1759builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 1879builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 2320builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => throw exception1)); 2354builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => default)); 2394builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => { await tcs.Task; })); 2439builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => { await tcs.Task; throw exception1; })); 2478builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => throw new TaskCanceledException())); 2516(Func<ValueTask>)(() => new ValueTask(tcs.Task))); 4274builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => { disposed = true; throw exception1; })); 4302builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => { await tcs.Task; disposed = true; throw exception1; })); 4911builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => await exception2Tcs.Task)); 5292public Func<Task> OnClickAsyncAction { get; set; } 5546public Func<ValueTask> AsyncDisposeAction { get; set; } 5800public Func<Task<(int id, EventType @event)>> EventAction { get; set; } 6052public Func<Task> Callback { get; set; }
Rendering\RendererSynchronizationContextTest.cs (4)
554var task = context.InvokeAsync<string>((Func<string>)(() => 570var task = context.InvokeAsync<string>((Func<string>)(() => 736var task = context.InvokeAsync<string>((Func<Task<string>>)(() => 752var task = context.InvokeAsync<string>((Func<Task<string>>)(() =>
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.Web (7)
Forms\EditContextFieldClassExtensions.cs (1)
23public static string FieldCssClass<TField>(this EditContext editContext, Expression<Func<TField>> accessor)
Forms\EditForm.cs (1)
15private readonly Func<Task> _handleSubmitDelegate; // Cache to avoid per-render allocations
Forms\Editor.cs (1)
25[Parameter] public Expression<Func<T>> ValueExpression { get; set; } = default!;
Forms\InputBase.cs (1)
55[Parameter] public Expression<Func<TValue>>? ValueExpression { get; set; }
Forms\ValidationMessage.cs (2)
15private Expression<Func<TValue>>? _previousFieldAccessor; 29[Parameter] public Expression<Func<TValue>>? For { get; set; }
JSComponents\JSComponentInterop.cs (1)
176var callback = jsObjectReference is null ? null : new Func<Task>(
Microsoft.AspNetCore.Components.Web.Tests (7)
Forms\InputRadioTest.cs (1)
87private static RenderFragment RadioButtonsWithGroup(string name, Expression<Func<TestEnum>> valueExpression) => (builder) =>
Forms\TestInputHostComponent.cs (1)
20public Expression<Func<TValue>> ValueExpression { get; set; }
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.WebAssembly (10)
Hosting\WebAssemblyHostBuilder.cs (1)
30private Func<IServiceProvider> _createServiceProvider;
Rendering\NullDispatcher.cs (3)
24public override Task InvokeAsync(Func<Task> workItem) 31public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 38public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Rendering\WebAssemblyDispatcher.cs (6)
51public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 64var state = ((TaskCompletionSource<TResult> tcs, Func<TResult> workItem))o!; 79public override Task InvokeAsync(Func<Task> workItem) 94var state = ((TaskCompletionSource tcs, Func<Task> workItem))o!; 124public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem) 139var state = ((TaskCompletionSource<TResult> tcs, Func<Task<TResult>> workItem))o!;
Microsoft.AspNetCore.Components.WebView.Maui (3)
MauiDispatcher.cs (3)
26 public override Task InvokeAsync(Func<Task> workItem) 31 public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 36 public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Microsoft.AspNetCore.Components.WebView.Photino (12)
PhotinoDispatcher.cs (3)
34public override Task InvokeAsync(Func<Task> workItem) 44public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 54public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
PhotinoSynchronizationContext.cs (9)
83public Task InvokeAsync(Func<Task> asyncAction) 85var completion = new PhotinoSynchronizationTaskCompletionSource<Func<Task>, object>(asyncAction); 88var completion = (PhotinoSynchronizationTaskCompletionSource<Func<Task>, object>)state; 107public Task<TResult> InvokeAsync<TResult>(Func<TResult> function) 109var completion = new PhotinoSynchronizationTaskCompletionSource<Func<TResult>, TResult>(function); 112var completion = (PhotinoSynchronizationTaskCompletionSource<Func<TResult>, TResult>)state; 131public Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> asyncFunction) 133var completion = new PhotinoSynchronizationTaskCompletionSource<Func<Task<TResult>>, TResult>(asyncFunction); 136var completion = (PhotinoSynchronizationTaskCompletionSource<Func<Task<TResult>>, TResult>)state;
Microsoft.AspNetCore.Components.WebView.WindowsForms (3)
WindowsFormsDispatcher.cs (3)
65 public override async Task InvokeAsync(Func<Task> workItem) 109 public override async Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 133 public override async Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Microsoft.AspNetCore.Components.WebView.Wpf (3)
WpfDispatcher.cs (3)
49 public override async Task InvokeAsync(Func<Task> workItem) 72 public override async Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 95 public override async Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Microsoft.AspNetCore.Connections.Abstractions (2)
ConnectionBuilderExtensions.cs (2)
46public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Func<Task>, Task> middleware) 52Func<Task> simpleNext = () => next(context);
Microsoft.AspNetCore.Cryptography.Internal (3)
Cng\CachedAlgorithmHandles.cs (2)
79private readonly Func<BCryptAlgorithmHandle> _factory; 81public CachedAlgorithmInfo(Func<BCryptAlgorithmHandle> factory)
WeakReferenceHelpers.cs (1)
12public static T GetSharedInstance<T>(ref WeakReference<T>? weakReference, Func<T> factory)
Microsoft.AspNetCore.Cryptography.Internal.Tests (3)
Cng\CachedAlgorithmHandlesTests.cs (3)
107private static void RunAesBlockCipherAlgorithmTest(Func<BCryptAlgorithmHandle> getter) 125Func<BCryptAlgorithmHandle> getter, 156Func<BCryptAlgorithmHandle> getter,
Microsoft.AspNetCore.DataProtection (17)
AuthenticatedEncryption\ManagedAuthenticatedEncryptorFactory.cs (5)
58private Func<KeyedHashAlgorithm> GetKeyedHashAlgorithmFactory(ManagedAuthenticatedEncryptorConfiguration configuration) 82private Func<SymmetricAlgorithm> GetSymmetricBlockCipherAlgorithmFactory(ManagedAuthenticatedEncryptorConfiguration configuration) 116public static Func<T> CreateFactory<T>([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type implementation) where T : class 123Func<T> Creator { get; } 128public Func<T> Creator { get; } = Activator.CreateInstance<T>;
KeyManagement\Key.cs (4)
24private readonly Func<IAuthenticatedEncryptorDescriptor>? _descriptorFactory; // May not be used 83Func<IAuthenticatedEncryptorDescriptor>? descriptorFactory) 102Func<IAuthenticatedEncryptorDescriptor>? descriptorFactory, 223private static Func<IAuthenticatedEncryptorDescriptor> GetLazyDescriptorDelegate(IInternalXmlKeyManager keyManager, XElement keyElement)
KeyManagement\XmlKeyManager.cs (1)
142internal Func<DateTimeOffset> GetUtcNow { get; set; } = () => DateTimeOffset.UtcNow;
Managed\ManagedAuthenticatedEncryptor.cs (4)
36private readonly Func<SymmetricAlgorithm> _symmetricAlgorithmFactory; 41private readonly Func<KeyedHashAlgorithm> _validationAlgorithmFactory; 43public ManagedAuthenticatedEncryptor(Secret keyDerivationKey, Func<SymmetricAlgorithm> symmetricAlgorithmFactory, int symmetricAlgorithmKeySizeInBytes, Func<KeyedHashAlgorithm> validationAlgorithmFactory, IManagedGenRandom? genRandom = null)
RegistryPolicyResolver.cs (1)
25private readonly Func<RegistryKey?> _getPolicyRegKey;
XmlEncryption\CertificateXmlEncryptor.cs (2)
21private readonly Func<X509Certificate2> _certFactory; 101private Func<X509Certificate2> CreateCertFactory(string thumbprint, ICertificateResolver resolver)
Microsoft.AspNetCore.DataProtection.StackExchangeRedis (4)
RedisDataProtectionBuilderExtensions.cs (2)
27public static IDataProtectionBuilder PersistKeysToStackExchangeRedis(this IDataProtectionBuilder builder, Func<IDatabase> databaseFactory, RedisKey key) 59private static IDataProtectionBuilder PersistKeysToStackExchangeRedisInternal(IDataProtectionBuilder builder, Func<IDatabase> databaseFactory, RedisKey key)
RedisXmlRepository.cs (2)
18private readonly Func<IDatabase> _databaseFactory; 26public RedisXmlRepository(Func<IDatabase> databaseFactory, RedisKey key)
Microsoft.AspNetCore.DataProtection.Tests (3)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorTests.cs (2)
104public static TheoryData<EncryptionAlgorithm, ValidationAlgorithm, Func<HMAC>> CreateAuthenticatedEncryptor_RoundTripsData_ManagedImplementationData 120Func<HMAC> validationAlgorithmFactory)
KeyManagement\KeyRingTests.cs (1)
97private readonly Func<IAuthenticatedEncryptor> _encryptorFactory;
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Latency\AddServerTimingHeaderMiddlewareTests.cs (2)
52private Func<Task> _responseStartingAsync = 57var prior = _responseStartingAsync;
Latency\RequestLatencyTelemetryMiddlewareTests.cs (2)
188private Func<Task> _responseStartingAsync = 203var prior = _responseStartingAsync;
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
Infrastructure\SyncPoint.cs (3)
49public static Func<Task> Create(out SyncPoint syncPoint, bool runContinuationsAsynchronously = true) 51var handler = Create(1, out var syncPoints, runContinuationsAsynchronously); 62public static Func<Task> Create(int count, out SyncPoint[] syncPoints, bool runContinuationsAsynchronously = true)
Microsoft.AspNetCore.Grpc.Swagger (2)
GrpcSwaggerGenOptionsExtensions.cs (2)
22Func<XPathDocument> xmlDocFactory) 38Func<XPathDocument> xmlDocFactory,
Microsoft.AspNetCore.Hosting.Tests (4)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
WebHostTests.cs (1)
1234public Func<IFeatureCollection> CreateRequestFeatures { get; set; } = NewFeatureCollection;
Microsoft.AspNetCore.Http (1)
src\Http\WebUtilities\src\AspNetCoreTempDirectory.cs (1)
34public static Func<string> TempDirectoryFactory => () => TempDirectory;
Microsoft.AspNetCore.Http.Abstractions (5)
Extensions\UseExtensions.cs (2)
29public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, Func<Task>, Task> middleware) 35Func<Task> simpleNext = () => next(context);
HttpResponse.cs (3)
19private static readonly Func<object, Task> _callbackDelegate = callback => ((Func<Task>)callback)(); 103public virtual void OnStarting(Func<Task> callback) => OnStarting(_callbackDelegate, callback); 128public virtual void OnCompleted(Func<Task> callback) => OnCompleted(_callbackDelegate, callback);
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 (5)
HttpConnection.cs (1)
53private Func<Task<string?>>? _accessTokenProvider;
HttpConnectionOptions.cs (1)
186public Func<Task<string?>>? AccessTokenProvider { get; set; }
Internal\DefaultTransportFactory.cs (2)
15private readonly Func<Task<string?>> _accessTokenProvider; 20public DefaultTransportFactory(HttpTransportType requestedTransportType, ILoggerFactory loggerFactory, HttpClient? httpClient, HttpConnectionOptions httpConnectionOptions, Func<Task<string?>> accessTokenProvider)
Internal\WebSocketsTransport.cs (1)
74public WebSocketsTransport(HttpConnectionOptions httpConnectionOptions, ILoggerFactory loggerFactory, Func<Task<string?>> accessTokenProvider, HttpClient? httpClient,
Microsoft.AspNetCore.Http.Connections.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
105private static readonly MemberExpression CompletedTaskExpr = Expression.Property(null, (PropertyInfo)GetMemberInfo<Func<Task>>(() => Task.CompletedTask));
Microsoft.AspNetCore.Http.Extensions.Tests (53)
RequestDelegateFactoryTests.cs (53)
1325new object[] { (Func<JsonTodo>)TestAction }, 1326new object[] { (Func<Task<JsonTodo>>)TaskTestAction}, 1327new object[] { (Func<Task<JsonTodo>>)TaskTestActionAwaited}, 1328new object[] { (Func<ValueTask<JsonTodo>>)ValueTaskTestAction}, 1329new object[] { (Func<ValueTask<JsonTodo>>)ValueTaskTestActionAwaited}, 1446new object[] { (Func<CustomResult>)TestAction }, 1447new object[] { (Func<Task<CustomResult>>)TaskTestAction}, 1448new object[] { (Func<ValueTask<CustomResult>>)ValueTaskTestAction}, 1449new object[] { (Func<FSharp.Control.FSharpAsync<CustomResult>>)FSharpAsyncTestAction }, 1451new object[] { (Func<CustomResult>)StaticTestAction}, 1452new object[] { (Func<Task<CustomResult>>)StaticTaskTestAction}, 1453new object[] { (Func<ValueTask<CustomResult>>)StaticValueTaskTestAction}, 1454new object[] { (Func<FSharp.Control.FSharpAsync<CustomResult>>)StaticFSharpAsyncTestAction }, 1456new object[] { (Func<object>)StaticResultAsObject}, 1458new object[] { (Func<Task<object>>)StaticTaskOfIResultAsObject}, 1459new object[] { (Func<ValueTask<object>>)StaticValueTaskOfIResultAsObject}, 1460new object[] { (Func<FSharp.Control.FSharpAsync<object>>)StaticFSharpAsyncOfIResultAsObject}, 1462new object[] { (Func<StructResult>)TestStructAction }, 1463new object[] { (Func<Task<StructResult>>)TaskTestStructAction }, 1464new object[] { (Func<ValueTask<StructResult>>)ValueTaskTestStructAction }, 1465new object[] { (Func<FSharp.Control.FSharpAsync<StructResult>>)FSharpAsyncTestStructAction }, 1500new object[] { (Func<IResult?>)TestAction, "The IResult returned by the Delegate must not be null." }, 1501new object[] { (Func<Task<IResult?>?>)TaskNullAction, "The IResult in Task<IResult> response must not be null." }, 1502new object[] { (Func<Task<bool?>?>)TaskBoolAction, "The Task returned by the Delegate must not be null." }, 1503new object[] { (Func<Task<IResult?>>)TaskTestAction, "The IResult returned by the Delegate must not be null." }, 1504new object[] { (Func<ValueTask<IResult?>>)ValueTaskTestAction, "The IResult returned by the Delegate must not be null." }, 2264new object[] { (Func<FSharp.Control.FSharpAsync<string>>)FSharpAsyncOfTMethod }, 2265new object[] { (Func<FSharp.Control.FSharpAsync<string>>)FSharpAsyncOfTWithYieldMethod }, 2266new object[] { (Func<FSharp.Control.FSharpAsync<object>>)FSharpAsyncOfObjectWithYieldMethod } 2354new object[] { (Func<ValueTask>)ValueTaskMethod }, 2355new object[] { (Func<ValueTask<FSharp.Core.Unit>>)ValueTaskOfUnitMethod }, 2356new object[] { (Func<Task>)TaskMethod }, 2357new object[] { (Func<Task<FSharp.Core.Unit>>)TaskOfUnitMethod }, 2358new object[] { (Func<FSharp.Control.FSharpAsync<FSharp.Core.Unit>>)FSharpAsyncOfUnitMethod }, 2359new object[] { (Func<ValueTask>)ValueTaskWithYieldMethod }, 2360new object[] { (Func<Task>)TaskWithYieldMethod}, 2361new object[] { (Func<FSharp.Control.FSharpAsync<FSharp.Core.Unit>>)FSharpAsyncOfUnitWithYieldMethod } 2475new object[] { (Func<ValueTask<TodoStruct>>)ValueTaskOfStructMethod }, 2476new object[] { (Func<ValueTask<TodoStruct>>)ValueTaskOfStructWithYieldMethod }, 2477new object[] { (Func<Task<TodoStruct>>)TaskOfStructMethod }, 2478new object[] { (Func<Task<TodoStruct>>)TaskOfStructWithYieldMethod }, 2479new object[] { (Func<FSharp.Control.FSharpAsync<TodoStruct>>)FSharpAsyncOfStructMethod }, 2480new object[] { (Func<FSharp.Control.FSharpAsync<TodoStruct>>)FSharpAsyncOfStructWithYieldMethod } 2533var @delegate = () => new object(); 2545var @delegate = () => "Hello"; 2620var @delegate = () => new AddsCustomEndpointMetadataResult(); 2633var @delegate = () => Task.FromResult(new AddsCustomEndpointMetadataResult()); 2646var @delegate = () => ValueTask.FromResult(new AddsCustomEndpointMetadataResult()); 2659var @delegate = () => FSharp.Core.ExtraTopLevelOperators.DefaultAsyncBuilder.Return(new AddsCustomEndpointMetadataResult()); 2672var @delegate = () => new CountsDefaultEndpointMetadataResult(); 2694var @delegate = () => Task.FromResult(new CountsDefaultEndpointMetadataResult()); 2717var @delegate = () => ValueTask.FromResult(new CountsDefaultEndpointMetadataResult()); 2740var @delegate = () => FSharp.Core.ExtraTopLevelOperators.DefaultAsyncBuilder.Return(new CountsDefaultEndpointMetadataResult());
Microsoft.AspNetCore.Http.Results.Tests (4)
ResultsTests.cs (4)
1700public void FactoryMethod_ReturnsCorrectResultType(Expression<Func<IResult>> expression, Type expectedReturnType) 1702var method = expression.Compile(); 1728private static IEnumerable<(Expression<Func<IResult>>, Type)> FactoryMethodsTuples { get; } = new List<(Expression<Func<IResult>>, Type)>
Microsoft.AspNetCore.HttpLogging.Tests (1)
FileLoggerProcessorTests.cs (1)
571private async Task WaitForCondition(Func<bool> waitForLog)
Microsoft.AspNetCore.Identity.Test (2)
SecurityStampValidatorTest.cs (1)
95private async Task RunApplicationCookieTest(PocoUser user, Mock<HttpContext> httpContext, bool shouldStampValidate, Func<Task> testCode)
UserManagerTest.cs (1)
968private async Task VerifyException<TException>(Func<Task> code, string expectedMessage) where TException : Exception
Microsoft.AspNetCore.InternalTesting (7)
ExceptionAssertions.cs (6)
50public static async Task<TException> ThrowsAsync<TException>(Func<Task> testCode, string exceptionMessage) 69public static TException Throws<TException>(Func<object> testCode, string exceptionMessage) 109public static Task<ArgumentException> ThrowsArgumentAsync(Func<Task> testCode, string paramName, string exceptionMessage) 115Func<Task> testCode, 164public static Task<ArgumentException> ThrowsArgumentNullOrEmptyAsync(Func<Task> testCode, string paramName) 188public static Task<ArgumentException> ThrowsArgumentNullOrEmptyStringAsync(Func<Task> testCode, string paramName)
HttpClientSlim.cs (1)
109private static async Task<string> RetryRequest(Func<Task<string>> retryBlock)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (1)
JsonPatchDocumentTest.cs (1)
219var getTestObject = () => new SimpleObject() { SimpleObjectList = new() };
Microsoft.AspNetCore.Mvc.Abstractions (9)
ModelBinding\EnumGroupAndName.cs (3)
11private readonly Func<string> _name; 32/// <param name="name">A <see cref="Func{String}"/> which will return the name.</param> 35Func<string> name)
ModelBinding\Metadata\ModelBindingMessageProvider.cs (4)
25public virtual Func<string> MissingKeyOrValueAccessor { get; } = default!; 32public virtual Func<string> MissingRequestBodyRequiredValueAccessor { get; } = default!; 71public virtual Func<string> NonPropertyUnknownValueIsInvalidAccessor { get; } = default!; 93public virtual Func<string> NonPropertyValueMustBeANumberAccessor { get; } = default!;
ModelBinding\Validation\ValidationEntry.cs (2)
12private Func<object?>? _modelAccessor; 37public ValidationEntry(ModelMetadata metadata, string key, Func<object?> modelAccessor)
Microsoft.AspNetCore.Mvc.Core (29)
Infrastructure\IActionDescriptorCollectionProvider.cs (1)
22/// using <see cref="ChangeToken.OnChange(System.Func{IChangeToken}, System.Action)"/>.
ModelBinding\Binders\CollectionModelBinder.cs (2)
26private Func<object>? _modelCreator; 253.Lambda<Func<object>>(Expression.New(targetType))
ModelBinding\Binders\ComplexObjectModelBinder.cs (2)
36private Func<object>? _modelCreator; 215.Lambda<Func<object>>(Expression.New(bindingContext.ModelType))
ModelBinding\Binders\ComplexTypeModelBinder.cs (2)
36private Func<object> _modelCreator; 504.Lambda<Func<object>>(Expression.New(bindingContext.ModelType))
ModelBinding\Metadata\DefaultModelBindingMessageProvider.cs (12)
17private Func<string> _missingKeyOrValueAccessor; 18private Func<string> _missingRequestBodyRequiredValueAccessor; 23private Func<string> _nonPropertyUnknownValueIsInvalidAccessor; 26private Func<string> _nonPropertyValueMustBeANumberAccessor; 84public override Func<string> MissingKeyOrValueAccessor => _missingKeyOrValueAccessor; 91public void SetMissingKeyOrValueAccessor(Func<string> missingKeyOrValueAccessor) 99public override Func<string> MissingRequestBodyRequiredValueAccessor => _missingRequestBodyRequiredValueAccessor; 106public void SetMissingRequestBodyRequiredValueAccessor(Func<string> missingRequestBodyRequiredValueAccessor) 175public override Func<string> NonPropertyUnknownValueIsInvalidAccessor => _nonPropertyUnknownValueIsInvalidAccessor; 182public void SetNonPropertyUnknownValueIsInvalidAccessor(Func<string> nonPropertyUnknownValueIsInvalidAccessor) 220public override Func<string> NonPropertyValueMustBeANumberAccessor => _nonPropertyValueMustBeANumberAccessor; 227public void SetNonPropertyValueMustBeANumberAccessor(Func<string> nonPropertyValueMustBeANumberAccessor)
ModelBinding\Metadata\DisplayMetadata.cs (9)
13private Func<string?> _displayFormatStringProvider = () => null; 14private Func<string?> _editFormatStringProvider = () => null; 15private Func<string?> _nullDisplayTextProvider = () => null; 39public Func<string?>? Description { get; set; } 67public Func<string?> DisplayFormatStringProvider 85public Func<string?>? DisplayName { get; set; } 126public Func<string?> EditFormatStringProvider 213public Func<string?> NullDisplayTextProvider 237public Func<string?>? Placeholder { get; set; }
src\Http\Routing\src\DataSourceDependentCache.cs (1)
17private readonly Func<T> _initializer;
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\TestModelBinderProviderContext.cs (1)
92public void OnCreatingBinder(ModelMetadata metadata, Func<IModelBinder> binderCreator)
Microsoft.AspNetCore.Mvc.Razor (6)
Compilation\DefaultRazorPageFactoryProvider.cs (2)
51var pageFactory = Expression 52.Lambda<Func<IRazorPage>>(objectInitializeExpression)
RazorPageFactoryResult.cs (2)
22Func<IRazorPage>? razorPageFactory) 32public Func<IRazorPage>? RazorPageFactory { get; }
ViewLocationCacheItem.cs (2)
16public ViewLocationCacheItem(Func<IRazorPage> razorPageFactory, string location) 30public Func<IRazorPage> PageFactory { get; }
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RuntimeViewCompilerProvider.cs (1)
18private readonly Func<IViewCompiler> _createCompiler;
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorViewEngineTest.cs (1)
2039Func<IRazorPage> factory,
Microsoft.AspNetCore.Mvc.RazorPages (6)
Infrastructure\PageActionInvokerCache.cs (2)
113internal List<Func<IRazorPage>> GetViewStartFactories(CompiledPageActionDescriptor descriptor) 115var viewStartFactories = new List<Func<IRazorPage>>();
Infrastructure\PageActionInvokerCacheEntry.cs (2)
24IReadOnlyList<Func<IRazorPage>> viewStartFactories, 71public IReadOnlyList<Func<IRazorPage>> ViewStartFactories { get; }
PageContext.cs (2)
22private IList<Func<IRazorPage>>? _viewStartFactories; 112public virtual IList<Func<IRazorPage>> ViewStartFactories
Microsoft.AspNetCore.Mvc.RazorPages.Test (3)
Infrastructure\PageActionInvokerProviderTest.cs (2)
163Func<IRazorPage> factory1 = () => null; 164Func<IRazorPage> factory2 = () => null;
Infrastructure\PageActionInvokerTest.cs (1)
1510ViewStartFactories = new List<Func<IRazorPage>>(),
Microsoft.AspNetCore.Mvc.TagHelpers (1)
GlobbingUrlBuilder.cs (1)
60internal Func<Matcher> MatcherBuilder { get; set; }
Microsoft.AspNetCore.Mvc.TagHelpers.Test (8)
LabelTagHelperTest.cs (3)
14public static TheoryData<object, Type, Func<object>, string, TagHelperOutputContent> TestDataSet 40return new TheoryData<object, Type, Func<object>, string, TagHelperOutputContent> 155Func<object> modelAccessor,
SelectTagHelperTest.cs (5)
19public static TheoryData<object, Type, Func<object>, NameAndId, string> GeneratesExpectedDataSet 57return new TheoryData<object, Type, Func<object>, NameAndId, string> 167Func<object> modelAccessor, 256Func<object> modelAccessor, 436Func<object> modelAccessor,
Microsoft.AspNetCore.Mvc.Testing (7)
WebApplicationFactory.cs (7)
215private void TryConfigureServerPort(Func<IServerAddressesFeature?> serverAddressFeatureAccessor) 805private readonly Func<IWebHostBuilder?> _createWebHostBuilder; 806private readonly Func<IHostBuilder?> _createHostBuilder; 807private readonly Func<IEnumerable<Assembly>> _getTestAssemblies; 814Func<IWebHostBuilder?> createWebHostBuilder, 815Func<IHostBuilder?> createHostBuilder, 816Func<IEnumerable<Assembly>> getTestAssemblies,
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
DynamicViewData.cs (2)
15private readonly Func<ViewDataDictionary> _viewDataFunc; 17public DynamicViewData(Func<ViewDataDictionary> viewDataFunc)
ViewDataInfo.cs (3)
13private static readonly Func<object> _propertyInfoResolver = () => null; 16private Func<object> _valueAccessor; 51public ViewDataInfo(object container, PropertyInfo propertyInfo, Func<object> valueAccessor)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
Filters\SaveTempDataFilterTest.cs (2)
400private Func<Task> _responseStartingAsync = () => Task.FromResult(true); 422var prior = _responseStartingAsync;
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (2)
RedisOutputCacheOptions.cs (2)
32public Func<Task<IConnectionMultiplexer>>? ConnectionMultiplexerFactory { get; set; } 43public Func<ProfilingSession>? ProfilingSession { get; set; }
Microsoft.AspNetCore.Owin (12)
OwinEnvironment.cs (10)
329public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory) 352public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter) 365public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter, Func<object> featureFactory) 377private Func<object> DefaultFactory { get; set; } 378private Func<object> FeatureFactory { get; set; } 443public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory) 464public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory, Action<TFeature, object> setter) 476public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory, Action<TFeature, object> setter, Func<TFeature> featureFactory)
OwinFeatureCollection.cs (2)
264var loadAsync = Prop<Func<Task>>(OwinConstants.CommonKeys.LoadClientCertAsync);
Microsoft.AspNetCore.RateLimiting.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Razor.Runtime (11)
Runtime\TagHelpers\TagHelperExecutionContext.cs (6)
17private readonly Func<TagHelperContent> _endTagHelperWritingScope; 19private Func<Task> _executeChildContentAsync; 56Func<Task> executeChildContentAsync, 58Func<TagHelperContent> endTagHelperWritingScope) 175/// <param name="executeChildContentAsync">The <see cref="Func{Task}"/> to use.</param> 181Func<Task> executeChildContentAsync)
Runtime\TagHelpers\TagHelperScopeManager.cs (5)
27Func<TagHelperContent> endTagHelperWritingScope) 47Func<Task> executeChildContentAsync) 104private readonly Func<TagHelperContent> _endTagHelperWritingScope; 110Func<TagHelperContent> endTagHelperWritingScope) 124Func<Task> executeChildContentAsync)
Microsoft.AspNetCore.Razor.Runtime.Test (5)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (5)
94Func<Task> executeChildContentAsync = () => 100Func<TagHelperContent> endTagHelperWritingScope = () => null; 112Func<Task> updatedExecuteChildContentAsync = () => 152Func<Task> executeChildContentAsync = () => 158Func<TagHelperContent> endWritingScope = () => null;
Microsoft.AspNetCore.Rewrite (5)
IISUrlRewrite\ServerVariables.cs (1)
22Func<PatternSegment>? managedVariableThunk = default;
PatternSegments\IISServerVariableSegment.cs (2)
11private readonly Func<PatternSegment> _fallbackThunk; 13public IISServerVariableSegment(string variableName, Func<PatternSegment> fallbackThunk)
UrlActions\ChangeCookieAction.cs (2)
10private readonly Func<DateTimeOffset> _timeSource; 19internal ChangeCookieAction(string name, Func<DateTimeOffset> timeSource)
Microsoft.AspNetCore.Routing (4)
Constraints\RegexRouteConstraint.cs (1)
27private readonly Func<Regex>? _regexFactory;
DataSourceDependentCache.cs (1)
17private readonly Func<T> _initializer;
Matching\DataSourceDependentMatcher.cs (2)
12private readonly Func<MatcherBuilder> _matcherBuilderFactory; 18Func<MatcherBuilder> matcherBuilderFactory)
Microsoft.AspNetCore.Routing.Tests (1)
Matching\DataSourceDependentMatcherTest.cs (1)
238public static Func<MatcherBuilder> Create = () => new TestMatcherBuilder();
Microsoft.AspNetCore.Server.HttpSys (2)
ResponseStream.cs (2)
9private readonly Func<Task> _onStart; 11internal ResponseStream(Stream innerStream, Func<Task> onStart)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\RetryHelper.cs (1)
20Func<Task<HttpResponseMessage>> retryBlock,
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
Http1\Http1ConnectionTests.cs (1)
1091private static async Task WaitForCondition(TimeSpan timeout, Func<bool> condition)
KestrelServerTests.cs (1)
762Func<Task> changeCallback = null;
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
76public Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
1691Func<Times> reloadTimes = loadInternal && reloadOnChange ? Times.AtLeastOnce : Times.Never;
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
NamedPipeTransportOptions.cs (1)
119internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = PinnedBlockMemoryPoolFactory.Create;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
SocketConnectionFactoryOptions.cs (1)
70internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = PinnedBlockMemoryPoolFactory.Create;
SocketTransportOptions.cs (1)
169internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
Microsoft.AspNetCore.Session (6)
DistributedSession.cs (2)
30private readonly Func<bool> _tryEstablishSession; 62Func<bool> tryEstablishSession,
DistributedSessionStore.cs (1)
33public ISession Create(string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey)
ISessionStore.cs (1)
30ISession Create(string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey);
SessionMiddleware.cs (2)
20private static readonly Func<bool> ReturnTrue = () => true; 63Func<bool> tryEstablishSession = ReturnTrue;
Microsoft.AspNetCore.Shared.Tests (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
Microsoft.AspNetCore.SignalR.Client.Core (4)
HubConnection.cs (1)
973private async Task CommonStreaming(ConnectionState connectionState, string streamId, Func<Task> createAndConsumeStream, CancellationTokenSource cts)
HubConnectionExtensions.cs (1)
227public static IDisposable On(this HubConnection hubConnection, string methodName, Func<Task> handler)
HubConnectionExtensions.OnResult.cs (2)
55public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Func<Task<TResult>> handler) 71public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Func<TResult> handler)
Microsoft.AspNetCore.SignalR.Client.Tests (18)
HttpConnectionFactoryTests.cs (1)
80Func<Task<string>> tokenProvider = () => Task.FromResult("");
HttpConnectionTests.Helpers.cs (1)
27Func<Task<string>> accessTokenProvider = null)
HubConnectionTests.ConnectionLifecycle.cs (1)
113var onDisposeForFirstConnection = SyncPoint.Create(out var syncPoint);
HubConnectionTests.cs (1)
764var accessTokenFactory = new Func<Task<string>>(() => Task.FromResult("fakeAccessToken"));
HubConnectionTests.Reconnect.cs (2)
1120public readonly Func<TestConnection> _testConnectionFactory; 1128public ReconnectingConnectionFactory(Func<TestConnection> testConnectionFactory)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
TestConnection.cs (4)
32private readonly Func<Task> _onStart; 33private readonly Func<Task> _onDispose; 48public TestConnection(Func<Task> onStart = null, Func<Task> onDispose = null, bool autoHandshake = true, bool hasInherentKeepAlive = false, PipeOptions pipeOptions = null)
TestHttpMessageHandler.cs (1)
135public void OnRequest(Func<HttpRequestMessage, Func<Task<HttpResponseMessage>>, CancellationToken, Task<HttpResponseMessage>> handler)
TestTransport.cs (4)
16private readonly Func<Task> _stopHandler; 17private readonly Func<Task> _startHandler; 29public TestTransport(Func<Task> onTransportStop = null, Func<Task> onTransportStart = null, TransferFormat transferFormat = TransferFormat.Text)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (5)
RedisProtocolTests.cs (4)
97private static readonly Dictionary<string, ProtocolTestData<Func<RedisInvocation>>> _invocationTestData = new[] 99CreateTestData<Func<RedisInvocation>>( 109CreateTestData<Func<RedisInvocation>>( 120CreateTestData<Func<RedisInvocation>>(
TestConnectionMultiplexer.cs (1)
212public void RegisterProfiler(Func<ProfilingSession> profilingSessionProvider)
Microsoft.AspNetCore.SignalR.Tests (11)
HubFilterTests.cs (6)
326var syncPoint1 = SyncPoint.Create(3, out var syncPoints1); 327var syncPoint2 = SyncPoint.Create(3, out var syncPoints2); 385var syncPoint1 = SyncPoint.Create(3, out var syncPoints1); 386var syncPoint2 = SyncPoint.Create(3, out var syncPoints2); 445var syncPoint1 = SyncPoint.Create(3, out var syncPoints1); 446var syncPoint2 = SyncPoint.Create(3, out var syncPoints2);
NativeAotTests.cs (1)
159private static void RunNativeAotTest(Func<Task> test)
SerializedHubMessageTests.cs (1)
65var onWrite = SyncPoint.Create(2, out var syncPoints);
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Proxying\SpaProxyingExtensions.cs (1)
58Func<Task<Uri>> baseUriTaskFactory)
Microsoft.AspNetCore.TestHost (10)
AsyncStreamWrapper.cs (2)
9private readonly Func<bool> _allowSynchronousIO; 11internal AsyncStreamWrapper(Stream inner, Func<bool> allowSynchronousIO)
ResponseBodyPipeWriter.cs (2)
11private readonly Func<Task> _onFirstWriteAsync; 17internal ResponseBodyPipeWriter(Pipe pipe, Func<Task> onFirstWriteAsync)
ResponseBodyWriterStream.cs (2)
9private readonly Func<bool> _allowSynchronousIO; 11public ResponseBodyWriterStream(ResponseBodyPipeWriter responseWriter, Func<bool> allowSynchronousIO)
ResponseFeature.cs (4)
15private Func<Task> _responseStartingAsync = () => Task.CompletedTask; 16private Func<Task> _responseCompletedAsync = () => Task.CompletedTask; 81var prior = _responseStartingAsync; 91var prior = _responseCompletedAsync;
Microsoft.AspNetCore.TestHost.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Testing.Tests (1)
TestResources\Startup.cs (1)
19public void Configure(IApplicationBuilder app) => app.Use((HttpContext _, Func<Task> _) => Task.CompletedTask);
Microsoft.AspNetCore.WebSockets.Tests (2)
KestrelWebSocketHelpers.cs (2)
90private readonly Func<ValueTask> _dispose; 92public Disposable(Func<ValueTask> dispose)
Microsoft.AspNetCore.WebUtilities (6)
AspNetCoreTempDirectory.cs (1)
34public static Func<string> TempDirectoryFactory => () => TempDirectory;
FileBufferingReadStream.cs (3)
25private readonly Func<string>? _tempFileDirectoryAccessor; 56Func<string> tempFileDirectoryAccessor) 73Func<string> tempFileDirectoryAccessor,
FileBufferingWriteStream.cs (2)
23private readonly Func<string> _tempFileDirectoryAccessor; 42Func<string>? tempFileDirectoryAccessor = null)
Microsoft.Build (21)
BackEnd\BuildManager\CacheAggregator.cs (2)
17private readonly Func<int> _nextConfigurationId; 25public CacheAggregator(Func<int> nextConfigurationId)
BackEnd\Client\MSBuildClient.cs (1)
420private bool TrySendPacket(Func<INodePacket> packetResolver)
BackEnd\Components\Communications\NodeLauncher.cs (1)
194private static Process DisableMSBuildServer(Func<Process> func)
BackEnd\Shared\BuildRequestConfiguration.cs (1)
503private void InitializeProject(BuildParameters buildParameters, Func<ProjectInstance> loadProjectFromFile)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
Definition\ToolsetConfigurationReader.cs (2)
33private readonly Func<Configuration> _readApplicationConfiguration; 69internal ToolsetConfigurationReader(PropertyDictionary<ProjectPropertyInstance> environmentProperties, PropertyDictionary<ProjectPropertyInstance> globalProperties, Func<Configuration> readApplicationConfiguration)
Graph\ParallelWorkSet.cs (1)
105internal void AddWork(TKey key, Func<TResult> workFunc)
Logging\TerminalLogger\TerminalLogger.cs (1)
68internal Func<StopwatchAbstraction>? CreateStopwatch = null;
Microsoft.Build.Engine.OM.UnitTests (17)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (5)
242public static void VerifySameLocationWithException(Func<ElementLocation> expectedGetter, Func<ElementLocation> actualGetter, ValidationContext context = null) 353public static bool GetWithExceptionCheck<T>(Func<T> getter, out T result) 367public static void ValidateEqualWithException<T>(Func<T> viewGetter, Func<T> realGetter, ValidationContext context = null)
Microsoft.Build.Engine.UnitTests (4)
Graph\ParallelWorkSet_Tests.cs (1)
31internal Func<string> WorkFunc { get; set; }
Graph\ProjectGraph_Tests.cs (1)
2920var getTargetListsFunc = (() => projectGraph.GetTargetLists([entryTarget]));
NodeStatus_Transition_Tests.cs (1)
32Func<TerminalNodeStatus> newNodeStatus = () => new TerminalNodeStatus("project", "tfm", AnsiCodes.Colorize("colorized target", TerminalColor.Green), new MockStopwatch());
TerminalLogger_Tests.cs (1)
678Func<StopwatchAbstraction>? createStopwatch = _terminallogger.CreateStopwatch;
Microsoft.Build.Framework (1)
IItemData.cs (1)
44private readonly Func<IEnumerable<KeyValuePair<string, string>>> _enumerateMetadata;
Microsoft.Build.Tasks.Core (19)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
Copy.cs (1)
868private bool TryPathOperation(Func<string> operation, string src, string dest, out string resultPathOperation)
FileIO\GetFileHash.cs (4)
26internal static readonly Dictionary<string, Func<HashAlgorithm>> SupportedAlgorithms 27= new Dictionary<string, Func<HashAlgorithm>>(StringComparer.OrdinalIgnoreCase) 69if (!SupportedAlgorithms.TryGetValue(Algorithm, out var algorithmFactory)) 141internal static byte[] ComputeHash(Func<HashAlgorithm> algorithmFactory, string filePath, CancellationToken ct)
FileIO\VerifyFileHash.cs (1)
48if (!GetFileHash.SupportedAlgorithms.TryGetValue(Algorithm, out var algorithmFactory))
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (1)
32Func<string>[] possibleLocations =
Microsoft.Build.UnitTests.Shared (12)
EngineTestEnvironment.cs (4)
153private IEnumerable<(ILogger logger, Func<string> textGetter)> GetLoggers() 155var result = new List<(ILogger logger, Func<string> textGetter)>(); 169private (ILogger logger, Func<string> textGetter) GetMockLogger() 195private (ILogger, Func<string>) GetBinaryLogger()
EnvironmentProvider.cs (3)
29private readonly Func<string?> _getCurrentProcessPath; 35public EnvironmentProvider(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath) 120public static string? GetDotnetExePath(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath)
TestEnvironment.cs (5)
173public TestInvariant WithStringInvariant(string name, Func<string> value) 403private readonly Func<string> _accessorFunc; 407public StringInvariant(string name, Func<string> accessorFunc) 540private readonly Func<bool> _condition; 542public CustomConditionInvariant(Func<bool> condition)
Microsoft.Build.Utilities.Core (12)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
Microsoft.CodeAnalysis (34)
Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
Compilation.EmitStream.cs (1)
68internal Func<Stream?> GetCreateStreamFunc(CommonMessageProvider messageProvider, DiagnosticBag diagnostics)
Compilation\Compilation.cs (5)
3271Func<Stream?>? getPortablePdbStream = 3274: (Func<Stream?>)(() => ConditionalGetOrCreateStream(pdbStreamProvider, metadataDiagnostics)); 3364Func<Stream?> getPeStream, 3365Func<Stream?>? getMetadataPeStreamOpt, 3366Func<Stream?>? getPortablePdbStreamOpt,
FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
InternalUtilities\ConcurrentLruCache.cs (1)
207public V GetOrAdd(K key, Func<V> creator)
InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
InternalUtilities\RoslynLazyInitializer.cs (4)
17/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, Func{T})"/> 18public static T EnsureInitialized<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 25/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, ref bool, ref object, Func{T})"/> 26public static T EnsureInitialized<T>([NotNull] ref T? target, ref bool initialized, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory)
InternalUtilities\UICultureUtilities.cs (2)
174public static Func<T> WithCurrentUICulture<T>(Func<T> func)
PEWriter\DebugSourceDocument.cs (1)
37public DebugSourceDocument(string location, Guid language, Func<DebugSourceInfo> sourceInfo)
PEWriter\ManagedResource.cs (2)
18private readonly Func<Stream>? _streamProvider; 28internal ManagedResource(string name, bool isPublic, Func<Stream>? streamProvider, IFileReference? fileReference, uint offset)
PEWriter\PeWriter.cs (2)
83Func<Stream?> getPeStream, 84Func<Stream?>? getPortablePdbStreamOpt,
ResourceDescription.cs (4)
24internal readonly Func<Stream> DataProvider; 38public ResourceDescription(string resourceName, Func<Stream> dataProvider, bool isPublic) 55public ResourceDescription(string resourceName, string? fileName, Func<Stream> dataProvider, bool isPublic) 60internal ResourceDescription(string resourceName, string? fileName, Func<Stream> dataProvider, bool isPublic, bool isEmbedded, bool checkArgs)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
169/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 412protected override Func<TResult> Bind()
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (2)
35private readonly Func<bool> _getIsInsideAnonymousObjectInitializer; 46Func<bool> getIsInsideAnonymousObjectInitializer,
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
2200Func<ControlFlowGraph?> getCfg, 3497TAnalysisData AnalyzePossibleTargetInvocation(Func<TAbstractAnalysisValue> computeValueForInvocation, TAnalysisData inputAnalysisData, TAnalysisData? mergedAnalysisData, ref bool first)
Microsoft.CodeAnalysis.CodeStyle (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
169/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 412protected override Func<TResult> Bind()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 91private Func<string>? _messageGetter; 93public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
170var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<int>), ContainingNamespace.Name: nameof(System) }
Microsoft.CodeAnalysis.CSharp (2)
CommandLine\CSharpCommandLineParser.cs (1)
2083Func<Stream> dataProvider = () =>
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
297private BoundStatement PossibleIteratorScope(ImmutableArray<LocalSymbol> locals, Func<BoundStatement> wrapped)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
324Name: nameof(Func<int>) or nameof(Action<int>),
Microsoft.CodeAnalysis.CSharp.EditorFeatures (9)
CompleteStatement\CompleteStatementCommandHandler.cs (1)
69public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler) => nextCommandHandler();
ConvertNamespace\ConvertNamespaceCommandHandler.cs (1)
60public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
37public CommandState GetCommandState(TabKeyCommandArgs args, Func<CommandState> nextHandler)
EventHookup\EventHookupCommandHandler_TypeCharCommand.cs (1)
83public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandler.cs (1)
90public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
RawStringLiteral\RawStringLiteralCommandHandler_TypeChar.cs (1)
23public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
76public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextCommandHandler)
StringCopyPaste\StringCopyPasteCommandHandler_CutCopy.cs (2)
25public CommandState GetCommandState(CutCommandArgs args, Func<CommandState> nextCommandHandler) 28public CommandState GetCommandState(CopyCommandArgs args, Func<CommandState> nextCommandHandler)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (9)
NavigateTo\NavigateToSearcherTests.cs (9)
48It.IsAny<Func<Task>>(), 57Func<Task> onProjectCompleted, 71It.IsAny<Func<Task>>(), 79Func<Task> onProjectCompleted, 98It.IsAny<Func<Task>>(), 107Func<Task> onProjectCompleted, 515public Task SearchCachedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 527public Task SearchGeneratedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 533public Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
Emit\ResourceTests.cs (5)
238Func<Stream> dataProvider = () => new MemoryStream(new byte[] { }); 258Func<Stream> dataProvider = () => new MemoryStream(new byte[] { }); 291Func<Stream> dataProvider = () => new MemoryStream(new byte[] { }); 311Func<Stream> dataProvider = () => new MemoryStream(new byte[] { }); 338Func<Stream> dataProvider = () => new MemoryStream(new byte[] { });
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ScriptTests.cs (1)
1142private async Task VerifyStackTraceAsync(Func<Script<object>> scriptProvider, int line = 0, int column = 0, string filename = null)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\NameLengthTests.cs (1)
568Func<Stream> dataProvider = () => new System.IO.MemoryStream();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
DocumentationComments\CrefTests.cs (1)
5514Func<Symbol> lookupSymbol = () =>
Microsoft.CodeAnalysis.CSharp.Test.Utilities (6)
CSharpTestBase.cs (6)
1346Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.Create( 1376private static void ValidateCompilation(Func<CSharpCompilation> createCompilationLambda) 1382private static void VerifyUsedAssemblyReferences(Func<CSharpCompilation> createCompilationLambda) 1476Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.Create(identity.Name, options: options ?? TestOptions.ReleaseDll, references: references, syntaxTrees: trees); 1495Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.CreateScriptCompilation( 1518Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.CreateScriptCompilation(
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
324Name: nameof(Func<int>) or nameof(Action<int>),
Microsoft.CodeAnalysis.EditorFeatures (24)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
46public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextCommandHandler)
AutomaticCompletion\AbstractAutomaticLineEnderCommandHandler.cs (1)
72public CommandState GetCommandState(AutomaticLineEnderCommandArgs args, Func<CommandState> nextHandler)
DocumentationComments\AbstractDocumentationCommentCommandHandler.cs (3)
115public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler) 228public CommandState GetCommandState(OpenLineAboveCommandArgs args, Func<CommandState> nextHandler) 264public CommandState GetCommandState(OpenLineBelowCommandArgs args, Func<CommandState> nextHandler)
DocumentationComments\AbstractXmlTagCompletionCommandHandler.cs (1)
45public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
DocumentationComments\DocumentationCommentSuggestion.cs (1)
160private async Task<T> RunWithEnqueueActionAsync<T>(string description, Func<Task<T>> action, CancellationToken cancellationToken)
Formatting\FormatCommandHandler.Paste.cs (1)
19public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextHandler)
Formatting\FormatCommandHandler.ReturnKey.cs (1)
13public CommandState GetCommandState(ReturnKeyCommandArgs args, Func<CommandState> nextHandler)
Formatting\FormatCommandHandler.TypeChar.cs (1)
13public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler.cs (1)
33private CommandState GetCommandState(Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_BackspaceDeleteHandler.cs (2)
16public CommandState GetCommandState(BackspaceKeyCommandArgs args, Func<CommandState> nextHandler) 19public CommandState GetCommandState(DeleteKeyCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_CutPasteHandler.cs (2)
14public CommandState GetCommandState(CutCommandArgs args, Func<CommandState> nextHandler) 25public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_OpenLineAboveHandler.cs (1)
13public CommandState GetCommandState(OpenLineAboveCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_OpenLineBelowHandler.cs (1)
13public CommandState GetCommandState(OpenLineBelowCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_TypeCharHandler.cs (1)
17public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
Interactive\InteractiveSession.cs (2)
55private readonly AsyncBatchingWorkQueue<Func<Task>> _workQueue; 113private async ValueTask ProcessWorkQueueAsync(ImmutableSegmentedList<Func<Task>> list, CancellationToken cancellationToken)
PasteTracking\PasteTrackingPasteCommandHandler.cs (1)
35public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextCommandHandler)
Shared\Utilities\WorkspaceThreadingService.cs (1)
23public TResult Run<TResult>(Func<Task<TResult>> asyncMethod)
Tagging\TaggerMainThreadManager.cs (2)
39Func<TaggerUIData?> action, 72public async ValueTask<TaggerUIData?> PerformWorkOnMainThreadAsync(Func<TaggerUIData?> action, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Emit\CompilationOutputsTests.cs (4)
19private readonly Func<Stream?>? _openAssemblyStream; 20private readonly Func<Stream?>? _openPdbStream; 22public TestCompilationOutputs(Func<Stream?>? openAssemblyStream = null, Func<Stream?>? openPdbStream = null)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (12)
QuickInfo\ContentControlService.cs (1)
50public void AttachToolTipToControl(FrameworkElement element, Func<DisposableToolTip> createToolTip)
QuickInfo\IContentControlService.cs (1)
49void AttachToolTipToControl(FrameworkElement element, Func<DisposableToolTip> createToolTip);
QuickInfo\LazyToolTip.cs (3)
24private readonly Func<DisposableToolTip> _createToolTip; 33Func<DisposableToolTip> createToolTip) 53public static void AttachTo(FrameworkElement element, IThreadingContext threadingContext, Func<DisposableToolTip> createToolTip)
SignatureHelp\Controller_InvokeSignatureHelp.cs (1)
17CommandState IChainedCommandHandler<InvokeSignatureHelpCommandArgs>.GetCommandState(InvokeSignatureHelpCommandArgs args, Func<CommandState> nextHandler)
SignatureHelp\Controller_TypeChar.cs (1)
20CommandState IChainedCommandHandler<TypeCharCommandArgs>.GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
SignatureHelp\SignatureHelpBeforeCompletionCommandHandler.cs (3)
70Func<CommandState> nextHandler) 96CommandState IChainedCommandHandler<TypeCharCommandArgs>.GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler) 108CommandState IChainedCommandHandler<InvokeSignatureHelpCommandArgs>.GetCommandState(InvokeSignatureHelpCommandArgs args, Func<CommandState> nextHandler)
ViewHostingControl.cs (2)
20private readonly Func<ITextBuffer> _createBuffer; 27Func<ITextBuffer> createBuffer)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Internal\NavigateTo\FSharpNavigateToSearchService.cs (1)
55Func<Task> onProjectCompleted,
Microsoft.CodeAnalysis.Features (22)
EditAndContinue\DebuggingSession.cs (1)
955public void SetTelemetryLogger(Action<FunctionId, LogMessage> logger, Func<int> getNextId)
EditAndContinue\DebuggingSessionTelemetry.cs (1)
72public static void Log(Data data, Action<FunctionId, LogMessage> log, Func<int> getNextId)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (2)
31private readonly AsyncBatchingWorkQueue<Func<Task>> _eventProcessingQueue; 72private async ValueTask ProcessWorkQueueAsync(ImmutableSegmentedList<Func<Task>> list, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (1)
57Func<Task> onProjectCompleted,
ExternalAccess\Watch\Api\WatchHotReloadService.cs (2)
21internal sealed class WatchHotReloadService(SolutionServices services, Func<ValueTask<ImmutableArray<string>>> capabilitiesProvider) 23private sealed class DebuggerService(Func<ValueTask<ImmutableArray<string>>> capabilitiesProvider) : IManagedHotReloadService
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (2)
66Func<Task> onProjectCompleted, 106Func<Task> onProjectCompleted,
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (2)
27Func<Task> onProjectCompleted, 65Func<Task> onProjectCompleted,
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (2)
152Func<Task> onProjectCompleted, 192Func<Task> onProjectCompleted,
NavigateTo\INavigateToSearchService.cs (3)
43Func<Task> onProjectCompleted, 70Func<Task> onProjectCompleted, 88Func<Task> onProjectCompleted,
NavigateTo\IRemoteNavigateToSearchService.cs (1)
52Func<Task>? onProjectCompleted,
NavigateTo\NavigateToSearcher.cs (2)
349Func<INavigateToSearchService, ImmutableArray<Project>, Func<ImmutableArray<INavigateToSearchResult>, Task>, Func<Task>, Task> processProjectAsync, 534public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
170var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<int>), ContainingNamespace.Name: nameof(System) }
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (2)
467FileInfo databaseFileInfo, XElement patchElement, Func<byte[]> getDatabaseBytes, CancellationToken cancellationToken) 491FileInfo databaseFileInfo, XElement patchElement, Func<byte[]> getDatabaseBytes, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\MockCompilationOutputs.cs (2)
15public Func<Stream?>? OpenAssemblyStreamImpl { get; set; } 16public Func<Stream?>? OpenPdbStreamImpl { get; set; }
EditAndContinue\MockManagedEditAndContinueDebuggerService.cs (2)
19public Func<ImmutableArray<ManagedActiveStatementDebugInfo>>? GetActiveStatementsImpl; 20public Func<ImmutableArray<string>>? GetCapabilitiesImpl;
Microsoft.CodeAnalysis.InteractiveHost (7)
Interactive\Core\InteractiveHost.Service.cs (4)
33private readonly Func<Func<object>, object> _invokeOnMainThread; 119private Service(Func<Func<object>, object> invokeOnMainThread) 219public static async Task RunServerAsync(string pipeName, int clientProcessId, Func<Func<object>, object> invokeOnMainThread) 752return (Task<ScriptState<object>>)_invokeOnMainThread((Func<Task<ScriptState<object>>>)(async () =>
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Extensions\Extensions.cs (1)
124Func<T> defaultGetter)
Protocol\SumType.cs (3)
154public TResult Match<TResult>(Func<T1, TResult> firstMatch, Func<T2, TResult> secondMatch, Func<TResult>? defaultMatch = null) 427public TResult Match<TResult>(Func<T1, TResult> firstMatch, Func<T2, TResult> secondMatch, Func<T3, TResult> thirdMatch, Func<TResult>? defaultMatch = null) 798public TResult Match<TResult>(Func<T1, TResult> firstMatch, Func<T2, TResult> secondMatch, Func<T3, TResult> thirdMatch, Func<T4, TResult> fourthMatch, Func<TResult>? defaultMatch = null)
Microsoft.CodeAnalysis.PooledObjects.Package (6)
PooledDelegates.cs (6)
169/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 412protected override Func<TResult> Bind()
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\NavigateToSearch\RemoteNavigateToSearchService.cs (1)
31private (Func<ImmutableArray<RoslynNavigateToItem>, VoidResult, CancellationToken, Task> onItemsFound, Func<Task> onProjectCompleted) GetCallbacks(
Services\ProcessTelemetry\RemoteProcessTelemetryService.cs (1)
92private static void SetRoslynLogger<T>(ImmutableArray<string> loggerTypes, Func<T> creator) where T : ILogger
Microsoft.CodeAnalysis.Test.Utilities (16)
Compilation\CompilationExtensions.cs (1)
269public static void ValidateIOperations(Func<Compilation> createCompilation)
Compilation\ControlFlowGraphVerifier.cs (6)
362Func<string> finalGraph = () => stringBuilder.ToString(); 380void verifyCaptures(Func<string> finalGraph) 457void verifyLeftRegions(BasicBlock block, PooledHashSet<CaptureId> longLivedIds, PooledHashSet<CaptureId> referencedIds, ArrayBuilder<ControlFlowRegion> regions, Func<string> finalGraph) 771PooledHashSet<CaptureId> longLivedIds, PooledHashSet<CaptureId> referencedIds, Func<string> finalGraph) 1646void validateLifetimeOfReferences(BasicBlock block, Func<string> finalGraph) 1787private static void AssertTrueWithGraph([DoesNotReturnIf(false)] bool value, string message, Func<string> finalGraph)
Compilation\TestDesktopStrongNameProvider.cs (1)
25internal Func<IClrStrongName> GetStrongNameInterfaceFunc { get; set; }
LazyToString.cs (2)
13private readonly Func<object> _evaluator; 15public LazyToString(Func<object> evaluator)
Mocks\TestStream.cs (2)
17private readonly Func<long> _getPosition; 28Func<long> getPosition = null,
ObjectReference.cs (1)
29public static ObjectReference<T> CreateFromFactory<T>(Func<T> targetFactory) where T : class
SourceGeneration\TestGenerators.cs (3)
84Func<ImmutableArray<(string hintName, SourceText? sourceText)>> computeSourceTexts) 92public CallbackGenerator(Action<GeneratorInitializationContext> onInit, Action<GeneratorExecutionContext> onExecute, Func<(string hintName, string? source)> computeSource) 103public CallbackGenerator(Func<(string hintName, string? source)> computeSource)
Microsoft.CodeAnalysis.Threading.Package (6)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
169/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 412protected override Func<TResult> Bind()
Microsoft.CodeAnalysis.UnitTests (8)
Collections\ImmutablesTestBase.cs (2)
201private readonly Func<string> _generator; 203internal DeferredToString(Func<string> generator)
Collections\SegmentedCollectionsMarshalTests.cs (2)
699static void test<TValue>(Func<TValue> createValue) 766static void test<T>(Func<T> createValue)
CommonCommandLineParserTests.cs (1)
51private void VerifyRuleSetError(string source, Func<string> messageFormatter, bool locSpecific = true, params string[] otherSources)
MetadataReferences\MetadataReferenceTests.cs (1)
587Assert.Throws<BadImageFormatException>((Func<object>)((AssemblyMetadata)r.GetMetadataNoCopy()).GetAssembly);
ResourceDescriptionTests.cs (1)
19Func<Stream> data = () => null;
Text\StringTextDecodingTests.cs (1)
40Func<Encoding> getEncoding,
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Source\SourcePropertySymbol.vb (1)
361Dim getErrorInfo As Func(Of DiagnosticInfo) = Nothing
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
ExpressionTrees\Sources\ExprLambdaUtils.vb (1)
17Public Shared Sub Check(Of T)(e As Expression(Of Func(Of T)), expected As String)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Semantics\NameLengthTests.vb (1)
525Dim dataProvider As Func(Of Stream) = Function() New System.IO.MemoryStream()
Microsoft.CodeAnalysis.Workspaces (30)
ExtensionManager\IExtensionManagerExtensions.cs (2)
33Func<T> function, 51Func<Task?> function)
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
60private Task CreateWorkAsync(Func<Task> createWorkAsync, CancellationToken cancellationToken)
Shared\Utilities\IOUtilities.cs (2)
25public static T PerformIO<T>(Func<T> function, T defaultValue = default) 38public static async Task<T> PerformIOAsync<T>(Func<Task<T>> function, T defaultValue = default)
Shared\Utilities\IWorkspaceThreadingService.cs (1)
30TResult Run<TResult>(Func<Task<TResult>> asyncMethod);
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
169/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 412protected override Func<TResult> Bind()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 91private Func<string>? _messageGetter; 93public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Storage\SQLite\v2\SQLitePersistentStorage_Threading.cs (1)
22using var _ = PooledDelegates.GetPooledFunction(func, arg, out var boundFunction);
Workspace\IsolatedAnalyzerReferenceSet.Core.cs (1)
221Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
Workspace\IsolatedAnalyzerReferenceSet.cs (1)
39Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
Workspace\Solution\SolutionCompilationState.cs (1)
56private static readonly Func<ConditionalWeakTable<ISymbol, OriginatingProjectInfo?>> s_createTable = () => new();
Workspace\Workspace.cs (1)
603protected internal async Task<T> ScheduleTask<T>(Func<T> func, string? taskName = "Workspace.Task")
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
106private async Task<TResult> DoOperationAndReportProgressAsync<TResult>(ProjectLoadOperation operation, string? projectPath, string? targetFramework, Func<Task<TResult>> doFunc)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (18)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
207public V GetOrAdd(K key, Func<V> creator)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Compilers\Core\Portable\InternalUtilities\RoslynLazyInitializer.cs (4)
17/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, Func{T})"/> 18public static T EnsureInitialized<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 25/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, ref bool, ref object, Func{T})"/> 26public static T EnsureInitialized<T>([NotNull] ref T? target, ref bool initialized, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory)
src\Compilers\Core\Portable\InternalUtilities\UICultureUtilities.cs (2)
174public static Func<T> WithCurrentUICulture<T>(Func<T> func)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
169/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 198public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 199=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 202/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 410: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 412protected override Func<TResult> Bind()
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
MSBuildWorkspaceTestBase.cs (1)
195protected static async Task AssertThrowsExceptionForInvalidPath(Func<Task> testCode)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Remote\InProcRemostHostClient.cs (3)
155private readonly Dictionary<ServiceMoniker, Func<object>> _inProcBrokeredServicesMap = []; 222public void RegisterInProcBrokeredService(ServiceDescriptor serviceDescriptor, Func<object> serviceFactory) 235if (_inProcBrokeredServicesMap.TryGetValue(descriptor.Moniker, out var inProcFactory))
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
UtilityTest\AsyncLazyTests.cs (1)
199var lazy = AsyncLazy.Create(static (cancellationTokenSource, c) => Task.Run((Func<object>)(() =>
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
178new PredefinedTypeInfo(PredefinedType.PT_FUNC, typeof(Func<>), "System.Func`1")
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
GeneralTests.cs (1)
190Func<bool> action = () => defaultLeft.Equals(defaultRight);
Microsoft.DotNet.Helix.Sdk (4)
AzureDevOpsTask.cs (4)
84protected async Task RetryAsync(Func<Task> function) 104protected async Task<T> RetryAsync<T>(Func<Task<T>> function) 192public Task<T> RetryAsync<T>(Func<Task<T>> function, Action<Exception> logRetry, 198public async Task<T> RetryAsync<T>(Func<Task<T>> function, Action<Exception> logRetry,
Microsoft.DotNet.Helix.Sdk.Tests (2)
InstallDotNetToolTests.cs (2)
55.Setup(x => x.DirectoryMutexExec(It.IsAny<Func<bool>>(), It.IsAny<string>())) 56.Callback<Func<bool>, string>((function, path) => {
Microsoft.DotNet.RemoteExecutor (3)
RemoteExecutor.cs (3)
191public static RemoteInvokeHandle Invoke(Func<Task<int>> method, RemoteInvokeOptions options = null) 259public static RemoteInvokeHandle Invoke(Func<Task> method, RemoteInvokeOptions options = null) 327public static RemoteInvokeHandle Invoke(Func<int> method, RemoteInvokeOptions options = null)
Microsoft.DotNet.SignCheckLibrary (1)
Utils.cs (1)
138public static (bool, string, string) CaptureConsoleOutput(Func<bool> action)
Microsoft.DotNet.XUnitAssert.Tests (8)
ExceptionAssertsTests.cs (7)
91 Assert.Throws<ArgumentNullException>("testCode", () => Assert.Throws(typeof(Exception), default(Func<object>)!)); 244 Assert.Throws<ArgumentNullException>("testCode", () => Assert.Throws<ArgumentException>(default(Func<object>)!)); 413 Assert.Throws<ArgumentNullException>("testCode", () => Assert.Throws<ArgumentException>(default(Func<object>)!)); 561 Assert.Throws<ArgumentNullException>("testCode", () => Assert.ThrowsAny<ArgumentException>(default(Func<object>)!)); 632 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.ThrowsAnyAsync<ArgumentException>(default(Func<Task>)!)); 691 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.ThrowsAsync<ArgumentException>(default(Func<Task>)!)); 760 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.ThrowsAsync<ArgumentException>("paramName", default(Func<Task>)!));
PropertyAssertsTests.cs (1)
69 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.PropertyChangedAsync(Substitute.For<INotifyPropertyChanged>(), "propertyName", default(Func<Task>)!));
Microsoft.DotNet.XUnitExtensions (3)
src\Microsoft.DotNet.XUnitExtensions.Shared\DiscovererHelpers.cs (1)
53Func<bool> conditionFunc = ConditionalTestDiscoverer.LookupConditionalMember(calleeType, entry);
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (2)
79Func<bool> conditionFunc; 148internal static Func<bool> LookupConditionalMember(Type t, string name)
Microsoft.DotNet.XUnitV3Extensions (3)
src\Microsoft.DotNet.XUnitExtensions.Shared\DiscovererHelpers.cs (1)
53Func<bool> conditionFunc = ConditionalTestDiscoverer.LookupConditionalMember(calleeType, entry);
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (2)
79Func<bool> conditionFunc; 148internal static Func<bool> LookupConditionalMember(Type t, string name)
Microsoft.Extensions.AI.Evaluation.Console (5)
Utilities\LoggerExtensions.cs (5)
64Func<TResult> action, 109Func<Task> action, 128Func<ValueTask> action, 187Func<Task<TResult>> action, 209Func<ValueTask<TResult>> action,
Microsoft.Extensions.AI.Evaluation.Reporting (5)
Storage\DiskBasedResponseCache.cs (3)
31private readonly Func<DateTime> _provideDateTime; 37Func<DateTime> provideDateTime) 289Func<DateTime> provideDateTime,
Storage\DiskBasedResponseCacheProvider.cs (2)
25private readonly Func<DateTime> _provideDateTime = () => DateTime.UtcNow; 30internal DiskBasedResponseCacheProvider(string storageRootPath, Func<DateTime> provideDateTime)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (5)
Storage\AzureStorageResponseCache.cs (3)
32Func<DateTime> provideDateTime, 45private readonly Func<DateTime> _provideDateTime = provideDateTime; 200Func<DateTime> provideDateTime,
Storage\AzureStorageResponseCacheProvider.cs (2)
33private readonly Func<DateTime> _provideDateTime = () => DateTime.Now; 40Func<DateTime> provideDateTime,
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (3)
AzureStorage\AzureResponseCacheTests.cs (1)
53internal override IResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime)
DiskBased\DiskBasedResponseCacheTests.cs (1)
51internal override IResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime)
ResponseCacheTester.cs (1)
23internal abstract IResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime);
Microsoft.Extensions.AI.Tests (6)
ChatCompletion\DistributedCachingChatClientTest.cs (3)
703=> ToAsyncEnumerableAsync(preTask, valueFactories.Select<T, Func<T>>(v => () => v)); 705private static async IAsyncEnumerable<T> ToAsyncEnumerableAsync<T>(Task preTask, IEnumerable<Func<T>> values) 709foreach (var value in values)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
539async Task InvokeAsync(Func<Task> work) 721async Task InvokeAsync(Func<Task<List<ChatMessage>>> work)
Functions\AIFunctionFactoryTest.cs (1)
145Func<string> dotnetFunc = () => "test";
Microsoft.Extensions.AmbientMetadata.Application.Tests (5)
ApplicationMetadataExtensionsTests.cs (2)
54var act = () => new ConfigurationBuilder().AddApplicationMetadata(_hostEnvironment.Object, sectionName!); 65var act = () => FakeHost.CreateBuilder().UseApplicationMetadata(sectionName!);
ApplicationMetadataSourceTests.cs (2)
34var act = () => new ApplicationMetadataSource(null!, _fixture.Create<string>()); 46var act = () => new ApplicationMetadataSource(_hostEnvironment.Object, sectionName!);
ApplicationMetadataValidatorTests.cs (1)
14var act = () => _ = new ApplicationMetadataValidator();
Microsoft.Extensions.AsyncState.Tests (1)
AsyncContextTests.cs (1)
232Func<Task?> setAsyncState = async () =>
Microsoft.Extensions.Caching.MicroBenchmarks (4)
DistributedCacheBenchmarks.cs (4)
130Func<Task<byte[]?>> callback = () => _backend.GetAsync(RandomKey()); 158Func<Task<byte[]?>> callback = () => _backend.GetAsync(RandomKey()); 185Func<Task<byte[]?>> callback = () => _backend.GetAsync(FixedKey()); 212Func<Task<byte[]?>> callback = () => _backend.GetAsync(FixedKey());
Microsoft.Extensions.Caching.StackExchangeRedis (2)
RedisCacheOptions.cs (2)
32public Func<Task<IConnectionMultiplexer>>? ConnectionMultiplexerFactory { get; set; } 43public Func<ProfilingSession>? ProfilingSession { get; set; }
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (1)
TimeExpirationAsyncTests.cs (1)
20static async Task ThrowsArgumentOutOfRangeAsync(Func<Task> test, string paramName, string message, object actualValue)
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Classification\DataClassificationTypeConverterTests.cs (1)
141var act = () => converter.ConvertFrom(null, null, input!);
Microsoft.Extensions.Configuration.Binder (2)
BindingPoint.cs (2)
11private readonly Func<object?>? _initialValueProvider; 22public BindingPoint(Func<object?> initialValueProvider, bool isReadOnly)
Microsoft.Extensions.DependencyModel (2)
DependencyContextLoader.cs (2)
20private readonly Func<IDependencyContextReader> _jsonReaderFactory; 34Func<IDependencyContextReader> jsonReaderFactory)
Microsoft.Extensions.Diagnostics.HealthChecks (4)
DependencyInjection\HealthChecksBuilderDelegateExtensions.cs (4)
31Func<HealthCheckResult> check, 50Func<HealthCheckResult> check, 117Func<Task<HealthCheckResult>> check, 136Func<Task<HealthCheckResult>> check,
Microsoft.Extensions.Diagnostics.ResourceMonitoring (9)
Windows\WindowsContainerSnapshotProvider.cs (3)
26private readonly Func<IJobHandle> _createJobHandleObject; 71Func<IJobHandle> createJobHandleObject, 185private double MemoryPercentage(Func<ulong> getMemoryUsage)
Windows\WindowsSnapshotProvider.cs (6)
28private readonly Func<long> _getCpuTicksFunc; 29private readonly Func<long> _getMemoryUsageFunc; 53Func<int> getCpuUnitsFunc, 54Func<long> getCpuTicksFunc, 55Func<long> getMemoryUsageFunc, 56Func<ulong> getTotalMemoryInBytesFunc)
Microsoft.Extensions.FileProviders.Physical (2)
PhysicalFileProvider.cs (1)
31private readonly Func<PhysicalFilesWatcher> _fileWatcherFactory;
PhysicalFilesWatcher.cs (1)
40private readonly Func<Timer> _timerFactory;
Microsoft.Extensions.Hosting (4)
HostApplicationBuilder.cs (1)
28private Func<IServiceProvider> _createServiceProvider;
HostBuilder.cs (1)
298Func<IServiceProvider> serviceProviderGetter)
Internal\ServiceFactoryAdapter.cs (2)
13private readonly Func<HostBuilderContext>? _contextResolver; 23public ServiceFactoryAdapter(Func<HostBuilderContext> contextResolver, Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factoryResolver)
Microsoft.Extensions.Http (5)
DefaultTypedHttpClientFactory.cs (1)
38private static readonly Func<ObjectFactory> _createActivator = () =>
DependencyInjection\HttpClientBuilderExtensions.cs (4)
74public static IHttpClientBuilder AddHttpMessageHandler(this IHttpClientBuilder builder, Func<DelegatingHandler> configureHandler) 154public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler(this IHttpClientBuilder builder, Func<HttpMessageHandler> configureHandler) 280/// <see cref="ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func{HttpMessageHandler})"/> or 317/// <see cref="ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func{HttpMessageHandler})"/> or
Microsoft.Extensions.Http.Diagnostics.Tests (18)
Latency\HttpClientLatencyTelemetryExtensionsTest.cs (1)
23var act = () => ((IServiceCollection)null!).AddHttpClientLatencyTelemetry();
Logging\HttpClientLoggerTest.cs (6)
72var act = async () => 107var act = async () => 150var act = async () => 436var act = () => client.SendAsync(httpRequestMessage, CancellationToken.None); 551var act = async () => await client 819var act = () => client.SendAsync(httpRequestMessage, CancellationToken.None);
Logging\HttpClientLoggingExtensionsTest.cs (5)
37var act = () => ((IHttpClientBuilder)null!).AddExtendedHttpClientLogging(); 56var act = () => ((IServiceCollection)null!).AddExtendedHttpClientLogging(); 75var act = () => ((IServiceCollection)null!).AddHttpClientLogEnricher<EmptyEnricher>(); 215var act = async () => await host.StartAsync().ConfigureAwait(false); 324var act = () =>
Logging\HttpRequestBodyReaderTest.cs (1)
113var act = async () =>
Logging\HttpResponseBodyReaderTest.cs (4)
34var act = () => new HttpResponseBodyReader(null!); 136var act = async () => await httpResponseBodyReader.ReadAsync(httpResponse, token); 199var act = async () => await responseStream.ReadAsync(buffer, 0, BodySize, cts.Token); 255var act = async () => await httpResponseBodyReader.ReadAsync(httpResponse, token);
Logging\LoggingOptionsValidatorTest.cs (1)
16var act = () => _ = new LoggingOptionsValidator();
Microsoft.Extensions.Http.Polly.Tests (1)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (1)
559public Func<Exception> CreateException { get; set; } = () => new OverflowException();
Microsoft.Extensions.Http.Resilience (4)
Routing\Internal\RequestRoutingOptions.cs (1)
10public Func<RequestRoutingStrategy>? RoutingStrategyProvider { get; set; }
Routing\Internal\RoutingResilienceStrategy.cs (2)
18private readonly Func<RequestRoutingStrategy>? _provider; 20public RoutingResilienceStrategy(Func<RequestRoutingStrategy>? provider)
Routing\RoutingStrategyBuilderExtensions.cs (1)
117internal static IRoutingStrategyBuilder ConfigureRoutingStrategy(this IRoutingStrategyBuilder builder, Func<IServiceProvider, Func<RequestRoutingStrategy>> factory)
Microsoft.Extensions.Http.Resilience.Tests (7)
Hedging\HedgingTests.cs (2)
35private readonly Func<RequestRoutingStrategy> _requestRoutingStrategyFactory; 41private protected HedgingTests(Func<IHttpClientBuilder, Func<RequestRoutingStrategy>, TBuilder> createDefaultBuilder)
Hedging\StandardHedgingTests.cs (1)
33private static IStandardHedgingHandlerBuilder ConfigureDefaultBuilder(IHttpClientBuilder builder, Func<RequestRoutingStrategy> factory)
Routing\RoutingResilienceStrategyTests.cs (1)
46private static ResiliencePipeline Create(Func<RequestRoutingStrategy>? provider) =>
Routing\RoutingStrategyTest.cs (3)
43var factory = CreateRoutingFactory(); 140var factory = CreateRoutingFactory(); 150internal Func<RequestRoutingStrategy> CreateRoutingFactory(string? name = null)
Microsoft.Extensions.ObjectPool (1)
DefaultObjectPool.cs (1)
17private readonly Func<T> _createFunc;
Microsoft.Extensions.Options (2)
IOptionsMonitorCache.cs (1)
22TOptions GetOrAdd(string? name, Func<TOptions> createOptions);
OptionsCache.cs (1)
31public virtual TOptions GetOrAdd(string? name, Func<TOptions> createOptions)
Microsoft.Extensions.Primitives (4)
ChangeToken.cs (4)
20public static IDisposable OnChange(Func<IChangeToken?> changeTokenProducer, Action changeTokenConsumer) 41public static IDisposable OnChange<TState>(Func<IChangeToken?> changeTokenProducer, Action<TState> changeTokenConsumer, TState state) 57private readonly Func<IChangeToken?> _changeTokenProducer; 64public ChangeTokenRegistration(Func<IChangeToken?> changeTokenProducer, Action<TState> changeTokenConsumer, TState state)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (6)
DnsServicePublicApiTests.cs (6)
17var action = () => services.AddDnsSrvServiceEndpointProvider(); 29var action = () => services.AddDnsSrvServiceEndpointProvider(configureOptions); 41var action = () => services.AddDnsSrvServiceEndpointProvider(configureOptions); 52var action = () => services.AddDnsServiceEndpointProvider(); 64var action = () => services.AddDnsServiceEndpointProvider(configureOptions); 76var action = () => services.AddDnsServiceEndpointProvider(configureOptions);
Microsoft.Extensions.ServiceDiscovery.Tests (16)
ExtensionsServicePublicApiTests.cs (15)
24var action = () => httpClientBuilder.AddServiceDiscovery(); 35var action = () => services.AddServiceDiscovery(); 47var action = () => services.AddServiceDiscovery(configureOptions); 59var action = () => services.AddServiceDiscovery(configureOptions); 70var action = () => services.AddServiceDiscoveryCore(); 82var action = () => services.AddServiceDiscoveryCore(configureOptions); 94var action = () => services.AddServiceDiscoveryCore(configureOptions); 105var action = () => services.AddConfigurationServiceEndpointProvider(); 117var action = () => services.AddConfigurationServiceEndpointProvider(configureOptions); 129var action = () => services.AddConfigurationServiceEndpointProvider(configureOptions); 140var action = () => services.AddPassThroughServiceEndpointProvider(); 158var action = async () => await serviceEndpointResolver.GetEndpointsAsync(serviceName, CancellationToken.None); 169var action = () => ServiceEndpoint.Create(endPoint); 200var action = () => new ServiceEndpointSource(endpoints, changeToken, features); 213var action = () => new ServiceEndpointSource(endpoints, changeToken, features);
ServiceEndpointResolverTests.cs (1)
77private sealed class FakeEndpointResolver(Func<IServiceEndpointBuilder, CancellationToken, ValueTask> resolveAsync, Func<ValueTask> disposeAsync) : IServiceEndpointProvider
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (3)
YarpServiceDiscoveryPublicApiTests.cs (3)
18var action = () => builder.AddServiceDiscoveryDestinationResolver(); 29var action = () => services.AddHttpForwarderWithServiceDiscovery(); 40var action = () => services.AddServiceDiscoveryForwarderFactory();
Microsoft.Extensions.Telemetry.Tests (7)
Logging\TestConfiguration.cs (3)
14private Func<string> _json; 16public TestConfiguration(JsonConfigurationSource source, Func<string> json) 22public static ConfigurationRoot Create(Func<string> getJson)
Sampling\SamplingLoggerBuilderExtensionsTests.cs (4)
269Func<ILoggingBuilder> action = () => SamplingLoggerBuilderExtensions.AddTraceBasedSampler(builder!); 272Func<ILoggingBuilder> action2 = () => SamplingLoggerBuilderExtensions.AddRandomProbabilisticSampler(builder!, 1.0); 275Func<ILoggingBuilder> action3 = () => SamplingLoggerBuilderExtensions.AddSampler<MySampler>(builder!); 278Func<ILoggingBuilder> action4 = () => SamplingLoggerBuilderExtensions.AddSampler(builder!, new MySampler());
Microsoft.Extensions.WebEncoders (1)
EncoderServiceCollectionExtensions.cs (1)
61Func<TService> defaultFactory,
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesExtensions.cs (1)
33private Func<int>? FuncBase { get; set; } // Not supposed to be logged (delegate type)
Microsoft.Maui (8)
Dispatching\DispatcherExtensions.cs (4)
19 public static Task<T> DispatchAsync<T>(this IDispatcher dispatcher, Func<T> func) 59 public static Task<T> DispatchAsync<T>(this IDispatcher dispatcher, Func<Task<T>> funcTask) 85 public static Task DispatchAsync(this IDispatcher dispatcher, Func<Task> funcTask) => 108 public static void StartTimer(this IDispatcher dispatcher, TimeSpan interval, Func<bool> callback)
Fonts\FileSystemEmbeddedFontLoader.cs (2)
13 readonly Func<string>? _getRootPath; 36 private protected FileSystemEmbeddedFontLoader(Func<string> getRootPath, IServiceProvider? serviceProvider = null)
Hosting\MauiAppBuilder.cs (1)
18 private Func<IServiceProvider>? _createServiceProvider;
Platform\ImageSourcePartLoader.cs (1)
43 public ImageSourcePartLoader(IElementHandler handler, Func<IImageSourcePart?> imageSourcePart, Action<PlatformImage?> setImage)
Microsoft.Maui.Controls (64)
Animation.cs (1)
71 public void Commit(IAnimatable owner, string name, uint rate = 16, uint length = 250, Easing easing = null, Action<double, bool> finished = null, Func<bool> repeat = null)
AnimationExtensions.cs (7)
137 Func<bool> repeat = null) 143 Func<bool> r = () => 156 Action<double, bool> finished = null, Func<bool> repeat = null) 163 Func<bool> repeat = null) 172 Action<T, bool> finished = null, Func<bool> repeat = null, IAnimationManager animationManager = null) 256 uint rate, uint length, Easing easing, Action<T, bool> finished, Func<bool> repeat) 390 public Func<bool> Repeat;
BoundsConstraint.cs (4)
13 Func<Rect> _measureFunc; 23 public static BoundsConstraint FromExpression(Expression<Func<Rect>> expression, IEnumerable<View> parents = null) 28 internal static BoundsConstraint FromExpression(Expression<Func<Rect>> expression, bool fromExpression, IEnumerable<View> parents = null) 30 Func<Rect> compiled = expression.Compile();
Command.cs (1)
96 public Command(Action execute, Func<bool> canExecute) : this(o => execute(), o => canExecute())
ControlTemplate.cs (1)
23 public ControlTemplate(Func<object> createTemplate) : base(createTemplate)
DataTemplate.cs (1)
34 public DataTemplate(Func<object> loadTemplate) : base(loadTemplate)
Device.cs (4)
95 public static Task<T> InvokeOnMainThreadAsync<T>(Func<T> func) => 105 public static Task<T> InvokeOnMainThreadAsync<T>(Func<Task<T>> funcTask) => 110 public static Task InvokeOnMainThreadAsync(Func<Task> funcTask) => 134 public static void StartTimer(TimeSpan interval, Func<bool> callback)
DispatcherExtensions.cs (1)
77 public static Task DispatchIfRequiredAsync(this IDispatcher? dispatcher, Func<Task> action)
ElementTemplate.cs (2)
36 internal ElementTemplate(Func<object> loadTemplate) : this() => LoadTemplate = loadTemplate ?? throw new ArgumentNullException(nameof(loadTemplate)); 38 public Func<object> LoadTemplate { get; set; }
Hosting\Effects\AppHostBuilderExtensions.cs (4)
72 internal Dictionary<Type, Func<PlatformEffect>> RegisteredEffects { get; } = new Dictionary<Type, Func<PlatformEffect>>(); 103 private readonly Dictionary<Type, Func<PlatformEffect>> _registeredEffects; 120 if (_registeredEffects != null && _registeredEffects.TryGetValue(fromEffect.GetType(), out Func<PlatformEffect> effectType))
ImageSource.cs (1)
89 public static ImageSource FromStream(Func<Stream> stream)
Interactivity\PropertyCondition.cs (2)
38 Func<MemberInfo> minforetriever = () => 68 Func<MemberInfo> minforetriever = () =>
IValueConverterProvider.cs (1)
11 object Convert(object value, Type toType, Func<MemberInfo> minfoRetriever, IServiceProvider serviceProvider);
LegacyLayouts\Constraint.cs (2)
28 public static Constraint FromExpression(Expression<Func<double>> expression) 30 Func<double> compiled = expression.Compile();
LegacyLayouts\RelativeLayout.cs (18)
279 Func<double> x; 289 Func<double> y; 299 Func<double> width; 300 Func<double> height = null; 343 void Add(T view, Expression<Func<Rect>> bounds); 345 void Add(T view, Expression<Func<double>> x = null, Expression<Func<double>> y = null, Expression<Func<double>> width = null, Expression<Func<double>> height = null); 359 public void Add(View view, Expression<Func<Rect>> bounds) 368 public void Add(View view, Expression<Func<double>> x = null, Expression<Func<double>> y = null, Expression<Func<double>> width = null, Expression<Func<double>> height = null) 370 Func<double> xCompiled = x != null ? x.Compile() : () => 0; 371 Func<double> yCompiled = y != null ? y.Compile() : () => 0; 373 Func<double> widthCompiled = width != null ? width.Compile() : () => view.Measure(Parent.Width, Parent.Height, MeasureFlags.IncludeMargins).Request.Width; 374 Func<double> heightCompiled = height != null ? height.Compile() : () => view.Measure(Parent.Width, Parent.Height, MeasureFlags.IncludeMargins).Request.Height;
Shell\Shell.cs (1)
1792 Func<T> defaultValue,
Shell\ShellNavigatingEventArgs.cs (2)
13 Func<Task> _deferralFinishedTask; 108 internal void RegisterDeferralCompletedCallBack(Func<Task> deferralFinishedTask)
Shell\ShellNavigationManager.cs (1)
365 Func<Task> navigationTask = () => GoToAsync(navArgs.Target, navArgs.Animate, false, navArgs);
ShellToolbar.cs (1)
101 Func<bool> getDefaultNavBarIsVisible = () =>
StyleSheets\Style.cs (1)
98 Func<MemberInfo> minforetriever =
Xaml\TypeConversionExtensions.cs (7)
45 internal static object ConvertTo(this object value, Type toType, Func<ParameterInfo> pinfoRetriever, 48 Func<TypeConverter> getConverter = () => 62 internal static object ConvertTo(this object value, Type toType, Func<MemberInfo> minfoRetriever, 65 Func<TypeConverter> getConverter = () => 118 ret = value.ConvertTo(toType, (Func<TypeConverter>)null, serviceProvider, out exception); 123 Func<TypeConverter> getConverter = () => (TypeConverter)Activator.CreateInstance(convertertype); 130 internal static object ConvertTo(this object value, Type toType, Func<TypeConverter> getConverter,
Xaml\ValueConverterProvider.cs (1)
13 public object Convert(object value, Type toType, Func<MemberInfo> minfoRetriever, IServiceProvider serviceProvider)
Microsoft.Maui.Controls.Build.Tasks (1)
SetPropertiesVisitor.cs (1)
764 static IEnumerable<Instruction> DigProperties(IEnumerable<(PropertyDefinition property, TypeReference propDeclTypeRef, string indexArg)> properties, Dictionary<TypeReference, VariableDefinition> locs, Func<Instruction> fallback, IXmlLineInfo lineInfo, ModuleDefinition module)
Microsoft.Maui.Controls.Xaml (5)
ApplyPropertiesVisitor.cs (4)
174 addMethod.Invoke(source, new[] { value.ConvertTo(addMethod.GetParameters()[0].ParameterType, (Func<TypeConverter>)null, new XamlServiceProvider(node, Context), out xpe) }); 587 Func<MemberInfo> minforetriever; 753 addMethod.Invoke(collection, new[] { value.ConvertTo(addMethod.GetParameters()[0].ParameterType, (Func<TypeConverter>)null, serviceProvider, out exception) }); 821 addMethod.Invoke(collection, new[] { value.ConvertTo(addMethod.GetParameters()[0].ParameterType, (Func<TypeConverter>)null, serviceProvider, out exception) });
MarkupExtensionParser.cs (1)
100 (Func<TypeConverter>)null, serviceProvider, out Exception converterException);
Microsoft.Maui.Essentials (3)
MainThread\MainThread.shared.cs (3)
71 public static Task<T> InvokeOnMainThreadAsync<T>(Func<T> func) 101 public static Task InvokeOnMainThreadAsync(Func<Task> funcTask) 133 public static Task<T> InvokeOnMainThreadAsync<T>(Func<Task<T>> funcTask)
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (2)
src\Graphics\src\Graphics\Platforms\Windows\AsyncPump.cs (2)
27 public static void Run(Func<Task> func) 58 public static T Run<T>(Func<Task<T>> asyncMethod)
Microsoft.Maui.Resizetizer (3)
AsyncTaskExtensions.cs (1)
47 public static Task<TSource> RunTask<TSource>(this MauiAsyncTask asyncTask, Func<TSource> body) =>
SkiaSharpAppIconTools.cs (2)
38 public ResizedImageInfo Resize(DpiPath dpi, string destination, Func<Stream>? getStream = null) 63 void Save(SKBitmap tempBitmap, string destination, Func<Stream>? getStream)
Microsoft.ML.AutoML.Tests (3)
AutoMLExperimentTests.cs (3)
57var runExperimentAction = async () => await experiment.RunAsync(cts.Token); 87var runExperimentAction = async () => await experiment.RunAsync(); 114var runExperimentAction = async () => await experiment.RunAsync();
Microsoft.ML.Core (12)
Data\ServerChannel.cs (2)
90public void Register<TRet>(string name, Func<TRet> func) 223/// some variety of <see cref="Func{TResult}"/>, <see cref="Func{T1, TResult}"/>,
Utilities\FuncInstanceMethodInfo1`2.cs (4)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{TResult}"/>, 31public FuncInstanceMethodInfo1(Func<TResult> function) 56public static FuncInstanceMethodInfo1<TTarget, TResult> Create(Expression<Func<TTarget, Func<TResult>>> expression) 74Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncMethodInfo1`1.cs (1)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{TResult}"/>,
Utilities\FuncStaticMethodInfo1`1.cs (2)
14/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{TResult}"/>, 26public FuncStaticMethodInfo1(Func<TResult> function)
Utilities\ObjectPool.cs (2)
23private readonly Func<T> _maker; 25public MadeObjectPool(Func<T> maker)
Utilities\Utils.cs (1)
1198/// <see cref="Action"/> instead of <see cref="Func{TRet}"/>.
Microsoft.ML.Core.Tests (13)
UnitTests\CoreBaseTestClass.cs (13)
29protected Func<bool> GetIdComparer(DataViewRow r1, DataViewRow r2, out ValueGetter<DataViewRowId> idGetter) 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) 83protected Func<bool> GetColumnComparer(DataViewRow r1, DataViewRow r2, int col, DataViewType type, bool exactDoubles) 250Func<bool>[] comps = new Func<bool>[colLim]; 269Func<bool> idComp = checkId ? GetIdComparer(curs1, curs2, out idGetter) : null; 309var comp = comps[col]; 341Func<bool>[] comps = new Func<bool>[colLim]; 343Func<bool>[] idComps = new Func<bool>[cursors.Length]; 381var comp = comps[col];
Microsoft.ML.CpuMath (3)
AlignedMatrix.cs (2)
129public void Randomize(Func<float> rand) 356public void Randomize(Func<float> rand)
ICpuBuffer.cs (1)
20void Randomize(Func<T> rand);
Microsoft.ML.Data (35)
Commands\CrossValidationCommand.cs (3)
187Func<IDataView> validDataCreator = null; 365private readonly Func<IDataView> _getValidationDataView; 394Func<IDataView> getValidationDataView = null,
Data\RowCursorUtils.cs (4)
22private static readonly FuncStaticMethodInfo1<DataViewRow, int, Func<bool>> _getIsNewGroupDelegateCoreMethodInfo 23= new FuncStaticMethodInfo1<DataViewRow, int, Func<bool>>(GetIsNewGroupDelegateCore<int>); 304public static Func<bool> GetIsNewGroupDelegate(DataViewRow cursor, int col) 313private static Func<bool> GetIsNewGroupDelegateCore<T>(DataViewRow cursor, int col)
DataLoadSave\Binary\BinarySaver.cs (4)
749var estimators = new Func<long>[actives.Length]; 755estimators[c] = (Func<long>)args[2]; 776out Func<long> fetchWriteEstimator, out IValueWriter writer); 779out Func<long> fetchWriteEstimator, out IValueWriter writer)
DataView\BatchDataViewMapperBase.cs (4)
67protected abstract Func<bool> GetLastInBatchDelegate(DataViewRowCursor lookAheadCursor); 68protected abstract Func<bool> GetIsNewBatchDelegate(DataViewRowCursor lookAheadCursor); 83private readonly Func<bool> _lastInBatchInLookAheadCursorDel; 84private readonly Func<bool> _firstInBatchInInputCursorDel;
EntryPoints\InputBase.cs (6)
59Func<ITrainer> createTrainer, 60Func<string> getLabel = null, 61Func<string> getWeight = null, 62Func<string> getGroup = null, 63Func<string> getName = null, 64Func<IEnumerable<KeyValuePair<RoleMappedSchema.ColumnRole, string>>> getCustom = null,
Evaluators\AnomalyDetectionEvaluator.cs (1)
129out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Evaluators\BinaryClassifierEvaluator.cs (2)
218out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate) 1176Func<bool> getPredictedLabel;
Evaluators\ClusteringEvaluator.cs (1)
160out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Evaluators\EvaluatorBase.cs (3)
133Func<bool> finishPass = 178Func<Dictionary<string, IDataView>> consolidate; 203out Action<uint, ReadOnlyMemory<char>, TAgg> addAgg, out Func<Dictionary<string, IDataView>> consolidate);
Evaluators\MulticlassClassificationEvaluator.cs (1)
141out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Evaluators\MultiOutputRegressionEvaluator.cs (1)
96out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Evaluators\RankingEvaluator.cs (2)
159out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate) 426private Func<bool> _newGroupDel;
Evaluators\RegressionEvaluatorBase.cs (1)
51out Action<uint, ReadOnlyMemory<char>, TAgg> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Transforms\PerGroupTransformBase.cs (2)
240private readonly Func<bool> _newGroupInGroupCursorDel; 241private readonly Func<bool> _newGroupInInputCursorDel;
Microsoft.ML.FastTree (3)
FastTree.cs (3)
2194Func<FeatureFlockBase> createOneHotFlock = 2198Func<FeatureFlockBase> createNHotFlock = 2210Func<FeatureFlockBase> createFlock =
Microsoft.ML.Predictor.Tests (2)
TestTransposer.cs (2)
106int rowCount, Double density, Random rgen, Func<T> generator, int slotCount, params int[] forceDenseSlot) 139private static T[] GenerateHelper<T>(int rowCount, Double density, Random rgen, Func<T> generator)
Microsoft.ML.TestFramework (13)
DataPipe\TestDataPipeBase.cs (13)
707Func<bool>[] comps = new Func<bool>[colLim]; 726Func<bool> idComp = checkId ? GetIdComparer(curs1, curs2, out idGetter) : null; 767var comp = comps[col]; 799Func<bool>[] comps = new Func<bool>[colLim]; 801Func<bool>[] idComps = new Func<bool>[cursors.Length]; 839var comp = comps[col]; 865protected Func<bool> GetIdComparer(DataViewRow r1, DataViewRow r2, out ValueGetter<DataViewRowId> idGetter) 881protected Func<bool> GetColumnComparer(DataViewRow r1, DataViewRow r2, int col, DataViewType type, bool exactDoubles) 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)
Datasets.cs (1)
28public Func<TextLoader.Column[]> GetLoaderColumns;
Microsoft.ML.Tests (3)
TrainerEstimators\TreeEstimators.cs (3)
1040var action = () => estimator.Fit(dataView); 1094var action = () => trainer.Fit(dataView); 1122var action = () => trainer.Fit(dataView);
Microsoft.ML.TimeSeries (2)
SrCnnEntireAnomalyDetector.cs (2)
234protected override Func<bool> GetIsNewBatchDelegate(DataViewRowCursor input) 239protected override Func<bool> GetLastInBatchDelegate(DataViewRowCursor input)
Microsoft.ML.Tokenizers.Data.Tests (1)
src\Common\tests\RetryHelper.cs (1)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null)
Microsoft.ML.Tokenizers.Tests (1)
src\Common\tests\RetryHelper.cs (1)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null)
Microsoft.ML.TorchSharp (2)
Utils\DefaultDictionary.cs (2)
21private readonly Func<TValue> _init; 24public DefaultDictionary(Func<TValue> init)
Microsoft.ML.Transforms (17)
CustomMappingFilter.cs (2)
94private readonly Func<bool> _accept; 160private readonly Func<bool> _accept;
Expression\BuiltinFunctions.cs (1)
72public static MethodInfo Fn<T1>(Func<T1> fn)
Expression\CodeGen.cs (2)
102private static readonly MethodInfo _methGetFalseBL = ((Func<BL>)BuiltinFunctions.False).GetMethodInfo(); 103private static readonly MethodInfo _methGetTrueBL = ((Func<BL>)BuiltinFunctions.True).GetMethodInfo();
GroupTransform.cs (4)
395private static readonly FuncStaticMethodInfo1<DataViewRow, int, Func<bool>> _makeSameCheckerMethodInfo 396= new FuncStaticMethodInfo1<DataViewRow, int, Func<bool>>(MakeSameChecker<int>); 398public readonly Func<bool> IsSameKey; 400private static Func<bool> MakeSameChecker<T>(DataViewRow row, int col)
PermutationFeatureImportance.cs (1)
25Func<TResult> resultInitializer,
PermutationFeatureImportanceExtensions.cs (1)
656Func<TResult> resultInitializer,
UngroupTransform.cs (6)
448private static readonly FuncInstanceMethodInfo1<Cursor, int, Func<int>> _makeSizeGetterMethodInfo 449= FuncInstanceMethodInfo1<Cursor, int, Func<int>>.Create(target => target.MakeSizeGetter<int>); 473private readonly Func<int>[] _sizeGetters; 489var needed = new List<Func<int>>(); 555foreach (var getter in _sizeGetters) 578private Func<int> MakeSizeGetter<T>(int col)
Microsoft.VisualBasic.Tests (2)
Microsoft\VisualBasic\MyServices\SpecialDirectoriesProxyTests.cs (2)
25private static void VerifySpecialDirectory(Func<string> getExpected, Func<string> getActual)
Microsoft.VisualStudio.LanguageServices (9)
CallHierarchy\CallHierarchyItem.cs (2)
28private readonly Func<ImageSource> _glyphCreator; 36Func<ImageSource> glyphCreator,
ProjectSystem\VisualStudioWorkspaceImpl.cs (4)
90private ImmutableDictionary<ProjectId, Func<string?>> _projectToRuleSetFilePath = ImmutableDictionary<ProjectId, Func<string?>>.Empty; 243internal void AddProjectRuleSetFileToInternalMaps(ProjectSystemProject project, Func<string?> ruleSetFilePathFunc) 280if (_projectToRuleSetFilePath.TryGetValue(projectId, out var ruleSetPathFunc))
Snippets\AbstractSnippetCommandHandler.cs (1)
103public CommandState GetCommandState(AutomaticLineEnderCommandArgs args, Func<CommandState> nextCommandHandler)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
207public V GetOrAdd(K key, Func<V> creator)
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
337Func<ImmutableHashSet<string>> computeDiagnosticIds)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\SnippetCommandHandler.cs (1)
80public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
PersistentStorage\AbstractPersistentStorageTests.cs (1)
909private static void DoSimultaneousReads(Func<Task<string>> read, string expectedValue)
MSBuild (12)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
MSBuildTaskHost (12)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
234[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
Mvc.Api.Analyzers.Test (1)
TestFiles\ApiConventionAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForReturnStatementsInLambdas.cs (1)
18Func<IActionResult> someLambda = () =>
netstandard (1)
netstandard.cs (1)
794[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
PresentationCore (6)
System\Windows\Input\Stylus\Common\RawStylusInputReport.cs (2)
66private Func<StylusPointDescription> _stylusPointDescGenerator; 228Func<StylusPointDescription> stylusPointDescGenerator,
System\Windows\Input\Stylus\Common\RawStylusSystemGestureInputReport.cs (1)
88Func<StylusPointDescription> stylusPointDescGenerator,
System\Windows\Input\Stylus\Pointer\PointerInteractionEngine.cs (3)
314(Func<StylusPointDescription>)null, 351(Func<StylusPointDescription>)null, 444(Func<StylusPointDescription>)null,
PresentationFramework (21)
MS\Internal\WindowsRuntime\Generated\Windows.Data.Text.cs (1)
345public WordsSegmenter(string language) : this(((Func<global::MS.Internal.WindowsRuntime.ABI.Windows.Data.Text.IWordsSegmenter>)(() => {
MS\Internal\WindowsRuntime\Generated\Windows.Globalization.cs (1)
97public Language(string languageTag) : this(((Func<global::MS.Internal.WindowsRuntime.ABI.Windows.Globalization.ILanguage>)(() => {
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (10)
48Func<bool> dispose = () => { m.Dispose(); return false; }; 139Func<bool> dispose = () => { m.Dispose(); return false; }; 200Func<bool> dispose = () => 233Func<bool> dispose = () => { DisposeAbiArrayElements((i, data)); return false; }; 454Func<bool> dispose = () => { m.Dispose(); return false; }; 528Func<bool> dispose = () => 564Func<bool> dispose = () => { DisposeAbiArrayElements((i, data)); return false; }; 636Func<bool> dispose = () => { m.Dispose(); return false; }; 688Func<bool> dispose = () => 722Func<bool> dispose = () => { DisposeAbiArrayElements((i, data)); return false; };
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (2)
19private Func<T> _creationDelegate; 21public XamlContextStack(Func<T> creationDelegate)
System\Windows\Documents\MsSpellCheckLib\SpellCheckerFactory\SpellCheckerCreationHelper.cs (1)
104public bool CreateSpellCheckerRetryPreamble(out Func<RCW.ISpellChecker> func)
System\Windows\Documents\MsSpellCheckLib\Utils\RetryHelper.cs (3)
30internal delegate bool RetryFunctionPreamble<TResult>(out Func<TResult> func); 163Func<TResult> func, 225Func<TResult> func,
System\Windows\FrameworkElementFactory.cs (1)
1269private Func<object> _knownTypeFactory;
System\Windows\Markup\Baml2006\WpfKnownType.cs (2)
35private Func<object> _defaultConstructor; 201public Func<object> DefaultConstructor
Roslyn.VisualStudio.DiagnosticsWindow (1)
OptionPages\PerformanceLoggersPage.cs (1)
96private static void SetRoslynLogger<T>(ImmutableArray<string> loggerTypeNames, Func<T> creator) where T : ILogger
ScenarioTests.Common.Tests (1)
ScenarioTestTypes.cs (1)
269public static void Run(Func<Task> asyncMethod)
SimpleWebSiteWithWebApplicationBuilderException (1)
Program.cs (1)
6app.MapGet("/", (Func<string>)(() => "Hello World"));
Sockets.BindTests (2)
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
76public Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
src\Servers\Kestrel\test\Sockets.FunctionalTests\TransportSelector.cs (1)
13public static IHostBuilder GetHostBuilder(Func<MemoryPool<byte>> memoryPoolFactory = null,
Sockets.FunctionalTests (7)
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
76public Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (3)
145Func<Task> sendFunc = async () => 238Func<Task> sendFunc = async () => 309Func<MemoryPool<byte>> memoryPoolFactory = null)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
49public static Dictionary<string, Func<ListenOptions>> ConnectionMiddlewareData { get; } = new Dictionary<string, Func<ListenOptions>>
TransportSelector.cs (1)
13public static IHostBuilder GetHostBuilder(Func<MemoryPool<byte>> memoryPoolFactory = null,
Swaggatherer (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
System.ComponentModel.Annotations (5)
System\ComponentModel\DataAnnotations\LocalizableString.cs (1)
18private Func<string?>? _cachedResult;
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (4)
27private Func<string>? _errorMessageResourceAccessor; 64/// <param name="errorMessageAccessor">The <see cref="Func{T}" /> that will return an error message.</param> 65protected ValidationAttribute(Func<string> errorMessageAccessor) 102private protected Func<string> ErrorMessageResourceAccessor
System.ComponentModel.Composition (16)
System\ComponentModel\Composition\ExportFactoryOfT.cs (2)
8private readonly Func<Tuple<T, Action>> _exportLifetimeContextCreator; 10public ExportFactory(Func<Tuple<T, Action>> exportLifetimeContextCreator)
System\ComponentModel\Composition\ExportFactoryOfTTMetadata.cs (1)
10public ExportFactory(Func<Tuple<T, Action>> exportLifetimeContextCreator, TMetadata metadata)
System\ComponentModel\Composition\ExportServices.DisposableLazy.cs (2)
14public DisposableLazy(Func<T> valueFactory, TMetadataView metadataView, IDisposable disposable, LazyThreadSafetyMode mode) 32public DisposableLazy(Func<T> valueFactory, IDisposable disposable, LazyThreadSafetyMode mode)
System\ComponentModel\Composition\Primitives\Export.cs (7)
19private readonly Func<object?>? _exportedValueGetter; 45/// A <see cref="Func{T}"/> that is called to create the exported value of the 58public Export(string contractName, Func<object?> exportedValueGetter) 78/// A <see cref="Func{T}"/> that is called to create the exported value of the 91public Export(string contractName, IDictionary<string, object?>? metadata, Func<object?> exportedValueGetter) 105/// A <see cref="Func{T}"/> that is called to create the exported value of the 115public Export(ExportDefinition definition, Func<object?> exportedValueGetter)
System\ComponentModel\Composition\ReflectionModel\ExportfactoryCreator.cs (2)
49Func<Tuple<T, Action>> exportLifetimeContextCreator = () => LifetimeContext.GetExportLifetimeContextFromExport<T>(export); 62Func<Tuple<T, Action>> exportLifetimeContextCreator = () => LifetimeContext.GetExportLifetimeContextFromExport<T>(export);
System\ComponentModel\Composition\ReflectionModel\LazyMemberInfo.cs (2)
15private readonly Func<MemberInfo[]>? _accessorsCreator; 61public LazyMemberInfo(MemberTypes memberType, Func<MemberInfo[]> accessorsCreator)
System.Composition.Hosting (3)
System\Composition\Hosting\Core\ExportDescriptorPromise.cs (1)
40Func<IEnumerable<CompositionDependency>> dependencies,
System\Composition\Hosting\Core\ExportDescriptorProvider.cs (1)
31protected static readonly Func<IEnumerable<CompositionDependency>> NoDependencies = Enumerable.Empty<CompositionDependency>;
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
18private static readonly Func<CompositionDependency[]> s_noDependencies = () => s_noDependenciesValue;
System.Composition.Runtime (3)
System\Composition\ExportFactoryOfT.cs (2)
12private readonly Func<Tuple<T, Action>> _exportLifetimeContextCreator; 18public ExportFactory(Func<Tuple<T, Action>> exportCreator)
System\Composition\ExportFactoryOfTTMetadata.cs (1)
18public ExportFactory(Func<Tuple<T, Action>> exportCreator, TMetadata metadata)
System.Configuration.ConfigurationManager (1)
System\Configuration\ConfigurationFileMap.cs (1)
18private Func<string> _getFilenameThunk;
System.Core (1)
System.Core.cs (1)
84[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
System.Diagnostics.DiagnosticSource (51)
System\Diagnostics\Activity.cs (2)
1012public static Func<ActivityTraceId>? TraceIdGenerator { get; set; } 1288Func<ActivityTraceId>? traceIdGenerator = TraceIdGenerator;
System\Diagnostics\ActivityCreationOptions.cs (1)
135Func<ActivityTraceId>? traceIdGenerator = Activity.TraceIdGenerator;
System\Diagnostics\Metrics\AggregationManager.cs (2)
358Func<Aggregator?>? createAggregatorFunc = GetAggregatorFactory(instrument); 368private Func<Aggregator?>? GetAggregatorFactory(Instrument instrument)
System\Diagnostics\Metrics\AggregatorStore.cs (5)
61private readonly Func<TAggregator?> _createAggregatorFunc; 63public AggregatorStore(Func<TAggregator?> createAggregator) 243public TAggregator? GetNoLabelAggregator(Func<TAggregator?> createFunc) 330Func<TAggregator?> createAggregatorFunc, 422Func<TAggregator?> createAggregator)
System\Diagnostics\Metrics\InstrumentState.cs (1)
28public InstrumentState(Func<TAggregator?> createAggregatorFunc)
System\Diagnostics\Metrics\Meter.cs (19)
266public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 280public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 294public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 308public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 321public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 335public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 348public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 362public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 375public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 389public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 403public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 417public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 427public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 438public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 448public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 459public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 469public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 480public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 544private Instrument GetOrCreateInstrument<T>(Type instrumentType, string name, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags, Func<Instrument> instrumentCreator)
System\Diagnostics\Metrics\ObservableCounter.cs (6)
20internal ObservableCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 24internal ObservableCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 30internal ObservableCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 34internal ObservableCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 40internal ObservableCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description) : this(meter, name, observeValues, unit, description, tags: null) 44internal ObservableCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags)
System\Diagnostics\Metrics\ObservableGauge.cs (6)
20internal ObservableGauge(Meter meter, string name, Func<T> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 24internal ObservableGauge(Meter meter, string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 30internal ObservableGauge(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 34internal ObservableGauge(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 40internal ObservableGauge(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description) : this(meter, name, observeValues, unit, description, tags: null) 44internal ObservableGauge(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags)
System\Diagnostics\Metrics\ObservableInstrument.cs (3)
74if (callback is Func<T> valueOnlyFunc) 79if (callback is Func<Measurement<T>> measurementOnlyFunc) 84if (callback is Func<IEnumerable<Measurement<T>>> listOfMeasurementsFunc)
System\Diagnostics\Metrics\ObservableUpDownCounter.cs (6)
20internal ObservableUpDownCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 24internal ObservableUpDownCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 30internal ObservableUpDownCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 34internal ObservableUpDownCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 40internal ObservableUpDownCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description) : this(meter, name, observeValues, unit, description, tags: null) 44internal ObservableUpDownCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags)
System.Drawing.Common.Tests (12)
System\Drawing\BrushesTests.cs (2)
153public static object[] Brush(Func<Brush> getBrush, Color expectedColor) => [getBrush, expectedColor]; 157public void Brushes_Get_ReturnsExpected(Func<Brush> getBrush, Color expectedColor)
System\Drawing\PensTests.cs (2)
155public static object[] Pen(Func<Pen> getPen, Color expectedColor) => [getPen, expectedColor]; 159public void Pens_Get_ReturnsExpected(Func<Pen> getPen, Color expectedColor)
System\Drawing\SystemBrushesTests.cs (2)
45public static object[] Brush(Func<Brush> getBrush, Color expectedColor) => [getBrush, expectedColor]; 49public void SystemBrushes_Get_ReturnsExpected(Func<Brush> getBrush, Color expectedColor)
System\Drawing\SystemFontsTests.cs (2)
22public void SystemFont_Get_ReturnsExpected(Func<Font> getFont) 75public void SystemFont_Get_ReturnsExpected_WindowsNames(Func<Font> getFont, string systemFontName, string windowsFontName)
System\Drawing\SystemIconsTests.cs (2)
22public static object[] Icon(Func<Icon> getIcon) => [getIcon]; 26public void SystemIcons_Get_ReturnsExpected(Func<Icon> getIcon)
System\Drawing\SystemPensTest.cs (2)
47public static object[] Pen(Func<Pen> getPen, Color expectedColor) => [getPen, expectedColor]; 51public void SystemPens_Get_ReturnsExpected(Func<Pen> getPen, Color expectedColor)
System.Linq.Expressions (8)
System\Dynamic\Utils\DelegateHelpers.cs (4)
46public static Func<IDisposable>? ForceAllowDynamicCodeDelegate { get; } 49private static Func<IDisposable>? ForceAllowDynamicCodeDelegateInternal() 52?.CreateDelegate<Func<IDisposable>>(); 107private static MethodInfo GetEmptyObjectArrayMethod() => ((Func<object[]>)Array.Empty<object>).GetMethodInfo();
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (1)
193return typeof(Func<>).MakeGenericType(types);
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
397private readonly Func<TRet> _target; 403_target = (Func<TRet>)target.CreateDelegate(typeof(Func<TRet>));
System.Linq.Parallel (3)
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (2)
63private readonly Func<TIntermediate>? _seedFactory; 72internal AssociativeAggregationOperator(IEnumerable<TInput> child, TIntermediate seed, Func<TIntermediate>? seedFactory, bool seedIsSpecified,
System\Linq\ParallelEnumerable.cs (1)
1810Func<TAccumulate> seedFactory,
System.Linq.Queryable (5)
System\Linq\EnumerableExecutor.cs (3)
45Expression<Func<T>> f = Expression.Lambda<Func<T>>(body, (IEnumerable<ParameterExpression>?)null); 46Func<T> func = f.Compile();
System\Linq\EnumerableQuery.cs (2)
110Expression<Func<IEnumerable<T>>> f = Expression.Lambda<Func<IEnumerable<T>>>(body, (IEnumerable<ParameterExpression>?)null);
System.Net.Http (9)
System\Net\Http\Headers\MediaTypeHeaderParser.cs (2)
10private readonly Func<MediaTypeHeaderValue> _mediaTypeCreator; 16private MediaTypeHeaderParser(bool supportsMultipleValues, Func<MediaTypeHeaderValue> mediaTypeCreator)
System\Net\Http\Headers\MediaTypeHeaderValue.cs (1)
176Func<MediaTypeHeaderValue> mediaTypeCreator, out MediaTypeHeaderValue? parsedValue)
System\Net\Http\Headers\NameValueHeaderValue.cs (2)
15private static readonly Func<NameValueHeaderValue> s_defaultNameValueCreator = CreateNameValue; 207Func<NameValueHeaderValue> nameValueCreator, out NameValueHeaderValue? parsedValue)
System\Net\Http\Headers\NameValueWithParametersHeaderValue.cs (1)
16private static readonly Func<NameValueHeaderValue> s_nameValueCreator = CreateNameValue;
System\Net\Http\Headers\TransferCodingHeaderParser.cs (2)
10private readonly Func<TransferCodingHeaderValue> _transferCodingCreator; 22Func<TransferCodingHeaderValue> transferCodingCreator)
System\Net\Http\Headers\TransferCodingHeaderValue.cs (1)
61Func<TransferCodingHeaderValue> transferCodingCreator, out TransferCodingHeaderValue? parsedValue)
System.Net.Quic (2)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System.Net.Security (2)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System.Private.CoreLib (73)
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (4)
26private Func<IPrincipal>? s_getWindowsPrincipal; 27private Func<IPrincipal>? s_getUnauthenticatedPrincipal; 414s_getUnauthenticatedPrincipal = mi.CreateDelegate<Func<IPrincipal>>(); 426s_getWindowsPrincipal = mi.CreateDelegate<Func<IPrincipal>>();
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (8)
1673Func<EventSource?> eventSourceFactory = () => this; 2475public OverrideEventProvider(Func<EventSource?> eventSourceFactory, EventProviderType providerType) 2489private readonly Func<EventSource?> _eventSourceFactory; 3916private static List<Func<EventSource?>> s_preregisteredEventSourceFactories = new List<Func<EventSource?>>(); 3942internal static unsafe void PreregisterEventProviders(Guid id, string name, Func<EventSource?> eventSourceFactory) 4005Func<EventSource?>[] factories; 4011foreach (Func<EventSource?> factory in factories)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\IncrementingPollingCounter.cs (2)
30public IncrementingPollingCounter(string name, EventSource eventSource, Func<double> totalValueProvider) : base(name, eventSource) 43private readonly Func<double> _totalValueProvider;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\PollingCounter.cs (2)
29public PollingCounter(string name, EventSource eventSource, Func<double> metricProvider) : base(name, eventSource) 39private readonly Func<double> _metricProvider;
src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (3)
16private readonly Func<bool>? _callback0; 20private Gen2GcCallback(Func<bool> callback) 35public static void Register(Func<bool> callback)
src\libraries\System.Private.CoreLib\src\System\Lazy.cs (10)
195private Func<T>? _factory; 230/// The <see cref="Func{T}"/> invoked to produce the lazily-initialized value when it is 238public Lazy(Func<T> valueFactory) 270/// The <see cref="Func{T}"/> invoked to produce the lazily-initialized value when it is needed. 276public Lazy(Func<T> valueFactory, bool isThreadSafe) : 286/// The <see cref="Func{T}"/> invoked to produce the lazily-initialized value when it is needed. 292public Lazy(Func<T> valueFactory, LazyThreadSafetyMode mode) 297private Lazy(Func<T>? valueFactory, LazyThreadSafetyMode mode, bool useDefaultConstructor) 318Func<T> factory = _factory ?? throw new InvalidOperationException(SR.Lazy_Value_RecursiveCallsToValue); 369Func<T>? factory = _factory;
src\libraries\System.Private.CoreLib\src\System\LazyOfTTMetadata.cs (3)
13public Lazy(Func<T> valueFactory, TMetadata metadata) : 32public Lazy(Func<T> valueFactory, TMetadata metadata, bool isThreadSafe) : 44public Lazy(Func<T> valueFactory, TMetadata metadata, LazyThreadSafetyMode mode) :
src\libraries\System.Private.CoreLib\src\System\Threading\LazyInitializer.cs (11)
81/// <param name="valueFactory">The <see cref="Func{T}"/> invoked to initialize the 102public static T EnsureInitialized<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class => 112private static T EnsureInitializedCore<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 190/// <param name="valueFactory">The <see cref="Func{T}"/> invoked to initialize the 193public static T EnsureInitialized<T>([AllowNull] ref T target, ref bool initialized, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory) 214/// The <see cref="Func{T}"/> to invoke in order to produce the lazily-initialized value. 217private static T EnsureInitializedCore<T>([AllowNull] ref T target, ref bool initialized, [NotNull] ref object? syncLock, Func<T> valueFactory) 240/// <param name="valueFactory">The <see cref="Func{T}"/> invoked to initialize the reference.</param> 242public static T EnsureInitialized<T>([NotNull] ref T? target, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory) where T : class => 254/// The <see cref="Func{T}"/> to invoke in order to produce the lazily-initialized value. 257private static T EnsureInitializedCore<T>([NotNull] ref T? target, [NotNull] ref object? syncLock, Func<T> valueFactory) where T : class
src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (3)
260public static void SpinUntil(Func<bool> condition) 283public static bool SpinUntil(Func<bool> condition, TimeSpan timeout) 307public static bool SpinUntil(Func<bool> condition, int millisecondsTimeout)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (7)
107public Task(Func<TResult> function) 128public Task(Func<TResult> function, CancellationToken cancellationToken) 152public Task(Func<TResult> function, TaskCreationOptions creationOptions) 179public Task(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions) 286internal Task(Func<TResult> valueSelector, Task? parent, CancellationToken cancellationToken, 310internal static Task<TResult> StartNew(Task? parent, Func<TResult> function, CancellationToken cancellationToken, 488if (m_action is Func<TResult> func)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (4)
256public Task<TResult> StartNew(Func<TResult> function) 283public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken) 312public Task<TResult> StartNew(Func<TResult> function, TaskCreationOptions creationOptions) 352public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (6)
5556public static Task<TResult> Run<TResult>(Func<TResult> function) 5574public static Task<TResult> Run<TResult>(Func<TResult> function, CancellationToken cancellationToken) 5589public static Task Run(Func<Task?> function) 5607public static Task Run(Func<Task?> function, CancellationToken cancellationToken) 5635public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function) 5651public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (4)
520public Task<TResult> StartNew<TResult>(Func<TResult> function) 551public Task<TResult> StartNew<TResult>(Func<TResult> function, CancellationToken cancellationToken) 583public Task<TResult> StartNew<TResult>(Func<TResult> function, TaskCreationOptions creationOptions) 626public Task<TResult> StartNew<TResult>(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (6)
31private Func<T>? _valueFactory; 90/// The <see cref="Func{T}"/> invoked to produce a lazily-initialized value when 96public ThreadLocal(Func<T> valueFactory) 108/// The <see cref="Func{T}"/> invoked to produce a lazily-initialized value when 115public ThreadLocal(Func<T> valueFactory, bool trackAllValues) 122private void Initialize(Func<T>? valueFactory, bool trackAllValues)
System.Private.DataContractSerialization (5)
System\Runtime\Serialization\AccessorBuilder.cs (3)
32public static Func<object> GetMakeNewInstanceFunc( 36Func<object> make = s_make.MakeGenericMethod(type).CreateDelegate<Func<object>>();
System\Runtime\Serialization\ClassDataContract.cs (2)
155private Func<object>? _makeNewInstance; 159private Func<object> MakeNewInstance => _makeNewInstance ??= FastInvokerBuilder.GetMakeNewInstanceFunc(UnderlyingType);
System.Private.Windows.Core.TestUtilities (1)
AppContextSwitchScope.cs (1)
25public AppContextSwitchScope(string switchName, Func<bool>? getDefaultValue, bool enable)
System.Private.Xml (3)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (3)
1446Func<object?> getSource = () => GetMemberValue(o, member.Mapping.MemberInfo!); 1452private object? WriteAddCollectionFixup(Func<object?> getSource, Action<object?> setSource, object memberValue, TypeDesc typeDesc, bool readOnly) 2081public Func<object?>? GetSource;
System.Reflection.Metadata (3)
System\Reflection\Internal\Utilities\ObjectPool`1.cs (3)
38private readonly Func<T> _factory; 41internal ObjectPool(Func<T> factory) 45internal ObjectPool(Func<T> factory, int size)
System.Reflection.MetadataLoadContext (5)
System\Reflection\TypeLoading\CustomAttributes\CustomAttributeHelpers.cs (2)
86public static CustomAttributeData? TryComputeMarshalAsCustomAttributeData(Func<MarshalAsAttribute> marshalAsAttributeComputer, MetadataLoadContext loader) 102Func<CustomAttributeArguments> argumentsPromise =
System\Reflection\TypeLoading\CustomAttributes\RoPseudoCustomAttributeData.cs (2)
11private readonly Func<CustomAttributeArguments>? _argumentsPromise; 19internal RoPseudoCustomAttributeData(ConstructorInfo constructor, Func<CustomAttributeArguments> argumentsPromise)
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.DllImport.cs (1)
31Func<CustomAttributeArguments> argumentsPromise =
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
192[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)
290public void ToManaged<TResult>(out Func<TResult>? value, ArgumentToManagedCallback<TResult> resMarshaler) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 291public void ToJS<TResult>(Func<TResult>? value, ArgumentToJSCallback<TResult> resMarshaler) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); }
System.Security.Claims (2)
System\Security\Claims\ClaimsPrincipal.cs (2)
31private static Func<ClaimsPrincipal?>? s_principalSelector; 81public static Func<ClaimsPrincipal?>? ClaimsPrincipalSelector
System.Security.Cryptography (4)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (2)
1671private static TAlg CreateAndImport<TAlg>(ReadOnlySpan<char> keyPem, Func<TAlg> factory) where TAlg : AsymmetricAlgorithm 1681Func<TAlg> factory) where TAlg : AsymmetricAlgorithm
System.Security.Principal.Windows (3)
artifacts\obj\System.Security.Principal.Windows\Debug\net10.0\System.Security.Principal.Windows.notsupported.cs (3)
269public static System.Threading.Tasks.Task RunImpersonatedAsync(Microsoft.Win32.SafeHandles.SafeAccessTokenHandle safeAccessTokenHandle, System.Func<System.Threading.Tasks.Task> func) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } 270public static System.Threading.Tasks.Task<T> RunImpersonatedAsync<T>(Microsoft.Win32.SafeHandles.SafeAccessTokenHandle safeAccessTokenHandle, System.Func<System.Threading.Tasks.Task<T>> func) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } 271public static T RunImpersonated<T>(Microsoft.Win32.SafeHandles.SafeAccessTokenHandle safeAccessTokenHandle, System.Func<T> func) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); }
System.Text.Json (33)
System\Text\Json\Serialization\Converters\Collection\StackOrQueueConverter.cs (1)
31Func<object>? constructorDelegate = typeInfo.CreateObject;
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (1)
129Func<object>? createObjectForExtensionDataProp = jsonPropertyInfo.JsonTypeInfo.CreateObject
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (2)
68Func<object>? createObject = DetermineCreateObjectDelegate(type, converter); 451private static Func<object>? DetermineCreateObjectDelegate(Type type, JsonConverter converter)
System\Text\Json\Serialization\Metadata\JsonCollectionInfoValuesOfTCollection.cs (2)
17/// A <see cref="Func{TResult}"/> to create an instance of the collection when deserializing. 20public Func<TCollection>? ObjectCreator { get; init; }
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (1)
116private static void PopulateParameterInfoValues(JsonTypeInfo typeInfo, Func<JsonParameterInfoValues[]?>? paramFactory)
System\Text\Json\Serialization\Metadata\JsonObjectInfoValuesOfT.cs (3)
21public Func<T>? ObjectCreator { get; init; } 39public Func<JsonParameterInfoValues[]>? ConstructorParameterMetadataInitializer { get; init; } 44public Func<ICustomAttributeProvider>? ConstructorAttributeProviderFactory { get; init; }
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (2)
168Func<ICustomAttributeProvider>? attributeProviderFactory = Volatile.Read(ref AttributeProviderFactory); 190internal Func<ICustomAttributeProvider>? AttributeProviderFactory;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs (1)
89public Func<ICustomAttributeProvider>? AttributeProviderFactory { get; init; }
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (5)
91public Func<object>? CreateObject 101private protected Func<object>? _createObject; 103internal Func<object>? CreateObjectForExtensionDataProperty { get; set; } 645Func<ICustomAttributeProvider>? ctorAttrProviderFactory = Volatile.Read(ref ConstructorAttributeProviderFactory); 667internal Func<ICustomAttributeProvider>? ConstructorAttributeProviderFactory;
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (10)
17private Func<T>? _typedCreateObject; 49public new Func<T>? CreateObject 60Debug.Assert(createObject is null or Func<object> or Func<T>); 78Func<object>? untypedCreateObject; 79Func<T>? typedCreateObject; 86else if (createObject is Func<T> typedDelegate) 89untypedCreateObject = createObject is Func<object> untypedDelegate ? untypedDelegate : () => typedDelegate()!; 93Debug.Assert(createObject is Func<object>); 94untypedCreateObject = (Func<object>)createObject;
System\Text\Json\Serialization\Metadata\MemberAccessor.cs (1)
12public abstract Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo);
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.cs (1)
31public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? ctorInfo) =>
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (2)
21public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo) 68return CreateDelegate<Func<object>>(dynamicMethod);
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (1)
19public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? ctorInfo)
System.Text.RegularExpressions (1)
System\Threading\StackHelper.cs (1)
121public static TResult CallOnEmptyStack<TResult>(Func<TResult> func) =>
System.Text.RegularExpressions.Generator (1)
src\libraries\System.Text.RegularExpressions\src\System\Threading\StackHelper.cs (1)
121public static TResult CallOnEmptyStack<TResult>(Func<TResult> func) =>
System.Threading.Tasks.Dataflow (1)
Internal\Common.cs (1)
596internal static readonly Func<T> DefaultTResultFunc = static () => default(T)!;
System.Threading.Tasks.Parallel (17)
System\Threading\Tasks\Parallel.cs (17)
692Func<TLocal> localInit, 745Func<TLocal> localInit, 809Func<TLocal> localInit, 874Func<TLocal> localInit, 920Func<TLocal>? localInit, Action<TLocal>? localFinally) 1416public static ParallelLoopResult ForEach<TSource, TLocal>(IEnumerable<TSource> source, Func<TLocal> localInit, 1481ParallelOptions parallelOptions, Func<TLocal> localInit, 1535public static ParallelLoopResult ForEach<TSource, TLocal>(IEnumerable<TSource> source, Func<TLocal> localInit, 1599public static ParallelLoopResult ForEach<TSource, TLocal>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TLocal> localInit, 1643Func<TLocal>? localInit, Action<TLocal>? localFinally) 1701Func<TLocal>? localInit, Action<TLocal>? localFinally) 1760Func<TLocal>? localInit, Action<TLocal>? localFinally) 2022Func<TLocal> localInit, 2100Func<TLocal> localInit, 2396Func<TLocal> localInit, 2487Func<TLocal> localInit, 2514Func<TLocal>? localInit,
System.Windows.Controls.Ribbon (4)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (4)
1013Func<bool> getter, 1177Func<bool> getter, 1220Func<bool> getter, 1245object sender, KeyEventArgs e, Func<bool> gettor, Action<bool> settor, UIElement targetFocusOnFalse, UIElement targetFocusContainerOnTrue)
System.Windows.Forms (4)
System\Windows\Forms\Control.cs (1)
5981public T Invoke<T>(Func<T> method) => (T)Invoke(method, null);
System\Windows\Forms\Control_InvokeAsync.cs (3)
96public async Task<T> InvokeAsync<T>(Func<T> callback, CancellationToken cancellationToken = default) 157/// <see cref="InvokeAsync{T}(Func{T}, CancellationToken)"/> or the overload 221/// <see cref="InvokeAsync{T}(Func{T}, CancellationToken)"/> or the overload
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\CommandSet.cs (1)
424private static bool ExecuteSafely<T>(Func<T> func, bool throwOnException, [MaybeNullWhen(false)] out T result)
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Internals\ScaleHelper.cs (1)
516public static T InvokeInSystemAwareContext<T>(Func<T> func)
System.Windows.Forms.Primitives.Tests (4)
Interop\Oleaut32\SAFEARRAYTests.cs (1)
131public Func<(Guid, HRESULT)> GetGuidAction { get; set; }
Interop\Oleaut32\VARIANTTests.cs (1)
5698public Func<(Guid, HRESULT)> GetGuidAction { get; set; }
Interop\User32\GetWindowTextTests.cs (2)
45public Func<string>? BeforeGetTextLengthCallback 51public Func<string>? BeforeGetTextCallback
System.Windows.Forms.Primitives.TestUtilities (5)
Extensions\AssertExtensions.cs (5)
58public static void Throws<T>(string netCoreParamName, string netFxParamName, Func<object> testCode) 94public static TException Throws<TException, TResult>(Func<TResult> func) 128public static T Throws<T>(string expectedParamName, Func<object> testCode) 138public static async Task<T> ThrowsAsync<T>(string expectedParamName, Func<Task> testCode) 271public static async Task CanceledAsync(CancellationToken cancellationToken, Func<Task> testCode)
System.Windows.Forms.Tests (29)
System\Windows\Forms\ClipboardTests.cs (2)
57public static TheoryData<Func<bool>> ContainsMethodsTheoryData => 67public void Contains_InvokeMultipleTimes_Success(Func<bool> contains)
System\Windows\Forms\CursorsTests.cs (4)
17static Func<Cursor> I(Func<Cursor> factory) => factory; 51public void Cursors_KnownCursor_Get_ReturnsExpected(Func<Cursor> getCursor) 77public void Cursors_ToString_KnownCursor_ReturnsExpected(Func<Cursor> getCursor)
System\Windows\Forms\ListViewTests.cs (6)
801foreach (Func<ImageList> imageListFactory in new Func<ImageList>[] { () => new ImageList(), () => null }) 907foreach (Func<ImageList> imageListFactory in new Func<ImageList>[] { () => new ImageList(), () => null }) 941foreach (Func<ImageList> imageListFactory in new Func<ImageList>[] { () => new ImageList(), () => null })
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (1)
134Func<SelectionRange> func = () => (SelectionRange)_converter.CreateInstance(null, propertyValues);
System\Windows\Forms\MonthCalendarTests.cs (1)
4527private void ShouldSerializeProperty(Func<bool> shouldSerializeFunc, Action setPropertyAction)
System\Windows\Forms\ProfessionalColorsTests.cs (4)
14static Func<T> I<T>(Func<T> t) => t; 75public void ProfessionalColors_Properties_Get_ReturnsExpected(Func<Color> factory) 83public void ProfessionalColors_Properties_GetToolStripManagerVisualStylesEnabled_ReturnsExpected(Func<Color> factory)
System\Windows\Forms\ProgressBarRendererTest.cs (1)
79private void TestChunkProperty(Func<int> propertyGetter, VisualStyleElement styleElement, int expectedValue)
System\Windows\Forms\ScrollableControlTests.cs (6)
1570Func<Control> controlFactory = () => new Control 1574Func<TabPage> tabPageFactory = () => new TabPage 1578foreach (Func<Control> parentFactory in new Func<Control>[] { controlFactory, tabPageFactory }) 1618foreach (Func<Control> parentFactory in new Func<Control>[] { CreateControl, CreateTabPage })
System\Windows\Forms\UnsupportedTypesTests.cs (1)
68((Func<bool>)(() => TestDataGridColumnStyle.Call_DGEditColumnEditing())).Should().Throw<PlatformNotSupportedException>();
System\Windows\Forms\VisualStyles\VisualStyleElementTests.cs (3)
36static Func<VisualStyleElement> I(Func<VisualStyleElement> factory) => factory; 652public void VisualStyleElement_KnownElements_Get_ReturnsExpected(Func<VisualStyleElement> elementFactory, string expectedClassName, int expectedPart, int expectedState)
System.Windows.Forms.UI.IntegrationTests (6)
Infra\ControlTestBase.cs (4)
243protected async Task RunSingleControlTestAsync<T>(Func<Form, T, Task> testDriverAsync, Func<T> createControl, Func<Form>? createForm = null) 300protected async Task RunFormAsync<T>(Func<(Form dialog, T control)> createDialog, Func<Form, T, Task> testDriverAsync) 346protected async Task RunFormWithoutControlAsync<TForm>(Func<TForm> createForm, Func<TForm, Task> testDriverAsync)
Infra\SendInput.cs (2)
12private readonly Func<Task> _waitForIdleAsync; 14public SendInput(Func<Task> waitForIdleAsync)
System.Windows.Input.Manipulations (7)
System\Windows\Input\Manipulations\InertiaParameters2D.cs (1)
27internal void ProtectedChangeProperty(Func<bool> isEqual, Action setNewValue, string paramName)
System\Windows\Input\Manipulations\Lazy.cs (2)
17private Func<T> getValue; 29public Lazy(Func<T> getValue)
System\Windows\Input\Manipulations\ManipulationVelocities2D.cs (4)
104Func<float> getLinearVelocityX, 105Func<float> getLinearVelocityY, 106Func<float> getAngularVelocity, 107Func<float> getExpansionVelocity)
System.Xaml (4)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (2)
19private Func<T> _creationDelegate; 21public XamlContextStack(Func<T> creationDelegate)
System\Xaml\Schema\BuiltInValueConverter.cs (2)
17private Func<TConverterBase> _factory; 19internal BuiltInValueConverter(Type converterType, Func<TConverterBase> factory)
System.Xaml.Tests (2)
Common\Optional.cs (1)
14public readonly T Or(Func<T> valueFactory) => HasValue ? Value : valueFactory();
System\Xaml\Replacements\EventConverterTests.cs (1)
226public Func<Type>? GetDestinationTypeAction { get; set; }
Templates.Blazor.Tests (8)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
Templates.Blazor.WebAssembly.Auth.Tests (20)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
src\Shared\E2ETesting\WaitAssert.cs (12)
26public static void Equal<T>(this IWebDriver driver, T expected, Func<T> actual) 29public static void NotEqual<T>(this IWebDriver driver, T expected, Func<T> actual) 32public static void True(this IWebDriver driver, Func<bool> actual) 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 41public static void False(this IWebDriver driver, Func<bool> actual) 44public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 47public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 50public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 53public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 59public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 89private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Templates.Blazor.WebAssembly.Tests (20)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
src\Shared\E2ETesting\WaitAssert.cs (12)
26public static void Equal<T>(this IWebDriver driver, T expected, Func<T> actual) 29public static void NotEqual<T>(this IWebDriver driver, T expected, Func<T> actual) 32public static void True(this IWebDriver driver, Func<bool> actual) 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 41public static void False(this IWebDriver driver, Func<bool> actual) 44public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 47public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 50public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 53public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 59public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 89private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Templates.Mvc.Tests (20)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
src\Shared\E2ETesting\WaitAssert.cs (12)
26public static void Equal<T>(this IWebDriver driver, T expected, Func<T> actual) 29public static void NotEqual<T>(this IWebDriver driver, T expected, Func<T> actual) 32public static void True(this IWebDriver driver, Func<bool> actual) 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 41public static void False(this IWebDriver driver, Func<bool> actual) 44public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 47public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 50public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 53public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 59public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 89private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Templates.Tests (20)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
src\Shared\E2ETesting\WaitAssert.cs (12)
26public static void Equal<T>(this IWebDriver driver, T expected, Func<T> actual) 29public static void NotEqual<T>(this IWebDriver driver, T expected, Func<T> actual) 32public static void True(this IWebDriver driver, Func<bool> actual) 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 41public static void False(this IWebDriver driver, Func<bool> actual) 44public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 47public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 50public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 53public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 59public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 89private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
UnitTests.Common (11)
IMockCommunicationObject.cs (2)
15Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 16Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockChannelBase.cs (3)
49public Func<EndpointAddress> GetEndpointPropertyOverride { get; set; } 55public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 56public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockChannelFactory.cs (2)
54public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 55public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockCommunicationObject.cs (2)
50public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 51public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockTransportBindingElement.cs (1)
16public Func<String> SchemePropertyOverride { get; set; }
TestTypes.cs (1)
337public static void Run(Func<Task> asyncMethod)
VBCSCompiler (1)
src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (1)
165Func<BuildResponse> func = () =>
VBCSCompiler.UnitTests (5)
CompilerServerTests.cs (1)
122Func<T> func)
TestableClientConnectionHost.cs (4)
18private readonly Queue<Func<Task<IClientConnection>>> _waitingTasks = new Queue<Func<Task<IClientConnection>>>(); 47Func<Task<IClientConnection>>? func = null; 66public void Add(Func<Task<IClientConnection>> func)
Wasm.Performance.ConsoleHost (10)
NullDispatcher.cs (3)
21public override Task InvokeAsync(Func<Task> workItem) 24public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 27public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
WindowsBase.Tests (4)
Helpers.cs (1)
40public static T ExecuteOnDifferentThread<T>(Func<T> action, ApartmentState? state = null)
System\Windows\FreezableTests.cs (2)
7278public Func<Freezable>? CreateInstanceCoreAction { get; set; } 7344public Func<Freezable>? CreateInstanceCoreAction { get; set; }
System\Windows\WeakEventManagerTests.cs (1)
6047public Func<ListenerList>? CloneAction { get; set; }
XmlFileLogger (1)
LogProcessNode.cs (1)
158protected void WriteChildren<T>(XElement parentElement, Func<XElement> subNodeFactory) where T : ILogNode
xunit.assert (31)
EventAsserts.cs (12)
113 Func<RaisedEvent<T>?> handler, 208 Func<Task> testCode) 230 Func<Task> testCode) 252 Func<Task> testCode) 273 Func<Task> testCode) 291 Func<Task> testCode) 316 Func<Task> testCode) 417 Func<RaisedEvent<T>?> handler, 440 Func<Task> testCode) 462 Func<Task> testCode) 487 Func<Task> testCode) 509 Func<Task> testCode)
ExceptionAsserts.cs (12)
71 Func<object?> testCode) => 82 Func<Task> testCode) 107 public static T Throws<T>(Func<object?> testCode) 119 public static T Throws<T>(Func<Task> testCode) 159 Func<object?> testCode) 183 Func<Task> testCode) 226 public static T ThrowsAny<T>(Func<object?> testCode) 236 public static T ThrowsAny<T>(Func<Task> testCode) 248 public static async Task<T> ThrowsAnyAsync<T>(Func<Task> testCode) 260 Func<Task> testCode) => 269 public static async Task<T> ThrowsAsync<T>(Func<Task> testCode) 288 Func<Task> testCode)
PropertyAsserts.cs (2)
69 Func<Task> testCode) 85 Func<Task> testCode)
Record.cs (3)
65 Func<object?> testCode, 94 protected static Exception RecordException(Func<Task> testCode) 105 protected static async Task<Exception?> RecordExceptionAsync(Func<Task> testCode)
Sdk\ArgumentFormatter.cs (1)
703 Func<object?> getter,
Sdk\CollectionTracker.cs (1)
616 Func<bool> moreItemsPastEndIndex,
xunit.console (3)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (2)
19private readonly Func<IDependencyContextReader> _jsonReaderFactory; 33Func<IDependencyContextReader> jsonReaderFactory)
common\DictionaryExtensions.cs (1)
21public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TValue> newValue)