2619 references to Func
aspire (53)
Acquisition\InstallationCandidateSources.cs (1)
184private static IEnumerable<string> EnumerateFileSystemEntriesSafe(string root, ILogger logger, string entryKind, Func<IEnumerator<string>> enumeratorFactory, CancellationToken cancellationToken)
Commands\PipelineCommandBase.cs (1)
295var backchannel = await InteractionService.ShowStatusAsync(GetProgressMessage(parseResult), (Func<Task<IAppHostCliBackchannel>>)(async () =>
Commands\RunCommand.cs (3)
386Func<ValueTask>? onBackchannelEstablished = null; 891Func<ValueTask>? onBackchannelEstablished, 979Func<ValueTask>? onBackchannelEstablished,
Commands\WaitCommand.cs (1)
115(Func<Task<int>>)(async () =>
DotNet\DotNetCliRunner.cs (1)
148public Func<Task>? ExtensionAppHostLaunchCompletedAsync { get; set; }
Interaction\ConsoleInteractionService.cs (1)
105public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
Interaction\ExtensionInteractionService.cs (4)
43private readonly Channel<Func<Task>> _extensionTaskChannel; 61_extensionTaskChannel = Channel.CreateUnbounded<Func<Task>>(new UnboundedChannelOptions 87public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) 697var taskFunction = await _extensionTaskChannel.Reader.ReadAsync().ConfigureAwait(false);
Interaction\IInteractionService.cs (2)
13Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false); 21/// Use this instead of <see cref="ShowStatusAsync{T}(string, Func{Task{T}}, KnownEmoji?, bool)"/> when the
Packaging\PackagingService.cs (4)
88private readonly Func<string?> _processPathProvider; 94private readonly Func<string?> _cliInformationalVersionProvider; 109Func<string?>? processPathProvider = null, 110Func<string?>? cliInformationalVersionProvider = null)
Processes\IsolatedProcess.cs (6)
109private Func<ValueTask> _disposeAsync = () => ValueTask.CompletedTask; 110private Func<int>? _exitCodeProvider; 111private Func<bool>? _hasExitedProvider; 445Func<ValueTask>? ExtraDispose, 446Func<int>? ExitCodeProvider = null, 447Func<bool>? HasExitedProvider = null,
Profiling\ProfileCaptureOptions.cs (2)
29Func<int>? portProvider = null) 61var getPort = portProvider ?? GetFreeTcpPort;
Projects\DotNetAppHostProject.cs (1)
73internal static Func<string?>? RepoLocalManagedPathProviderOverride { get; set; }
Projects\ExtensionGuestLauncher.cs (1)
36Func<Task>? afterLaunchAsync,
Projects\GuestAppHostProject.cs (2)
2186Func<Task>? afterAppHostLaunchedAsync, 2211Func<Task>? afterAppHostLaunchedAsync,
Projects\GuestRuntime.cs (3)
208Func<Task>? afterAppHostLaunchedAsync = null, 251Func<Task>? afterAppHostLaunchedAsync = null, 581Func<Task>? afterLaunchAsync = null,
Projects\IGuestProcessLauncher.cs (1)
54Func<Task>? afterLaunchAsync,
Projects\ProcessGuestLauncher.cs (1)
43Func<Task>? afterLaunchAsync,
Projects\ProjectUpdater.cs (4)
1494internal abstract record UpdateStep(string Description, Func<Task> Callback) 1507Func<Task> Callback, 1525Func<Task> Callback, 1554internal record AnalyzeStep(string Description, Func<Task> Callback);
Telemetry\TelemetryTagsSource.cs (1)
62public void StartCalculation(Func<Task<IReadOnlyList<KeyValuePair<string, object?>>>> factory)
Templating\CliTemplateFactory.EmptyTemplate.cs (1)
67(Func<Task<TemplateResult>>)(async () =>
Templating\CliTemplateFactory.GoStarterTemplate.cs (1)
50(Func<Task<TemplateResult>>)(async () =>
Templating\CliTemplateFactory.JavaStarterTemplate.cs (1)
50(Func<Task<TemplateResult>>)(async () =>
Templating\CliTemplateFactory.PythonStarterTemplate.cs (1)
52(Func<Task<TemplateResult>>)(async () =>
Templating\CliTemplateFactory.TypeScriptStarterTemplate.cs (1)
51(Func<Task<TemplateResult>>)(async () =>
Templating\OutputPathHelper.cs (1)
20Func<Task<string>> promptCallback,
Utils\EnvironmentChecker\OperatingSystemCheck.cs (2)
19private readonly Func<OperatingSystemDetails> _getOperatingSystemDetails; 26internal OperatingSystemCheck(Func<OperatingSystemDetails> getOperatingSystemDetails)
Utils\EnvironmentChecker\WslEnvironmentCheck.cs (2)
20private readonly Func<string?> _readProcVersion; 28internal WslEnvironmentCheck(IEnvironment environment, Func<string?> readProcVersion)
Utils\ProcessCaptureRunner.cs (2)
25Func<TCapture> createEmptyCapture, 220private static async Task<TCapture> SwallowCaptureAsync<TCapture>(Task<TCapture> task, Func<TCapture> createEmptyCapture, ILogger logger, TimeSpan? bound = null)
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.EndToEnd.Tests (1)
tests\Shared\Hex1bAutomatorTestHelpers.cs (1)
507Func<Task>? beforeAcceptingAgentInit = null)
Aspire.Cli.Tests (29)
CliSmokeTests.cs (1)
129using var result = RemoteExecutor.Invoke((Func<Task>)(async () =>
Commands\PublishCommandPromptingIntegrationTests.cs (1)
1237public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => action();
Commands\UpdateCommandTests.cs (1)
3522public 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)
1386private sealed class CountingDocsFetcher(Func<string?> contentProvider) : IDocsFetcher
ProfileCaptureOptionsTests.cs (1)
210private static Func<int> CreatePortProvider(params int[] ports)
Projects\DotNetAppHostProjectTests.cs (1)
2888Func<JsonDocument> createAppHostInfo,
Projects\ExtensionGuestLauncherTests.cs (1)
227public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => throw new NotImplementedException();
Projects\GuestRuntimeTests.cs (1)
1693Func<Task>? afterLaunchAsync,
Telemetry\TelemetryFixture.cs (2)
128public Func<Task<string?>>? GetDeviceIdCallback { get; set; } 129public Func<Task<string>>? GetMacAddressHashCallback { get; set; }
Templating\DotNetTemplateFactoryTests.cs (2)
391public Task<TResult> ShowStatusAsync<TResult>(string message, Func<Task<TResult>> work, KnownEmoji? emoji = null, bool allowMarkup = false) 397public 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\FakeAppHostServerSession.cs (1)
27public Func<Task>? StartAsyncCallback { get; init; }
TestServices\TestAppHostCliBackchannel.cs (1)
12public Func<Task>? RequestStopAsyncCallback { get; set; }
TestServices\TestCertificateToolRunner.cs (4)
15public Func<CertificateTrustResult>? CheckHttpCertificateCallback { get; set; } 16public Func<EnsureCertificateResult>? EnsureHttpCertificateExistsCallback { get; set; } 17public Func<EnsureCertificateResult>? TrustHttpCertificateCallback { get; set; } 18public Func<CertificateCleanResult>? CleanHttpCertificateCallback { get; set; }
TestServices\TestCliUpdateNotifier.cs (1)
12public Func<bool>? IsUpdateAvailableCallback { get; set; }
TestServices\TestExtensionBackchannel.cs (2)
31public Func<Task>? DisplayEmptyLineAsyncCallback { get; set; } 37public Func<Task>? DisplayCancellationMessageAsyncCallback { get; set; }
TestServices\TestExtensionInteractionService.cs (2)
24public Func<Task>? LaunchAppHostAsyncCallback { get; set; } 51public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
TestServices\TestInteractionService.cs (1)
77public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
TestServices\TestPackagingService.cs (1)
20public Func<string?>? GetStagingChannelUnavailableReasonCallback { get; set; }
TestServices\TestProcessExecutionFactory.cs (2)
143private readonly Func<int> _attemptCounter; 154Func<int> attemptCounter)
Aspire.Dashboard (70)
Components\Controls\AspireMenuButton.razor.cs (2)
27private Func<IList<MenuButtonItem>>? _renderedItemsProvider; 60public required Func<IList<MenuButtonItem>> ItemsProvider { get; set; }
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)
15public required Func<Task> HandleSelectedTreeItemChangedAsync { get; set; }
Components\Dialogs\GenAIVisualizerDialog.razor.cs (2)
261var getContextGenAISpans = Content.GetContextGenAISpans; 389ITelemetryRepository telemetryRepository, ITelemetryErrorRecorder errorRecorder, List<OtlpResource> resources, Func<List<OtlpSpan>> getContextGenAISpans,
Components\Layout\AspirePageContentLayout.razor.cs (2)
61public Dictionary<string, Func<Task>> DialogCloseListeners { get; } = new(); 117foreach (var dialogCloseListener in DialogCloseListeners.Values)
Components\Layout\MobileNavMenu.razor.cs (4)
30public required Func<Task> LaunchHelpAsync { get; set; } 33public required Func<Task> LaunchAIAgentsAsync { get; set; } 39public required Func<Task> LaunchNotificationsAsync { get; set; } 42public required Func<Task> LaunchSettingsAsync { get; set; }
Components\Layout\MobileNavMenuEntry.cs (1)
11Func<Task> OnClick,
Components\Layout\NotificationsHeaderButton.razor.cs (1)
13public required Func<Task> OnClick { get; set; }
DashboardWebApplication.cs (8)
74private readonly List<Func<ResolvedEndpointInfo>> _frontendEndPointAccessor = new(); 75private Func<ResolvedEndpointInfo>? _otlpServiceGrpcEndPointAccessor; 76private Func<ResolvedEndpointInfo>? _otlpServiceHttpEndPointAccessor; 78public List<Func<ResolvedEndpointInfo>> FrontendEndPointsAccessor 91public Func<ResolvedEndpointInfo> FrontendSingleEndPointAccessor 108public Func<ResolvedEndpointInfo> OtlpServiceGrpcEndPointAccessor 113public Func<ResolvedEndpointInfo> OtlpServiceHttpEndPointAccessor 775static Func<ResolvedEndpointInfo> CreateEndPointAccessor(EndpointConfiguration endpointConfiguration)
Model\BrowserLinkOutgoingPeerResolver.cs (1)
10public IDisposable OnPeerChanges(Func<Task> callback)
Model\ConsoleLogsManager.cs (1)
54public IDisposable OnFiltersChanged(Func<Task> callback)
Model\DashboardCommandExecutor.cs (1)
328private static NotificationAction CreateCancelNotificationAction(IStringLocalizer<Dashboard.Resources.Resources> loc, Func<Task> onCancelAsync)
Model\DashboardSqliteOutgoingPeerResolver.cs (1)
23public IDisposable OnPeerChanges(Func<Task> callback) => NullDisposable.Instance;
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 (4)
12private ImmutableArray<Func<Task>> _dataUpdateSubscriptions = []; 20internal void AddDataUpdateSubscription(Func<Task> subscription) 25internal void RemoveDataUpdateSubscription(Func<Task> subscription) 39foreach (var subscription in subscriptions)
Model\Interaction\InteractionsInputsDialogViewModel.cs (1)
23public Func<Task>? OnInteractionUpdated { get; set; }
Model\IOutgoingPeerResolver.cs (1)
9IDisposable OnPeerChanges(Func<Task> callback);
Model\MenuButtonItem.cs (2)
23public Func<Task>? OnSecondaryActionClick { get; set; } 37public 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 (2)
307public IDisposable OnPeerChanges(Func<Task> callback) 373Func<Task> callback,
Model\StructuredLogMenuBuilder.cs (1)
80Func<OtlpLogEntry?> getLogEntry,
Model\TelemetryExportService.cs (1)
652private 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,
Model\TraceMenuBuilder.cs (1)
76Func<OtlpTrace?> getTrace,
Otlp\Storage\ITelemetryRepository.cs (4)
32Subscription OnNewResources(Func<Task> callback); 33Subscription OnNewLogs(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback); 34Subscription OnNewMetrics(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback); 35Subscription OnNewTraces(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback);
Otlp\Storage\SqliteTelemetryRepository.Runtime.cs (5)
125public Subscription OnNewResources(Func<Task> callback) => 128public Subscription OnNewLogs(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) => 131public Subscription OnNewMetrics(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) => 134public Subscription OnNewTraces(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) => 141Func<Task> callback,
Otlp\Storage\Subscription.cs (1)
27public Subscription(string name, ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback, Action unsubscribe, ExecutionContext? executionContext, ILogger logger, TimeSpan minExecuteInterval)
ServiceClient\DashboardDataSourcePool.cs (2)
226Func<ITelemetryRepository> telemetryRepositoryFactory, 227Func<IResourceRepository> resourceRepositoryFactory,
ServiceClient\TracingSqliteConnection.cs (5)
201private async Task ExecuteWithActivityAsync(string query, Func<Task> execute) 333private T ExecuteWithActivity<T>(Func<T> execute) 347private async Task<T> ExecuteWithActivityAsync<T>(Func<Task<T>> execute) 480private T ExecuteReaderOperation<T>(Func<T> operation) 494private async Task<T> ExecuteReaderOperationAsync<T>(Func<Task<T>> operation)
Utils\CallbackThrottler.cs (2)
17public CallbackThrottler(string name, ILogger logger, TimeSpan minExecuteInterval, Func<Task> callback, ExecutionContext? executionContext) 32private readonly Func<Task> _callback;
Utils\FilterHelpers.cs (1)
26Func<Task> afterChangeAsync,
Aspire.Dashboard.Components.Tests (52)
Controls\AspireMenuButtonTests.cs (1)
181Func<IList<MenuButtonItem>> itemsProvider = () => [new MenuButtonItem { Text = itemText }];
Controls\GenAIVisualizerDialogTests.cs (6)
44var getCut = SetUpDialog(out var dialogService); 124var getCut = SetUpDialog(out var dialogService); 152var getCut = SetUpDialog(out var dialogService); 209var getCut = SetUpDialog(out var dialogService); 294var getCut = SetUpDialog(out var dialogService); 388private Func<IRenderedFragment> SetUpDialog(out DashboardDialogService dialogService)
Controls\TextVisualizerDialogTests.cs (14)
50var getCut = SetUpDialog(out var dialogService); 78var getCut = SetUpDialog(out var dialogService); 101var getCut = SetUpDialog(out var dialogService); 161var getCut = SetUpDialog(out var dialogService); 178var getCut = SetUpDialog(out var dialogService); 195var getCut = SetUpDialog(out var dialogService); 209var getCut = SetUpDialog(out var dialogService, themeManager: themeManager); 229var getCut = SetUpDialog(out var dialogService); 252var getCut = SetUpDialog(out var dialogService, localStorage: localStorage); 275var getCut = SetUpDialog(out var dialogService, localStorage: localStorage); 294var getCut = SetUpDialog(out var dialogService, localStorage: localStorage); 307var getCut = SetUpDialog(out var dialogService); 327var getCut = SetUpDialog(out var dialogService); 346private Func<IRenderedFragment> SetUpDialog(out DashboardDialogService dialogService, ThemeManager? themeManager = null, TestLocalStorage? localStorage = null)
Dialogs\InteractionMessageBoxDialogTests.cs (4)
30var getCut = SetUpDialog(out var dialogService); 57var getCut = SetUpDialog(out var dialogService); 82var getCut = SetUpDialog(out var dialogService); 104private Func<IRenderedFragment> SetUpDialog(out DashboardDialogService dialogService)
Dialogs\InteractionsInputDialogTests.cs (17)
37var getCut = SetUpDialog(out var dialogService); 103var getCut = SetUpDialog(out var dialogService); 162var getCut = SetUpDialog(out var dialogService); 222var getCut = SetUpDialog(out var dialogService); 297var getCut = SetUpDialog(out var dialogService); 335var getCut = SetUpDialog(out var dialogService); 361var getCut = SetUpDialog(out var dialogService); 416var getCut = SetUpDialog(out var dialogService); 450var getCut = SetUpDialog(out var dialogService); 481var getCut = SetUpDialog(out var dialogService); 501var getCut = SetUpDialog(out var dialogService); 526var getCut = SetUpDialog(out var dialogService); 572var getCut = SetUpDialog(out var dialogService); 604var getCut = SetUpDialog(out var dialogService); 626var getCut = SetUpDialog(out var dialogService); 647var getCut = SetUpDialog(out var dialogService); 693private Func<IRenderedFragment> SetUpDialog(out DashboardDialogService dialogService)
Shared\TestTelemetryRepository.cs (4)
28public Subscription OnNewResources(Func<Task> callback) => inner.OnNewResources(callback); 29public Subscription OnNewLogs(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) => inner.OnNewLogs(resourceKey, subscriptionType, callback); 30public Subscription OnNewMetrics(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) => inner.OnNewMetrics(resourceKey, subscriptionType, callback); 31public Subscription OnNewTraces(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) => inner.OnNewTraces(resourceKey, subscriptionType, callback);
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\TestDashboardClient.cs (4)
19private readonly Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? _resourceChannelProvider; 20private readonly Func<Channel<WatchInteractionsResponseUpdate>>? _interactionChannelProvider; 40Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? resourceChannelProvider = null, 41Func<Channel<WatchInteractionsResponseUpdate>>? interactionChannelProvider = null,
Aspire.Dashboard.Tests (12)
Integration\StartupTests.cs (2)
1127private static void AssertIPv4OrIPv6Endpoint(Func<ResolvedEndpointInfo> endPointAccessor) 1134private static void AssertDynamicIPEndpoint(Func<ResolvedEndpointInfo> endPointAccessor)
Model\SqliteResourceRepositoryTests.cs (1)
935private static async Task<IReadOnlyList<string>> CaptureSqlQueriesAsync(Func<Task> action)
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\TestDashboardClient.cs (4)
19private readonly Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? _resourceChannelProvider; 20private readonly Func<Channel<WatchInteractionsResponseUpdate>>? _interactionChannelProvider; 40Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? resourceChannelProvider = null, 41Func<Channel<WatchInteractionsResponseUpdate>>? interactionChannelProvider = null,
Aspire.Deployment.EndToEnd.Tests (1)
tests\Shared\Hex1bAutomatorTestHelpers.cs (1)
507Func<Task>? beforeAcceptingAgentInit = null)
Aspire.Hosting (33)
ApplicationModel\EnvironmentCallbackAnnotation.cs (1)
25public 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?)"/>. 96/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?, HttpCommandOptions?)"/>.
ApplicationModel\HttpCommandOptions.cs (1)
42public Func<EndpointReference>? EndpointSelector { get; set; }
ApplicationModel\LogFacade.cs (2)
14private readonly Func<ILogger> _loggerAccessor; 22public LogFacade(Func<ILogger> loggerAccessor)
ApplicationModel\ParameterDefault.cs (1)
168class ConstantParameterDefault(Func<string> valueGetter) : ParameterDefault
Ats\HealthCheckExports.cs (1)
22public static void AddHealthCheck(this IDistributedApplicationBuilder builder, string name, Func<Task<HealthCheckResult>> check)
Dashboard\DashboardEventHandlers.cs (1)
554private async ValueTask<string?> ResolveUrlAsync(Func<ValueTask<string?>> resolveCallback, string? configuredUrl)
ExternalServiceBuilderExtensions.cs (7)
345public static async Task<HealthCheckResult> CheckUriAsync(Uri uri, int expectedStatusCode, Func<HttpClient> httpClientFactory, HealthCheckContext context, CancellationToken cancellationToken) 372private readonly Func<HttpClient> _httpClientFactory; 374public StaticUriHealthCheck(Uri uri, int expectedStatusCode, Func<HttpClient> httpClientFactory) 393private readonly Func<HttpClient> _httpClientFactory; 397public ParameterUriHealthCheck(ParameterResource urlParameter, string? path, int expectedStatusCode, Func<HttpClient> httpClientFactory) 459private readonly Func<HttpClient> _httpClientFactory; 461public EndpointUriHealthCheck(EndpointReference endpoint, string path, int expectedStatusCode, Func<HttpClient> httpClientFactory)
ParameterResourceBuilderExtensions.cs (1)
100public 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\ContainerImageInspectionResult.cs (2)
77private readonly Func<ContainerImageConfig?>? _configAccessor; 83Func<ContainerImageConfig?>? configAccessor)
Publishing\ManifestPublishingContext.cs (1)
147async Task WriteResourceObjectAsync<T>(T resource, Func<Task> action) where T : IResource
ResourceBuilderExtensions.cs (8)
349public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, Func<string> callback) where T : IResourceWithEnvironment 2766var endpointSelector = endpointName is not null 2804public static IResourceBuilder<T> WithHttpHealthCheck<T>(this IResourceBuilder<T> builder, Func<EndpointReference>? endpointSelector, string? path = null, int? statusCode = null) where T : IResourceWithEndpoints 3676Func<EndpointReference>? endpointSelector, 4367private static Func<EndpointReference> NamedEndpointSelector<TResource>(IResourceBuilder<TResource> builder, string[] endpointNames, string errorDisplayNoun) 4393private static Func<EndpointReference> DefaultEndpointSelector<TResource>(IResourceBuilder<TResource> builder) 5055var endpointSelector = endpointName is not null 5110public 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)
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
45private static LaunchSettings? ReadWithDistributedApplicationException(Func<LaunchSettings?> read)
UserSecrets\IUserSecretsManager.cs (1)
60void GetOrSetSecret(IConfigurationManager configuration, string name, Func<string> valueGenerator);
UserSecrets\NoopUserSecretsManager.cs (1)
39public void GetOrSetSecret(IConfigurationManager configuration, string name, Func<string> valueGenerator)
UserSecrets\UserSecretsManagerFactory.cs (1)
136public void GetOrSetSecret(IConfigurationManager configuration, string name, Func<string> valueGenerator)
Aspire.Hosting.Azure (8)
AzureBicepResource.cs (1)
257object? inputValue = input.Value is Func<object?> f ? f() : input.Value;
AzureBicepResourceExtensions.cs (1)
235public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, Func<object?> valueCallback)
AzureProvisioningController.cs (5)
2376private static async Task<ExecuteCommandResult> ExecuteCommandAsync(Func<Task> action, string successMessage, Func<Task<CommandResultData>> createResultData, string? failureOperation = null) 2393private static async Task<ExecuteCommandResult> ExecuteCommandAsync<T>(Func<Task<T>> action, string successMessage, Func<T, Task<CommandResultData>> createResultData, string? failureOperation = null) 2410private static async Task<ExecuteCommandResult> ExecuteCommandAsync(Func<Task<bool>> action, string successMessage, Func<Task<CommandResultData>> createResultData, string? failureOperation = null)
Provisioning\BicepUtilities.cs (1)
46var parameterValue = parameter.Value is Func<object?> f ? f() : parameter.Value;
Aspire.Hosting.Azure.AppContainers (1)
BaseContainerAppContext.cs (1)
426Func<BicepList<ContainerAppWritableSecret>> getContainerAppConfigurationSecrets,
Aspire.Hosting.Azure.Functions (1)
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
45private static LaunchSettings? ReadWithDistributedApplicationException(Func<LaunchSettings?> read)
Aspire.Hosting.Azure.Kubernetes (1)
AzureKubernetesEnvironmentResource.AksPipeline.cs (1)
34internal Func<string>? AzCliPathResolverForTesting { get; set; }
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.Sandboxes (2)
AzureSandboxContainerDeployment.cs (1)
1770Func<Task<T>> createResource,
Internal\Adc\AzureDevComputeClient.cs (1)
206Func<T>? notFoundFactory = null)
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)
18var action = () => container.PublishAsAzureContainerApp(configure); 31var action = () => container.PublishAsAzureContainerApp(configure); 42var action = () => new AzureContainerAppCustomizationAnnotation(configure); 54var action = () => executable.PublishAsAzureContainerApp(configure); 67var action = () => executable.PublishAsAzureContainerApp(configure); 95var action = () => project.PublishAsAzureContainerApp(configure); 108var 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)
23var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 43var action = () => new AzureCosmosDBContainerResource(name, containerName, [partitionKeyPath], parent); 63var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 83var action = () => new AzureCosmosDBContainerResource(name, containerName, [partitionKeyPath], parent); 103var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 121var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPaths, parent); 137var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPaths, parent); 155var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPaths, parent); 169var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 183var action = () => new AzureCosmosDBContainerResource(name, containerName, [partitionKeyPath], parent); 199var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent.Resource); 217var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent.Resource); 232var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent); 243var action = () => new AzureCosmosDBEmulatorResource(innerResource); 257var action = () => new AzureCosmosDBResource(name, configureInfrastructure); 271var action = () => new AzureCosmosDBResource(name, configureInfrastructure); 283var action = () => builder.AddAzureCosmosDB(name); 297var action = () => builder.AddAzureCosmosDB(name); 311var action = () => builder.RunAsEmulator(configureContainer); 323var action = () => builder.RunAsClassicEmulator(configureContainer); 334var action = () => builder.WithDataVolume(); 346var action = () => builder.WithGatewayPort(port); 358var action = () => builder.WithPartitionCount(count); 371var action = () => builder.AddDatabase(databaseName); 387var action = () => cosmos.AddDatabase(databaseName); 401var action = () => builder.AddCosmosDatabase(name); 416var action = () => cosmos.AddCosmosDatabase(name); 431var action = () => builder.AddContainer(name, partitionKeyPath); 448var action = () => cosmos.AddContainer(name, partitionKeyPath); 467var action = () => cosmos.AddContainer(name, partitionKeyPath); 482var action = () => cosmos.AddContainer(name, partitionKeyPaths!); 494var action = () => cosmos.AddContainer(name, partitionKeyPaths); 508var action = () => cosmos.AddContainer(name, partitionKeyPaths); 518var 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.Blazor (2)
BlazorHostedExtensions.cs (1)
281Func<string?> clientProjectPathProvider,
BrowserDebuggerHelper.cs (1)
65Func<string?> clientProjectPathProvider,
Aspire.Hosting.Blazor.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.Browsers (4)
BrowserConfiguration.cs (1)
204Func<T> getDefault)
BrowserLogsArtifacts.cs (2)
25private readonly Func<string> _rootDirectoryFactory; 33internal BrowserLogsArtifactWriter(TimeProvider timeProvider, Func<string> rootDirectoryFactory)
BrowserLogsCdpConnection.cs (1)
86Func<IClientWebSocketConnector> connectorFactory)
Aspire.Hosting.Browsers.Tests (7)
BrowserLogsBuilderExtensionsTests.cs (1)
1973public void GetOrSetSecret(IConfigurationManager configuration, string name, Func<string> valueGenerator)
src\Aspire.Hosting.Browsers\BrowserConfiguration.cs (1)
204Func<T> getDefault)
src\Aspire.Hosting.Browsers\BrowserLogsArtifacts.cs (2)
25private readonly Func<string> _rootDirectoryFactory; 33internal BrowserLogsArtifactWriter(TimeProvider timeProvider, Func<string> rootDirectoryFactory)
src\Aspire.Hosting.Browsers\BrowserLogsCdpConnection.cs (1)
86Func<IClientWebSocketConnector> connectorFactory)
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.CodeGeneration.Go.Tests (2)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (2)
417Func<string> valueProvider) 428Func<Task<string>> asyncValueProvider)
Aspire.Hosting.CodeGeneration.Java.Tests (2)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (2)
417Func<string> valueProvider) 428Func<Task<string>> asyncValueProvider)
Aspire.Hosting.CodeGeneration.Python.Tests (2)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (2)
417Func<string> valueProvider) 428Func<Task<string>> asyncValueProvider)
Aspire.Hosting.CodeGeneration.Rust.Tests (2)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (2)
417Func<string> valueProvider) 428Func<Task<string>> asyncValueProvider)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (2)
TestTypes\TestExtensions.cs (2)
417Func<string> valueProvider) 428Func<Task<string>> asyncValueProvider)
Aspire.Hosting.Containers.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.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.Dotnet (1)
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
45private static LaunchSettings? ReadWithDistributedApplicationException(Func<LaunchSettings?> read)
Aspire.Hosting.Dotnet.Tests (9)
DotnetProjectPublicApiTests.cs (7)
55var action = () => new DotnetProjectResource(name, workingDirectory); 68var action = () => new DotnetProjectResource(name, workingDirectory: null!); 81var action = () => builder.AddDotnetProject("app", "app.csproj"); 92var action = () => builder.AddDotnetProject(null!, "app.csproj"); 103var action = () => builder.AddDotnetProject("app", null!); 114var action = () => builder.AddDotnetProject("app", "app.csproj", configure: null!); 128var action = () => project.WithBuildEnvironment(name!, "value");
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.Go.Tests (11)
GoPublicApiTests.cs (11)
24var action = () => new GoAppResource(name, workingDirectory); 37var action = () => new GoAppResource(name, workingDirectory: null!); 50var action = () => builder.AddGoApp("api", "/src/go-app"); 64var action = () => builder.AddGoApp(name, "/src/go-app"); 80var action = () => builder.AddGoApp("api", appDirectory); 228var action = () => builder.WithAppArgs("--port", "9090"); 285var action = () => builder.WithModTidy(); 320var action = () => builder.WithModVendor(); 354var action = () => builder.WithModDownload(); 388var action = () => builder.WithVetTool(); 422var action = () => builder.WithDelveServer();
Aspire.Hosting.Java.Tests (20)
AddJavaAppTests.cs (16)
211var action = () => builder.WithMavenGoal("spring-boot:run"); 224var nullAction = () => app.WithMavenGoal(null!); 225var emptyAction = () => app.WithMavenGoal(string.Empty); 270var action = () => builder.WithGradleTask("bootRun"); 283var nullAction = () => app.WithGradleTask(null!); 284var emptyAction = () => app.WithGradleTask(string.Empty); 455var action = () => app.WithGradleTask("bootRun"); 471var action = () => app.WithMavenGoal("spring-boot:run"); 487var action = () => app.WithGradleTask("bootRun"); 503var action = () => app.WithMavenGoal("spring-boot:run"); 518var action = () => builder.WithWrapperPath("custom-mvnw"); 530var nullAction = () => app.WithWrapperPath(null!); 531var emptyAction = () => app.WithWrapperPath(string.Empty); 583var action = () => builder.WithJvmArgs(["-Xmx512m"]); 595var action = () => app.WithJvmArgs(null!); 651var action = () => builder.WithOtelAgent("/opt/otel/agent.jar");
AddJavaContainerTests.cs (3)
18var action = () => builder.AddJavaContainer("catalog", "mycompany/catalog"); 32var action = () => builder.AddJavaContainer(name!, "mycompany/catalog"); 48var action = () => builder.AddJavaContainer("catalog", image!);
JavaPublicApiTests.cs (1)
18var action = () => new JavaAppResource(name, workingDirectory);
Aspire.Hosting.JavaScript.Tests (19)
NodeJsPublicApiTests.cs (17)
22var action = () => new NodeAppResource(name, command, workingDirectory); 39var action = () => new NodeAppResource(name, command, workingDirectory); 54var action = () => new NodeAppResource(name, command, workingDirectory); 67var action = () => builder.AddNodeApp(name, ".", scriptPath); 82var action = () => builder.AddNodeApp(name, ".", scriptPath); 99var action = () => builder.AddNodeApp(name, ".", scriptPath); 114var action = () => builder.AddJavaScriptApp(name: name, workingDirectory); 129var action = () => builder.AddJavaScriptApp(name: name, workingDirectory); 144var action = () => builder.AddJavaScriptApp(name, appDirectory); 160var action = () => builder.AddJavaScriptApp(name, workingDirectory, runScriptName); 173var action = () => builder.PublishAsStaticWebsite(); 184var action = () => builder.PublishAsNodeServer("server.js"); 199var action = () => app.PublishAsNodeServer(entryPoint); 216var action = () => app.PublishAsNodeServer("server.js", outputPath); 229var action = () => builder.PublishAsPackageScript("start"); 244var action = () => app.PublishAsPackageScript(scriptName); 257var action = () => builder.AddNextJsApp("nextjs", ".");
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)
85Func<bool> isSupported,
Aspire.Hosting.Maui.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.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 (40)
AddMongoDBTests.cs (1)
606var action = () => mongo1.WithTlsAllowInvalidCertificates();
MongoDBPublicApiTests.cs (30)
20var action = () => builder.AddMongoDB(name, port); 35var action = () => builder.AddMongoDB(name, port); 50var action = () => builder.AddMongoDB(name, userName: userName, password: password); 66var action = () => builder.AddMongoDB(name, userName: userName, password: password); 80var action = () => builder.AddDatabase(name); 95var action = () => builder.AddDatabase(name); 108var action = () => builder.WithMongoExpress(); 122var action = () => builder.WithHostPort(port); 133var action = () => builder.WithDataVolume(); 145var action = () => builder.WithDataBindMount(source); 160var action = () => builder.WithDataBindMount(source); 174var action = () => builder.WithInitBindMount("init.js"); 191var action = () => builder.WithInitBindMount(source); 205var action = () => builder.WithInitFiles("init.js"); 220var action = () => builder.WithInitFiles(source); 237var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 254var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 269var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 282var action = () => new MongoDBServerResource(name); 297var action = () => new MongoExpressContainerResource(name); 311var action = () => builder.WithReplicaSet(name); 326var action = () => mongo.WithReplicaSet(name); 339var action = () => builder.WithBindIpAll(); 350var action = () => builder.WithTlsMode(); 362var action = () => mongo.WithTlsMode((MongoDBTlsMode)999); 373var action = () => builder.WithTlsAllowInvalidCertificates(); 386var action = () => builder.WithKeyFile(keyValue, keyFilePath); 403var action = () => builder.WithKeyFile(keyValue, keyFilePath); 426var action = () => builder.WithKeyFile(keyValue, keyFilePath); 441var action = () => builder.WithKeyFile(keyValue, keyFilePath);
ReplicaSet\AddMongoDBReplicaSetTests.cs (7)
136var action = () => builder.AddMongoDBReplicaSet(name); 150var action = () => builder.AddMongoDBReplicaSet(name); 236var action = () => rs.WithMember(mongo1); 250var action = () => otherReplicaSet.WithMember(mongo1); 264var action = () => rs.WithMember(mongo1); 279var action = () => rs.WithMember(mongo1); 291var action = () => builder.AddMongoDBReplicaSet("rs0").WithMember(mongo1);
ReplicaSet\MongoDBReplicaSetPublicApiTests.cs (2)
20var action = () => builder.WithMember(member); 31var action = () => rs.WithMember(null!);
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.Orleans.Tests (2)
OrleansProviderTypeTests.cs (2)
83var action = () => builder.WithOrleansProviderType("Redis"); 102var action = () => provider.WithOrleansProviderType(providerType!);
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.Radius (1)
Publishing\SealedSecretApplyStep.cs (1)
321Func<InvalidOperationException> createTimeoutException)
Aspire.Hosting.Redis.Tests (19)
RedisPublicApiTests.cs (19)
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.WithModule(RedisModules.Json); 156var action = () => redis.WithModule(path); 171var action = () => redis.WithModule(path); 182var action = () => builder.WithDataVolume(); 194var action = () => builder.WithDataBindMount(source); 211var action = () => redisInsightBuilder.WithDataBindMount(source); 226var action = () => new RedisCommanderResource(name); 241var action = () => new RedisInsightResource(name); 256var action = () => new RedisResource(name);
Aspire.Hosting.RemoteHost (3)
AtsCapabilityScanner.cs (1)
1253Func<object?> getValue,
CodeGeneration\CodeGeneratorResolver.cs (1)
32Func<IReadOnlyList<Assembly>> assembliesProvider,
Language\LanguageSupportResolver.cs (1)
31Func<IReadOnlyList<Assembly>> assembliesProvider,
Aspire.Hosting.RemoteHost.Tests (3)
CapabilityDispatcherTests.cs (3)
2377public static void InvokeCallback(Func<Task> callback) 2397public static int WithAsyncCallback(Func<Task<int>> callback) 2458public static Task InvokeSyncCallbackFromAsyncBackgroundThreadProbe(Func<Task> callback)
Aspire.Hosting.Rust.Tests (3)
RustPublicApiTests.cs (3)
30var action = () => builder.AddRustApp("api", "/src/rust-app"); 195var action = () => new RustCargoArgsCallbackContext(resource, []); 206var action = () => new RustCargoArgsCallbackContext(new RustAppResource("api", "/src/rust-app"), args);
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 (1)
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (1)
45private static LaunchSettings? ReadWithDistributedApplicationException(Func<LaunchSettings?> read)
Aspire.Hosting.Testing.Tests (33)
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); 228var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint); 239var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args); 252var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args); 270var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args); 282var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args); 296var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args); 314var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args, configureBuilder); 326var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args, configureBuilder); 340var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args, configureBuilder); 359var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 372var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 385var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 400var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 417var action = () => DistributedApplicationTestingBuilder.Create(args); 430var action = () => DistributedApplicationTestingBuilder.Create(args); 448var action = () => DistributedApplicationTestingBuilder.Create(args, configureBuilder); 460var action = () => DistributedApplicationTestingBuilder.Create(args, configureBuilder); 474var action = () => DistributedApplicationTestingBuilder.Create(args, configureBuilder);
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.Tests (3)
Dcp\DcpExecutorTests.cs (1)
10322private 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)
Aspire.Hosting.TestUtilities (1)
Utils\MockUserSecretsManager.cs (1)
47public 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 (4)
tests\Aspire.TestUtilities\TestcontainersPodmanConfiguration.cs (2)
113Func<string?> findPodmanSocketFromCli) 211Func<string?> findPodmanSocketFromCli)
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)
86public 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);
Aspire.TerminalHost.Tests (3)
TerminalHostAppTests.cs (1)
778private static async Task WaitForAsync(Func<bool> predicate, TimeSpan timeout, string failureMessage)
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.TestUtilities (2)
TestcontainersPodmanConfiguration.cs (2)
113Func<string?> findPodmanSocketFromCli) 211Func<string?> findPodmanSocketFromCli)
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-aot (12)
parent\dotnet\Commands\Run\FileBasedAppRunPlanInputs.cs (1)
29Func<IEnumerable<string>> GetCscInputPaths);
parent\dotnet\Commands\Test\MTP\Terminal\TerminalTestReporter.cs (1)
36internal Func<IStopwatch> CreateStopwatch { get; set; } = SystemStopwatch.StartNew;
parent\dotnet\Commands\Test\MTP\Terminal\TestProgressState.cs (1)
454internal TestNodeResultsState GetOrCreateTestNodeResultsState(Func<TestNodeResultsState> factory)
parent\dotnet\Commands\Test\VSTest\VSTestTrace.cs (1)
23public static void SafeWriteTrace(Func<string> messageLog)
parent\dotnet\NugetPackageDownloader\NuGetPackageDownloader.cs (2)
33private readonly Func<IEnumerable<Task>> _retryTimer; 71Func<IEnumerable<Task>> timer = null,
parent\dotnet\Telemetry\TelemetryCommonProperties.cs (6)
15Func<string>? getCurrentDirectory = null, 17Func<string?>? getMACAddress = null, 18Func<string>? getDeviceId = null, 27private readonly Func<string> _getCurrentDirectory = getCurrentDirectory ?? Directory.GetCurrentDirectory; 29private readonly Func<string?> _getMACAddress = getMACAddress ?? MacAddressGetter.GetMacAddress; 30private readonly Func<string> _getDeviceId = getDeviceId ?? DeviceIdGetter.GetDeviceId;
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-getdocument (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-openapi (8)
Commands\BaseCommand.cs (1)
298Func<Task<IHttpResponseMessageWrapper>> retryBlock,
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-sql-cache (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 (23)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
320public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 337public 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 (4)
19/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, Func{string}, LogLevel)"/> 20public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 51/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, Func{string}, CancellationToken, LogLevel)"/> 52public 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\Log\RoslynTelemetry.cs (2)
139public void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 245public IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
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);
GetDocument.Insider (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)
ILAssembler (1)
EntityRegistry.cs (1)
812private 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)
Infrastructure.Tests (6)
CreateFailingTestIssue\GitHubCliArgumentTests.cs (1)
47private static async Task<IReadOnlyList<string>> CaptureArgumentsAsync(Func<Task<string>> call)
TestTriggerMap\SelectTestsCliTests.cs (3)
1214Action<string, string, Func<IReadOnlyDictionary<string, string>>> body, 1235private static void WithGitRepo(Action<string, Func<IReadOnlyDictionary<string, string>>> body) 1253private static void WithGitHubEnv(string dir, Action<Func<IReadOnlyDictionary<string, string>>> body)
TestTriggerMap\SelectTestsLayer1IntegrationTests.cs (1)
345public void WithGitHubEnvRedirected(Action<Func<IReadOnlyDictionary<string, string>>> body)
TestTriggerMap\TestTriggerMapTests.cs (1)
327var expected = new Dictionary<string, Func<bool>>(StringComparer.Ordinal)
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.Authentication (1)
src\aspnetcore\src\Shared\RemoteAuthenticationAntiforgery.cs (1)
23public static async Task<bool> HandleWithoutAntiforgeryVerdictAsync(HttpContext context, Func<Task<bool>> handler)
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
src\aspnetcore\src\Shared\RemoteAuthenticationAntiforgery.cs (1)
23public static async Task<bool> HandleWithoutAntiforgeryVerdictAsync(HttpContext context, Func<Task<bool>> handler)
Microsoft.AspNetCore.Authorization.Policy (1)
parent\parent\parent\parent\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)
54/// Invokes the given <see cref="Func{TResult}"/> in the context of the associated <see cref="Renderer"/>. 58public abstract Task InvokeAsync(Func<Task> workItem); 61/// Invokes the given <see cref="Func{TResult}"/> in the context of the associated <see cref="Renderer"/>. 65public abstract Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem); 68/// Invokes the given <see cref="Func{TResult}"/> in the context of the associated <see cref="Renderer"/>. 72public 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 (13)
CacheView\CacheView.cs (1)
102internal Func<string>? TreePositionKeyFactory { get; set; }
SessionCascadingValueSupplier.cs (5)
20private readonly Dictionary<string, Func<object?>> _valueCallbacks = new(StringComparer.OrdinalIgnoreCase); 56Func<object?> valueGetter = () => getter.GetValue(componentState.Component); 78internal void RegisterValueCallback(string sessionKey, Func<object?> valueGetter) 151private readonly Func<object?> _currentValueGetter; 158Func<object?> currentValueGetter)
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) 113private readonly Func<object?> _currentValueGetter; 120Func<object?> currentValueGetter)
Microsoft.AspNetCore.Components.Forms (17)
EditContext.cs (5)
191public IEnumerable<string> GetValidationMessages(Expression<Func<object>> accessor) 208public bool IsModified(Expression<Func<object>> accessor) 223public bool IsValid(Expression<Func<object>> accessor) 436public bool IsValidationPending<TField>(Expression<Func<TField>> accessor) 463public 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) 146var modelLambda = Expression.Lambda(typeof(Func<object?>), memberExpression.Expression); 147var modelLambdaCompiled = (Func<object?>)modelLambda.Compile(); 231var methodCallObjectLambda = Expression.Lambda(typeof(Func<object?>), methodCallExpression!); 232var 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.QuickGrid (1)
QuickGrid.razor.cs (1)
498/// <see cref="ComponentBase.InvokeAsync(Func{Task})"/>.
Microsoft.AspNetCore.Components.Server (6)
Circuits\CircuitHost.cs (4)
30private Func<Func<Task>, Task> _dispatchInboundActivity; 655internal Task HandleInboundActivityAsync(Func<Task> handler) 659internal async Task<TResult> HandleInboundActivityAsync<TResult>(Func<Task<TResult>> handler) 666private 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.Testing (1)
Infrastructure\PlaywrightExtensions.cs (1)
208public static async Task WaitForEnhancedNavigationAsync(this IPage page, Func<Task> navigationAction)
Microsoft.AspNetCore.Components.Web (14)
Forms\DisplayName.cs (2)
24private Expression<Func<TValue>>? _previousFieldAccessor; 31public 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 (3)
28private static MemberInfo GetMemberInfo<TValue>(Expression<Func<TValue>> accessor) 92public static string GetDisplayName<TValue>(Expression<Func<TValue>> accessor) 100Expression<Func<TValue>> accessor,
Forms\InputBase.cs (1)
55[Parameter] public Expression<Func<TValue>>? ValueExpression { get; set; }
Forms\Label.cs (1)
47public Expression<Func<TValue>>? For { get; set; }
Forms\ValidationMessage.cs (2)
15private Expression<Func<TValue>>? _previousFieldAccessor; 31[Parameter] public Expression<Func<TValue>>? For { get; set; }
JSComponents\JSComponentInterop.cs (1)
185var callback = jsObjectReference is null ? null : new Func<Task>(
Virtualization\Virtualize.cs (1)
234/// <see cref="ComponentBase.InvokeAsync(Func{Task})"/> to await completion.
Microsoft.AspNetCore.Components.WebAssembly (10)
Hosting\WebAssemblyHostBuilder.cs (1)
31private Func<IServiceProvider> _createServiceProvider;
Rendering\NullDispatcher.cs (3)
24public override Task InvokeAsync(Func<Task> workItem) 31public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 38public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Rendering\WebAssemblyDispatcher.cs (6)
51public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 64var state = ((TaskCompletionSource<TResult> tcs, Func<TResult> workItem))o!; 79public override Task InvokeAsync(Func<Task> workItem) 94var state = ((TaskCompletionSource tcs, Func<Task> workItem))o!; 124public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem) 139var state = ((TaskCompletionSource<TResult> tcs, Func<Task<TResult>> workItem))o!;
Microsoft.AspNetCore.Components.WebView.Maui (3)
MauiDispatcher.cs (3)
26 public override Task InvokeAsync(Func<Task> workItem) 31 public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 36 public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Microsoft.AspNetCore.Components.WebView.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.DataProtection.StackExchangeRedis (4)
RedisDataProtectionBuilderExtensions.cs (2)
27public static IDataProtectionBuilder PersistKeysToStackExchangeRedis(this IDataProtectionBuilder builder, Func<IDatabase> databaseFactory, RedisKey key) 59private static IDataProtectionBuilder PersistKeysToStackExchangeRedisInternal(IDataProtectionBuilder builder, Func<IDatabase> databaseFactory, RedisKey key)
RedisXmlRepository.cs (2)
18private readonly Func<IDatabase> _databaseFactory; 26public RedisXmlRepository(Func<IDatabase> databaseFactory, RedisKey key)
Microsoft.AspNetCore.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)
parent\parent\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.Connections.Client (6)
HttpConnection.cs (2)
56private Func<Task<string?>>? _accessTokenProvider; 57private readonly Func<Task<string?>>? _appAccessTokenProvider;
HttpConnectionOptions.cs (1)
186public Func<Task<string?>>? AccessTokenProvider { get; set; }
Internal\DefaultTransportFactory.cs (2)
15private readonly Func<Task<string?>> _accessTokenProvider; 20public DefaultTransportFactory(HttpTransportType requestedTransportType, ILoggerFactory loggerFactory, HttpClient? httpClient, HttpConnectionOptions httpConnectionOptions, Func<Task<string?>> accessTokenProvider)
Internal\WebSocketsTransport.cs (1)
74public WebSocketsTransport(HttpConnectionOptions httpConnectionOptions, ILoggerFactory loggerFactory, Func<Task<string?>> accessTokenProvider, HttpClient? httpClient,
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
105private static readonly MemberExpression CompletedTaskExpr = Expression.Property(null, (PropertyInfo)GetMemberInfo<Func<Task>>(() => Task.CompletedTask));
Microsoft.AspNetCore.InternalTesting (7)
ExceptionAssertions.cs (6)
50public static async Task<TException> ThrowsAsync<TException>(Func<Task> testCode, string exceptionMessage) 69public static TException Throws<TException>(Func<object> testCode, string exceptionMessage) 109public static Task<ArgumentException> ThrowsArgumentAsync(Func<Task> testCode, string paramName, string exceptionMessage) 115Func<Task> testCode, 164public static Task<ArgumentException> ThrowsArgumentNullOrEmptyAsync(Func<Task> testCode, string paramName) 188public static Task<ArgumentException> ThrowsArgumentNullOrEmptyStringAsync(Func<Task> testCode, string paramName)
HttpClientSlim.cs (1)
109private static async Task<string> RetryRequest(Func<Task<string>> retryBlock)
Microsoft.AspNetCore.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; }
parent\parent\parent\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.Razor.RuntimeCompilation (1)
RuntimeViewCompilerProvider.cs (1)
18private readonly Func<IViewCompiler> _createCompiler;
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)
61internal Func<Matcher> MatcherBuilder { get; set; }
Microsoft.AspNetCore.Mvc.Testing (7)
WebApplicationFactory.cs (7)
226private void TryConfigureServerPort(Func<IServerAddressesFeature?> serverAddressFeatureAccessor) 897private readonly Func<IWebHostBuilder?> _createWebHostBuilder; 898private readonly Func<IHostBuilder?> _createHostBuilder; 899private readonly Func<IEnumerable<Assembly>> _getTestAssemblies; 907Func<IWebHostBuilder?> createWebHostBuilder, 908Func<IHostBuilder?> createHostBuilder, 909Func<IEnumerable<Assembly>> getTestAssemblies,
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
DynamicViewData.cs (2)
15private readonly Func<ViewDataDictionary> _viewDataFunc; 17public DynamicViewData(Func<ViewDataDictionary> viewDataFunc)
ViewDataInfo.cs (3)
13private static readonly Func<object> _propertyInfoResolver = () => null; 16private Func<object> _valueAccessor; 51public ViewDataInfo(object container, PropertyInfo propertyInfo, Func<object> valueAccessor)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (2)
RedisOutputCacheOptions.cs (2)
32public Func<Task<IConnectionMultiplexer>>? ConnectionMultiplexerFactory { get; set; } 43public Func<ProfilingSession>? ProfilingSession { get; set; }
Microsoft.AspNetCore.Owin (12)
OwinEnvironment.cs (10)
251public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory) 274public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter) 287public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter, Func<object> featureFactory) 299private Func<object> DefaultFactory { get; set; } 300private Func<object> FeatureFactory { get; set; } 365public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory) 386public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory, Action<TFeature, object> setter) 398public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory, Action<TFeature, object> setter, Func<TFeature> featureFactory)
OwinFeatureCollection.cs (2)
264var loadAsync = Prop<Func<Task>>(OwinConstants.CommonKeys.LoadClientCertAsync);
Microsoft.AspNetCore.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)
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\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\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
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\DefaultPool.cs (2)
21public static ObjectPool<T> Create<T>(Func<T> factory, Opt<int> poolSize = default) 29private sealed class PoolableObjectPolicy<T>(Func<T> factory) : IPooledObjectPolicy<T>
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.Server.HttpSys (2)
ResponseStream.cs (2)
9private readonly Func<Task> _onStart; 11internal ResponseStream(Stream innerStream, Func<Task> onStart)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\RetryHelper.cs (1)
20Func<Task<HttpResponseMessage>> retryBlock,
Microsoft.AspNetCore.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.SignalR.Client.Core (5)
HubConnection.cs (2)
1179Func<Task> createAndConsumeStream; 1234private async Task CommonStreaming(ConnectionState connectionState, string streamId, Func<Task> createAndConsumeStream, CancellationTokenSource cts)
HubConnectionExtensions.cs (1)
227public static IDisposable On(this HubConnection hubConnection, string methodName, Func<Task> handler)
HubConnectionExtensions.OnResult.cs (2)
55public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Func<Task<TResult>> handler) 71public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Func<TResult> handler)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Proxying\SpaProxyingExtensions.cs (1)
58Func<Task<Uri>> baseUriTaskFactory)
Microsoft.AspNetCore.TestHost (10)
AsyncStreamWrapper.cs (2)
9private readonly Func<bool> _allowSynchronousIO; 11internal AsyncStreamWrapper(Stream inner, Func<bool> allowSynchronousIO)
ResponseBodyPipeWriter.cs (2)
11private readonly Func<Task> _onFirstWriteAsync; 17internal ResponseBodyPipeWriter(Pipe pipe, Func<Task> onFirstWriteAsync)
ResponseBodyWriterStream.cs (2)
9private readonly Func<bool> _allowSynchronousIO; 11public ResponseBodyWriterStream(ResponseBodyPipeWriter responseWriter, Func<bool> allowSynchronousIO)
ResponseFeature.cs (4)
15private Func<Task> _responseStartingAsync = () => Task.CompletedTask; 16private Func<Task> _responseCompletedAsync = () => Task.CompletedTask; 81var prior = _responseStartingAsync; 91var prior = _responseCompletedAsync;
Microsoft.AspNetCore.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 (18)
BackEnd\BuildManager\CacheAggregator.cs (2)
16private readonly Func<int> _nextConfigurationId; 24public CacheAggregator(Func<int> nextConfigurationId)
BackEnd\Client\MSBuildClient.cs (1)
501private bool TrySendPacket(Func<INodePacket> packetResolver)
BackEnd\Components\Communications\NodeLauncher.cs (1)
326private static Process DisableMSBuildServer(Func<Process> func)
BackEnd\Shared\BuildRequestConfiguration.cs (1)
592private void InitializeProject(BuildParameters buildParameters, Func<ProjectInstance> loadProjectFromFile)
Definition\ToolsetConfigurationReader.cs (2)
32private readonly Func<Configuration> _readApplicationConfiguration; 68internal ToolsetConfigurationReader(PropertyDictionary<ProjectPropertyInstance> environmentProperties, PropertyDictionary<ProjectPropertyInstance> globalProperties, Func<Configuration> readApplicationConfiguration)
Graph\ParallelWorkSet.cs (3)
105internal void AddWork(TKey key, Func<TResult> workFunc) 224private Func<TResult> _workFunc; 228internal WorkItem(Func<TResult> workFunc)
Logging\BinaryLogger\BinaryLogger.cs (1)
779private 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 (19)
BuildEnvironmentHelper.cs (14)
77var possibleLocations = new Func<BuildEnvironment>[] 89foreach (var location in possibleLocations) 492internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 493Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 494Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 496Func<bool> runningTests = null, 497Func<string> getSdkRootFromAppContext = null) 522private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 523private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 524private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 525private static Func<string> s_getSdkRootFromAppContext = GetSdkRootFromAppContext; 526private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 528private static Func<bool> s_runningTests = CheckIfRunningTests;
TaskClassRegistration.cs (4)
17/// <see cref="TaskClassRegistry.Register(string, Func{ITask})"/> overload - where only an untyped factory is 33/// <see cref="TaskClassRegistry.Register(string, Func{ITask})"/> overload it is computed on first use by 52internal TaskClassRegistration(Func<ITask> factory) 82private static LoadedType CreateLoadedTypeFromFactory(Func<ITask> factory)
TaskClassRegistry.cs (1)
79internal static void Register(string taskName, Func<ITask> factory)
Microsoft.Build.Tasks.Core (8)
Copy.cs (1)
923private 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 =
XmlTaskUtility.cs (1)
43internal static bool IsDtdProhibitedException(Exception exception, bool prohibitDtd, Func<bool> containsDtd)
Microsoft.Build.Utilities.Core (1)
Task.cs (1)
214public static void RegisterTask(string taskName, Func<ITask> factory)
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)
3316Func<Stream?>? getPortablePdbStream = 3319: (Func<Stream?>)(() => ConditionalGetOrCreateStream(pdbStreamProvider, metadataDiagnostics)); 3409Func<Stream?> getPeStream, 3410Func<Stream?>? getMetadataPeStreamOpt, 3411Func<Stream?>? getPortablePdbStreamOpt,
FileSystem\FileUtilities.cs (2)
320public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 337public 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 (23)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
320public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 337public 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 (4)
19/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, Func{string}, LogLevel)"/> 20public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 51/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, Func{string}, CancellationToken, LogLevel)"/> 52public 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\Log\RoslynTelemetry.cs (2)
139public void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 245public IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
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 (27)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
320public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 337public 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 (4)
19/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, Func{string}, LogLevel)"/> 20public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 51/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, Func{string}, CancellationToken, LogLevel)"/> 52public 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\Log\RoslynTelemetry.cs (2)
139public void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 245public IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
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 (23)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
320public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 337public 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 (4)
19/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, Func{string}, LogLevel)"/> 20public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 51/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, Func{string}, CancellationToken, LogLevel)"/> 52public 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\Log\RoslynTelemetry.cs (2)
139public void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 245public IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
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 (3)
Api\HotReloadService.cs (3)
17private sealed class DebuggerService(Func<ValueTask<ImmutableArray<string>>> capabilitiesProvider) : IManagedHotReloadService 138private readonly Func<ValueTask<ImmutableArray<string>>> _capabilitiesProvider; 141public HotReloadService(SolutionServices services, Func<ValueTask<ImmutableArray<string>>> capabilitiesProvider)
Microsoft.CodeAnalysis.Features (18)
EditAndContinue\DebuggingSession.cs (1)
983public 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.NetAnalyzers (5)
Microsoft.NetCore.Analyzers\Resources\MarkAssembliesWithNeutralResourcesLanguage.cs (1)
40protected abstract void RegisterAttributeAnalyzer(CompilationStartAnalysisContext context, Func<bool> shouldAnalyze, Action<SyntaxNodeAnalysisContext> onResourceFound, INamedTypeSymbol generatedCode);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (2)
34private readonly Func<bool> _getIsInsideAnonymousObjectInitializer; 45Func<bool> getIsInsideAnonymousObjectInitializer,
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
2199Func<ControlFlowGraph?> getCfg, 3496TAnalysisData AnalyzePossibleTargetInvocation(Func<TAbstractAnalysisValue> computeValueForInvocation, TAnalysisData inputAnalysisData, TAnalysisData? mergedAnalysisData, ref bool first)
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 (23)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
320public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 337public 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 (4)
19/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, Func{string}, LogLevel)"/> 20public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 51/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, Func{string}, CancellationToken, LogLevel)"/> 52public 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\Log\RoslynTelemetry.cs (2)
139public void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 245public IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
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 (29)
Binding\Binder_Statements.vb (2)
1304Dim typeDiagnostic As Func(Of DiagnosticInfo) = Nothing 1614getRequireTypeDiagnosticInfoFunc As Func(Of DiagnosticInfo),
Binding\Binder_Utils.vb (6)
486getRequireTypeDiagnosticInfoFunc As Func(Of DiagnosticInfo), 575getRequireTypeDiagnosticInfoFunc As Func(Of DiagnosticInfo), 608getRequireTypeDiagnosticInfoFunc As Func(Of DiagnosticInfo), 628getRequireTypeDiagnosticInfoFunc As Func(Of DiagnosticInfo), 651getRequireTypeDiagnosticInfoFunc As Func(Of DiagnosticInfo), 667getRequireTypeDiagnosticInfoFunc As Func(Of DiagnosticInfo),
CommandLine\CommandLineDiagnosticFormatter.vb (2)
15Private ReadOnly _getAdditionalTextFiles As Func(Of ImmutableArray(Of AdditionalTextFile)) 17Friend Sub New(baseDirectory As String, getAdditionalTextFiles As Func(Of ImmutableArray(Of AdditionalTextFile)))
Compilation\VisualBasicCompilation.vb (2)
136Public Sub New(treeOpt As Func(Of SyntaxTree), rootNamespaceOpt As Func(Of RootSingleNamespaceDeclaration))
Errors\ErrorFactories.vb (9)
31Public Shared ReadOnly GetErrorInfo_ERR_WithEventsRequiresClass As Func(Of DiagnosticInfo) = 34Public Shared ReadOnly GetErrorInfo_ERR_StrictDisallowImplicitObject As Func(Of DiagnosticInfo) = 37Public Shared ReadOnly GetErrorInfo_WRN_ObjectAssumedVar1_WRN_StaticLocalNoInference As Func(Of DiagnosticInfo) = 40Public Shared ReadOnly GetErrorInfo_WRN_ObjectAssumedVar1_WRN_MissingAsClauseinVarDecl As Func(Of DiagnosticInfo) = 43Public Shared ReadOnly GetErrorInfo_ERR_StrictDisallowsImplicitProc As Func(Of DiagnosticInfo) = 46Public Shared ReadOnly GetErrorInfo_ERR_StrictDisallowsImplicitArgs As Func(Of DiagnosticInfo) = 49Public Shared ReadOnly GetErrorInfo_WRN_ObjectAssumed1_WRN_MissingAsClauseinFunction As Func(Of DiagnosticInfo) = 52Public Shared ReadOnly GetErrorInfo_WRN_ObjectAssumed1_WRN_MissingAsClauseinOperator As Func(Of DiagnosticInfo) = 55Public Shared ReadOnly GetErrorInfo_WRN_ObjectAssumedProperty1_WRN_MissingAsClauseinProperty As Func(Of DiagnosticInfo) =
Parser\Parser.vb (2)
497Private Function ParseWithStackGuard(Of TNode As VisualBasicSyntaxNode)(parseFunc As Func(Of TNode), defaultFunc As Func(Of TNode)) As TNode
Symbols\Source\SourceComplexParameterSymbol.vb (1)
332Dim getErrorInfo As Func(Of DiagnosticInfo) = Nothing
Symbols\Source\SourceDelegateMethodSymbol.vb (1)
113Dim getErrorInfo As Func(Of DiagnosticInfo) = Nothing
Symbols\Source\SourceMemberFieldSymbol.vb (1)
184Dim getErrorInfo As Func(Of DiagnosticInfo) = Nothing
Symbols\Source\SourceMethodSymbol.vb (1)
2318Dim getErrorInfo As Func(Of DiagnosticInfo) = Nothing
Symbols\Source\SourcePropertySymbol.vb (1)
362Dim getErrorInfo As Func(Of DiagnosticInfo) = Nothing
Symbols\Source\UnboundLambdaParameterSymbol.vb (1)
85Dim getErrorInfo As Func(Of DiagnosticInfo) = Nothing
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Resources\BasicMarkAssembliesWithNeutralResourcesLanguage.vb (1)
16Protected Overrides Sub RegisterAttributeAnalyzer(context As CompilationStartAnalysisContext, shouldAnalyze As Func(Of Boolean), onResourceFound As Action(Of SyntaxNodeAnalysisContext), generatedCode As INamedTypeSymbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (1)
17Private ReadOnly _createAliasSet As Func(Of ImmutableHashSet(Of String)) =
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (2)
302Dim syntaxPredicate As Func(Of Boolean) = Function() 328syntaxPredicate As Func(Of Boolean),
Microsoft.CodeAnalysis.Workspaces (33)
ExtensionManager\IExtensionManagerExtensions.cs (2)
33Func<T> function, 51Func<Task?> function)
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
57private 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)
320public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 337public 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 (4)
19/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, Func{string}, LogLevel)"/> 20public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 51/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, Func{string}, CancellationToken, LogLevel)"/> 52public 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\Log\RoslynTelemetry.cs (2)
139public void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 245public IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
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)
582protected 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)
320public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 337public 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.DataContractReader.Contracts (2)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LayoutSet.g.cs (2)
104private Func<Target.TypeInfo?>? _factory; 112public LazyLayout(Func<Target.TypeInfo?> factory)
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)
parent\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.Abstractions (1)
Realtime\RealtimeSessionOptions.cs (1)
109public Func<object?>? RawRepresentationFactory { get; init; }
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)
31private readonly Func<DateTime> _provideDateTime; 38Func<DateTime> provideDateTime, 242Func<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)
28Func<DateTime> provideDateTime, 39private readonly Func<DateTime> _provideDateTime = provideDateTime; 196Func<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)
61internal override IEvaluationResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime)
DiskBased\DiskBasedResponseCacheTests.cs (1)
63internal override IEvaluationResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime)
ResponseCacheTester.cs (1)
20internal 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)
416Func<AIFunctionFactoryOptions> createOptions = () =>
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIHostedFileClientIntegrationTests.cs (1)
439private static async Task<T> RetryAsync<T>(Func<Task<T>> action, int maxRetries = 5, int delayMs = 2000)
Microsoft.Extensions.AI.Tests (13)
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)
1031Func<Queue<List<ChatMessage>>> expectedDownstreamClientInput = () => new Queue<List<ChatMessage>>( 1045Func<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 (6)
266Func<string> dotnetFunc = () => "test"; 292Func<string> funcWithDisplayName = [DisplayName("get_user_id")] () => "test"; 298Func<string> funcWithBoth = [DisplayName("my_function")][Description("A test function")] () => "test"; 316Func<string> funcWithoutDisplayName = () => "test"; 324Func<string> funcWithAttribute = [AIFunctionName("get_user")] () => "test"; 328Func<string> funcWithBoth = [AIFunctionName("my_function")][DisplayName("display_name")] () => "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.Caching.StackExchangeRedis (2)
RedisCacheOptions.cs (2)
32public Func<Task<IConnectionMultiplexer>>? ConnectionMultiplexerFactory { get; set; } 43public Func<ProfilingSession>? ProfilingSession { get; set; }
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)
63private 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 (20)
Latency\HttpClientLatencyTelemetryExtensionsTest.cs (1)
23var act = () => ((IServiceCollection)null!).AddHttpClientLatencyTelemetry();
Logging\HttpClientLoggerTest.cs (6)
72var act = async () => 107var act = async () => 150var act = async () => 468var act = () => client.SendAsync(httpRequestMessage, CancellationToken.None); 584var act = async () => await client 854var act = () => client.SendAsync(httpRequestMessage, CancellationToken.None);
Logging\HttpClientLoggingExtensionsTest.cs (7)
42var act = () => ((IHttpClientBuilder)null!).AddExtendedHttpClientLogging(); 61var act = () => ((IServiceCollection)null!).AddExtendedHttpClientLogging(); 80var act = () => ((IServiceCollection)null!).AddHttpClientLogEnricher<EmptyEnricher>(); 220var act = async () => await host.StartAsync().ConfigureAwait(false); 401var act = () => provider.GetRequiredService<IOptionsMonitor<LoggingOptions>>().Get("test"); 423var act = () => provider.GetRequiredService<IOptionsMonitor<LoggingOptions>>().Get("test"); 541var 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 (10)
ChangeToken.cs (10)
25public static IDisposable OnChange(Func<IChangeToken?> changeTokenProducer, Action changeTokenConsumer) 44public static IDisposable OnChange<TState>(Func<IChangeToken?> changeTokenProducer, Action<TState> changeTokenConsumer, TState state) 63public static IDisposable OnChange(Func<IChangeToken?> changeTokenProducer, Func<Task> changeTokenConsumer) 68return new AsyncChangeTokenRegistration<Func<Task>>(changeTokenProducer, static callback => callback(), changeTokenConsumer); 83public static IDisposable OnChange<TState>(Func<IChangeToken?> changeTokenProducer, Func<TState, Task> changeTokenConsumer, TState state) 91private abstract class ChangeTokenRegistration<TState>(Func<IChangeToken?> changeTokenProducer, TState state) : IDisposable 99protected Func<IChangeToken?> ChangeTokenProducer { get; } = changeTokenProducer; 179public SyncChangeTokenRegistration(Func<IChangeToken?> changeTokenProducer, Action<TState> changeTokenConsumer, TState state) 212public AsyncChangeTokenRegistration(Func<IChangeToken?> changeTokenProducer, Func<TState, Task> 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.VectorData.Abstractions (3)
ProviderServices\CollectionModel.cs (2)
25private readonly Func<object> _recordFactory; 62Func<object> recordFactory,
ProviderServices\Filter\FilterTranslatorBase.cs (1)
379var evaluated = Expression.Lambda<Func<object>>(Expression.Convert(visited, typeof(object)))
Microsoft.Extensions.VectorData.ConformanceTests (1)
TypeTests\DataTypeTests.cs (1)
157Expression<Func<TTestType>>? instantiationExpression = null)
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 (2)
Datasets.cs (1)
28public Func<TextLoader.Column[]> GetLoaderColumns;
parent\parent\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.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)
parent\parent\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)
parent\parent\src\Common\tests\RetryHelper.cs (1)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null)
Microsoft.ML.TorchSharp (2)
Utils\DefaultDictionary.cs (2)
21private readonly Func<TValue> _init; 24public DefaultDictionary(Func<TValue> init)
Microsoft.ML.Transforms (17)
CustomMappingFilter.cs (2)
94private readonly Func<bool> _accept; 160private readonly Func<bool> _accept;
Expression\BuiltinFunctions.cs (1)
72public static MethodInfo Fn<T1>(Func<T1> fn)
Expression\CodeGen.cs (2)
102private static readonly MethodInfo _methGetFalseBL = ((Func<BL>)BuiltinFunctions.False).GetMethodInfo(); 103private static readonly MethodInfo _methGetTrueBL = ((Func<BL>)BuiltinFunctions.True).GetMethodInfo();
GroupTransform.cs (4)
395private static readonly FuncStaticMethodInfo1<DataViewRow, int, Func<bool>> _makeSameCheckerMethodInfo 396= new FuncStaticMethodInfo1<DataViewRow, int, Func<bool>>(MakeSameChecker<int>); 398public readonly Func<bool> IsSameKey; 400private static Func<bool> MakeSameChecker<T>(DataViewRow row, int col)
PermutationFeatureImportance.cs (1)
25Func<TResult> resultInitializer,
PermutationFeatureImportanceExtensions.cs (1)
656Func<TResult> resultInitializer,
UngroupTransform.cs (6)
448private static readonly FuncInstanceMethodInfo1<Cursor, int, Func<int>> _makeSizeGetterMethodInfo 449= FuncInstanceMethodInfo1<Cursor, int, Func<int>>.Create(target => target.MakeSizeGetter<int>); 473private readonly Func<int>[] _sizeGetters; 489var needed = new List<Func<int>>(); 555foreach (var getter in _sizeGetters) 578private Func<int> MakeSizeGetter<T>(int col)
Microsoft.NET.Build.Containers (6)
LocalDaemons\ContainerRuntime.cs (2)
27private readonly Func<bool> _isPodmanAlias; 61Func<bool> isPodmanAlias,
Registry\Registry.cs (4)
80private readonly Func<TimeSpan> _retryDelayProvider; 93internal Registry(string registryName, ILogger logger, IRegistryAPI registryAPI, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null) : 102internal Registry(Uri baseUri, ILogger logger, IRegistryAPI registryAPI, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null) : 110private Registry(Uri baseUri, ILogger logger, RegistryApiFactory factory, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null)
Microsoft.NET.Build.Tasks (4)
parent\parent\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.ProjectData.Tasks (1)
ProjectDataWriter.cs (1)
386 Func<string>? candidateTextFactory,
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) 581private 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)
parent\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)
MSBuildStaticGraphRestore.cs (1)
896Func<PackageSpec> getPackageSpec,
Program.cs (1)
169internal 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 (45)
Commands\ConfigCommands\ConfigCommand.cs (5)
32internal static Command Register(Command app, Func<ILoggerWithColor> getLogger) 75private static void RegisterOptionsForCommandConfigPaths(Command cmd, Func<ILogger> getLogger) 97private static void RegisterOptionsForCommandConfigGet(Command cmd, Func<ILogger> getLogger) 136private static void RegisterOptionsForCommandConfigSet(Command cmd, Func<ILogger> getLogger) 174private 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)
17internal static void Register(Command parent, Func<ILoggerWithColor> getLogger)
Commands\LocalsCommand.cs (1)
17internal static void Register(Command parent, Func<ILoggerWithColor> getLogger)
Commands\NuGet\Add\DotnetNuGetAddCommand.cs (3)
13internal static void Register(Command parent, Func<ILoggerWithColor> getLogger) 23private static void RegisterAddSource(Command parent, Func<ILoggerWithColor> getLogger) 69private static void RegisterAddClientCert(Command parent, Func<ILoggerWithColor> getLogger)
Commands\NuGet\Disable\DotnetNuGetDisableCommand.cs (1)
13internal static void Register(Command parent, Func<ILoggerWithColor> getLogger)
Commands\NuGet\Enable\DotnetNuGetEnableCommand.cs (1)
13internal static void Register(Command parent, Func<ILoggerWithColor> getLogger)
Commands\NuGet\List\DotnetNuGetListCommand.cs (3)
13internal static void Register(Command parent, Func<ILoggerWithColor> getLogger) 23private static void RegisterListSource(Command parent, Func<ILoggerWithColor> getLogger) 48private static void RegisterListClientCert(Command parent, Func<ILoggerWithColor> getLogger)
Commands\NuGet\Remove\DotnetNuGetRemoveCommand.cs (3)
13internal static void Register(Command parent, Func<ILoggerWithColor> getLogger) 23private static void RegisterRemoveSource(Command parent, Func<ILoggerWithColor> getLogger) 48private static void RegisterRemoveClientCert(Command parent, Func<ILoggerWithColor> getLogger)
Commands\NuGet\Update\DotnetNuGetUpdateCommand.cs (3)
13internal static void Register(Command parent, Func<ILoggerWithColor> getLogger) 23private static void RegisterUpdateSource(Command parent, Func<ILoggerWithColor> getLogger) 69private static void RegisterUpdateClientCert(Command parent, Func<ILoggerWithColor> getLogger)
Commands\PackageReferenceCommands\AddPackageReferenceCommand.cs (3)
17internal static void Register(Command parent, Func<ILoggerWithColor> getLogger, 18Func<IPackageReferenceCommandRunner> getCommandRunner, 19Func<IVirtualProjectBuilder?>? getVirtualProjectBuilder = null)
Commands\PackageReferenceCommands\ListPackage\ListPackageCommand.cs (2)
27Func<ILoggerWithColor> getLogger, 29Func<IListPackageCommandRunner> getCommandRunner,
Commands\PackageReferenceCommands\RemovePackageReferenceCommand.cs (3)
16internal static void Register(Command parent, Func<ILoggerWithColor> getLogger, 17Func<IPackageReferenceCommandRunner> getCommandRunner, 18Func<IVirtualProjectBuilder?>? getVirtualProjectBuilder = null)
Commands\PackageSearch\PackageSearchCommand.cs (2)
20public static void Register(Command rootCommand, Func<ILoggerWithColor> getLogger) 25public static void Register(Command rootCommand, Func<ILoggerWithColor> getLogger, Func<PackageSearchArgs, string, CancellationToken, Task<int>> setupSettingsAndRunSearchAsync)
Commands\PushCommand.cs (1)
17internal static void Register(Command parent, Func<ILoggerWithColor> getLogger)
Commands\Signing\SignCommand.cs (2)
25Func<ILoggerWithColor> getLogger, 27Func<ISignCommandRunner> getCommandRunner)
Commands\Signing\TrustedSignersCommand.cs (2)
21Func<ILoggerWithColor> getLogger, 192Func<ILoggerWithColor> getLogger,
Commands\Signing\VerifyCommand.cs (2)
22Func<ILoggerWithColor> getLogger, 24Func<IVerifyCommandRunner> getCommandRunner)
Commands\Why\WhyCommand.cs (1)
44internal static void Register(Command rootCommand, Lazy<IAnsiConsole> console, Func<WhyCommandRunner> getCommandRunner)
Program.cs (1)
96Func<ILoggerWithColor> getHidePrefixLogger = () =>
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, bool restoreEnableAnalyzerAssets, Func<(LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework)> valueFactory)
RestoreCommand\Utility\PackageSpecFactory.cs (1)
894private 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)
214private 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)
364internal 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 = async () =>
HttpSource\HttpSourceRequest.cs (2)
27public HttpSourceRequest(Func<HttpRequestMessage> requestFactory) 40public Func<HttpRequestMessage> RequestFactory { get; }
LocalRepositories\LocalPackageInfo.cs (1)
13private readonly Func<PackageReaderBase> _getPackageReader = null!;
Model\LocalPackageSearchMetadata.cs (1)
101public Func<PackageReaderBase> PackageReader
Model\PackageSearchMetadataBuilder.cs (3)
61public Func<PackageReaderBase>? PackageReader { get; set; } 169public static IPackageSearchMetadata WithVersions(this IPackageSearchMetadata metadata, Func<Task<IEnumerable<VersionInfo>>> asyncValueFactory) 177public static IPackageSearchMetadata WithVersions(this IPackageSearchMetadata metadata, Func<IEnumerable<VersionInfo>> valueFactory)
NuGetTestMode.cs (1)
54public static T InvokeTestFunctionAgainstTestMode<T>(Func<T> function, bool testModeEnabled)
Plugins\InboundRequestContext.cs (1)
256Func<Task> task = () => ProcessResponseAsync(requestHandler, request, responseHandler);
Plugins\InboundRequestProcessingHandler.cs (1)
50internal void Handle(MessageMethod messageMethod, Func<Task> task, CancellationToken cancellationToken)
Plugins\IPluginMulticlientUtilities.cs (1)
28Task DoOncePerPluginLifetimeAsync(string key, Func<Task> taskFunc, CancellationToken cancellationToken);
Plugins\IRequestHandlers.cs (1)
26Func<IRequestHandler> addHandlerFunc,
Plugins\PluginMulticlientUtilities.cs (1)
41Func<Task> taskFunc,
Plugins\PluginPackageReader.cs (1)
1152public override string GetContentHash(CancellationToken token, Func<string>? GetUnsignedPackageHash = null)
Plugins\RequestHandlers.cs (1)
37Func<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 (23)
src\roslyn\src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
320public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 337public 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 (4)
19/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, Func{string}, LogLevel)"/> 20public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 51/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, Func{string}, CancellationToken, LogLevel)"/> 52public 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\Log\RoslynTelemetry.cs (2)
139public void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 245public IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
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 (7)
System\ComponentModel\DataAnnotations\AsyncValidationAttribute.cs (2)
35/// <param name="errorMessageAccessor">The <see cref="Func{T}" /> that will return an error message.</param> 36protected AsyncValidationAttribute(Func<string> errorMessageAccessor)
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 (55)
System\Diagnostics\Activity.cs (2)
1026public static Func<ActivityTraceId>? TraceIdGenerator { get; set; } 1302Func<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 (7)
22internal ObservableCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 26internal ObservableCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 32internal ObservableCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 36internal ObservableCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 42internal ObservableCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description) : this(meter, name, observeValues, unit, description, tags: null) 46internal 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) 55protected override IEnumerable<Measurement<T>> Observe() => ((Func<IEnumerable<Measurement<T>>>)_callback)();
System\Diagnostics\Metrics\ObservableGauge.cs (7)
22internal ObservableGauge(Meter meter, string name, Func<T> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 26internal ObservableGauge(Meter meter, string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 32internal ObservableGauge(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 36internal ObservableGauge(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 42internal ObservableGauge(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description) : this(meter, name, observeValues, unit, description, tags: null) 46internal 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) 55protected override IEnumerable<Measurement<T>> Observe() => ((Func<IEnumerable<Measurement<T>>>)_callback)();
System\Diagnostics\Metrics\ObservableInstrument.cs (2)
66if (callback is Func<T> valueOnlyFunc) 72if (callback is Func<Measurement<T>> measurementOnlyFunc)
System\Diagnostics\Metrics\ObservableUpDownCounter.cs (7)
22internal ObservableUpDownCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 26internal ObservableUpDownCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 32internal ObservableUpDownCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 36internal ObservableUpDownCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 42internal ObservableUpDownCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description) : this(meter, name, observeValues, unit, description, tags: null) 46internal 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) 55protected override IEnumerable<Measurement<T>> Observe() => ((Func<IEnumerable<Measurement<T>>>)_callback)();
System.IO.Compression (3)
System\IO\Compression\ZipArchiveEntry.cs (1)
1010Func<Stream> compressorStreamFactory;
System\IO\Compression\ZipCustomStreams.cs (2)
256private readonly Func<Stream> _baseStreamFactory; 283public 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; 2493public OverrideEventProvider(Func<EventSource?> eventSourceFactory, EventProviderType providerType) 2507private readonly Func<EventSource?> _eventSourceFactory; 3944private static List<Func<EventSource?>> s_preregisteredEventSourceFactories = new List<Func<EventSource?>>(); 3962internal static unsafe void PreregisterEventProviders(Guid id, string name, Func<EventSource?> eventSourceFactory) 4025Func<EventSource?>[] factories; 4031foreach (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_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\Task.cs (6)
5724public static Task<TResult> Run<TResult>(Func<TResult> function) 5742public static Task<TResult> Run<TResult>(Func<TResult> function, CancellationToken cancellationToken) 5757public static Task Run(Func<Task?> function) 5775public static Task Run(Func<Task?> function, CancellationToken cancellationToken) 5803public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function) 5819public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function, CancellationToken cancellationToken)
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\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\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)
1553Func<object?> getSource = () => GetMemberValue(o, member.Mapping.MemberInfo!); 1559private object? WriteAddCollectionFixup(Func<object?> getSource, Action<object?> setSource, object memberValue, TypeDesc typeDesc, bool readOnly) 2227public 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.Caching (1)
System\Runtime\Caching\Counters.cs (1)
113private PollingCounter CreatePollingCounter(string name, string displayName, Func<double> getValue)
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)
51Func<object>? createObject = DetermineCreateObjectDelegate(type, converter); 954private 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)
149private 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)
166Func<ICustomAttributeProvider>? attributeProviderFactory = Volatile.Read(ref AttributeProviderFactory); 188internal 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)
88public Func<object>? CreateObject 98private protected Func<object>? _createObject; 100internal Func<object>? CreateObjectForExtensionDataProperty { get; set; } 883Func<ICustomAttributeProvider>? ctorAttrProviderFactory = Volatile.Read(ref ConstructorAttributeProviderFactory); 905internal 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)
50public 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)
20public 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)
parent\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 (6)
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\Control.cs (1)
6305public T Invoke<T>(Func<T> method) => (T)Invoke(method, null);
System\Windows\Forms\SystemVisualSettingsTracker.cs (2)
17private static Func<SystemVisualSettings> s_snapshotProvider = GetNativeSnapshot; 119Func<SystemVisualSettings>? snapshotProvider = null)
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)
561public 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 (5)
Processors\ListExtensionsArgumentProcessor.cs (4)
43private readonly Func<IArgumentExecutor> _getExecutor; 44private readonly Func<IArgumentProcessorCapabilities> _getCapabilities; 46public ListExtensionsArgumentProcessor(Func<IArgumentExecutor> getExecutor, Func<IArgumentProcessorCapabilities> getCapabilities)
TestPlatformHelpers\LazyTestRequestManager.cs (1)
27public LazyTestRequestManager(Func<ITestRequestManager> factory)
vstest.console.arm64 (5)
parent\vstest.console\Processors\ListExtensionsArgumentProcessor.cs (4)
43private readonly Func<IArgumentExecutor> _getExecutor; 44private readonly Func<IArgumentProcessorCapabilities> _getCapabilities; 46public ListExtensionsArgumentProcessor(Func<IArgumentExecutor> getExecutor, Func<IArgumentProcessorCapabilities> getCapabilities)
parent\vstest.console\TestPlatformHelpers\LazyTestRequestManager.cs (1)
27public LazyTestRequestManager(Func<ITestRequestManager> factory)