2170 references to Func
aspire (12)
Certificates\NativeCertificateToolRunner.cs (2)
13internal sealed class NativeCertificateToolRunner(CertificateManager certificateManager, Func<bool>? isLinux = null) : ICertificateToolRunner 15private readonly Func<bool> _isLinux = isLinux ?? OperatingSystem.IsLinux;
Interaction\ConsoleInteractionService.cs (1)
45public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
Interaction\ExtensionInteractionService.cs (4)
33private readonly Channel<Func<Task>> _extensionTaskChannel; 43_extensionTaskChannel = Channel.CreateUnbounded<Func<Task>>(new UnboundedChannelOptions 55var taskFunction = await _extensionTaskChannel.Reader.ReadAsync().ConfigureAwait(false); 67public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
Interaction\IInteractionService.cs (1)
13Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false);
Projects\ProjectUpdater.cs (3)
1137internal abstract record UpdateStep(string Description, Func<Task> Callback) 1150Func<Task> Callback, 1162internal record AnalyzeStep(string Description, Func<Task> Callback);
Utils\TransactionalAction.cs (1)
70Func<T> action,
Aspire.Azure.AI.Inference.Tests (8)
AspireAzureAIInferenceEmbeddingsPublicApiTests.cs (4)
17var action = () => builder.AddAzureEmbeddingsClient(connectionName); 31var action = () => builder.AddAzureEmbeddingsClient(connectionName); 45var action = () => builder.AddKeyedAzureEmbeddingsClient(name); 59var action = () => builder.AddKeyedAzureEmbeddingsClient(name);
AspireAzureAIInferencePublicApiTests.cs (4)
17var action = () => builder.AddAzureChatCompletionsClient(connectionName); 31var action = () => builder.AddAzureChatCompletionsClient(connectionName); 45var action = () => builder.AddKeyedAzureChatCompletionsClient(name); 59var action = () => builder.AddKeyedAzureChatCompletionsClient(name);
Aspire.Azure.AI.OpenAI.Tests (10)
AIOpenAIPublicApiTests.cs (10)
20var action = () => new AspireAzureOpenAIClientBuilder(hostBuilder, connectionName, serviceKey, disableTracing, enableSensitiveTelemetryData); 37var action = () => new AspireAzureOpenAIClientBuilder(hostBuilder, connectionName, serviceKey, disableTracing, enableSensitiveTelemetryData); 51var action = () => builder.AddAzureOpenAIClient(connectionName); 65var action = () => builder.AddAzureOpenAIClient(connectionName); 79var action = () => builder.AddKeyedAzureOpenAIClient(name); 93var action = () => builder.AddKeyedAzureOpenAIClient(name); 107var action = () => builder.AddOpenAIClientFromConfiguration(connectionName); 121var action = () => builder.AddOpenAIClientFromConfiguration(connectionName); 135var action = () => builder.AddKeyedOpenAIClientFromConfiguration(name); 149var action = () => builder.AddKeyedOpenAIClientFromConfiguration(name);
Aspire.Azure.Storage.Files.DataLake.Tests (2)
AzureDataLakePublicApiTests.cs (2)
126var action = () => new AzureDataLakeStorageHealthCheck(null!); 134var action = () => new AzureDataLakeFileSystemHealthCheck(null!);
Aspire.Cli.Tests (22)
Certificates\CertificateServiceTests.cs (2)
226public Func<CertificateTrustResult>? CheckHttpCertificateCallback { get; set; } 227public Func<EnsureCertificateResult>? TrustHttpCertificateCallback { get; set; }
Commands\NewCommandTests.cs (1)
1524public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
Commands\PublishCommandPromptingIntegrationTests.cs (1)
949public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => action();
Commands\UpdateCommandTests.cs (1)
1044public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => _innerService.ShowStatusAsync(statusText, action, emoji, allowMarkup);
Mcp\Docs\DocsIndexServiceTests.cs (1)
993private sealed class CountingDocsFetcher(Func<string?> contentProvider) : IDocsFetcher
Projects\ExtensionGuestLauncherTests.cs (1)
159public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => throw new NotImplementedException();
Templating\DotNetTemplateFactoryTests.cs (2)
472public Task<TResult> ShowStatusAsync<TResult>(string message, Func<Task<TResult>> work, KnownEmoji? emoji = null, bool allowMarkup = false) 475public Task ShowStatusAsync(string message, Func<Task> work)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
TestServices\TestAppHostCliBackchannel.cs (1)
12public Func<Task>? RequestStopAsyncCallback { get; set; }
TestServices\TestCertificateToolRunner.cs (3)
15public Func<CertificateTrustResult>? CheckHttpCertificateCallback { get; set; } 16public Func<EnsureCertificateResult>? TrustHttpCertificateCallback { get; set; } 17public Func<CertificateCleanResult>? CleanHttpCertificateCallback { get; set; }
TestServices\TestCliUpdateNotifier.cs (1)
12public Func<bool>? IsUpdateAvailableCallback { get; set; }
TestServices\TestDotNetCliExecutionFactory.cs (2)
77private readonly Func<int> _attemptCounter; 85Func<int> attemptCounter)
TestServices\TestExtensionBackchannel.cs (2)
29public Func<Task>? DisplayEmptyLineAsyncCallback { get; set; } 35public Func<Task>? DisplayCancellationMessageAsyncCallback { get; set; }
TestServices\TestExtensionInteractionService.cs (1)
28public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
TestServices\TestInteractionService.cs (1)
53public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
Aspire.Dashboard (64)
Components\Controls\LogLevelSelect.razor.cs (1)
21public required Func<Task> HandleSelectedLogLevelChangedAsync { get; set; }
Components\Controls\SelectResourceOptions.razor.cs (1)
15public required Func<Task> OnAllValuesCheckedChangedAsync { get; set; }
Components\Controls\SpanTypeSelect.razor.cs (1)
22public required Func<Task> HandleSelectedSpanTypeChangedAsync { get; set; }
Components\Controls\TreeGenAISelector.razor.cs (1)
13public required Func<Task> HandleSelectedTreeItemChangedAsync { get; set; }
Components\Controls\TreeMetricSelector.razor.cs (1)
13public required Func<Task> HandleSelectedTreeItemChangedAsync { get; set; }
Components\Dialogs\GenAIVisualizerDialog.razor.cs (1)
374TelemetryRepository telemetryRepository, ITelemetryErrorRecorder errorRecorder, List<OtlpResource> resources, Func<List<OtlpSpan>> getContextGenAISpans)
Components\Layout\AspirePageContentLayout.razor.cs (2)
53public Dictionary<string, Func<Task>> DialogCloseListeners { get; } = new(); 111foreach (var dialogCloseListener in DialogCloseListeners.Values)
Components\Layout\MobileNavMenuEntry.cs (1)
9internal record MobileNavMenuEntry(string Text, Func<Task> OnClick, Icon? Icon = null, Regex? LinkMatchRegex = null);
DashboardWebApplication.cs (10)
58private readonly List<Func<ResolvedEndpointInfo>> _frontendEndPointAccessor = new(); 59private Func<ResolvedEndpointInfo>? _otlpServiceGrpcEndPointAccessor; 60private Func<ResolvedEndpointInfo>? _otlpServiceHttpEndPointAccessor; 61private Func<ResolvedEndpointInfo>? _mcpEndPointAccessor; 63public List<Func<ResolvedEndpointInfo>> FrontendEndPointsAccessor 76public Func<ResolvedEndpointInfo> FrontendSingleEndPointAccessor 93public Func<ResolvedEndpointInfo> OtlpServiceGrpcEndPointAccessor 98public Func<ResolvedEndpointInfo> OtlpServiceHttpEndPointAccessor 103public Func<ResolvedEndpointInfo> McpEndPointAccessor 704static Func<ResolvedEndpointInfo> CreateEndPointAccessor(EndpointConfiguration endpointConfiguration)
Model\Assistant\AIContextProvider.cs (2)
201public IDisposable OnContextChanged(Func<Task> callback) 219public IDisposable OnDisplayChanged(Func<Task> callback)
Model\Assistant\AssistantChatViewModel.cs (2)
209public Func<Task>? OnDisconnectCallback { get; set; } 312public async Task InitializeWithInitialPromptAsync(Func<Task> addInitialPrompt)
Model\Assistant\ChatViewModel.cs (3)
53public void AddChatMessage(Func<ChatMessage> chatMessageProvider) 92private readonly Func<ChatMessage> _chatMessageProvider; 94public DynamicChatMessageViewModel(Func<ChatMessage> chatMessageProvider)
Model\Assistant\IAIContextProvider.cs (2)
16IDisposable OnContextChanged(Func<Task> callback); 17IDisposable OnDisplayChanged(Func<Task> callback);
Model\Assistant\Prompts\IceBreakersBuilder.cs (9)
136public void StructuredLogs(BuildIceBreakersContext context, Func<PagedResult<OtlpLogEntry>> getCurrentLogs, bool hasErrors, Func<PagedResult<OtlpLogEntry>> getErrorLogs) 168public void StructuredLogs(BuildIceBreakersContext context, OtlpResource resource, Func<PagedResult<OtlpLogEntry>> getCurrentLogs, bool hasErrors, Func<PagedResult<OtlpLogEntry>> getErrorLogs) 212public void Traces(BuildIceBreakersContext context, Func<PagedResult<OtlpTrace>> getCurrentTraces, bool hasErrors, Func<PagedResult<OtlpTrace>> getErrorTraces) 244private InitialPrompt CreateErrorTracesPrompt(Func<PagedResult<OtlpTrace>> getErrorTraces) 256public void Traces(BuildIceBreakersContext context, OtlpResource resource, Func<PagedResult<OtlpTrace>> getCurrentTraces, bool hasErrors, Func<PagedResult<OtlpTrace>> getErrorTraces)
Model\Assistant\Prompts\PromptContextsBuilder.cs (2)
11public static Task ErrorTraces(InitializePromptContext promptContext, string displayText, Func<PagedResult<OtlpTrace>> getErrorTraces) 29public static Task ErrorStructuredLogs(InitializePromptContext promptContext, string displayText, Func<PagedResult<OtlpLogEntry>> getErrorLogs)
Model\BrowserLinkOutgoingPeerResolver.cs (1)
10public IDisposable OnPeerChanges(Func<Task> callback)
Model\ConsoleLogsManager.cs (1)
54public IDisposable OnFiltersChanged(Func<Task> callback)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (2)
30public required Func<List<OtlpSpan>> GetContextGenAISpans { get; init; } 55Func<List<OtlpSpan>> getContextGenAISpans)
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\Interaction\InteractionsInputsDialogViewModel.cs (1)
22public Func<Task>? OnInteractionUpdated { get; set; }
Model\IOutgoingPeerResolver.cs (1)
9IDisposable OnPeerChanges(Func<Task> callback);
Model\MenuButtonItem.cs (1)
15public Func<Task>? OnClick { get; set; }
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)
250public IDisposable OnPeerChanges(Func<Task> callback)
Model\TelemetryExportService.cs (1)
653private static OtlpKeyValueJson[]? ConvertAttributes(KeyValuePair<string, string>[] attributes, Func<KeyValuePair<string, string>[]>? getAdditionalAttributes = null)
Model\ThemeManager.cs (1)
114public IDisposable OnThemeChanged(Func<Task> callback)
Model\TraceLinkHelpers.cs (2)
22Func<Func<Task>, Task> dispatcher, 39Func<Func<Task>, Task> dispatcher,
Otlp\Storage\Subscription.cs (1)
27public Subscription(string name, ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback, Action unsubscribe, ExecutionContext? executionContext, TelemetryRepository telemetryRepository)
Otlp\Storage\TelemetryRepository.cs (5)
259public Subscription OnNewResources(Func<Task> callback) 264public Subscription OnNewLogs(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) 269public Subscription OnNewMetrics(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) 274public Subscription OnNewTraces(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) 279private Subscription AddSubscription(string name, ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback, List<Subscription> subscriptions)
Utils\CallbackThrottler.cs (2)
14public CallbackThrottler(string name, ILogger logger, TimeSpan minExecuteInterval, Func<Task> callback, ExecutionContext? executionContext) 29private readonly Func<Task> _callback;
Aspire.Dashboard.Components.Tests (9)
Shared\TestMessageService.cs (1)
22public event Func<Task>? OnMessageItemsUpdatedAsync;
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestAIContextProvider.cs (2)
54public IDisposable OnContextChanged(Func<Task> callback) 59public IDisposable OnDisplayChanged(Func<Task> callback)
tests\Shared\TestDashboardClient.cs (4)
15private readonly Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? _resourceChannelProvider; 16private readonly Func<Channel<WatchInteractionsResponseUpdate>>? _interactionChannelProvider; 29Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? resourceChannelProvider = null, 30Func<Channel<WatchInteractionsResponseUpdate>>? interactionChannelProvider = null,
Aspire.Dashboard.Tests (13)
Integration\StartupTests.cs (2)
1131private static void AssertIPv4OrIPv6Endpoint(Func<ResolvedEndpointInfo> endPointAccessor) 1138private static void AssertDynamicIPEndpoint(Func<ResolvedEndpointInfo> endPointAccessor)
TelemetryRepositoryTests\TestOutgoingPeerResolver.cs (3)
12private readonly List<Func<Task>> _callbacks; 24public IDisposable OnPeerChanges(Func<Task> callback) 32foreach (var callback in _callbacks)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestAIContextProvider.cs (2)
54public IDisposable OnContextChanged(Func<Task> callback) 59public IDisposable OnDisplayChanged(Func<Task> callback)
tests\Shared\TestDashboardClient.cs (4)
15private readonly Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? _resourceChannelProvider; 16private readonly Func<Channel<WatchInteractionsResponseUpdate>>? _interactionChannelProvider; 29Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? resourceChannelProvider = null, 30Func<Channel<WatchInteractionsResponseUpdate>>? interactionChannelProvider = null,
Aspire.Hosting (21)
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
ExternalServiceBuilderExtensions.cs (2)
260private readonly Func<HttpClient> _httpClientFactory; 266public ParameterUriHealthCheck(ParameterResource urlParameter, string? path, int expectedStatusCode, Func<HttpClient> httpClientFactory)
ParameterResourceBuilderExtensions.cs (1)
78public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, string name, Func<string> valueGetter, bool publishValueAsDefault = false, bool secret = false)
Pipelines\PipelineLoggerProvider.cs (1)
68private sealed class StepLogger(Func<IReportingStep?> currentStepAccessor, PipelineLoggingOptions options) : ILogger
Publishing\ManifestPublishingContext.cs (1)
148async Task WriteResourceObjectAsync<T>(T resource, Func<Task> action) where T : IResource
ResourceBuilderExtensions.cs (8)
119public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, Func<string> callback) where T : IResourceWithEnvironment 2036var endpointSelector = endpointName is not null 2074public static IResourceBuilder<T> WithHttpHealthCheck<T>(this IResourceBuilder<T> builder, Func<EndpointReference>? endpointSelector, string? path = null, int? statusCode = null) where T : IResourceWithEndpoints 2428Func<EndpointReference>? endpointSelector, 2914private static Func<EndpointReference> NamedEndpointSelector<TResource>(IResourceBuilder<TResource> builder, string[] endpointNames, string errorDisplayNoun) 2940private static Func<EndpointReference> DefaultEndpointSelector<TResource>(IResourceBuilder<TResource> builder) 3356var endpointSelector = endpointName is not null 3410public static IResourceBuilder<T> WithHttpProbe<T>(this IResourceBuilder<T> builder, ProbeType type, Func<EndpointReference>? endpointSelector, string? path = null, int? initialDelaySeconds = null, int? periodSeconds = null, int? timeoutSeconds = null, int? failureThreshold = null, int? successThreshold = null)
UserSecrets\IUserSecretsManager.cs (1)
46void GetOrSetSecret(IConfigurationManager configuration, string name, Func<string> valueGenerator);
UserSecrets\NoopUserSecretsManager.cs (1)
33public void GetOrSetSecret(IConfigurationManager configuration, string name, Func<string> valueGenerator)
UserSecrets\UserSecretsManagerFactory.cs (1)
118public void GetOrSetSecret(IConfigurationManager configuration, string name, Func<string> valueGenerator)
Aspire.Hosting.Azure (3)
AzureBicepResource.cs (1)
248object? inputValue = input.Value is Func<object?> f ? f() : input.Value;
AzureBicepResourceExtensions.cs (1)
207public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, Func<object?> valueCallback)
Provisioning\BicepUtilities.cs (1)
36var parameterValue = parameter.Value is Func<object?> f ? f() : parameter.Value;
Aspire.Hosting.Azure.AppContainers (1)
BaseContainerAppContext.cs (1)
411Func<BicepList<ContainerAppWritableSecret>> getContainerAppConfigurationSecrets,
Aspire.Hosting.Azure.Kusto.Tests (10)
KustoPublicApiTests.cs (8)
12var action = () => new AzureKustoClusterResource(null!, _ => { }); 24var action = () => new AzureKustoClusterResource(name, _ => { }); 51var action = () => new AzureKustoReadWriteDatabaseResource(null!, "db", parentResource); 66var action = () => new AzureKustoReadWriteDatabaseResource("kusto-db", name, parentResource); 79var action = () => new AzureKustoReadWriteDatabaseResource("kusto-db", null!, parentResource); 94var action = () => new AzureKustoReadWriteDatabaseResource("kusto-db", name, parentResource); 107var action = () => new AzureKustoReadWriteDatabaseResource("kusto-db", "db1", kustoParentResource); 130var action = () => new AzureKustoEmulatorResource(null!);
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Azure.Tests (163)
PublicApiTests\AppConfigurationPublicApiTests.cs (4)
16var action = () => builder.AddAzureAppConfiguration(name); 30var action = () => builder.AddAzureAppConfiguration(name); 46var action = () => new AzureAppConfigurationResource(name, configureInfrastructure); 60var action = () => new AzureAppConfigurationResource(name, configureInfrastructure);
PublicApiTests\AppContainersPublicApiTests.cs (7)
19var action = () => container.PublishAsAzureContainerApp(configure); 32var action = () => container.PublishAsAzureContainerApp(configure); 43var action = () => new AzureContainerAppCustomizationAnnotation(configure); 55var action = () => executable.PublishAsAzureContainerApp(configure); 68var action = () => executable.PublishAsAzureContainerApp(configure); 96var action = () => project.PublishAsAzureContainerApp(configure); 109var action = () => project.PublishAsAzureContainerApp(configure);
PublicApiTests\ApplicationInsightsPublicApiTests.cs (2)
63var action = () => new AzureApplicationInsightsResource(name, configureInfrastructure); 77var action = () => new AzureApplicationInsightsResource(name, configureInfrastructure);
PublicApiTests\CognitiveServicesPublicApiTests.cs (7)
22var action = () => new AzureOpenAIDeployment(name, modelName, modelVersion); 39var action = () => new AzureOpenAIDeployment(name, modelName, modelVersion); 56var action = () => new AzureOpenAIDeployment(name, modelName, modelVersion); 70var action = () => builder.AddAzureOpenAI(name); 84var action = () => builder.AddAzureOpenAI(name); 98var action = () => builder.AddDeployment(deployment); 111var action = () => builder.AddDeployment(deployment);
PublicApiTests\CosmosDBPublicApiTests.cs (34)
24var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 44var action = () => new AzureCosmosDBContainerResource(name, containerName, [partitionKeyPath], parent); 64var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 84var action = () => new AzureCosmosDBContainerResource(name, containerName, [partitionKeyPath], parent); 104var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 122var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPaths, parent); 138var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPaths, parent); 156var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPaths, parent); 170var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 184var action = () => new AzureCosmosDBContainerResource(name, containerName, [partitionKeyPath], parent); 200var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent.Resource); 218var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent.Resource); 233var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent); 244var action = () => new AzureCosmosDBEmulatorResource(innerResource); 258var action = () => new AzureCosmosDBResource(name, configureInfrastructure); 272var action = () => new AzureCosmosDBResource(name, configureInfrastructure); 284var action = () => builder.AddAzureCosmosDB(name); 298var action = () => builder.AddAzureCosmosDB(name); 312var action = () => builder.RunAsEmulator(configureContainer); 325var action = () => builder.RunAsPreviewEmulator(configureContainer); 336var action = () => builder.WithDataVolume(); 348var action = () => builder.WithGatewayPort(port); 360var action = () => builder.WithPartitionCount(count); 373var action = () => builder.AddDatabase(databaseName); 389var action = () => cosmos.AddDatabase(databaseName); 403var action = () => builder.AddCosmosDatabase(name); 418var action = () => cosmos.AddCosmosDatabase(name); 433var action = () => builder.AddContainer(name, partitionKeyPath); 450var action = () => cosmos.AddContainer(name, partitionKeyPath); 469var action = () => cosmos.AddContainer(name, partitionKeyPath); 484var action = () => cosmos.AddContainer(name, partitionKeyPaths!); 496var action = () => cosmos.AddContainer(name, partitionKeyPaths); 510var action = () => cosmos.AddContainer(name, partitionKeyPaths); 521var action = () => builder.WithDataExplorer();
PublicApiTests\EventHubsPublicApiTests.cs (28)
23var action = () => new AzureEventHubConsumerGroupResource(name, consumerGroupName, parent); 42var action = () => new AzureEventHubConsumerGroupResource(name, consumerGroupName, parent); 57var action = () => new AzureEventHubConsumerGroupResource(name, consumerGroupName, parent); 72var action = () => new AzureEventHubResource(name, hubName, parent); 89var action = () => new AzureEventHubResource(name, hubName, parent); 104var action = () => new AzureEventHubResource(name, hubName, parent); 115var action = () => new AzureEventHubsEmulatorResource(innerResource); 127var action = () => builder.AddAzureEventHubs(name); 141var action = () => builder.AddAzureEventHubs(name); 156var action = () => builder.AddEventHub(name); 172var action = () => builder.AddEventHub(name); 186var action = () => builder.AddHub(name); 201var action = () => builder.AddHub(name); 215var action = () => builder.WithProperties(configure); 228var action = () => builder.WithProperties(configure); 240var action = () => builder.AddConsumerGroup(name); 255var action = () => builder.AddConsumerGroup(name); 268var action = () => builder.RunAsEmulator(); 280var action = () => builder.WithDataBindMount(); 293var action = () => builder.WithDataVolume(); 307var action = () => builder.WithGatewayPort(port); 319var action = () => builder.WithHostPort(port); 331var action = () => builder.WithConfigurationFile(path); 347var action = () => builder.RunAsEmulator(configure => configure.WithConfigurationFile(path)); 361var action = () => builder.WithConfiguration(configJson); 374var action = () => builder.RunAsEmulator(configure => configure.WithConfiguration(configJson)); 388var action = () => new AzureEventHubsResource(name, configureInfrastructure); 402var action = () => new AzureEventHubsResource(name, configureInfrastructure);
PublicApiTests\FunctionsPublicApiTests.cs (5)
17var action = () => builder.AddAzureFunctionsProject<TestProject>(name); 31var action = () => builder.AddAzureFunctionsProject<TestProject>(name); 46var action = () => builder.WithHostStorage(storage); 59var action = () => builder.WithHostStorage(storage); 88var action = () => new AzureFunctionsProjectResource(name);
PublicApiTests\KeyVaultPublicApiTests.cs (4)
18var action = () => new AzureKeyVaultResource(name, configureInfrastructure); 32var action = () => new AzureKeyVaultResource(name, configureInfrastructure); 44var action = () => builder.AddAzureKeyVault(name); 58var action = () => builder.AddAzureKeyVault(name);
PublicApiTests\OperationalInsightsPublicApiTests.cs (4)
18var action = () => new AzureLogAnalyticsWorkspaceResource(name, configureInfrastructure); 32var action = () => new AzureLogAnalyticsWorkspaceResource(name, configureInfrastructure); 44var action = () => builder.AddAzureLogAnalyticsWorkspace(name); 58var action = () => builder.AddAzureLogAnalyticsWorkspace(name);
PublicApiTests\PostgreSQLPublicApiTests.cs (13)
48var action = () => builder.AddAzurePostgresFlexibleServer(name); 62var action = () => builder.AddAzurePostgresFlexibleServer(name); 76var action = () => builder.AddDatabase(name); 91var action = () => builder.AddDatabase(name); 104var action = () => builder.RunAsContainer(); 115var action = () => builder.WithPasswordAuthentication(); 128var action = () => new AzurePostgresResource(innerResource, configureInfrastructure); 143var action = () => new AzurePostgresResource(innerResource, configureInfrastructure); 158var action = () => new AzurePostgresFlexibleServerDatabaseResource(name, databaseName, postgresParentResource); 175var action = () => new AzurePostgresFlexibleServerDatabaseResource(name, databaseName, postgresParentResource); 190var action = () => new AzurePostgresFlexibleServerDatabaseResource(name, databaseName, postgresParentResource); 204var action = () => new AzurePostgresFlexibleServerResource(name, configureInfrastructure); 218var action = () => new AzurePostgresFlexibleServerResource(name, configureInfrastructure);
PublicApiTests\RedisPublicApiTests.cs (7)
21var action = () => new AzureRedisCacheResource(name, configureInfrastructure); 35var action = () => new AzureRedisCacheResource(name, configureInfrastructure); 77var action = () => builder.AddAzureRedis(name); 91var action = () => builder.AddAzureRedis(name); 104var action = () => builder.RunAsContainer(); 131var action = () => new AzureRedisResource(innerResource, configureInfrastructure); 144var action = () => new AzureRedisResource(innerResource, configureInfrastructure);
PublicApiTests\SearchPublicApiTests.cs (4)
16var action = () => builder.AddAzureSearch(name); 30var action = () => builder.AddAzureSearch(name); 46var action = () => new AzureSearchResource(name, configureInfrastructure); 60var action = () => new AzureSearchResource(name, configureInfrastructure);
PublicApiTests\ServiceBusPublicApiTests.cs (23)
17var action = () => new AzureServiceBusEmulatorResource(innerResource); 29var action = () => builder.AddAzureServiceBus(name); 43var action = () => builder.AddAzureServiceBus(name); 58var action = () => builder.AddQueue(name); 74var action = () => builder.AddQueue(name); 88var action = () => builder.AddServiceBusQueue(name); 103var action = () => builder.AddServiceBusQueue(name); 117var action = () => builder.WithProperties(configure); 130var action = () => builder.WithProperties(configure); 142var action = () => builder.AddServiceBusTopic(name); 157var action = () => builder.AddServiceBusTopic(name); 171var action = () => builder.WithProperties(configure); 184var action = () => builder.WithProperties(configure); 196var action = () => builder.AddServiceBusSubscription(name); 212var action = () => builder.AddServiceBusSubscription(name); 226var action = () => builder.WithProperties(configure); 241var action = () => builder.WithProperties(configure); 252var action = () => builder.RunAsEmulator(); 264var action = () => builder.WithConfigurationFile(path); 279var action = () => builder.RunAsEmulator(configure => configure.WithConfigurationFile(path)); 293var action = () => builder.WithConfiguration(configJson); 306var action = () => builder.RunAsEmulator(configure => configure.WithConfiguration(configJson)); 318var action = () => builder.WithHostPort(port);
PublicApiTests\SignalRPublicApiTests.cs (4)
16var action = () => new AzureSignalREmulatorResource(innerResource); 71var action = () => builder.RunAsEmulator(); 85var action = () => new AzureSignalRResource(name, configureInfrastructure); 99var action = () => new AzureSignalRResource(name, configureInfrastructure);
PublicApiTests\SqlPublicApiTests.cs (8)
20var action = () => new AzureSqlDatabaseResource(name, databaseName, parent); 37var action = () => new AzureSqlDatabaseResource(name, databaseName, parent); 52var action = () => new AzureSqlDatabaseResource(name, databaseName, parent); 94var action = () => builder.AddAzureSqlServer(name); 108var action = () => builder.AddAzureSqlServer(name); 122var action = () => builder.AddDatabase(name); 137var action = () => builder.AddDatabase(name); 150var action = () => builder.RunAsContainer();
PublicApiTests\WebPubSubPublicApiTests.cs (9)
18var action = () => builder.AddAzureWebPubSub(name); 32var action = () => builder.AddAzureWebPubSub(name); 46var action = () => builder.AddHub(hubName); 61var action = () => builder.AddHub(name); 121var action = () => builder.AddEventHandler(urlExpression); 135var action = () => new AzureWebPubSubHubResource(name, name, webpubsub); 149var action = () => new AzureWebPubSubHubResource(name, name, webpubsub); 163var action = () => new AzureWebPubSubResource(name, configureInfrastructure); 177var action = () => new AzureWebPubSubResource(name, configureInfrastructure);
Aspire.Hosting.CodeGeneration.Go.Tests (2)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (2)
350Func<string> valueProvider) 361Func<Task<string>> asyncValueProvider)
Aspire.Hosting.CodeGeneration.Java.Tests (2)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (2)
350Func<string> valueProvider) 361Func<Task<string>> asyncValueProvider)
Aspire.Hosting.CodeGeneration.Python.Tests (2)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (2)
350Func<string> valueProvider) 361Func<Task<string>> asyncValueProvider)
Aspire.Hosting.CodeGeneration.Rust.Tests (2)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (2)
350Func<string> valueProvider) 361Func<Task<string>> asyncValueProvider)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (2)
TestTypes\TestExtensions.cs (2)
350Func<string> valueProvider) 361Func<Task<string>> asyncValueProvider)
Aspire.Hosting.DevTunnels.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.DotnetTool.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Foundry.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Garnet.Tests (8)
GarnetPublicApiTests.cs (8)
17var action = () => builder.AddGarnet(name); 31var action = () => builder.AddGarnet(name); 44var action = () => builder.WithDataVolume(); 56var action = () => builder.WithDataBindMount(source); 71var action = () => builder.WithDataBindMount(source); 84var action = () => builder.WithPersistence(); 98var action = () => builder.WithPersistence(interval, keysChangedThreshold); 113var action = () => new GarnetResource(name);
Aspire.Hosting.GitHub.Models (1)
GitHubModelsHealthCheck.cs (1)
17internal sealed class GitHubModelsHealthCheck(HttpClient httpClient, Func<ValueTask<string?>> connectionString) : IHealthCheck
Aspire.Hosting.GitHub.Models.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.JavaScript.Tests (12)
NodeJsPublicApiTests.cs (10)
19var action = () => new NodeAppResource(name, command, workingDirectory); 36var action = () => new NodeAppResource(name, command, workingDirectory); 51var action = () => new NodeAppResource(name, command, workingDirectory); 64var action = () => builder.AddNodeApp(name, ".", scriptPath); 79var action = () => builder.AddNodeApp(name, ".", scriptPath); 96var action = () => builder.AddNodeApp(name, ".", scriptPath); 111var action = () => builder.AddJavaScriptApp(name: name, workingDirectory); 126var action = () => builder.AddJavaScriptApp(name: name, workingDirectory); 141var action = () => builder.AddJavaScriptApp(name, appDirectory); 157var action = () => builder.AddJavaScriptApp(name, workingDirectory, runScriptName);
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Kafka.Tests (11)
KafkaPublicApiTests.cs (9)
17var action = () => builder.AddKafka(name); 31var action = () => builder.AddKafka(name); 44var action = () => builder.WithKafkaUI(); 56var action = () => builder.WithHostPort(port); 67var action = () => builder.WithDataVolume(); 79var action = () => builder.WithDataBindMount(source); 94var action = () => builder.WithDataBindMount(source); 109var action = () => new KafkaServerResource(name); 124var action = () => new KafkaUIContainerResource(name);
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Keycloak.Tests (10)
KeycloakPublicApiTests.cs (10)
20var action = () => new KeycloakResource(name, admin, adminPassword); 35var action = () => new KeycloakResource(name, admin, adminPassword); 47var action = () => builder.AddKeycloak(name); 61var action = () => builder.AddKeycloak(name); 74var action = () => builder.WithDataVolume(); 86var action = () => builder.WithDataBindMount(source); 101var action = () => builder.WithDataBindMount(source); 115var action = () => builder.WithRealmImport(importDirectory); 130var action = () => builder.WithRealmImport(import); 144var action = () => builder.WithRealmImport("does-not-exist");
Aspire.Hosting.Maui (1)
MauiPlatformHelper.cs (1)
56Func<bool> isSupported,
Aspire.Hosting.Milvus.Tests (18)
MilvusPublicApiTests.cs (18)
18var action = () => new AttuResource(name); 32var action = () => builder.AddMilvus(name); 46var action = () => builder.AddMilvus(name); 60var action = () => builder.AddDatabase(name); 75var action = () => builder.AddDatabase(name); 88var action = () => builder.WithAttu(); 99var action = () => builder.WithDataVolume(); 111var action = () => builder.WithDataBindMount(source); 126var action = () => builder.WithDataBindMount(source); 141var action = () => builder.WithConfigurationBindMount(configurationFilePath); 158var action = () => builder.WithConfigurationBindMount(configurationFilePath); 173var action = () => builder.WithConfigurationFile(configurationFilePath); 188var action = () => builder.WithConfigurationFile(configurationFilePath); 206var action = () => new MilvusDatabaseResource(name, databaseName, parent); 224var action = () => new MilvusDatabaseResource(name, databaseName, parent); 239var action = () => new MilvusDatabaseResource(name, databaseName, parent); 253var action = () => new MilvusServerResource(name, apiKey); 267var action = () => new MilvusServerResource(name, apiKey);
Aspire.Hosting.MongoDB.Tests (20)
MongoDBPublicApiTests.cs (20)
18var action = () => builder.AddMongoDB(name, port); 33var action = () => builder.AddMongoDB(name, port); 48var action = () => builder.AddMongoDB(name, userName: userName, password: password); 64var action = () => builder.AddMongoDB(name, userName: userName, password: password); 78var action = () => builder.AddDatabase(name); 93var action = () => builder.AddDatabase(name); 106var action = () => builder.WithMongoExpress(); 120var action = () => builder.WithHostPort(port); 131var action = () => builder.WithDataVolume(); 143var action = () => builder.WithDataBindMount(source); 158var action = () => builder.WithDataBindMount(source); 172var action = () => builder.WithInitBindMount("init.js"); 189var action = () => builder.WithInitBindMount(source); 203var action = () => builder.WithInitFiles("init.js"); 218var action = () => builder.WithInitFiles(source); 235var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 252var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 267var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 280var action = () => new MongoDBServerResource(name); 295var action = () => new MongoExpressContainerResource(name);
Aspire.Hosting.MySql.Tests (23)
MySqlPublicApiTests.cs (21)
17var action = () => builder.AddMySql(name); 31var action = () => builder.AddMySql(name); 45var action = () => builder.AddDatabase(name); 60var action = () => builder.AddDatabase(name); 73var action = () => builder.WithPhpMyAdmin(); 87var action = () => builder.WithHostPort(port); 98var action = () => builder.WithDataVolume(); 110var action = () => builder.WithDataBindMount(source); 125var action = () => builder.WithDataBindMount(source); 140var action = () => builder.WithInitBindMount(source); 157var action = () => builder.WithInitBindMount(source); 172var action = () => builder.WithInitFiles(source); 187var action = () => builder.WithInitFiles(source); 208var action = () => new MySqlDatabaseResource(name, databaseName, parent); 229var action = () => new MySqlDatabaseResource(name, databaseName, parent); 245var action = () => new MySqlDatabaseResource(name, databaseName, parent); 261var action = () => new MySqlServerResource(name, password); 275var action = () => new MySqlServerResource(name, password); 288var action = () => new PhpMyAdminContainerResource(name); 302var action = () => builder.WithPassword(password); 315var action = () => builder.WithPassword(password);
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Nats.Tests (11)
NatsPublicApiTests.cs (11)
19var action = () => includePort ? builder.AddNats(name, 4222) : builder.AddNats(name); 35var action = () => includePort ? builder.AddNats(name, 4222) : builder.AddNats(name); 53var action = () => includePort 73var action = () => includePort 90var action = () => builder.WithJetStream(srcMountPath); 101var action = () => builder.WithJetStream(); 112var action = () => builder.WithDataVolume(); 124var action = () => builder.WithDataBindMount(source); 139var action = () => builder.WithDataBindMount(source); 154var action = () => new NatsServerResource(name); 178var action = () => new NatsServerResource(name, user?.Resource, password?.Resource);
Aspire.Hosting.OpenAI (1)
OpenAIModelHealthCheck.cs (1)
17internal sealed class OpenAIModelHealthCheck(HttpClient httpClient, Func<ValueTask<string?>> connectionString) : IHealthCheck
Aspire.Hosting.OpenAI.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Oracle.Tests (18)
OraclePublicApiTests.cs (18)
17var action = () => builder.AddOracle(name); 31var action = () => builder.AddOracle(name); 45var action = () => builder.AddDatabase(name); 60var action = () => builder.AddDatabase(name); 73var action = () => builder.WithDataVolume(); 85var action = () => builder.WithDataBindMount(source); 100var action = () => builder.WithDataBindMount(source); 115var action = () => builder.WithInitBindMount(source); 132var action = () => builder.WithInitBindMount(source); 147var action = () => builder.WithInitFiles(source); 162var action = () => builder.WithInitFiles(source); 176var action = () => builder.WithDbSetupBindMount(source); 191var action = () => builder.WithDbSetupBindMount(source); 210var action = () => new OracleDatabaseResource(name, databaseName, parent); 229var action = () => new OracleDatabaseResource(name, databaseName, parent); 244var action = () => new OracleDatabaseResource(name, databaseName, parent); 258var action = () => new OracleDatabaseServerResource(name, password); 272var action = () => new OracleDatabaseServerResource(name, password);
Aspire.Hosting.PostgreSQL.Tests (24)
PostgrePublicApiTests.cs (22)
19var action = () => new PgAdminContainerResource(name); 34var action = () => new PgWebContainerResource(name); 48var action = () => builder.AddPostgres(name); 62var action = () => builder.AddPostgres(name); 76var action = () => builder.AddDatabase(name); 91var action = () => builder.AddDatabase(name); 104var action = () => builder.WithPgAdmin(); 116var action = () => builder.WithHostPort(port); 128var action = () => builder.WithHostPort(port); 139var action = () => builder.WithPgWeb(); 150var action = () => builder.WithDataVolume(); 162var action = () => builder.WithDataBindMount(source); 177var action = () => builder.WithDataBindMount(source); 192var action = () => builder.WithInitBindMount(source); 205var action = () => builder.WithInitFiles(source); 221var action = () => builder.WithInitBindMount(source); 239var action = () => builder.WithInitFiles(source); 259var action = () => new PostgresDatabaseResource(name, databaseName, postgresParentResource); 279var action = () => new PostgresDatabaseResource(name, databaseName, postgresParentResource); 294var action = () => new PostgresDatabaseResource(name, databaseName, postgresParentResource); 310var action = () => new PostgresServerResource(name, userName, builder.Resource); 325var action = () => new PostgresServerResource(name, userName, password);
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Python.Tests (15)
PythonPublicApiTests.cs (15)
21var action = () => new PythonAppResource(name, executablePath, appDirectory); 38var action = () => new PythonAppResource(name, executablePath, appDirectory); 52var action = () => new PythonAppResource(name, executablePath, appDirectory: null!); 67var action = () => builder.AddPythonApp( 88var action = () => builder.AddPythonApp( 109var action = () => builder.AddPythonApp( 130var action = () => builder.AddPythonApp( 151var action = () => builder.AddPythonApp( 172var action = () => builder.AddPythonApp( 198var action = () => builder.AddPythonApp( 221var action = () => builder.AddPythonApp( 244var action = () => builder.AddPythonApp( 267var action = () => builder.AddPythonApp( 290var action = () => builder.AddPythonApp( 313var action = () => builder.AddPythonApp(
Aspire.Hosting.Qdrant.Tests (9)
QdrantPublicApiTests.cs (9)
17var action = () => builder.AddQdrant(name); 31var action = () => builder.AddQdrant(name); 44var action = () => builder.WithDataVolume(); 56var action = () => builder.WithDataBindMount(source); 71var action = () => qdrant.WithDataBindMount(source); 86var action = () => builder.WithReference(qdrantResource); 99var action = () => qdrant.WithReference(qdrantResource); 115var action = () => new QdrantServerResource(name, apiKey); 129var action = () => new QdrantServerResource(name, apiKey);
Aspire.Hosting.RabbitMQ.Tests (11)
RabbitMQPublicApiTests.cs (9)
17var action = () => builder.AddRabbitMQ(name); 31var action = () => builder.AddRabbitMQ(name); 44var action = () => builder.WithDataVolume(); 56var action = () => builder.WithDataBindMount(source); 71var action = () => rabbitMQ.WithDataBindMount(source); 84var action = () => builder.WithManagementPlugin(); 96var action = () => builder.WithManagementPlugin(port); 113var action = () => new RabbitMQServerResource(name: name, userName: userName, password: password); 128var action = () => new RabbitMQServerResource(name: name, userName: userName, password: password);
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Redis.Tests (16)
RedisPublicApiTests.cs (16)
17var action = () => builder.AddRedis(name); 31var action = () => builder.AddRedis(name); 44var action = () => builder.WithRedisCommander(); 55var action = () => builder.WithRedisInsight(); 67var action = () => builder.WithHostPort(port); 79var action = () => builder.WithHostPort(port); 90var action = () => builder.WithDataVolume(); 102var action = () => builder.WithDataBindMount(source); 117var action = () => redis.WithDataBindMount(source); 130var action = () => builder.WithPersistence(); 141var action = () => builder.WithDataVolume(); 153var action = () => builder.WithDataBindMount(source); 170var action = () => redisInsightBuilder.WithDataBindMount(source); 185var action = () => new RedisCommanderResource(name); 200var action = () => new RedisInsightResource(name); 215var action = () => new RedisResource(name);
Aspire.Hosting.RemoteHost.Tests (2)
CapabilityDispatcherTests.cs (2)
1622public static void InvokeCallback(Func<Task> callback) 1640public static int WithAsyncCallback(Func<Task<int>> callback)
Aspire.Hosting.Seq.Tests (6)
SeqPublicApiTests.cs (6)
17var action = () => builder.AddSeq(name); 29var action = () => builder.AddSeq(name); 40var action = () => builder.WithDataVolume(); 52var action = () => builder.WithDataBindMount(source); 65var action = () => qdrant.WithDataBindMount(source); 77var action = () => new SeqResource(name);
Aspire.Hosting.SqlServer.Tests (12)
SqlServerPublicApiTests.cs (12)
17var action = () => builder.AddSqlServer(name); 31var action = () => builder.AddSqlServer(name); 45var action = () => builder.AddDatabase(name); 60var action = () => builder.AddDatabase(name); 73var action = () => builder.WithDataVolume(); 85var action = () => builder.WithDataBindMount(source); 100var action = () => builder.WithDataBindMount(source); 121var action = () => new SqlServerDatabaseResource(name, databaseName, parent); 142var action = () => new SqlServerDatabaseResource(name, databaseName, parent); 157var action = () => new SqlServerDatabaseResource(name, databaseName, parent); 173var action = () => new SqlServerServerResource(name, password); 187var 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 (4)
Dcp\DcpExecutorTests.cs (1)
2595private static bool RetryTillTrueOrTimeout(Func<bool> check, int timeoutMilliseconds)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Utils\MockUserSecretsManager.cs (1)
19public void GetOrSetSecret(IConfigurationManager configuration, string name, Func<string> valueGenerator)
Aspire.Hosting.Valkey.Tests (9)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
ValkeyPublicApiTests.cs (7)
17var action = () => builder.AddValkey(name); 31var action = () => builder.AddValkey(name); 44var action = () => builder.WithDataVolume(); 56var action = () => builder.WithDataBindMount(source); 71var action = () => builder.WithDataBindMount(source); 84var action = () => builder.WithPersistence(); 97var 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)
20var action = () => new AspireOpenAIClientBuilder(hostBuilder, connectionName, serviceKey, disableTracing, enableSensitiveTelemetryData); 37var action = () => new AspireOpenAIClientBuilder(hostBuilder, connectionName, serviceKey, disableTracing, enableSensitiveTelemetryData); 50var action = () => builder.AddChatClient(); 62var action = () => builder.AddKeyedChatClient(serviceKey); 81var action = () => builder.AddKeyedChatClient(serviceKey); 94var action = () => builder.AddEmbeddingGenerator(); 106var action = () => builder.AddKeyedEmbeddingGenerator(serviceKey); 125var action = () => builder.AddKeyedEmbeddingGenerator(serviceKey); 139var action = () => builder.AddOpenAIClient(connectionName); 153var action = () => builder.AddOpenAIClient(connectionName); 167var action = () => builder.AddKeyedOpenAIClient(name); 181var action = () => builder.AddKeyedOpenAIClient(name);
Aspire.Playground.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
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);
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 = () =>
dotnet (15)
Commands\New\SdkInfoProvider.cs (2)
19private readonly Func<string> _getCurrentProcessPath; 27internal SdkInfoProvider(Func<string> getCurrentProcessPath)
Commands\Test\MTP\Terminal\TerminalTestReporter.cs (1)
29internal Func<IStopwatch> CreateStopwatch { get; set; } = SystemStopwatch.StartNew;
Commands\Test\VSTest\VSTestTrace.cs (1)
23public static void SafeWriteTrace(Func<string> messageLog)
Commands\Workload\WorkloadHistoryRecorder.cs (2)
17private readonly Func<IWorkloadResolver> _workloadResolverFunc; 19public WorkloadHistoryRecorder(IWorkloadResolver workloadResolver, IInstaller workloadInstaller, Func<IWorkloadResolver> workloadResolverFunc)
NugetPackageDownloader\NuGetPackageDownloader.cs (2)
35private readonly Func<IEnumerable<Task>> _retryTimer; 73Func<IEnumerable<Task>> timer = null,
Telemetry\TelemetryCommonProperties.cs (6)
14Func<string>? getCurrentDirectory = null, 16Func<string?>? getMACAddress = null, 17Func<string>? getDeviceId = null, 26private readonly Func<string> _getCurrentDirectory = getCurrentDirectory ?? Directory.GetCurrentDirectory; 28private readonly Func<string?> _getMACAddress = getMACAddress ?? MacAddressGetter.GetMacAddress; 29private readonly Func<string> _getDeviceId = getDeviceId ?? DeviceIdGetter.GetDeviceId;
TransactionalAction.cs (1)
58Func<T> action,
dotnet-dev-certs (7)
src\aspnetcore\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\aspnetcore\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\aspnetcore\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)
GenerateDocumentationAndConfigFiles (19)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\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\roslyn\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\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
ILAssembler (1)
EntityRegistry.cs (1)
609private TEntity CreateEntity<TEntity>(TableIndex table, List<TEntity> cache, Func<TEntity> constructor)
ILCompiler.ReadyToRun (8)
Compiler\DependencyAnalysis\ReadyToRun\CopiedMethodILDeduplicator.cs (2)
13private readonly Func<IEnumerable<CopiedMethodILNode>> _nodesProvider; 16public CopiedMethodILDeduplicator(Func<IEnumerable<CopiedMethodILNode>> nodesProvider)
IBC\IBCDataReader.cs (6)
365Func<IBC.MethodData> readFn; 380readFn = (Func<IBC.MethodData>)ReadV1Method; 391readFn = (Func<IBC.MethodData>)ReadMethod; 623Func<IBC.BlobEntry> readFn = 624(majorVersion == 1) ? (Func<IBC.BlobEntry>)ReadV1BlobEntry : 625(Func<IBC.BlobEntry>)ReadBlobEntry;
Infrastructure.Common (1)
ConditionalWcfTest.cs (1)
29private static bool GetConditionValue(string conditionName, Func<bool> detectFunc = null)
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.Authorization.Policy (1)
src\aspnetcore\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:
PersistentComponentState.cs (2)
52public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback) 62public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback, IComponentRenderMode? renderMode)
PersistentState\ComponentStatePersistenceManager.cs (1)
259static Task<bool> TryExecuteCallback(Func<Task> callback, ILogger<ComponentStatePersistenceManager> logger)
PersistentState\PersistComponentStateRegistration.cs (2)
7Func<Task> callback, 10public Func<Task> Callback { get; } = callback;
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\aspnetcore\src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
27private readonly Func<Regex>? _regexFactory;
Microsoft.AspNetCore.Components.Endpoints (7)
TempData\TempData.cs (2)
14private Func<IDictionary<string, object?>>? _loadFunc; 17internal TempData(Func<IDictionary<string, object?>> loadFunc)
TempData\TempDataCascadingValueSupplier.cs (5)
18private readonly Dictionary<string, Func<object?>> _valueCallbacks = new(StringComparer.OrdinalIgnoreCase); 39Func<object?> valueGetter = () => getter.GetValue(componentState.Component); 59internal void RegisterValueCallback(string tempDataKey, Func<object?> valueGetter) 110private readonly Func<object?> _currentValueGetter; 117Func<object?> currentValueGetter)
Microsoft.AspNetCore.Components.Forms (17)
EditContext.cs (5)
206public IEnumerable<string> GetValidationMessages(Expression<Func<object>> accessor) 223public bool IsModified(Expression<Func<object>> accessor) 238public bool IsValid(Expression<Func<object>> accessor) 519public bool IsValidationPending<TField>(Expression<Func<TField>> accessor) 548public bool IsValidationFaulted<TField>(Expression<Func<TField>> accessor)
FieldIdentifier.cs (8)
34public static FieldIdentifier Create<TField>(Expression<Func<TField>> accessor) 109private static void ParseAccessor<T>(Expression<Func<T>> accessor, out object model, out string fieldName) 143var modelLambda = Expression.Lambda(typeof(Func<object?>), memberExpression.Expression); 144var modelLambdaCompiled = (Func<object?>)modelLambda.Compile(); 218var methodCallObjectLambda = Expression.Lambda(typeof(Func<object?>), methodCallExpression!); 219var 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.Server (6)
Circuits\CircuitHost.cs (4)
29private Func<Func<Task>, Task> _dispatchInboundActivity; 654internal Task HandleInboundActivityAsync(Func<Task> handler) 658internal async Task<TResult> HandleInboundActivityAsync<TResult>(Func<Task<TResult>> handler) 665private 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.Web (12)
Forms\DisplayName.cs (2)
20private Expression<Func<TValue>>? _previousFieldAccessor; 27public Expression<Func<TValue>>? For { get; set; }
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\ExpressionMemberAccessor.cs (2)
26private static MemberInfo GetMemberInfo<TValue>(Expression<Func<TValue>> accessor) 79public static string GetDisplayName<TValue>(Expression<Func<TValue>> accessor)
Forms\InputBase.cs (1)
56[Parameter] public Expression<Func<TValue>>? ValueExpression { get; set; }
Forms\Label.cs (1)
42public Expression<Func<TValue>>? For { get; set; }
Forms\ValidationMessage.cs (2)
16private Expression<Func<TValue>>? _previousFieldAccessor; 32[Parameter] public Expression<Func<TValue>>? For { get; set; }
JSComponents\JSComponentInterop.cs (1)
176var callback = jsObjectReference is null ? null : new Func<Task>(
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.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.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)
39private readonly Func<SymmetricAlgorithm> _symmetricAlgorithmFactory; 44private readonly Func<KeyedHashAlgorithm> _validationAlgorithmFactory; 46public 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.Diagnostics.Middleware.Tests (7)
Buffering\TestConfiguration.cs (3)
14private Func<string> _json; 16public TestConfiguration(JsonConfigurationSource source, Func<string> json) 22public static ConfigurationRoot Create(Func<string> getJson)
Latency\AddServerTimingHeaderMiddlewareTests.cs (2)
52private Func<Task> _responseStartingAsync = 57var prior = _responseStartingAsync;
Latency\RequestLatencyTelemetryMiddlewareTests.cs (2)
188private Func<Task> _responseStartingAsync = 203var prior = _responseStartingAsync;
Microsoft.AspNetCore.Http (1)
src\aspnetcore\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.Extensions (1)
RequestDelegateFactory.cs (1)
105private static readonly MemberExpression CompletedTaskExpr = Expression.Property(null, (PropertyInfo)GetMemberInfo<Func<Task>>(() => Task.CompletedTask));
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\aspnetcore\src\Http\Routing\src\DataSourceDependentCache.cs (1)
17private readonly Func<T> _initializer;
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.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.TagHelpers (1)
GlobbingUrlBuilder.cs (1)
60internal Func<Matcher> MatcherBuilder { get; set; }
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.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.Utilities.Shared (14)
InterlockedOperations.cs (2)
108public static T Initialize<T>(ref T target, ref int state, Func<T> factory) 168/// <see cref="Initialize{T}(ref T, ref int, Func{T})"/> and provides the same thread-safety
PooledObjects\DefaultPool.cs (2)
21public static ObjectPool<T> Create<T>(Func<T> factory, Optional<int> poolSize = default) 29private sealed class PoolableObjectPolicy<T>(Func<T> factory) : IPooledObjectPolicy<T>
src\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
Threading\LazyValue`1.cs (3)
37private readonly Func<T> _factory; 51public LazyValue(Func<T> factory) 72/// The implementation uses <see cref="InterlockedOperations.Initialize{T}(ref T, ref int, Func{T})"/>
Utilities\CleanableWeakCache`2.cs (1)
93public TValue GetOrAdd(TKey key, Func<TValue> valueFactory)
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.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.Testing.Tests (1)
TestResources\Startup.cs (1)
19public void Configure(IApplicationBuilder app) => app.Use((HttpContext _, Func<Task> _) => Task.CompletedTask);
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 (16)
BackEnd\BuildManager\CacheAggregator.cs (2)
17private readonly Func<int> _nextConfigurationId; 25public CacheAggregator(Func<int> nextConfigurationId)
BackEnd\Client\MSBuildClient.cs (1)
411private bool TrySendPacket(Func<INodePacket> packetResolver)
BackEnd\Components\Communications\NodeLauncher.cs (1)
324private static Process DisableMSBuildServer(Func<Process> func)
BackEnd\Shared\BuildRequestConfiguration.cs (1)
528private void InitializeProject(BuildParameters buildParameters, Func<ProjectInstance> loadProjectFromFile)
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\BinaryLogger\BinaryLogger.cs (1)
761private static bool TryInterpretPathParameterCore(string parameter, Func<string> wildcardExpander, out string filePath)
Logging\TerminalLogger\TerminalLogger.cs (1)
82internal Func<StopwatchAbstraction>? _createStopwatch = null;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
Microsoft.Build.Framework (12)
BuildEnvironmentHelper.cs (12)
74var possibleLocations = new Func<BuildEnvironment>[] 85foreach (var location in possibleLocations) 462internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 463Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 464Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 466Func<bool> runningTests = null) 490private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 491private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 492private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 493private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 495private static Func<bool> s_runningTests = CheckIfRunningTests;
Microsoft.Build.Tasks.Core (7)
Copy.cs (1)
922private bool TryPathOperation(Func<string> operation, string src, string dest, out string resultPathOperation)
FileIO\GetFileHash.cs (4)
27internal static readonly Dictionary<string, Func<HashAlgorithm>> SupportedAlgorithms 28= new Dictionary<string, Func<HashAlgorithm>>(StringComparer.OrdinalIgnoreCase) 73if (!SupportedAlgorithms.TryGetValue(Algorithm, out var algorithmFactory)) 146internal static byte[] ComputeHash(Func<HashAlgorithm> algorithmFactory, AbsolutePath filePath, CancellationToken ct)
FileIO\VerifyFileHash.cs (1)
54if (!GetFileHash.SupportedAlgorithms.TryGetValue(Algorithm, out var algorithmFactory))
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (1)
33Func<string>[] possibleLocations =
Microsoft.CodeAnalysis (35)
Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
CommandLine\CommandLineResource.cs (1)
70Func<Stream> dataProvider = () =>
Compilation.EmitStream.cs (1)
68internal Func<Stream?> GetCreateStreamFunc(CommonMessageProvider messageProvider, DiagnosticBag diagnostics)
Compilation\Compilation.cs (5)
3308Func<Stream?>? getPortablePdbStream = 3311: (Func<Stream?>)(() => ConditionalGetOrCreateStream(pdbStreamProvider, metadataDiagnostics)); 3401Func<Stream?> getPeStream, 3402Func<Stream?>? getMetadataPeStreamOpt, 3403Func<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)
62public 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)
19private readonly Func<Stream>? _streamProvider; 29internal 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\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
Microsoft.CodeAnalysis.Analyzers (19)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\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\roslyn\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\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.AnalyzerUtilities (23)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\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\roslyn\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\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (2)
36private readonly Func<bool> _getIsInsideAnonymousObjectInitializer; 47Func<bool> getIsInsideAnonymousObjectInitializer,
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
2202Func<ControlFlowGraph?> getCfg, 3499TAnalysisData AnalyzePossibleTargetInvocation(Func<TAbstractAnalysisValue> computeValueForInvocation, TAnalysisData inputAnalysisData, TAnalysisData? mergedAnalysisData, ref bool first)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.CodeStyle (19)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\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\roslyn\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\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\roslyn\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\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
170var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<>), ContainingNamespace.Name: nameof(System) }
Microsoft.CodeAnalysis.CSharp (1)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
301private BoundStatement PossibleIteratorScope(ImmutableArray<LocalSymbol> locals, Func<BoundStatement> wrapped)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
308Name: nameof(Func<>) or nameof(Action<>),
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Resources\CSharpMarkAssembliesWithNeutralResourcesLanguage.cs (1)
19protected override void RegisterAttributeAnalyzer(CompilationStartAnalysisContext context, Func<bool> shouldAnalyze, Action<SyntaxNodeAnalysisContext> onResourceFound, INamedTypeSymbol generatedCode)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
308Name: nameof(Func<>) or nameof(Action<>),
Microsoft.CodeAnalysis.Extensions.Package (6)
src\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
Microsoft.CodeAnalysis.ExternalAccess.HotReload (2)
Api\HotReloadService.cs (2)
17internal sealed class HotReloadService(SolutionServices services, Func<ValueTask<ImmutableArray<string>>> capabilitiesProvider) 19private sealed class DebuggerService(Func<ValueTask<ImmutableArray<string>>> capabilitiesProvider) : IManagedHotReloadService
Microsoft.CodeAnalysis.Features (18)
EditAndContinue\DebuggingSession.cs (1)
969public 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)
37private record struct TimestampedWorkItem(Func<Task> Work, DateTime TimestampAdded); 119private void AddWork(Func<Task> work)
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (1)
57Func<Task> onProjectCompleted,
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (2)
76Func<Task> onProjectCompleted, 116Func<Task> onProjectCompleted,
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (2)
27Func<Task> onProjectCompleted, 65Func<Task> onProjectCompleted,
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (2)
154Func<Task> onProjectCompleted, 194Func<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)
350Func<INavigateToSearchService, ImmutableArray<Project>, Func<ImmutableArray<INavigateToSearchResult>, Task>, Func<Task>, Task> processProjectAsync, 536public 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\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
170var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<>), ContainingNamespace.Name: nameof(System) }
Microsoft.CodeAnalysis.Razor.Compiler (5)
Language\Legacy\NativeCSharpTokenizer.cs (5)
24private readonly Dictionary<char, Func<SyntaxKind>> _operatorHandlers; 113_operatorHandlers = new Dictionary<char, Func<SyntaxKind>>() 465Func<SyntaxKind> handler; 513private Func<SyntaxKind> CreateTwoCharOperatorHandler(SyntaxKind typeIfOnlyFirst, char second, SyntaxKind typeIfBoth) 526private Func<SyntaxKind> CreateTwoCharOperatorHandler(SyntaxKind typeIfOnlyFirst, char option1, SyntaxKind typeIfOption1, char option2, SyntaxKind typeIfOption2)
Microsoft.CodeAnalysis.ResxSourceGenerator (19)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\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\roslyn\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\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Source\SourcePropertySymbol.vb (1)
362Dim getErrorInfo As Func(Of DiagnosticInfo) = Nothing
Microsoft.CodeAnalysis.Workspaces (29)
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\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\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\roslyn\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\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Workspace\IsolatedAnalyzerReferenceSet.Core.cs (1)
221Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
Workspace\IsolatedAnalyzerReferenceSet.cs (1)
39Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
Workspace\Solution\SolutionCompilationState.cs (1)
57private static readonly Func<ConditionalWeakTable<ISymbol, OriginatingProjectInfo?>> s_createTable = () => new();
Workspace\Workspace.cs (1)
585protected internal async Task<T> ScheduleTask<T>(Func<T> func, string? taskName = "Workspace.Task")
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\ProjectLoadProgressExtensions.cs (1)
15public async Task<TResult> DoOperationAndReportProgressAsync<TResult>(ProjectLoadOperation operation, string? projectPath, string? targetFramework, Func<Task<TResult>> doFunc)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\roslyn\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)
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
178new PredefinedTypeInfo(PredefinedType.PT_FUNC, typeof(Func<>), "System.Func`1")
Microsoft.Diagnostics.NETCore.Client (2)
WebSocketServer\WebSocketServerProvider.cs (2)
12internal static void SetProvider(Func<IWebSocketServer> provider) 22private static Func<IWebSocketServer> _provider;
Microsoft.DotNet.ApiCompat.Task (1)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\ApiCompatServiceProvider.cs (1)
21Func<ISuppressionEngine> suppressionEngineFactory,
Microsoft.DotNet.Cli.Definitions (3)
src\sdk\src\Resolvers\Microsoft.DotNet.NativeWrapper\EnvironmentProvider.cs (3)
15private readonly Func<string?> _getCurrentProcessPath; 21public EnvironmentProvider(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath) 124public static string? GetDotnetExeDirectory(Func<string, string?> getEnvironmentVariable, Func<string?>? getCurrentProcessPath, Action<FormattableString>? log = null)
Microsoft.DotNet.Cli.Utils (8)
ExponentialRetry.cs (7)
33public static async Task<T> ExecuteAsyncWithRetry<T>(Func<Task<T>> action, 36Func<IEnumerable<Task>> timer, 61public static async Task<T> ExecuteWithRetry<T>(Func<T> action, 64Func<IEnumerable<Task>> timer, 67Func<Task<T>> asyncAction = () => Task.FromResult(action()); 71public static async Task<T> ExecuteWithRetryOnFailure<T>(Func<Task<T>> action, 73Func<IEnumerable<Task>>? timer = null)
FileAccessRetrier.cs (1)
9Func<T> func,
Microsoft.DotNet.Configurer (4)
IUserLevelCacheWriter.cs (2)
8string RunWithCache(string cacheKey, Func<string> getValueToCache); 9string RunWithCacheInFilePath(string cacheFilepath, Func<string> getValueToCache);
UserLevelCacheWriter.cs (2)
23public string RunWithCache(string cacheKey, Func<string> getValueToCache) 29public string RunWithCacheInFilePath(string cacheFilepath, Func<string> getValueToCache)
Microsoft.DotNet.NativeWrapper (3)
EnvironmentProvider.cs (3)
15private readonly Func<string?> _getCurrentProcessPath; 21public EnvironmentProvider(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath) 124public static string? GetDotnetExeDirectory(Func<string, string?> getEnvironmentVariable, Func<string?>? getCurrentProcessPath, Action<FormattableString>? log = null)
Microsoft.DotNet.TemplateLocator (6)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\ReadableWorkloadManifest.cs (4)
18readonly Func<Stream> _openManifestStreamFunc; 21readonly Func<Stream?> _openLocalizationStream; 23public ReadableWorkloadManifest(string manifestId, string manifestDirectory, string manifestPath, string manifestFeatureBand, string manifestVersion, Func<Stream> openManifestStreamFunc, Func<Stream?> openLocalizationStream)
TemplateLocator.cs (2)
16private readonly Func<string>? _getCurrentProcessPath; 26public TemplateLocator(Func<string, string?> getEnvironmentVariable, Func<string>? getCurrentProcessPath, VSSettings vsSettings,
Microsoft.Extensions.AI.Evaluation (5)
Utilities\TimingHelper.cs (5)
32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 83Func<Task<TResult>> operation) 101Func<ValueTask<TResult>> operation)
Microsoft.Extensions.AI.Evaluation.Console (15)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (5)
32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 83Func<Task<TResult>> operation) 101Func<ValueTask<TResult>> operation)
Telemetry\TelemetryExtensions.cs (5)
51Func<TResult> operation, 73Func<Task> operation, 93Func<ValueTask> operation, 113Func<Task<TResult>> operation, 136Func<ValueTask<TResult>> operation,
Utilities\LoggerExtensions.cs (5)
35Func<TResult> operation, 54Func<Task> operation, 69Func<ValueTask> operation, 84Func<Task<TResult>> operation, 102Func<ValueTask<TResult>> operation,
Microsoft.Extensions.AI.Evaluation.NLP (5)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (5)
32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 83Func<Task<TResult>> operation) 101Func<ValueTask<TResult>> operation)
Microsoft.Extensions.AI.Evaluation.Quality (5)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (5)
32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 83Func<Task<TResult>> operation) 101Func<ValueTask<TResult>> operation)
Microsoft.Extensions.AI.Evaluation.Reporting (5)
Storage\DiskBasedResponseCache.cs (3)
30private readonly Func<DateTime> _provideDateTime; 37Func<DateTime> provideDateTime, 236Func<DateTime> provideDateTime,
Storage\DiskBasedResponseCacheProvider.cs (2)
27private readonly Func<DateTime> _provideDateTime = () => DateTime.UtcNow; 34Func<DateTime> provideDateTime,
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (5)
Storage\AzureStorageResponseCache.cs (3)
27Func<DateTime> provideDateTime, 38private readonly Func<DateTime> _provideDateTime = provideDateTime; 195Func<DateTime> provideDateTime,
Storage\AzureStorageResponseCacheProvider.cs (2)
28private readonly Func<DateTime> _provideDateTime = () => DateTime.Now; 35Func<DateTime> provideDateTime,
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (3)
AzureStorage\AzureResponseCacheTests.cs (1)
53internal override IEvaluationResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime)
DiskBased\DiskBasedResponseCacheTests.cs (1)
51internal override IEvaluationResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime)
ResponseCacheTester.cs (1)
21internal abstract IEvaluationResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime);
Microsoft.Extensions.AI.Evaluation.Safety (5)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (5)
32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 83Func<Task<TResult>> operation) 101Func<ValueTask<TResult>> operation)
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
426Func<AIFunctionFactoryOptions> createOptions = () =>
Microsoft.Extensions.AI.Tests (11)
ChatCompletion\DistributedCachingChatClientTest.cs (3)
777=> ToAsyncEnumerableAsync(preTask, valueFactories.Select<T, Func<T>>(v => () => v)); 779private static async IAsyncEnumerable<T> ToAsyncEnumerableAsync<T>(Task preTask, IEnumerable<Func<T>> values) 783foreach (var value in values)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (2)
782Func<Queue<List<ChatMessage>>> expectedDownstreamClientInput = () => new Queue<List<ChatMessage>>( 796Func<Queue<List<ChatMessage>>> downstreamClientOutput = () => new Queue<List<ChatMessage>>(
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
1117async Task InvokeAsync(Func<Task> work) 1316async Task InvokeAsync(Func<Task<List<ChatMessage>>> work)
Functions\AIFunctionFactoryTest.cs (4)
263Func<string> dotnetFunc = () => "test"; 289Func<string> funcWithDisplayName = [DisplayName("get_user_id")] () => "test"; 295Func<string> funcWithBoth = [DisplayName("my_function")][Description("A test function")] () => "test"; 313Func<string> funcWithoutDisplayName = () => "test";
Microsoft.Extensions.AmbientMetadata.Application.Tests (6)
ApplicationMetadataExtensionsTests.cs (3)
64var act = () => new ConfigurationBuilder().AddApplicationMetadata(_hostEnvironment.Object, sectionName!); 75var act = () => FakeHost.CreateBuilder().UseApplicationMetadata(sectionName!); 86var act = () => Host.CreateEmptyApplicationBuilder(new()).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)
233Func<Task?> setAsyncState = async () =>
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 (13)
Linux\LinuxUtilizationProvider.cs (2)
304private Measurement<T>[] GetMeasurementWithRetry<T>(Func<T> func) 315private bool TryGetValueWithRetry<T>(Func<T> func, out T value)
Linux\Network\LinuxNetworkMetrics.cs (1)
89Func<TcpStateInfo> getStateInfoFunc,
Windows\WindowsContainerResourceQuotaProvider.cs (2)
14private Func<IJobHandle> _createJobHandleObject; 21public WindowsContainerResourceQuotaProvider(IMemoryInfo memoryInfo, ISystemInfo systemInfo, Func<IJobHandle> createJobHandleObject)
Windows\WindowsContainerSnapshotProvider.cs (2)
24private readonly Func<IJobHandle> _createJobHandleObject; 76Func<IJobHandle> createJobHandleObject,
Windows\WindowsSnapshotProvider.cs (6)
29private readonly Func<long> _getCpuTicksFunc; 30private readonly Func<long> _getMemoryUsageFunc; 54Func<int> getCpuUnitsFunc, 55Func<long> getCpuTicksFunc, 56Func<long> getMemoryUsageFunc, 57Func<ulong> getTotalMemoryInBytesFunc)
Microsoft.Extensions.FileProviders.Physical (2)
PhysicalFileProvider.cs (1)
29private readonly Func<PhysicalFilesWatcher> _fileWatcherFactory;
PhysicalFilesWatcher.cs (1)
47private 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 () => 439var act = () => client.SendAsync(httpRequestMessage, CancellationToken.None); 555var act = async () => await client 825var act = () => client.SendAsync(httpRequestMessage, CancellationToken.None);
Logging\HttpClientLoggingExtensionsTest.cs (5)
38var act = () => ((IHttpClientBuilder)null!).AddExtendedHttpClientLogging(); 57var act = () => ((IServiceCollection)null!).AddExtendedHttpClientLogging(); 76var act = () => ((IServiceCollection)null!).AddHttpClientLogEnricher<EmptyEnricher>(); 216var act = async () => await host.StartAsync().ConfigureAwait(false); 325var 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.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 (7)
DnsServicePublicApiTests.cs (7)
17var action = () => services.AddDnsSrvServiceEndpointProvider(); 29var action = () => services.AddDnsSrvServiceEndpointProvider(configureOptions); 41var action = () => services.AddDnsSrvServiceEndpointProvider(configureOptions); 52var action = () => services.AddDnsServiceEndpointProvider(); 64var action = () => services.AddDnsServiceEndpointProvider(configureOptions); 75var action = () => services.ConfigureDnsResolver(_ => { }); 87var action = () => services.ConfigureDnsResolver(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)
79private 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)
34private 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 (18)
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 (7)
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>>(); 507var sizeGetter = Utils.MarshalInvoke(_makeSizeGetterMethodInfo, this, rawItemType, info.Index); 555foreach (var getter in _sizeGetters) 578private Func<int> MakeSizeGetter<T>(int col)
Microsoft.NET.Build.Containers (4)
Registry\Registry.cs (4)
79private readonly Func<TimeSpan> _retryDelayProvider; 92internal Registry(string registryName, ILogger logger, IRegistryAPI registryAPI, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null) : 101internal Registry(Uri baseUri, ILogger logger, IRegistryAPI registryAPI, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null) : 109private Registry(Uri baseUri, ILogger logger, RegistryApiFactory factory, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null)
Microsoft.NET.Build.Tasks (4)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\ReadableWorkloadManifest.cs (4)
18readonly Func<Stream> _openManifestStreamFunc; 21readonly Func<Stream?> _openLocalizationStream; 23public ReadableWorkloadManifest(string manifestId, string manifestDirectory, string manifestPath, string manifestFeatureBand, string manifestVersion, Func<Stream> openManifestStreamFunc, Func<Stream?> openLocalizationStream)
Microsoft.NET.Sdk.Publish.Tasks (1)
Tasks\ZipDeploy\ZipDeploymentStatus.cs (1)
96private async System.Threading.Tasks.Task RetryAsync(Func<System.Threading.Tasks.Task> func, int retryCount, TimeSpan retryDelay)
Microsoft.NET.Sdk.WorkloadManifestReader (4)
ReadableWorkloadManifest.cs (4)
18readonly Func<Stream> _openManifestStreamFunc; 21readonly Func<Stream?> _openLocalizationStream; 23public ReadableWorkloadManifest(string manifestId, string manifestDirectory, string manifestPath, string manifestFeatureBand, string manifestVersion, Func<Stream> openManifestStreamFunc, Func<Stream?> openLocalizationStream)
Microsoft.TemplateEngine.Cli (4)
PostActionDispatcher.cs (2)
44private readonly Func<string> _inputGetter; 51internal PostActionDispatcher(IEngineEnvironmentSettings environment, Func<string> inputGetter)
TemplateInvoker.cs (2)
24private readonly Func<string> _inputGetter; 30Func<string> inputGetter)
Microsoft.TemplateEngine.Core (5)
Expressions\Cpp\CppStyleEvaluatorDefinition.cs (2)
320private static bool EvaluateCondition(IReadOnlyList<TokenRef> tokens, IReadOnlyList<Func<object>> values) 575private static object ResolveToken(TokenRef tokenRef, IReadOnlyList<Func<object>> values)
Util\EncodingConfig.cs (3)
11private readonly Func<object>[] _values; 37_values = new Func<object>[config.Variables.Count]; 47public IReadOnlyList<Func<object>> VariableValues => _values;
Microsoft.TemplateEngine.Core.Contracts (1)
IEncodingConfig.cs (1)
16IReadOnlyList<Func<object>> VariableValues { get; }
Microsoft.TemplateEngine.Utils (2)
AsyncLazy.cs (2)
20public AsyncLazy(Func<T> valueFactory) 28public AsyncLazy(Func<Task<T>> taskFactory)
Microsoft.VisualStudio.TestPlatform.Common (3)
ExtensionFramework\Utilities\LazyExtension.cs (2)
22private readonly Func<TExtension>? _extensionCreator; 68public LazyExtension(Func<TExtension> creator, TMetadata metadata)
Logging\InternalTestLoggerEvents.cs (1)
315private void SafeInvokeAsync(Func<MulticastDelegate?> eventHandlersFactory, EventArgs args, int size, string traceDisplayName)
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (2)
Utility\TrxFileHelper.cs (2)
28private readonly Func<DateTime> _timeProvider; 60public TrxFileHelper(Func<DateTime> timeProvider)
Microsoft.VisualStudio.TestPlatform.ObjectModel (4)
LazyPropertyValue.cs (2)
25private readonly Func<T> _getValue; 29public LazyPropertyValue(Func<T> getValue)
Nuget.Frameworks\SimplePool.cs (2)
14private readonly Func<T> _allocate; 16public SimplePool(Func<T> allocate)
Mono.Cecil (3)
Mono.Cecil.Cil\CodeReader.cs (2)
338 void ReadExceptionHandlers (int count, Func<int> read_entry, Func<int> read_length)
Mono.Cecil\AssemblyReader.cs (1)
1948 Dictionary<MetadataToken, Range []> InitializeRanges (Table table, Func<MetadataToken> get_next)
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
234[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
netstandard (1)
netstandard.cs (1)
794[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
NuGet.Build.Tasks (1)
RestoreSettingsUtils.cs (1)
71public static T GetValue<T>(params Func<T>[] funcs)
NuGet.Build.Tasks.Console (2)
Program.cs (2)
153/// <param name="getStream">A <see cref="Func{TResult}" /> that is called to get a <see cref="Stream" /> to read.</param> 157internal static bool TryParseArguments(string[] args, Func<Stream> getStream, TextWriter errorWriter, out (Dictionary<string, string> Options, FileInfo MSBuildExeFilePath, string EntryProjectFilePath, Dictionary<string, string> MSBuildGlobalProperties) arguments)
NuGet.CommandLine.XPlat (46)
Commands\CommandParsers.cs (1)
14public static void Register(CommandLineApplication app, Func<ILogger> getLogger)
Commands\ConfigCommands\ConfigCommand.cs (5)
89internal static Command Register(Command app, Func<ILogger> getLogger) 133private static void RegisterOptionsForCommandConfigPaths(Command cmd, Func<ILogger> getLogger) 150private static void RegisterOptionsForCommandConfigGet(Command cmd, Func<ILogger> getLogger) 172private static void RegisterOptionsForCommandConfigSet(Command cmd, Func<ILogger> getLogger) 193private static void RegisterOptionsForCommandConfigUnset(Command cmd, Func<ILogger> getLogger)
Commands\ConfigCommands\ConfigRunners.cs (5)
19public static int Run(ConfigPathsArgs args, Func<ILogger> getLogger) 52public static int Run(ConfigGetArgs args, Func<ILogger> getLogger) 99public static int Run(ConfigSetArgs args, Func<ILogger> getLogger) 121public static int Run(ConfigUnsetArgs args, Func<ILogger> getLogger) 262public static void EnsureArgumentsNotNull<TArgs>(TArgs args, Func<ILogger> logger)
Commands\DeleteCommand.cs (1)
18public static void Register(CommandLineApplication app, Func<ILogger> getLogger)
Commands\LocalsCommand.cs (1)
16public static void Register(CommandLineApplication app, Func<ILogger> getLogger)
Commands\PackageReferenceCommands\AddPackageReferenceCommand.cs (3)
17public static void Register(CommandLineApplication app, Func<ILogger> getLogger, 18Func<IPackageReferenceCommandRunner> getCommandRunner, 19Func<IVirtualProjectBuilder?>? getVirtualProjectBuilder = null)
Commands\PackageReferenceCommands\ListPackage\ListPackageCommand.cs (2)
25Func<ILogger> getLogger, 27Func<IListPackageCommandRunner> getCommandRunner)
Commands\PackageReferenceCommands\RemovePackageReferenceCommand.cs (3)
16public static void Register(CommandLineApplication app, Func<ILogger> getLogger, 17Func<IPackageReferenceCommandRunner> getCommandRunner, 18Func<IVirtualProjectBuilder?>? getVirtualProjectBuilder = null)
Commands\PackageSearch\PackageSearchCommand.cs (2)
21public static void Register(Command rootCommand, Func<ILoggerWithColor> getLogger) 26public static void Register(Command rootCommand, Func<ILoggerWithColor> getLogger, Func<PackageSearchArgs, string, CancellationToken, Task<int>> setupSettingsAndRunSearchAsync)
Commands\PushCommand.cs (1)
19public static void Register(CommandLineApplication app, Func<ILogger> getLogger)
Commands\Signing\SignCommand.cs (2)
23Func<ILogger> getLogger, 25Func<ISignCommandRunner> getCommandRunner)
Commands\Signing\TrustedSignersCommand.cs (2)
21Func<ILogger> getLogger, 241Func<ILogger> getLogger,
Commands\Signing\VerifyCommand.cs (2)
21Func<ILogger> getLogger, 23Func<IVerifyCommandRunner> getCommandRunner)
Commands\Verbs.cs (6)
16Func<ILogger> getLogger) 155Func<ILogger> getLogger) 195Func<ILogger> getLogger) 235Func<ILogger> getLogger) 296Func<ILogger> getLogger) 360Func<ILogger> getLogger)
Commands\Why\WhyCommand.cs (1)
54internal static void Register(Command rootCommand, Lazy<IAnsiConsole> console, Func<WhyCommandRunner> getCommandRunner)
Program.cs (2)
102Func<ILoggerWithColor> getHidePrefixLogger = () => 307Func<ILoggerWithColor> getHidePrefixLogger = () =>
src\nuget-client\artifacts\.packages\microsoft.extensions.commandlineutils.sources\3.0.0-preview6.19253.5\contentFiles\cs\netstandard1.0\shared\CommandLine\CommandLineApplication.cs (7)
44public Func<int> Invoke { get; set; } 45public Func<string> LongVersionGetter { get; set; } 46public Func<string> ShortVersionGetter { get; set; } 116public void OnExecute(Func<int> invoke) 121public void OnExecute(Func<Task<int>> invoke) 325Func<string> shortFormVersionGetter, 326Func<string> longFormVersionGetter = null)
NuGet.Commands (15)
ClientCertificatesCommand\AddClientCertRunner.cs (1)
16public static void Run(AddClientCertArgs args, Func<ILogger> getLogger)
ClientCertificatesCommand\ListClientCertRunner.cs (1)
20public static void Run(ListClientCertArgs args, Func<ILogger> getLogger)
ClientCertificatesCommand\RemoveClientCertRunner.cs (1)
15public static void Run(RemoveClientCertArgs args, Func<ILogger> getLogger)
ClientCertificatesCommand\UpdateClientCertRunner.cs (1)
16public static void Run(UpdateClientCertArgs args, Func<ILogger> getLogger)
RestoreCommand\LockFileBuilderCache.cs (1)
109internal (LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework) GetLockFileTargetLibrary(RestoreTargetGraph graph, NuGetFramework framework, LocalPackageInfo localPackageInfo, string aliases, LibraryIncludeFlags libraryIncludeFlags, List<LibraryDependency> dependencies, Func<(LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework)> valueFactory)
RestoreCommand\Utility\PackageSpecFactory.cs (1)
1042private static T? GetValue<T>(params Func<T>[] funcs)
SourcesCommands\SourceRunners.cs (8)
18public static void Run(AddSourceArgs args, Func<ILogger> getLogger) 102public static void Run(DisableSourceArgs args, Func<ILogger> getLogger) 112public static void Run(EnableSourceArgs args, Func<ILogger> getLogger) 122public static void Run(ListSourceArgs args, Func<ILogger> getLogger) 201private static void WarnForHttpSources(IEnumerable<PackageSource> sources, Func<ILogger> getLogger) 238public static void Run(RemoveSourceArgs args, Func<ILogger> getLogger) 258public static void Run(UpdateSourceArgs args, Func<ILogger> getLogger) 358public static void EnableOrDisableSource(PackageSourceProvider sourceProvider, string name, bool enable, Func<ILogger> getLogger)
src\nuget-client\build\Shared\TaskResultCache.cs (1)
68/// <param name="valueFactory">A <see cref="Func{TResult}" /> to execute asynchronously if a cached operation does not exist.</param>
NuGet.Common (8)
AsyncLazy.cs (3)
20public AsyncLazy(Func<Task<T>> valueFactory) 40public static AsyncLazy<T> New<T>(Func<Task<T>> asyncValueFactory) => new AsyncLazy<T>(asyncValueFactory); 42public static AsyncLazy<T> New<T>(Func<T> valueFactory) => new AsyncLazy<T>(() => Task.Run(valueFactory));
PathUtil\PathUtility.cs (2)
453var listOfPathsToCheck = new Func<string>[] 461foreach (var pathFunc in listOfPathsToCheck)
Preprocessor.cs (1)
32Func<Task<Stream>> streamTaskFactory,
src\nuget-client\build\Shared\SimplePool.cs (2)
13private readonly Func<T> _allocate; 15public SimplePool(Func<T> allocate)
NuGet.Configuration (1)
Settings\SettingsFile.cs (1)
209private T ExecuteSynchronized<T>(Func<T> ioOperation)
NuGet.DependencyResolver.Core (1)
src\nuget-client\build\Shared\TaskResultCache.cs (1)
68/// <param name="valueFactory">A <see cref="Func{TResult}" /> to execute asynchronously if a cached operation does not exist.</param>
NuGet.Frameworks (2)
src\nuget-client\build\Shared\SimplePool.cs (2)
13private readonly Func<T> _allocate; 15public SimplePool(Func<T> allocate)
NuGet.LibraryModel (2)
src\nuget-client\build\Shared\SimplePool.cs (2)
13private readonly Func<T> _allocate; 15public SimplePool(Func<T> allocate)
NuGet.PackageManagement (15)
FileModifiers\IPackageFileTransformer.cs (2)
34Func<Task<Stream>> streamTaskFactory, 57Func<Task<Stream>> streamTaskFactory,
FileModifiers\Preprocessor.cs (3)
34Func<Task<Stream>> streamTaskFactory, 74Func<Task<Stream>> streamTaskFactory, 100Func<Task<Stream>> streamTaskFactory,
FileModifiers\XdtTransformer.cs (3)
40Func<Task<Stream>> streamTaskFactory, 78Func<Task<Stream>> streamTaskFactory, 100Func<Task<Stream>> streamTaskFactory,
FileModifiers\XmlTransformer.cs (3)
56Func<Task<Stream>> streamTaskFactory, 100Func<Task<Stream>> streamTaskFactory, 177Func<Task<Stream>> streamTaskFactory,
Utility\FileSystemUtility.cs (2)
319public static bool ContentEquals(string path, Func<Stream> streamFactory) 350public static async Task<bool> ContentEqualsAsync(string path, Func<Task<Stream>> streamTaskFactory)
Utility\MSBuildNuGetProjectSystemUtility.cs (2)
105Func<Task<Stream>> streamTaskFactory, 385Func<Task<Stream>> streamFactory,
NuGet.Packaging (9)
PackageArchiveReader.cs (1)
458public override string GetContentHash(CancellationToken token, Func<string>? GetUnsignedPackageHash = null)
PackageCreation\Authoring\PhysicalPackageFile.cs (2)
13private readonly Func<Stream>? _streamFactory; 26internal PhysicalPackageFile(Func<Stream> streamFactory)
PackageFolderReader.cs (1)
257public override string GetContentHash(CancellationToken token, Func<string>? GetUnsignedPackageHash = null)
PackageReaderBase.cs (1)
611public abstract string GetContentHash(CancellationToken token, Func<string>? GetUnsignedPackageHash = null);
Rules\MisplaceAssemblyOutsideLibRule.cs (1)
33internal IEnumerable<PackagingLogMessage> Validate(Func<IEnumerable<string>> getFiles)
Signing\Package\ISignedPackageReader.cs (1)
49string GetContentHash(CancellationToken token, Func<string>? GetUnsignedPackageHash = null);
src\nuget-client\build\Shared\SimplePool.cs (2)
13private readonly Func<T> _allocate; 15public SimplePool(Func<T> allocate)
NuGet.ProjectModel (1)
DependencyGraphSpec.cs (1)
356internal string GetHash(Func<IHashFunction> getHashFunction)
NuGet.Protocol (31)
HttpSource\HttpRetryHandlerRequest.cs (2)
19public HttpRetryHandlerRequest(HttpClient httpClient, Func<HttpRequestMessage> requestFactory) 46public Func<HttpRequestMessage> RequestFactory { get; }
HttpSource\HttpSource.cs (6)
21private readonly Func<Task<HttpHandlerResource>> _messageHandlerFactory; 40Func<Task<HttpHandlerResource>> messageHandlerFactory, 118Func<HttpRequestMessage> requestFactory = () => 130Func<Task<ThrottledResponse>> throttledResponseFactory = () => GetThrottledResponse( 327Func<HttpRequestMessage> requestFactory, 453Func<Task<HttpHandlerResource>> factory = () => source.GetResourceAsync<HttpHandlerResource>(CancellationToken.None);
HttpSource\HttpSourceRequest.cs (2)
27public HttpSourceRequest(Func<HttpRequestMessage> requestFactory) 40public Func<HttpRequestMessage> RequestFactory { get; }
LocalRepositories\LocalPackageInfo.cs (1)
15private readonly Func<PackageReaderBase> _getPackageReader;
Model\LocalPackageSearchMetadata.cs (1)
103public Func<PackageReaderBase> PackageReader
Model\PackageSearchMetadataBuilder.cs (3)
63public Func<PackageReaderBase> PackageReader { get; set; } 171public static IPackageSearchMetadata WithVersions(this IPackageSearchMetadata metadata, Func<Task<IEnumerable<VersionInfo>>> asyncValueFactory) 179public static IPackageSearchMetadata WithVersions(this IPackageSearchMetadata metadata, Func<IEnumerable<VersionInfo>> valueFactory)
NuGetTestMode.cs (1)
39public static T InvokeTestFunctionAgainstTestMode<T>(Func<T> function, bool testModeEnabled)
Plugins\InboundRequestContext.cs (1)
258Func<Task> task = () => ProcessResponseAsync(requestHandler, request, responseHandler);
Plugins\InboundRequestProcessingHandler.cs (1)
50internal void Handle(MessageMethod messageMethod, Func<Task> task, CancellationToken cancellationToken)
Plugins\IPluginMulticlientUtilities.cs (1)
30Task DoOncePerPluginLifetimeAsync(string key, Func<Task> taskFunc, CancellationToken cancellationToken);
Plugins\IRequestHandlers.cs (1)
27Func<IRequestHandler> addHandlerFunc,
Plugins\PluginMulticlientUtilities.cs (1)
43Func<Task> taskFunc,
Plugins\PluginPackageReader.cs (1)
1154public override string GetContentHash(CancellationToken token, Func<string> GetUnsignedPackageHash = null)
Plugins\RequestHandlers.cs (1)
38Func<IRequestHandler> addHandlerFunc,
src\nuget-client\build\Shared\SimplePool.cs (2)
13private readonly Func<T> _allocate; 15public SimplePool(Func<T> allocate)
src\nuget-client\build\Shared\TaskResultCache.cs (1)
68/// <param name="valueFactory">A <see cref="Func{TResult}" /> to execute asynchronously if a cached operation does not exist.</param>
Utility\DedicatedAsynchronousProcessingThread.cs (5)
13/// Uses a queue to execute all the tasks added through the invocation of <see cref="Enqueue(Func{Task})"/>. 23private readonly ConcurrentQueue<Func<Task>> _taskQueue = new ConcurrentQueue<Func<Task>>(); 50internal void Enqueue(Func<Task> task) 63if (_taskQueue.TryDequeue(out var result))
NuGet.Versioning (2)
src\nuget-client\build\Shared\SimplePool.cs (2)
13private readonly Func<T> _allocate; 15public SimplePool(Func<T> allocate)
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\wpf\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.Diagnostics.Analyzers (19)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\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\roslyn\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\roslyn\src\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
308Name: nameof(Func<>) or nameof(Action<>),
rzc (9)
CommandBase.cs (1)
28OnExecute((Func<Task<int>>)ExecuteAsync);
CommandLine\CommandLineApplication.cs (7)
53public Func<int> Invoke { get; set; } 54public Func<string> LongVersionGetter { get; set; } 55public Func<string> ShortVersionGetter { get; set; } 127public void OnExecute(Func<int> invoke) 132public void OnExecute(Func<Task<int>> invoke) 401Func<string> shortFormVersionGetter, 402Func<string> longFormVersionGetter = null)
DefaultRequestDispatcher.cs (1)
413Func<ServerResponse> func = () =>
ScenarioTests.Common.Tests (1)
ScenarioTestTypes.cs (1)
269public static void Run(Func<Task> asyncMethod)
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 (53)
System\Diagnostics\Activity.cs (2)
1020public static Func<ActivityTraceId>? TraceIdGenerator { get; set; } 1296Func<ActivityTraceId>? traceIdGenerator = TraceIdGenerator;
System\Diagnostics\ActivityCreationOptions.cs (1)
135Func<ActivityTraceId>? traceIdGenerator = Activity.TraceIdGenerator;
System\Diagnostics\Metrics\AggregationManager.cs (4)
51private Func<Aggregator?> _histogramAggregatorFactory = () => new ExponentialHistogramAggregator(s_defaultHistogramConfig); 124public void SetHistogramAggregation(Func<Aggregator?> histogramAggregatorFactory) 369Func<Aggregator?>? createAggregatorFunc = GetAggregatorFactory(instrument); 379private 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)
263public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 277public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 291public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 305public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 318public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 332public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 345public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 359public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 372public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 386public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 400public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 414public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 424public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 435public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 445public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 456public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 466public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 477public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 541private 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.IO.Compression (3)
System\IO\Compression\ZipArchiveEntry.cs (1)
776Func<Stream> compressorStreamFactory;
System\IO\Compression\ZipCustomStreams.cs (2)
469private readonly Func<Stream> _baseStreamFactory; 496public CheckSumAndSizeWriteStream(Func<Stream> baseStreamFactory, Stream baseBaseStream, bool leaveOpenOnClose,
System.Linq.Expressions (5)
System\Dynamic\Utils\DelegateHelpers.cs (1)
78private 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\runtime\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\runtime\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 (69)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (8)
1689Func<EventSource?> eventSourceFactory = () => this; 2496public OverrideEventProvider(Func<EventSource?> eventSourceFactory, EventProviderType providerType) 2510private readonly Func<EventSource?> _eventSourceFactory; 3941private static List<Func<EventSource?>> s_preregisteredEventSourceFactories = new List<Func<EventSource?>>(); 3959internal static unsafe void PreregisterEventProviders(Guid id, string name, Func<EventSource?> eventSourceFactory) 4022Func<EventSource?>[] factories; 4028foreach (Func<EventSource?> factory in factories)
src\runtime\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\runtime\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\runtime\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\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (3)
256public static void SpinUntil(Func<bool> condition) 279public static bool SpinUntil(Func<bool> condition, TimeSpan timeout) 303public static bool SpinUntil(Func<bool> condition, int millisecondsTimeout)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (6)
5691public static Task<TResult> Run<TResult>(Func<TResult> function) 5709public static Task<TResult> Run<TResult>(Func<TResult> function, CancellationToken cancellationToken) 5724public static Task Run(Func<Task?> function) 5742public static Task Run(Func<Task?> function, CancellationToken cancellationToken) 5770public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function) 5786public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task_T.cs (7)
105public Task(Func<TResult> function) 126public Task(Func<TResult> function, CancellationToken cancellationToken) 150public Task(Func<TResult> function, TaskCreationOptions creationOptions) 177public Task(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions) 284internal Task(Func<TResult> valueSelector, Task? parent, CancellationToken cancellationToken, 308internal static Task<TResult> StartNew(Task? parent, Func<TResult> function, CancellationToken cancellationToken, 484if (m_action is Func<TResult> func)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory_T.cs (4)
257public Task<TResult> StartNew(Func<TResult> function) 284public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken) 313public Task<TResult> StartNew(Func<TResult> function, TaskCreationOptions creationOptions) 353public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
src\runtime\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)
1456Func<object?> getSource = () => GetMemberValue(o, member.Mapping.MemberInfo!); 1462private object? WriteAddCollectionFixup(Func<object?> getSource, Action<object?> setSource, object memberValue, TypeDesc typeDesc, bool readOnly) 2090public 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)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
194[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
System.Runtime.InteropServices.JavaScript (4)
System\Runtime\InteropServices\JavaScript\JSMarshalerType.cs (1)
365/// <param name="result">Metadata about the type of the result of the <see cref="System.Func{TRes}"/>.</param>
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Func.cs (3)
421public void ToManaged<TResult>(out Func<TResult>? value, ArgumentToManagedCallback<TResult> resMarshaler) 610public unsafe void ToJS<TResult>(Func<TResult> value, ArgumentToJSCallback<TResult> resMarshaler) 612Func<TResult> cpy = value;
System.Security.Claims (2)
System\Security\Claims\ClaimsPrincipal.cs (2)
31private static Func<ClaimsPrincipal?>? s_principalSelector; 81public static Func<ClaimsPrincipal?>? ClaimsPrincipalSelector
System.Security.Cryptography (8)
src\runtime\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\BasicSymmetricCipherLiteNCrypt.cs (1)
32Func<CngKey> cngKeyFactory,
System\Security\Cryptography\BasicSymmetricCipherNCrypt.cs (1)
18public BasicSymmetricCipherNCrypt(Func<CngKey> cngKeyFactory, CipherMode cipherMode, int blockSizeInBytes, byte[]? iv, bool encrypting, int paddingSizeInBytes)
System\Security\Cryptography\CngSymmetricAlgorithmCore.cs (2)
233Func<CngKey> cngKeyFactory, 252private UniversalCryptoTransform CreatePersistedCryptoTransformCore(Func<CngKey> cngKeyFactory, byte[]? iv, bool encrypting, PaddingMode padding, CipherMode mode, int feedbackSizeInBits)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (2)
1873private static TAlg CreateAndImport<TAlg>(ReadOnlySpan<char> keyPem, Func<TAlg> factory) where TAlg : AsymmetricAlgorithm 1883Func<TAlg> factory) where TAlg : AsymmetricAlgorithm
System.Security.Cryptography.Pkcs (2)
src\runtime\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.Principal.Windows (7)
System\Security\Principal\WindowsIdentity.cs (7)
700public static T RunImpersonated<T>(SafeAccessTokenHandle safeAccessTokenHandle, Func<T> func) 713/// <param name="func">The <see cref="System.Func{Task}"/> to run.</param> 714/// <returns>A <see cref="Task"/> that represents the asynchronous operation of the provided <see cref="System.Func{Task}"/>.</returns> 715public static Task RunImpersonatedAsync(SafeAccessTokenHandle safeAccessTokenHandle, Func<Task> func) 723/// <param name="func">The <see cref="System.Func{Task}"/> of <see cref="System.Threading.Tasks.Task{T}"/> to run.</param> 724/// <returns>A <see cref="Task{T}"/> that represents the asynchronous operation of the <see cref="System.Func{Task}"/> of <see cref="System.Threading.Tasks.Task{T}"/> provided.</returns> 725public static Task<T> RunImpersonatedAsync<T>(SafeAccessTokenHandle safeAccessTokenHandle, Func<Task<T>> func)
System.ServiceModel.Primitives (12)
Internals\System\Runtime\InputQueue.cs (3)
34public InputQueue(Func<Action<AsyncCallback, IAsyncResult>> asyncCallbackGenerator) 60private Func<Action<AsyncCallback, IAsyncResult>> AsyncCallbackGenerator 411public void Shutdown(Func<Exception> pendingExceptionGenerator)
System\IdentityModel\CryptoHelper.cs (5)
21private static Dictionary<string, Func<object>> s_algorithmDelegateDictionary = new Dictionary<string, Func<object>>(); 276Func<object> delegateFunction = null; 309Linq.Expressions.LambdaExpression creationFunction = Linq.Expressions.Expression.Lambda<Func<object>>(algorithmCreationExpression); 310delegateFunction = creationFunction.Compile() as Func<object>;
System\ServiceModel\Channels\ServiceChannelProxy.cs (3)
285private Func<object> _createDelegate; 310_createDelegate = (Func<object>)Delegate.CreateDelegate(typeof(Func<object>), createTcsGenericMethod);
System\ServiceModel\Diagnostics\TraceUtility.cs (1)
32public static Func<Action<AsyncCallback, IAsyncResult>> asyncCallbackGenerator;
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)
137Func<object>? createObjectForExtensionDataProp = jsonPropertyInfo.JsonTypeInfo.CreateObject
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (2)
69Func<object>? createObject = DetermineCreateObjectDelegate(type, converter); 512private 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)
93public Func<object>? CreateObject 103private protected Func<object>? _createObject; 105internal Func<object>? CreateObjectForExtensionDataProperty { get; set; } 647Func<ICustomAttributeProvider>? ctorAttrProviderFactory = Volatile.Read(ref ConstructorAttributeProviderFactory); 669internal 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\runtime\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)
687Func<TLocal> localInit, 740Func<TLocal> localInit, 804Func<TLocal> localInit, 869Func<TLocal> localInit, 915Func<TLocal>? localInit, Action<TLocal>? localFinally) 1411public static ParallelLoopResult ForEach<TSource, TLocal>(IEnumerable<TSource> source, Func<TLocal> localInit, 1476ParallelOptions parallelOptions, Func<TLocal> localInit, 1530public static ParallelLoopResult ForEach<TSource, TLocal>(IEnumerable<TSource> source, Func<TLocal> localInit, 1594public static ParallelLoopResult ForEach<TSource, TLocal>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TLocal> localInit, 1638Func<TLocal>? localInit, Action<TLocal>? localFinally) 1696Func<TLocal>? localInit, Action<TLocal>? localFinally) 1755Func<TLocal>? localInit, Action<TLocal>? localFinally) 2017Func<TLocal> localInit, 2095Func<TLocal> localInit, 2391Func<TLocal> localInit, 2482Func<TLocal> localInit, 2509Func<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.Extensions (2)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System.Windows.Forms (4)
System\Windows\Forms\Control.cs (1)
6072public T Invoke<T>(Func<T> method) => (T)Invoke(method, null);
System\Windows\Forms\Control_InvokeAsync.cs (3)
175public async Task<T> InvokeAsync<T>(Func<T> callback, CancellationToken cancellationToken = default) 254/// <see cref="InvokeAsync{T}(Func{T}, CancellationToken)"/>. 359/// <see cref="InvokeAsync{T}(Func{T}, CancellationToken)"/>.
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\CommandSet.cs (1)
418private 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.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\wpf\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)
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\roslyn\src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (1)
165Func<BuildResponse> func = () =>
vstest.console (4)
Processors\ListExtensionsArgumentProcessor.cs (4)
43private readonly Func<IArgumentExecutor> _getExecutor; 44private readonly Func<IArgumentProcessorCapabilities> _getCapabilities; 46public ListExtensionsArgumentProcessor(Func<IArgumentExecutor> getExecutor, Func<IArgumentProcessorCapabilities> getCapabilities)
vstest.console.arm64 (4)
src\vstest\src\vstest.console\Processors\ListExtensionsArgumentProcessor.cs (4)
43private readonly Func<IArgumentExecutor> _getExecutor; 44private readonly Func<IArgumentProcessorCapabilities> _getCapabilities; 46public ListExtensionsArgumentProcessor(Func<IArgumentExecutor> getExecutor, Func<IArgumentProcessorCapabilities> getCapabilities)