2990 references to Func
aspire (14)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
DotNet\DotNetCliRunner.cs (2)
60internal Func<int> GetCurrentProcessId { get; set; } = () => Environment.ProcessId; 62internal Func<long> GetCurrentProcessStartTime { get; set; } = () =>
Interaction\ConsoleInteractionService.cs (1)
33public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
Interaction\ExtensionInteractionService.cs (4)
31private readonly Channel<Func<Task>> _extensionTaskChannel; 41_extensionTaskChannel = Channel.CreateUnbounded<Func<Task>>(new UnboundedChannelOptions 53var taskFunction = await _extensionTaskChannel.Reader.ReadAsync().ConfigureAwait(false); 65public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
Interaction\IInteractionService.cs (1)
11Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action);
Projects\ProjectLocator.cs (2)
128var fileNameSuggestsAppHost = () => projectFile.Name.EndsWith("AppHost.csproj", StringComparison.OrdinalIgnoreCase); 129var folderContainsAppHostCSharpFile = () => projectFile.Directory!.EnumerateFiles("*", SearchOption.TopDirectoryOnly).Any(f => f.Name.Equals("AppHost.cs", StringComparison.OrdinalIgnoreCase));
Projects\ProjectUpdater.cs (3)
858internal abstract record UpdateStep(string Description, Func<Task> Callback) 871Func<Task> Callback, 883internal record AnalyzeStep(string Description, Func<Task> Callback);
Aspire.Azure.AI.Inference (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Azure.AI.Inference.Tests (4)
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 (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
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.Data.Tables (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Azure.Messaging.EventHubs (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Azure.Messaging.ServiceBus (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Azure.Messaging.WebPubSub (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Azure.Search.Documents (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Azure.Security.KeyVault (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Azure.Storage.Blobs (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Azure.Storage.Queues (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Cli.Tests (9)
Commands\NewCommandTests.cs (1)
628public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
Commands\PublishCommandPromptingIntegrationTests.cs (1)
984public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action) => action();
Templating\DotNetTemplateFactoryTests.cs (2)
427public Task<TResult> ShowStatusAsync<TResult>(string message, Func<Task<TResult>> work) 430public Task ShowStatusAsync(string message, Func<Task> work)
TestServices\TestAppHostBackchannel.cs (1)
13public Func<Task>? RequestStopAsyncCallback { get; set; }
TestServices\TestConsoleInteractionService.cs (1)
18public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
TestServices\TestExtensionBackchannel.cs (2)
28public Func<Task>? DisplayEmptyLineAsyncCallback { get; set; } 34public Func<Task>? DisplayCancellationMessageAsyncCallback { get; set; }
TestServices\TestExtensionInteractionService.cs (1)
24public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
Aspire.Confluent.Kafka (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Dashboard (121)
Components\Controls\LogLevelSelect.razor.cs (1)
21public required Func<Task> HandleSelectedLogLevelChangedAsync { get; set; }
Components\Controls\SelectResourceOptions.razor.cs (1)
15public required Func<Task> OnAllValuesCheckedChangedAsync { get; set; }
Components\Controls\SpanTypeSelect.razor.cs (1)
22public required Func<Task> HandleSelectedSpanTypeChangedAsync { get; set; }
Components\Controls\TreeGenAISelector.razor.cs (1)
13public required Func<Task> HandleSelectedTreeItemChangedAsync { get; set; }
Components\Controls\TreeMetricSelector.razor.cs (1)
13public required Func<Task> HandleSelectedTreeItemChangedAsync { get; set; }
Components\Dialogs\GenAIVisualizerDialog.razor.cs (1)
223TelemetryRepository telemetryRepository, ITelemetryErrorRecorder errorRecorder, List<OtlpResource> resources, Func<List<OtlpSpan>> getContextGenAISpans)
Components\Layout\AspirePageContentLayout.razor.cs (2)
52public Dictionary<string, Func<Task>> DialogCloseListeners { get; } = new(); 111foreach (var dialogCloseListener in DialogCloseListeners.Values)
Components\Layout\MobileNavMenuEntry.cs (1)
9internal record MobileNavMenuEntry(string Text, Func<Task> OnClick, Icon? Icon = null, Regex? LinkMatchRegex = null);
Components_Controls_Chart_ChartFilters_razor.g.cs (2)
775__builder5.AddComponentParameter(80, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentCheckbox.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.Boolean>>>(() => isChecked)); 915__builder.AddComponentParameter(95, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSwitch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.Boolean>>>(() => ShowCounts));
Components_Controls_Chart_MetricTable_razor.g.cs (1)
805__builder2.AddComponentParameter(66, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSwitch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.Boolean>>>(() => OnlyShowValueChangesInTable));
Components_Controls_DetailView_razor.g.cs (2)
469public required Func<Task> HandleToggleOrientation { get; set; } 472public required Func<Task> HandleDismissAsync { get; set; }
Components_Controls_InteractionInputField_razor.g.cs (1)
498public static void CreateValidationMessage_0<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.Linq.Expressions.Expression<global::System.Func<TValue>> __arg0)
Components_Controls_LogLevelSelect_razor.g.cs (2)
404__builder.AddComponentParameter(17, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<LogLevel?>>.SelectedOptionExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<SelectViewModel<LogLevel?>>>>(() => LogLevel)); 590__builder.AddComponentParameter(31, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<LogLevel?>>.SelectedOptionExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<SelectViewModel<LogLevel?>>>>(() => LogLevel));
Components_Controls_ResourceDetails_razor.g.cs (1)
616__builder2.AddComponentParameter(40, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSearch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _filter));
Components_Controls_ResourceFilters_razor.g.cs (4)
341public required Func<Task> OnAllFilterVisibilityCheckedChangedAsync { get; set; } 375public static void CreateSelectResourceOptions_0<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.String __arg0, int __seq1, global::System.Collections.Concurrent.ConcurrentDictionary<TValue, global::System.Boolean> __arg1, int __seq2, global::System.Func<global::System.Threading.Tasks.Task> __arg2, int __seq3, global::System.Func<TValue, global::System.Boolean, global::System.Threading.Tasks.Task> __arg3) 417public static void CreateSelectResourceOptions_1<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.String __arg0, int __seq1, global::System.Collections.Concurrent.ConcurrentDictionary<TValue, global::System.Boolean> __arg1, int __seq2, global::System.Func<global::System.Threading.Tasks.Task> __arg2, int __seq3, global::System.Func<TValue, global::System.Boolean, global::System.Threading.Tasks.Task> __arg3) 459public static void CreateSelectResourceOptions_2<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.String __arg0, int __seq1, global::System.Collections.Concurrent.ConcurrentDictionary<TValue, global::System.Boolean> __arg1, int __seq2, global::System.Func<global::System.Threading.Tasks.Task> __arg2, int __seq3, global::System.Func<TValue, global::System.Boolean, global::System.Threading.Tasks.Task> __arg3)
Components_Controls_ResourceSelect_razor.g.cs (3)
380public static void CreateFluentSelect_0<TOption>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.Collections.Generic.IEnumerable<TOption> __arg0, int __seq1, global::System.Boolean __arg1, int __seq2, global::System.String __arg2, int __seq3, global::System.Func<TOption, global::System.String> __arg3, int __seq4, global::System.Func<TOption, global::System.Boolean> __arg4, int __seq5, global::System.Func<TOption, global::System.String> __arg5, int __seq6, global::Microsoft.AspNetCore.Components.EventCallback<global::System.String> __arg6, int __seq7, global::System.String __arg7, int __seq8, global::System.String __arg8, int __seq9, global::System.String __arg9, int __seq10, TOption __arg10, int __seq11, global::Microsoft.AspNetCore.Components.EventCallback<TOption> __arg11, int __seq12, global::System.Linq.Expressions.Expression<global::System.Func<TOption>> __arg12, int __seq13, global::Microsoft.AspNetCore.Components.RenderFragment<TOption> __arg13, int __seq14, object __arg14) 490public static void CreateFluentSelect_0_CaptureParameters<TOption>(global::System.Collections.Generic.IEnumerable<TOption> __arg0, out global::System.Collections.Generic.IEnumerable<TOption> __arg0_out, global::System.Boolean __arg1, out global::System.Boolean __arg1_out, global::System.String __arg2, out global::System.String __arg2_out, global::System.Func<TOption, global::System.String> __arg3, out global::System.Func<TOption, global::System.String> __arg3_out, global::System.Func<TOption, global::System.Boolean> __arg4, out global::System.Func<TOption, global::System.Boolean> __arg4_out, global::System.Func<TOption, global::System.String> __arg5, out global::System.Func<TOption, global::System.String> __arg5_out, global::Microsoft.AspNetCore.Components.EventCallback<global::System.String> __arg6, out global::Microsoft.AspNetCore.Components.EventCallback<global::System.String> __arg6_out, global::System.String __arg7, out global::System.String __arg7_out, global::System.String __arg8, out global::System.String __arg8_out, global::System.String __arg9, out global::System.String __arg9_out, TOption __arg10, out TOption __arg10_out, global::Microsoft.AspNetCore.Components.EventCallback<TOption> __arg11, out global::Microsoft.AspNetCore.Components.EventCallback<TOption> __arg11_out, global::System.Linq.Expressions.Expression<global::System.Func<TOption>> __arg12, out global::System.Linq.Expressions.Expression<global::System.Func<TOption>> __arg12_out)
Components_Controls_SelectResourceOptions_razor.g.cs (1)
391__builder2.AddComponentParameter(15, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentCheckbox.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.Boolean>>>(() => isChecked));
Components_Controls_SpanDetails_razor.g.cs (1)
431__builder2.AddComponentParameter(33, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSearch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _filter));
Components_Controls_SpanTypeSelect_razor.g.cs (2)
404__builder.AddComponentParameter(17, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<SpanType>>.SelectedOptionExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<SelectViewModel<SpanType>>>>(() => SpanType)); 590__builder.AddComponentParameter(31, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<SpanType>>.SelectedOptionExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<SelectViewModel<SpanType>>>>(() => SpanType));
Components_Controls_StructuredLogDetails_razor.g.cs (1)
342__builder2.AddComponentParameter(26, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSearch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _filter));
Components_Controls_SummaryDetailsView_razor.g.cs (4)
397), (global::System.Func<global::System.Threading.Tasks.Task>)( 414), (global::System.Func<global::System.Threading.Tasks.Task>)( 529), (global::System.Func<global::System.Threading.Tasks.Task>)( 546), (global::System.Func<global::System.Threading.Tasks.Task>)(
Components_Dialogs_FilterDialog_razor.g.cs (4)
420__builder3.AddComponentParameter(24, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<string>>.SelectedOptionExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<SelectViewModel<string>>>>(() => _formModel.Parameter)); 523__builder3.AddComponentParameter(36, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<FilterCondition>>.SelectedOptionExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<SelectViewModel<FilterCondition>>>>(() => _formModel.Condition)); 702__builder3.AddComponentParameter(53, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentCombobox<SelectViewModel<FieldValue>>.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _formModel.Value)); 1288public static void CreateValidationMessage_0<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.Linq.Expressions.Expression<global::System.Func<TValue>> __arg0)
Components_Dialogs_GenAIVisualizerDialog_razor.g.cs (1)
590), (global::System.Func<global::System.Threading.Tasks.Task>)(
Components_Dialogs_InteractionsInputDialog_razor.g.cs (6)
629__builder5.AddComponentParameter(43, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentTextField.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => input.ViewModel.Value)); 846__builder5.AddComponentParameter(61, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentTextField.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => input.ViewModel.Value)); 1122__builder5.AddComponentParameter(81, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<string>>.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => input.ViewModel.Value)); 1360__builder5.AddComponentParameter(98, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentCombobox<SelectViewModel<string>>.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => input.ViewModel.Value)); 1581__builder5.AddComponentParameter(117, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentCheckbox.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.Boolean>>>(() => input.ViewModel.IsChecked)); 1780__builder5.AddComponentParameter(133, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentNumberField<int?>.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<int?>>>(() => input.ViewModel.NumberValue));
Components_Dialogs_SettingsDialog_razor.g.cs (2)
302__builder3.AddComponentParameter(13, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentRadioGroup<string>.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<string>>>(() => _currentSetting)); 524__builder3.AddComponentParameter(41, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<CultureInfo>.SelectedOptionExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<CultureInfo>>>(() => _selectedUiCulture));
Components_Layout_MainLayout_razor.g.cs (3)
1022), (global::System.Func<global::System.Threading.Tasks.Task>)( 1039), (global::System.Func<global::System.Threading.Tasks.Task>)( 1056), (global::System.Func<global::System.Threading.Tasks.Task>)(
Components_Layout_MobileNavMenu_razor.g.cs (3)
417public required Func<Task> LaunchHelpAsync { get; set; } 420public required Func<Task> LaunchAIAssistantAsync { get; set; } 423public required Func<Task> LaunchSettingsAsync { get; set; }
Components_Pages_Login_razor.g.cs (2)
478__builder2.AddComponentParameter(50, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentTextField.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _formModel.Token)); 762public static void CreateFluentValidationMessage_0<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.Linq.Expressions.Expression<global::System.Func<TValue>> __arg0)
Components_Pages_Metrics_razor.g.cs (3)
706__builder2.AddComponentParameter(50, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<TimeSpan>>.SelectedOptionExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<SelectViewModel<TimeSpan>>>>(() => PageViewModel.SelectedDuration)); 779), (global::System.Func<global::System.Threading.Tasks.Task>)( 948), (global::System.Func<global::System.Threading.Tasks.Task>)(
Components_Pages_Resources_razor.g.cs (3)
390__builder2.AddComponentParameter(24, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSearch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _filter)); 747), (global::System.Func<global::System.Threading.Tasks.Task>)( 918), (global::System.Func<global::System.Threading.Tasks.Task>)(
Components_Pages_StructuredLogs_razor.g.cs (2)
637__builder2.AddComponentParameter(46, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSearch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _filter)); 679), (global::System.Func<global::System.Threading.Tasks.Task>)(
Components_Pages_TraceDetail_razor.g.cs (4)
620__builder2.AddComponentParameter(57, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSearch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _filter)); 662), (global::System.Func<global::System.Threading.Tasks.Task>)( 863__builder2.AddComponentParameter(82, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSearch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _filter)); 901), (global::System.Func<global::System.Threading.Tasks.Task>)(
Components_Pages_Traces_razor.g.cs (2)
620__builder2.AddComponentParameter(45, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSearch.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => _filter)); 662), (global::System.Func<global::System.Threading.Tasks.Task>)(
DashboardWebApplication.cs (8)
57private readonly List<Func<EndpointInfo>> _frontendEndPointAccessor = new(); 58private Func<EndpointInfo>? _otlpServiceGrpcEndPointAccessor; 59private Func<EndpointInfo>? _otlpServiceHttpEndPointAccessor; 61public List<Func<EndpointInfo>> FrontendEndPointsAccessor 74public Func<EndpointInfo> FrontendSingleEndPointAccessor 91public Func<EndpointInfo> OtlpServiceGrpcEndPointAccessor 96public Func<EndpointInfo> OtlpServiceHttpEndPointAccessor 683static Func<EndpointInfo> CreateEndPointAccessor(EndpointConfiguration endpointConfiguration)
Model\Assistant\AIContextProvider.cs (2)
201public IDisposable OnContextChanged(Func<Task> callback) 219public IDisposable OnDisplayChanged(Func<Task> callback)
Model\Assistant\AssistantChatViewModel.cs (2)
204public Func<Task>? OnDisconnectCallback { get; set; } 307public async Task InitializeWithInitialPromptAsync(Func<Task> addInitialPrompt)
Model\Assistant\ChatViewModel.cs (3)
53public void AddChatMessage(Func<ChatMessage> chatMessageProvider) 92private readonly Func<ChatMessage> _chatMessageProvider; 94public DynamicChatMessageViewModel(Func<ChatMessage> chatMessageProvider)
Model\Assistant\IAIContextProvider.cs (2)
15IDisposable OnContextChanged(Func<Task> callback); 16IDisposable OnDisplayChanged(Func<Task> callback);
Model\Assistant\Prompts\IceBreakersBuilder.cs (9)
136public void StructuredLogs(BuildIceBreakersContext context, Func<PagedResult<OtlpLogEntry>> getCurrentLogs, bool hasErrors, Func<PagedResult<OtlpLogEntry>> getErrorLogs) 168public void StructuredLogs(BuildIceBreakersContext context, OtlpResource resource, Func<PagedResult<OtlpLogEntry>> getCurrentLogs, bool hasErrors, Func<PagedResult<OtlpLogEntry>> getErrorLogs) 212public void Traces(BuildIceBreakersContext context, Func<PagedResult<OtlpTrace>> getCurrentTraces, bool hasErrors, Func<PagedResult<OtlpTrace>> getErrorTraces) 244private InitialPrompt CreateErrorTracesPrompt(Func<PagedResult<OtlpTrace>> getErrorTraces) 256public void Traces(BuildIceBreakersContext context, OtlpResource resource, Func<PagedResult<OtlpTrace>> getCurrentTraces, bool hasErrors, Func<PagedResult<OtlpTrace>> getErrorTraces)
Model\Assistant\Prompts\PromptContextsBuilder.cs (2)
12public static Task ErrorTraces(InitializePromptContext promptContext, string displayText, Func<PagedResult<OtlpTrace>> getErrorTraces) 28public static Task ErrorStructuredLogs(InitializePromptContext promptContext, string displayText, Func<PagedResult<OtlpLogEntry>> getErrorLogs)
Model\BrowserLinkOutgoingPeerResolver.cs (1)
10public IDisposable OnPeerChanges(Func<Task> callback)
Model\ConsoleLogsManager.cs (1)
54public IDisposable OnFiltersChanged(Func<Task> callback)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (2)
30public required Func<List<OtlpSpan>> GetContextGenAISpans { get; init; } 53Func<List<OtlpSpan>> getContextGenAISpans)
Model\GridColumn.cs (1)
6public record GridColumn(string Name, string? DesktopWidth, string? MobileWidth = null, Func<bool>? IsVisible = null);
Model\InstrumentViewModel.cs (2)
14public List<Func<Task>> DataUpdateSubscriptions { get; } = []; 23foreach (var subscription in DataUpdateSubscriptions)
Model\Interaction\InteractionsInputsDialogViewModel.cs (1)
22public Func<Task>? OnInteractionUpdated { get; set; }
Model\IOutgoingPeerResolver.cs (1)
9IDisposable OnPeerChanges(Func<Task> callback);
Model\MenuButtonItem.cs (1)
15public Func<Task>? OnClick { get; set; }
Model\ModelSubscription.cs (2)
6public sealed class ModelSubscription(Func<Task> callback, Action<ModelSubscription> onDispose) : IDisposable 8private readonly Func<Task> _callback = callback;
Model\ResourceOutgoingPeerResolver.cs (1)
250public IDisposable OnPeerChanges(Func<Task> callback)
Model\ThemeManager.cs (1)
114public IDisposable OnThemeChanged(Func<Task> callback)
Model\TraceLinkHelpers.cs (2)
22Func<Func<Task>, Task> dispatcher, 39Func<Func<Task>, Task> dispatcher,
Otlp\Storage\Subscription.cs (1)
27public Subscription(string name, ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback, Action unsubscribe, ExecutionContext? executionContext, TelemetryRepository telemetryRepository)
Otlp\Storage\TelemetryRepository.cs (5)
253public Subscription OnNewResources(Func<Task> callback) 258public Subscription OnNewLogs(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) 263public Subscription OnNewMetrics(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) 268public Subscription OnNewTraces(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) 273private Subscription AddSubscription(string name, ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback, List<Subscription> subscriptions)
Utils\CallbackThrottler.cs (2)
14public CallbackThrottler(string name, ILogger logger, TimeSpan minExecuteInterval, Func<Task> callback, ExecutionContext? executionContext) 29private readonly Func<Task> _callback;
Aspire.Dashboard.Components.Tests (9)
Shared\TestMessageService.cs (1)
21public event Func<Task>? OnMessageItemsUpdatedAsync;
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestAIContextProvider.cs (2)
54public IDisposable OnContextChanged(Func<Task> callback) 59public IDisposable OnDisplayChanged(Func<Task> callback)
tests\Shared\TestDashboardClient.cs (4)
15private readonly Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? _resourceChannelProvider; 16private readonly Func<Channel<WatchInteractionsResponseUpdate>>? _interactionChannelProvider; 29Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? resourceChannelProvider = null, 30Func<Channel<WatchInteractionsResponseUpdate>>? interactionChannelProvider = null,
Aspire.Dashboard.Tests (13)
Integration\StartupTests.cs (2)
882private static void AssertIPv4OrIPv6Endpoint(Func<EndpointInfo> endPointAccessor) 889private static void AssertDynamicIPEndpoint(Func<EndpointInfo> endPointAccessor)
TelemetryRepositoryTests\TestOutgoingPeerResolver.cs (3)
12private readonly List<Func<Task>> _callbacks; 24public IDisposable OnPeerChanges(Func<Task> callback) 32foreach (var callback in _callbacks)
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestAIContextProvider.cs (2)
54public IDisposable OnContextChanged(Func<Task> callback) 59public IDisposable OnDisplayChanged(Func<Task> callback)
tests\Shared\TestDashboardClient.cs (4)
15private readonly Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? _resourceChannelProvider; 16private readonly Func<Channel<WatchInteractionsResponseUpdate>>? _interactionChannelProvider; 29Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? resourceChannelProvider = null, 30Func<Channel<WatchInteractionsResponseUpdate>>? interactionChannelProvider = null,
Aspire.Hosting (21)
ApplicationModel\EnvironmentCallbackAnnotation.cs (1)
21public EnvironmentCallbackAnnotation(string name, Func<string> callback)
ApplicationModel\HttpCommandContext.cs (2)
9/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?, HttpCommandOptions?)"/>. 47/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?, HttpCommandOptions?)"/>.
ApplicationModel\HttpCommandOptions.cs (1)
16public Func<EndpointReference>? EndpointSelector { get; set; }
ApplicationModel\ParameterDefault.cs (1)
167class ConstantParameterDefault(Func<string> valueGetter) : ParameterDefault
ExternalServiceBuilderExtensions.cs (2)
256private readonly Func<HttpClient> _httpClientFactory; 262public ParameterUriHealthCheck(ParameterResource urlParameter, string? path, int expectedStatusCode, Func<HttpClient> httpClientFactory)
ParameterResourceBuilderExtensions.cs (1)
70public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, string name, Func<string> valueGetter, bool publishValueAsDefault = false, bool secret = false)
Pipelines\PipelineStepAnnotation.cs (3)
17private readonly Func<IEnumerable<PipelineStep>> _factory; 23public PipelineStepAnnotation(Func<PipelineStep> factory) 32public PipelineStepAnnotation(Func<IEnumerable<PipelineStep>> factory)
Publishing\ManifestPublishingContext.cs (1)
126async Task WriteResourceObjectAsync<T>(T resource, Func<Task> action) where T : IResource
ResourceBuilderExtensions.cs (8)
96public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, Func<string> callback) where T : IResourceWithEnvironment 1580var endpointSelector = endpointName is not null 1616public static IResourceBuilder<T> WithHttpHealthCheck<T>(this IResourceBuilder<T> builder, Func<EndpointReference>? endpointSelector, string? path = null, int? statusCode = null) where T : IResourceWithEndpoints 1965Func<EndpointReference>? endpointSelector, 2209private static Func<EndpointReference> NamedEndpointSelector<TResource>(IResourceBuilder<TResource> builder, string[] endpointNames, string errorDisplayNoun) 2235private static Func<EndpointReference> DefaultEndpointSelector<TResource>(IResourceBuilder<TResource> builder) 2635var endpointSelector = endpointName is not null 2675public 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\SecretsStore.cs (1)
100public static void GetOrSetUserSecret(IConfigurationManager configuration, Assembly? appHostAssembly, string name, Func<string> valueGenerator)
Aspire.Hosting.Azure (3)
AzureBicepResource.cs (1)
184object? inputValue = input.Value is Func<object?> f ? f() : input.Value;
AzureBicepResourceExtensions.cs (1)
195public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, Func<object?> valueCallback)
Provisioning\BicepUtilities.cs (1)
42var parameterValue = parameter.Value is Func<object?> f ? f() : parameter.Value;
Aspire.Hosting.Azure.AppContainers (1)
BaseContainerAppContext.cs (1)
373Func<BicepList<ContainerAppWritableSecret>> getContainerAppConfigurationSecrets,
Aspire.Hosting.Azure.Kusto.Tests (10)
KustoPublicApiTests.cs (8)
12var action = () => new AzureKustoClusterResource(null!, _ => { }); 24var action = () => new AzureKustoClusterResource(name, _ => { }); 51var action = () => new AzureKustoReadWriteDatabaseResource(null!, "db", parentResource); 66var action = () => new AzureKustoReadWriteDatabaseResource("kusto-db", name, parentResource); 79var action = () => new AzureKustoReadWriteDatabaseResource("kusto-db", null!, parentResource); 94var action = () => new AzureKustoReadWriteDatabaseResource("kusto-db", name, parentResource); 107var action = () => new AzureKustoReadWriteDatabaseResource("kusto-db", "db1", kustoParentResource); 130var action = () => new AzureKustoEmulatorResource(null!);
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Azure.Tests (163)
PublicApiTests\AppConfigurationPublicApiTests.cs (4)
16var action = () => builder.AddAzureAppConfiguration(name); 30var action = () => builder.AddAzureAppConfiguration(name); 46var action = () => new AzureAppConfigurationResource(name, configureInfrastructure); 60var action = () => new AzureAppConfigurationResource(name, configureInfrastructure);
PublicApiTests\AppContainersPublicApiTests.cs (7)
19var action = () => container.PublishAsAzureContainerApp(configure); 32var action = () => container.PublishAsAzureContainerApp(configure); 43var action = () => new AzureContainerAppCustomizationAnnotation(configure); 55var action = () => executable.PublishAsAzureContainerApp(configure); 68var action = () => executable.PublishAsAzureContainerApp(configure); 96var action = () => project.PublishAsAzureContainerApp(configure); 109var action = () => project.PublishAsAzureContainerApp(configure);
PublicApiTests\ApplicationInsightsPublicApiTests.cs (2)
63var action = () => new AzureApplicationInsightsResource(name, configureInfrastructure); 77var action = () => new AzureApplicationInsightsResource(name, configureInfrastructure);
PublicApiTests\CognitiveServicesPublicApiTests.cs (7)
22var action = () => new AzureOpenAIDeployment(name, modelName, modelVersion); 39var action = () => new AzureOpenAIDeployment(name, modelName, modelVersion); 56var action = () => new AzureOpenAIDeployment(name, modelName, modelVersion); 70var action = () => builder.AddAzureOpenAI(name); 84var action = () => builder.AddAzureOpenAI(name); 98var action = () => builder.AddDeployment(deployment); 111var action = () => builder.AddDeployment(deployment);
PublicApiTests\CosmosDBPublicApiTests.cs (34)
24var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 44var action = () => new AzureCosmosDBContainerResource(name, containerName, [partitionKeyPath], parent); 64var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 84var action = () => new AzureCosmosDBContainerResource(name, containerName, [partitionKeyPath], parent); 104var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 122var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPaths, parent); 138var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPaths, parent); 156var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPaths, parent); 170var action = () => new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, parent); 184var action = () => new AzureCosmosDBContainerResource(name, containerName, [partitionKeyPath], parent); 200var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent.Resource); 218var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent.Resource); 233var action = () => new AzureCosmosDBDatabaseResource(name, databaseName, parent); 244var action = () => new AzureCosmosDBEmulatorResource(innerResource); 258var action = () => new AzureCosmosDBResource(name, configureInfrastructure); 272var action = () => new AzureCosmosDBResource(name, configureInfrastructure); 284var action = () => builder.AddAzureCosmosDB(name); 298var action = () => builder.AddAzureCosmosDB(name); 312var action = () => builder.RunAsEmulator(configureContainer); 325var action = () => builder.RunAsPreviewEmulator(configureContainer); 336var action = () => builder.WithDataVolume(); 348var action = () => builder.WithGatewayPort(port); 360var action = () => builder.WithPartitionCount(count); 373var action = () => builder.AddDatabase(databaseName); 389var action = () => cosmos.AddDatabase(databaseName); 403var action = () => builder.AddCosmosDatabase(name); 418var action = () => cosmos.AddCosmosDatabase(name); 433var action = () => builder.AddContainer(name, partitionKeyPath); 450var action = () => cosmos.AddContainer(name, partitionKeyPath); 469var action = () => cosmos.AddContainer(name, partitionKeyPath); 484var action = () => cosmos.AddContainer(name, partitionKeyPaths!); 496var action = () => cosmos.AddContainer(name, partitionKeyPaths); 510var action = () => cosmos.AddContainer(name, partitionKeyPaths); 521var action = () => builder.WithDataExplorer();
PublicApiTests\EventHubsPublicApiTests.cs (28)
23var action = () => new AzureEventHubConsumerGroupResource(name, consumerGroupName, parent); 42var action = () => new AzureEventHubConsumerGroupResource(name, consumerGroupName, parent); 57var action = () => new AzureEventHubConsumerGroupResource(name, consumerGroupName, parent); 72var action = () => new AzureEventHubResource(name, hubName, parent); 89var action = () => new AzureEventHubResource(name, hubName, parent); 104var action = () => new AzureEventHubResource(name, hubName, parent); 115var action = () => new AzureEventHubsEmulatorResource(innerResource); 127var action = () => builder.AddAzureEventHubs(name); 141var action = () => builder.AddAzureEventHubs(name); 156var action = () => builder.AddEventHub(name); 172var action = () => builder.AddEventHub(name); 186var action = () => builder.AddHub(name); 201var action = () => builder.AddHub(name); 215var action = () => builder.WithProperties(configure); 228var action = () => builder.WithProperties(configure); 240var action = () => builder.AddConsumerGroup(name); 255var action = () => builder.AddConsumerGroup(name); 268var action = () => builder.RunAsEmulator(); 280var action = () => builder.WithDataBindMount(); 293var action = () => builder.WithDataVolume(); 307var action = () => builder.WithGatewayPort(port); 319var action = () => builder.WithHostPort(port); 331var action = () => builder.WithConfigurationFile(path); 347var action = () => builder.RunAsEmulator(configure => configure.WithConfigurationFile(path)); 361var action = () => builder.WithConfiguration(configJson); 374var action = () => builder.RunAsEmulator(configure => configure.WithConfiguration(configJson)); 388var action = () => new AzureEventHubsResource(name, configureInfrastructure); 402var action = () => new AzureEventHubsResource(name, configureInfrastructure);
PublicApiTests\FunctionsPublicApiTests.cs (5)
17var action = () => builder.AddAzureFunctionsProject<TestProject>(name); 31var action = () => builder.AddAzureFunctionsProject<TestProject>(name); 46var action = () => builder.WithHostStorage(storage); 59var action = () => builder.WithHostStorage(storage); 88var action = () => new AzureFunctionsProjectResource(name);
PublicApiTests\KeyVaultPublicApiTests.cs (4)
18var action = () => new AzureKeyVaultResource(name, configureInfrastructure); 32var action = () => new AzureKeyVaultResource(name, configureInfrastructure); 44var action = () => builder.AddAzureKeyVault(name); 58var action = () => builder.AddAzureKeyVault(name);
PublicApiTests\OperationalInsightsPublicApiTests.cs (4)
18var action = () => new AzureLogAnalyticsWorkspaceResource(name, configureInfrastructure); 32var action = () => new AzureLogAnalyticsWorkspaceResource(name, configureInfrastructure); 44var action = () => builder.AddAzureLogAnalyticsWorkspace(name); 58var action = () => builder.AddAzureLogAnalyticsWorkspace(name);
PublicApiTests\PostgreSQLPublicApiTests.cs (13)
48var action = () => builder.AddAzurePostgresFlexibleServer(name); 62var action = () => builder.AddAzurePostgresFlexibleServer(name); 76var action = () => builder.AddDatabase(name); 91var action = () => builder.AddDatabase(name); 104var action = () => builder.RunAsContainer(); 115var action = () => builder.WithPasswordAuthentication(); 128var action = () => new AzurePostgresResource(innerResource, configureInfrastructure); 143var action = () => new AzurePostgresResource(innerResource, configureInfrastructure); 158var action = () => new AzurePostgresFlexibleServerDatabaseResource(name, databaseName, postgresParentResource); 175var action = () => new AzurePostgresFlexibleServerDatabaseResource(name, databaseName, postgresParentResource); 190var action = () => new AzurePostgresFlexibleServerDatabaseResource(name, databaseName, postgresParentResource); 204var action = () => new AzurePostgresFlexibleServerResource(name, configureInfrastructure); 218var action = () => new AzurePostgresFlexibleServerResource(name, configureInfrastructure);
PublicApiTests\RedisPublicApiTests.cs (7)
19var action = () => new AzureRedisCacheResource(name, configureInfrastructure); 33var action = () => new AzureRedisCacheResource(name, configureInfrastructure); 75var action = () => builder.AddAzureRedis(name); 89var action = () => builder.AddAzureRedis(name); 102var action = () => builder.RunAsContainer(); 129var action = () => new AzureRedisResource(innerResource, configureInfrastructure); 142var 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.DevTunnels.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public 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)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public 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)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public 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.Milvus.Tests (18)
MilvusPublicApiTests.cs (18)
18var action = () => new AttuResource(name); 32var action = () => builder.AddMilvus(name); 46var action = () => builder.AddMilvus(name); 60var action = () => builder.AddDatabase(name); 75var action = () => builder.AddDatabase(name); 88var action = () => builder.WithAttu(); 99var action = () => builder.WithDataVolume(); 111var action = () => builder.WithDataBindMount(source); 126var action = () => builder.WithDataBindMount(source); 141var action = () => builder.WithConfigurationBindMount(configurationFilePath); 158var action = () => builder.WithConfigurationBindMount(configurationFilePath); 173var action = () => builder.WithConfigurationFile(configurationFilePath); 188var action = () => builder.WithConfigurationFile(configurationFilePath); 206var action = () => new MilvusDatabaseResource(name, databaseName, parent); 224var action = () => new MilvusDatabaseResource(name, databaseName, parent); 239var action = () => new MilvusDatabaseResource(name, databaseName, parent); 253var action = () => new MilvusServerResource(name, apiKey); 267var action = () => new MilvusServerResource(name, apiKey);
Aspire.Hosting.MongoDB.Tests (20)
MongoDBPublicApiTests.cs (20)
18var action = () => builder.AddMongoDB(name, port); 33var action = () => builder.AddMongoDB(name, port); 48var action = () => builder.AddMongoDB(name, userName: userName, password: password); 64var action = () => builder.AddMongoDB(name, userName: userName, password: password); 78var action = () => builder.AddDatabase(name); 93var action = () => builder.AddDatabase(name); 106var action = () => builder.WithMongoExpress(); 120var action = () => builder.WithHostPort(port); 131var action = () => builder.WithDataVolume(); 143var action = () => builder.WithDataBindMount(source); 158var action = () => builder.WithDataBindMount(source); 172var action = () => builder.WithInitBindMount("init.js"); 189var action = () => builder.WithInitBindMount(source); 203var action = () => builder.WithInitFiles("init.js"); 218var action = () => builder.WithInitFiles(source); 235var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 252var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 267var action = () => new MongoDBDatabaseResource(name, databaseName, parent); 280var action = () => new MongoDBServerResource(name); 295var action = () => new MongoExpressContainerResource(name);
Aspire.Hosting.MySql.Tests (23)
MySqlPublicApiTests.cs (21)
17var action = () => builder.AddMySql(name); 31var action = () => builder.AddMySql(name); 45var action = () => builder.AddDatabase(name); 60var action = () => builder.AddDatabase(name); 73var action = () => builder.WithPhpMyAdmin(); 87var action = () => builder.WithHostPort(port); 98var action = () => builder.WithDataVolume(); 110var action = () => builder.WithDataBindMount(source); 125var action = () => builder.WithDataBindMount(source); 140var action = () => builder.WithInitBindMount(source); 157var action = () => builder.WithInitBindMount(source); 172var action = () => builder.WithInitFiles(source); 187var action = () => builder.WithInitFiles(source); 208var action = () => new MySqlDatabaseResource(name, databaseName, parent); 229var action = () => new MySqlDatabaseResource(name, databaseName, parent); 245var action = () => new MySqlDatabaseResource(name, databaseName, parent); 261var action = () => new MySqlServerResource(name, password); 275var action = () => new MySqlServerResource(name, password); 288var action = () => new PhpMyAdminContainerResource(name); 302var action = () => builder.WithPassword(password); 315var action = () => builder.WithPassword(password);
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public 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.NodeJs.Tests (12)
NodeJsPublicApiTests.cs (10)
19var action = () => new NodeAppResource(name, command, workingDirectory); 36var action = () => new NodeAppResource(name, command, workingDirectory); 51var action = () => new NodeAppResource(name, command, workingDirectory); 64var action = () => builder.AddNodeApp(name, scriptPath); 79var action = () => builder.AddNodeApp(name, scriptPath); 96var action = () => builder.AddNodeApp(name, scriptPath); 111var action = () => builder.AddNpmApp(name: name, workingDirectory: workingDirectory); 126var action = () => builder.AddNpmApp(name: name, workingDirectory); 141var action = () => builder.AddNpmApp(name, workingDirectory); 157var action = () => builder.AddNpmApp(name, workingDirectory, scriptName);
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
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)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Oracle.Tests (18)
OraclePublicApiTests.cs (18)
17var action = () => builder.AddOracle(name); 31var action = () => builder.AddOracle(name); 45var action = () => builder.AddDatabase(name); 60var action = () => builder.AddDatabase(name); 73var action = () => builder.WithDataVolume(); 85var action = () => builder.WithDataBindMount(source); 100var action = () => builder.WithDataBindMount(source); 115var action = () => builder.WithInitBindMount(source); 132var action = () => builder.WithInitBindMount(source); 147var action = () => builder.WithInitFiles(source); 162var action = () => builder.WithInitFiles(source); 176var action = () => builder.WithDbSetupBindMount(source); 191var action = () => builder.WithDbSetupBindMount(source); 210var action = () => new OracleDatabaseResource(name, databaseName, parent); 229var action = () => new OracleDatabaseResource(name, databaseName, parent); 244var action = () => new OracleDatabaseResource(name, databaseName, parent); 258var action = () => new OracleDatabaseServerResource(name, password); 272var action = () => new OracleDatabaseServerResource(name, password);
Aspire.Hosting.PostgreSQL.Tests (24)
PostgrePublicApiTests.cs (22)
19var action = () => new PgAdminContainerResource(name); 34var action = () => new PgWebContainerResource(name); 48var action = () => builder.AddPostgres(name); 62var action = () => builder.AddPostgres(name); 76var action = () => builder.AddDatabase(name); 91var action = () => builder.AddDatabase(name); 104var action = () => builder.WithPgAdmin(); 116var action = () => builder.WithHostPort(port); 128var action = () => builder.WithHostPort(port); 139var action = () => builder.WithPgWeb(); 150var action = () => builder.WithDataVolume(); 162var action = () => builder.WithDataBindMount(source); 177var action = () => builder.WithDataBindMount(source); 192var action = () => builder.WithInitBindMount(source); 205var action = () => builder.WithInitFiles(source); 221var action = () => builder.WithInitBindMount(source); 239var action = () => builder.WithInitFiles(source); 259var action = () => new PostgresDatabaseResource(name, databaseName, postgresParentResource); 279var action = () => new PostgresDatabaseResource(name, databaseName, postgresParentResource); 294var action = () => new PostgresDatabaseResource(name, databaseName, postgresParentResource); 310var action = () => new PostgresServerResource(name, userName, builder.Resource); 325var action = () => new PostgresServerResource(name, userName, password);
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public 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)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Redis.Tests (16)
RedisPublicApiTests.cs (16)
17var action = () => builder.AddRedis(name); 31var action = () => builder.AddRedis(name); 44var action = () => builder.WithRedisCommander(); 55var action = () => builder.WithRedisInsight(); 67var action = () => builder.WithHostPort(port); 79var action = () => builder.WithHostPort(port); 90var action = () => builder.WithDataVolume(); 102var action = () => builder.WithDataBindMount(source); 117var action = () => redis.WithDataBindMount(source); 130var action = () => builder.WithPersistence(); 141var action = () => builder.WithDataVolume(); 153var action = () => builder.WithDataBindMount(source); 170var action = () => redisInsightBuilder.WithDataBindMount(source); 185var action = () => new RedisCommanderResource(name); 200var action = () => new RedisInsightResource(name); 215var action = () => new RedisResource(name);
Aspire.Hosting.Seq.Tests (6)
SeqPublicApiTests.cs (6)
17var action = () => builder.AddSeq(name); 29var action = () => builder.AddSeq(name); 40var action = () => builder.WithDataVolume(); 52var action = () => builder.WithDataBindMount(source); 65var action = () => qdrant.WithDataBindMount(source); 77var action = () => new SeqResource(name);
Aspire.Hosting.SqlServer.Tests (12)
SqlServerPublicApiTests.cs (12)
17var action = () => builder.AddSqlServer(name); 31var action = () => builder.AddSqlServer(name); 45var action = () => builder.AddDatabase(name); 60var action = () => builder.AddDatabase(name); 73var action = () => builder.WithDataVolume(); 85var action = () => builder.WithDataBindMount(source); 100var action = () => builder.WithDataBindMount(source); 121var action = () => new SqlServerDatabaseResource(name, databaseName, parent); 142var action = () => new SqlServerDatabaseResource(name, databaseName, parent); 157var action = () => new SqlServerDatabaseResource(name, databaseName, parent); 173var action = () => new SqlServerServerResource(name, password); 187var action = () => new SqlServerServerResource(name, password);
Aspire.Hosting.Testing.Tests (31)
TestingPublicApiTests.cs (31)
17var action = () => new DistributedApplicationFactory(entryPoint); 29var action = () => new DistributedApplicationFactory(entryPoint, args); 41var action = () => new DistributedApplicationFactory(entryPoint, args); 55var action = () => new DistributedApplicationFactory(entryPoint, args); 76var action = () => distributedApplicationFactory.CreateHttpClient(resourceName); 93var action = async () => await distributedApplicationFactory.GetConnectionString(resourceName); 110var action = () => distributedApplicationFactory.GetEndpoint(resourceName); 124var action = () => app.CreateHttpClient(resourceName); 138var action = () => distributedApplication.CreateHttpClient(resourceName); 152var action = async () => await app.GetConnectionStringAsync(resourceName); 166var action = async () => await distributedApplication.GetConnectionStringAsync(resourceName); 180var action = () => app.GetEndpoint(resourceName); 194var action = () => distributedApplication.GetEndpoint(resourceName); 207var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint); 218var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args); 231var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args); 249var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args); 261var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args); 275var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args); 293var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args, configureBuilder); 305var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args, configureBuilder); 319var action = () => DistributedApplicationTestingBuilder.CreateAsync<Projects.TestingAppHost1_AppHost>(args, configureBuilder); 338var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 351var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 364var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 379var action = () => DistributedApplicationTestingBuilder.CreateAsync(entryPoint, args, configureBuilder); 396var action = () => DistributedApplicationTestingBuilder.Create(args); 409var action = () => DistributedApplicationTestingBuilder.Create(args); 427var action = () => DistributedApplicationTestingBuilder.Create(args, configureBuilder); 439var action = () => DistributedApplicationTestingBuilder.Create(args, configureBuilder); 453var action = () => DistributedApplicationTestingBuilder.Create(args, configureBuilder);
Aspire.Hosting.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Valkey.Tests (9)
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public 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.Microsoft.Azure.Cosmos (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Microsoft.Data.SqlClient (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Milvus.Client (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.MongoDB.Driver (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.MySqlConnector (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.NATS.Net (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Npgsql (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.OpenAI (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
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.Oracle.EntityFrameworkCore (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Playground.Tests (2)
tests\Shared\AsyncTestHelpers.cs (2)
198public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Pomelo.EntityFrameworkCore.MySql (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Qdrant.Client (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.RabbitMQ.Client (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.Seq (1)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
Aspire.StackExchange.Redis (2)
BindingExtensions.g.cs (1)
73public static bool ParseBool(string value, Func<string?> getPath)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
68public Func<ProfilingSession?> GetProfilerSessionsFactory()
Aspire.StackExchange.Redis.Tests (2)
AspireRedisExtensionsTests.cs (2)
240static extern ref Func<ProfilingSession>? GetProfiler(ConnectionMultiplexer? @this); 258var profiler = GetProfiler(connectionMultiplexer as ConnectionMultiplexer);
BinaryFormatTests (2)
FormatTests\FormattedObject\CountTests.cs (1)
11Func<Count> func = () => (Count)(-1);
FormatTests\FormattedObject\RecordMapTests.cs (1)
30Func<object> func = () => map[(Id)0];
BlazorUnitedApp (10)
artifacts\obj\BlazorUnitedApp\Release\net10.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Pages_AddressEditor_razor.g.cs (8)
126__builder.AddComponentParameter(6, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => Value.Street)); 163__builder.AddComponentParameter(17, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => Value.State)); 200__builder.AddComponentParameter(28, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => Value.Zip)); 237__builder.AddComponentParameter(39, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => Value.City)); 260public static void CreateValidationMessage_0<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.Linq.Expressions.Expression<global::System.Func<TValue>> __arg0) 274public static void CreateValidationMessage_1<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.Linq.Expressions.Expression<global::System.Func<TValue>> __arg0) 288public static void CreateValidationMessage_2<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.Linq.Expressions.Expression<global::System.Func<TValue>> __arg0) 302public static void CreateValidationMessage_3<TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.Linq.Expressions.Expression<global::System.Func<TValue>> __arg0)
artifacts\obj\BlazorUnitedApp\Release\net10.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Pages_Index_razor.g.cs (2)
180__builder2.AddComponentParameter(16, nameof(global::Microsoft.AspNetCore.Components.Forms.InputText.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.String>>>(() => Value!.Name)); 204__builder2.AddComponentParameter(21, nameof(global::BlazorUnitedApp.Pages.AddressEditor.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::BlazorUnitedApp.Data.Address>>>(() => Value.BillingAddress));
Client.ClientBase.IntegrationTests (1)
MessageInspectorTestHelpers.cs (1)
49public TResult Call<TResult>(Func<TResult> action) where TResult : class
Client.ExpectedExceptions.IntegrationTests (2)
ExpectedExceptionTests.4.0.0.cs (1)
295Func<string> callFunc = () =>
ExpectedExceptionTests.4.1.0.cs (1)
545Func<string> callFunc = () =>
ClientSample (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
DefaultBuilder.SampleApp (1)
Program.cs (1)
17app.MapGet("/", (Func<string>)(() => "Hello, World!"));
dotnet (16)
Commands\New\SdkInfoProvider.cs (2)
16private readonly Func<string> _getCurrentProcessPath; 24internal SdkInfoProvider(Func<string> getCurrentProcessPath)
Commands\Test\MTP\Terminal\TerminalTestReporter.cs (1)
27internal Func<IStopwatch> CreateStopwatch { get; set; } = SystemStopwatch.StartNew;
Commands\Test\VSTest\VSTestTrace.cs (1)
23public static void SafeWriteTrace(Func<string> messageLog)
Commands\Workload\Install\NetSdkMsiInstallerClient.cs (1)
1055private uint ExecuteWithProgress(string progressLabel, Func<uint> installDelegate)
Commands\Workload\WorkloadHistoryRecorder.cs (2)
17private readonly Func<IWorkloadResolver> _workloadResolverFunc; 19public WorkloadHistoryRecorder(IWorkloadResolver workloadResolver, IInstaller workloadInstaller, Func<IWorkloadResolver> workloadResolverFunc)
NugetPackageDownloader\NuGetPackageDownloader.cs (2)
33private readonly Func<IEnumerable<Task>> _retryTimer; 59Func<IEnumerable<Task>> timer = null,
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;
TransactionalAction.cs (1)
58Func<T> action,
dotnet.Tests (13)
CommandTests\MSBuild\DotnetMsbuildInProcTests.cs (4)
47private string[] GetArgsForMSBuild(Func<bool> sentinelExists) 53private string[] GetArgsForMSBuild(Func<bool> sentinelExists, out Telemetry.Telemetry telemetry) 71private readonly Func<bool> _exists; 75public MockFirstTimeUseNoticeSentinel(Func<bool> exists = null)
CommandTests\Workload\Search\GivenDotnetWorkloadSearch.cs (1)
48var command = () => new WorkloadSearchVersionsCommand(parseResult, _reporter, workloadResolverFactory);
ConfigurerTests\GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs (2)
145private readonly Func<bool> _tellTheActionIsRun; 147public FirstRunExperienceAction(Func<bool> tellTheActionIsRun, string name)
ConfigurerTests\GivenAFunctionReturnStringAndFakeFileSystem.cs (2)
40Func<string> func = () => 81Func<string> func = () =>
GivenExponentialRetry.cs (2)
18Func<Task<string>> action = () => 32Func<Task<string?>> action = () => // Updated to use nullable reference type
TelemetryCommonPropertiesTests.cs (2)
260public string RunWithCache(string cacheKey, Func<string> getValueToCache) 265public string RunWithCacheInFilePath(string cacheFilepath, Func<string> getValueToCache)
dotnet-dev-certs (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-getdocument (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-new.IntegrationTests (1)
DotnetNewDetailsTest.Approval.cs (1)
36var createCommandResult = () => new DotnetNewCommand(_log, "details", _nuGetPackageId)
dotnet-openapi (8)
Commands\BaseCommand.cs (1)
298Func<Task<IHttpResponseMessageWrapper>> retryBlock,
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-sql-cache (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-svcutil-lib (17)
FrameworkFork\Microsoft.Xml\Xml\AsyncHelper.cs (6)
65public static Task CallTaskFuncWhenFinish(this Task task, Func<Task> func) 77private static async Task _CallTaskFuncWhenFinish(Task task, Func<Task> func) 83public static Task<bool> CallBoolTaskFuncWhenFinish(this Task task, Func<Task<bool>> func) 95private static async Task<bool> _CallBoolTaskFuncWhenFinish(this Task task, Func<Task<bool>> func) 101public static Task<bool> ContinueBoolTaskFuncWhenFalse(this Task<bool> task, Func<Task<bool>> func) 116private static async Task<bool> _ContinueBoolTaskFuncWhenFalse(Task<bool> task, Func<Task<bool>> func)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InputQueue.cs (3)
38public InputQueue(Func<Action<AsyncCallback, IAsyncResult>> asyncCallbackGenerator) 64private Func<Action<AsyncCallback, IAsyncResult>> AsyncCallbackGenerator 356public void Shutdown(Func<Exception> pendingExceptionGenerator)
FrameworkFork\System.ServiceModel\System\IdentityModel\CryptoHelper.cs (2)
16private static Dictionary<string, Func<object>> s_algorithmDelegateDictionary = new Dictionary<string, Func<object>>();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (3)
26private Func<IEnumerable<DelegatingHandler>> _handlerFunc; 92public HttpMessageHandlerFactory(Func<IEnumerable<DelegatingHandler>> handlers) 194private static string GetFuncDetails(Func<IEnumerable<DelegatingHandler>> func)
Shared\Options\OptionValueParser.cs (1)
246public static object CreateValue<TValue>(Func<object> GetValueFunc, OptionBase option, object originalValue)
Shared\Utilities\AsyncHelper.cs (2)
38public static async Task<T> RunAsync<T>(Func<T> func, CancellationToken cancellationToken) 43public static async Task<T> RunAsync<T>(Func<T> func, Action onCancellation, CancellationToken cancellationToken)
dotnet-user-jwts (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-user-secrets (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-watch.Tests (2)
TestUtilities\MockFileSetFactory.cs (1)
14public Func<EvaluationResult?>? TryCreateImpl;
TestUtilities\TestRuntimeProcessLauncher.cs (1)
20public Func<IEnumerable<(string name, string value)>>? GetEnvironmentVariablesImpl;
ExceptionHandlerSample (1)
StartupWithWebSocket.cs (1)
25app.Use(async (HttpContext context, Func<Task> next) =>
GetDocument.Insider (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
IIS.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.LongTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.NewHandler.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.NewShim.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.ShadowCopy.Tests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
Infrastructure.Common (1)
ConditionalWcfTest.cs (1)
29private static bool GetConditionValue(string conditionName, Func<bool> detectFunc = null)
InMemory.FunctionalTests (5)
src\Servers\Kestrel\shared\test\TestServiceContext.cs (2)
83private readonly Func<MemoryPool<byte>> _memoryPoolFactory; 85public WrappingMemoryPoolFactory(Func<MemoryPool<byte>> memoryPoolFactory)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
InteractiveHost32 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
53var invokeOnMainThread = new Func<Func<object>, object>(operation => control!.Invoke(operation));
InteractiveHost64 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
53var invokeOnMainThread = new Func<Func<object>, object>(operation => control!.Invoke(operation));
Interop.FunctionalTests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
InteropClient (1)
Assert.cs (1)
62public static async Task<TException> ThrowsAsync<TException>(Func<Task> action) where TException : Exception
Metrics (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Metrics.Legacy (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.Arcade.Common (12)
Helpers.cs (6)
29public T MutexExec<T>(Func<T> function, string mutexName) 56public T MutexExec<T>(Func<Task<T>> function, string mutexName) => 60public void MutexExec(Func<Task> function, string mutexName) => 63public T DirectoryMutexExec<T>(Func<T> function, string path) => 66public T DirectoryMutexExec<T>(Func<Task<T>> function, string path) => 70public void DirectoryMutexExec(Func<Task> function, string path) =>
IHelpers.cs (6)
10T MutexExec<T>(Func<T> function, string mutexName); 11T MutexExec<T>(Func<Task<T>> function, string mutexName); 12void MutexExec(Func<Task> function, string mutexName); 14T DirectoryMutexExec<T>(Func<T> function, string path); 15T DirectoryMutexExec<T>(Func<Task<T>> function, string path); 16void DirectoryMutexExec(Func<Task> function, string path);
Microsoft.AspNetCore.Analyzer.Testing (1)
DiagnosticProject.cs (1)
31public static Project Create(Assembly testAssembly, string[] sources, Func<Workspace> workspaceFactory = null, Type[] analyzerReferences = null)
Microsoft.AspNetCore.App.Analyzers.Test (1)
TestDiagnosticAnalyzer.cs (1)
152Func<Workspace> createWorkspace = CreateWorkspace;
Microsoft.AspNetCore.Authentication.Test (2)
JwtBearerTests.cs (1)
1157private static async Task<IHost> CreateHost(Action<JwtBearerOptions> options = null, Func<HttpContext, Func<Task>, Task> handlerBeforeAuth = null)
JwtBearerTests_Handler.cs (1)
1225private static async Task<IHost> CreateHost(Action<JwtBearerOptions> options = null, Func<HttpContext, Func<Task>, Task> handlerBeforeAuth = null)
Microsoft.AspNetCore.Authorization.Policy (1)
src\Http\Routing\src\DataSourceDependentCache.cs (1)
17private readonly Func<T> _initializer;
Microsoft.AspNetCore.Components (29)
CascadingValueSource.cs (3)
25private Func<TValue>? _initialValueFactory; 54public CascadingValueSource(Func<TValue> initialValueFactory, bool isFixed) : this(isFixed) 65public CascadingValueSource(string name, Func<TValue> initialValueFactory, bool isFixed) : this(initialValueFactory, isFixed)
CompilerServices\RuntimeHelpers.cs (1)
153public static Task InvokeAsynchronousDelegate(Func<Task> callback)
ComponentBase.cs (1)
213protected Task InvokeAsync(Func<Task> workItem)
Dispatcher.cs (6)
62/// Invokes the given <see cref="Func{TResult}"/> in the context of the associated <see cref="Renderer"/>. 66public abstract Task InvokeAsync(Func<Task> workItem); 69/// Invokes the given <see cref="Func{TResult}"/> in the context of the associated <see cref="Renderer"/>. 73public abstract Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem); 76/// Invokes the given <see cref="Func{TResult}"/> in the context of the associated <see cref="Renderer"/>. 80public abstract Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem);
EventCallbackFactory.cs (2)
63public EventCallback Create(object receiver, Func<Task> callback) 147public EventCallback<TValue> Create<TValue>(object receiver, Func<Task> callback)
EventCallbackWorkItem.cs (1)
54case Func<Task> func:
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\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
27private readonly Func<Regex>? _regexFactory;
Microsoft.AspNetCore.Components.Authorization.Tests (5)
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.Forms (15)
EditContext.cs (3)
178public IEnumerable<string> GetValidationMessages(Expression<Func<object>> accessor) 195public bool IsModified(Expression<Func<object>> accessor) 210public bool IsValid(Expression<Func<object>> accessor)
FieldIdentifier.cs (8)
34public static FieldIdentifier Create<TField>(Expression<Func<TField>> accessor) 98private static void ParseAccessor<T>(Expression<Func<T>> accessor, out object model, out string fieldName) 132var modelLambda = Expression.Lambda(typeof(Func<object?>), memberExpression.Expression); 133var modelLambdaCompiled = (Func<object?>)modelLambda.Compile(); 207var methodCallObjectLambda = Expression.Lambda(typeof(Func<object?>), methodCallExpression!); 208var methodCallObjectLambdaCompiled = (Func<object?>)methodCallObjectLambda.Compile();
ValidationMessageStore.cs (4)
38public void Add(Expression<Func<object>> accessor, string message) 54public void Add(Expression<Func<object>> accessor, IEnumerable<string> messages) 74public IEnumerable<string> this[Expression<Func<object>> accessor] 94public void Clear(Expression<Func<object>> accessor)
Microsoft.AspNetCore.Components.Forms.Tests (6)
FieldIdentifierTest.cs (1)
184Expression<Func<object>> accessor = () => model.IntProperty;
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.QuickGrid.Tests (5)
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.Server (6)
Circuits\CircuitHost.cs (4)
29private Func<Func<Task>, Task> _dispatchInboundActivity; 652internal Task HandleInboundActivityAsync(Func<Task> handler) 656internal async Task<TResult> HandleInboundActivityAsync<TResult>(Func<Task<TResult>> handler) 663private static Func<Func<Task>, Task> BuildInboundActivityDispatcher(IReadOnlyList<CircuitHandler> circuitHandlers, Circuit circuit)
Circuits\CircuitInboundActivityContext.cs (2)
11internal Func<Task> Handler { get; } 18internal CircuitInboundActivityContext(Func<Task> handler, Circuit circuit)
Microsoft.AspNetCore.Components.Tests (49)
EventCallbackFactoryTest.cs (14)
166var @delegate = (Func<Task>)component.SomeFuncTask; 182var @delegate = (Func<Task>)component.SomeFuncTask; 200var @delegate = (Func<Task>)(() => Task.CompletedTask); 236var callback = EventCallback.Factory.Create(component, (Func<Task>)null); 453var @delegate = (Func<Task>)component.SomeFuncTask; 469var @delegate = (Func<Task>)component.SomeFuncTask; 487var @delegate = (Func<Task>)(() => Task.CompletedTask); 507var callback = EventCallback.Factory.Create<string>(component, (Func<Task>)null);
EventCallbackTest.cs (4)
173var callback = new EventCallback(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 190var callback = new EventCallback(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 371var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 388var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; }));
PersistentValueProviderComponentSubscriptionTests.cs (3)
522public override Task InvokeAsync(Func<Task> workItem) 526public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 530public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
RendererTest.cs (19)
630OnArbitraryDelegateEvent = (Func<Task>)(() => Task.CompletedTask), 1184builder.AddComponentParameter(1, nameof(EventComponent.OnClickEventCallback), EventCallback.Factory.Create(parentComponent, (Func<Task>)(() => 1303builder.AddComponentParameter(1, nameof(EventComponent.OnClickEventCallbackOfT), EventCallback.Factory.Create<DerivedEventArgs>(parentComponent, (Func<Task>)(() => 1649builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 1760builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 1880builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 2321builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => throw exception1)); 2355builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => default)); 2395builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => { await tcs.Task; })); 2440builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => { await tcs.Task; throw exception1; })); 2479builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => throw new TaskCanceledException())); 2517(Func<ValueTask>)(() => new ValueTask(tcs.Task))); 4275builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => { disposed = true; throw exception1; })); 4303builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => { await tcs.Task; disposed = true; throw exception1; })); 4912builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => await exception2Tcs.Task)); 5355public Func<Task> OnClickAsyncAction { get; set; } 5609public Func<ValueTask> AsyncDisposeAction { get; set; } 5863public Func<Task<(int id, EventType @event)>> EventAction { get; set; } 6115public Func<Task> Callback { get; set; }
Rendering\RendererSynchronizationContextTest.cs (4)
555var task = context.InvokeAsync<string>((Func<string>)(() => 571var task = context.InvokeAsync<string>((Func<string>)(() => 737var task = context.InvokeAsync<string>((Func<Task<string>>)(() => 753var task = context.InvokeAsync<string>((Func<Task<string>>)(() =>
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.Web (7)
Forms\EditContextFieldClassExtensions.cs (1)
23public static string FieldCssClass<TField>(this EditContext editContext, Expression<Func<TField>> accessor)
Forms\EditForm.cs (1)
15private readonly Func<Task> _handleSubmitDelegate; // Cache to avoid per-render allocations
Forms\Editor.cs (1)
25[Parameter] public Expression<Func<T>> ValueExpression { get; set; } = default!;
Forms\InputBase.cs (1)
55[Parameter] public Expression<Func<TValue>>? ValueExpression { get; set; }
Forms\ValidationMessage.cs (2)
15private Expression<Func<TValue>>? _previousFieldAccessor; 29[Parameter] public Expression<Func<TValue>>? For { get; set; }
JSComponents\JSComponentInterop.cs (1)
176var callback = jsObjectReference is null ? null : new Func<Task>(
Microsoft.AspNetCore.Components.Web.Tests (7)
Forms\InputRadioTest.cs (1)
87private static RenderFragment RadioButtonsWithGroup(string name, Expression<Func<TestEnum>> valueExpression) => (builder) =>
Forms\TestInputHostComponent.cs (1)
20public Expression<Func<TValue>> ValueExpression { get; set; }
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.WebAssembly (10)
Hosting\WebAssemblyHostBuilder.cs (1)
30private Func<IServiceProvider> _createServiceProvider;
Rendering\NullDispatcher.cs (3)
24public override Task InvokeAsync(Func<Task> workItem) 31public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 38public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Rendering\WebAssemblyDispatcher.cs (6)
51public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 64var state = ((TaskCompletionSource<TResult> tcs, Func<TResult> workItem))o!; 79public override Task InvokeAsync(Func<Task> workItem) 94var state = ((TaskCompletionSource tcs, Func<Task> workItem))o!; 124public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem) 139var state = ((TaskCompletionSource<TResult> tcs, Func<Task<TResult>> workItem))o!;
Microsoft.AspNetCore.Components.WebView.Maui (3)
MauiDispatcher.cs (3)
26 public override Task InvokeAsync(Func<Task> workItem) 31 public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 36 public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Microsoft.AspNetCore.Components.WebView.Photino (12)
PhotinoDispatcher.cs (3)
34public override Task InvokeAsync(Func<Task> workItem) 44public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 54public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
PhotinoSynchronizationContext.cs (9)
83public Task InvokeAsync(Func<Task> asyncAction) 85var completion = new PhotinoSynchronizationTaskCompletionSource<Func<Task>, object>(asyncAction); 88var completion = (PhotinoSynchronizationTaskCompletionSource<Func<Task>, object>)state; 107public Task<TResult> InvokeAsync<TResult>(Func<TResult> function) 109var completion = new PhotinoSynchronizationTaskCompletionSource<Func<TResult>, TResult>(function); 112var completion = (PhotinoSynchronizationTaskCompletionSource<Func<TResult>, TResult>)state; 131public Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> asyncFunction) 133var completion = new PhotinoSynchronizationTaskCompletionSource<Func<Task<TResult>>, TResult>(asyncFunction); 136var completion = (PhotinoSynchronizationTaskCompletionSource<Func<Task<TResult>>, TResult>)state;
Microsoft.AspNetCore.Components.WebView.WindowsForms (3)
WindowsFormsDispatcher.cs (3)
65 public override async Task InvokeAsync(Func<Task> workItem) 109 public override async Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 133 public override async Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Microsoft.AspNetCore.Components.WebView.Wpf (3)
WpfDispatcher.cs (3)
49 public override async Task InvokeAsync(Func<Task> workItem) 72 public override async Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 95 public override async Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Microsoft.AspNetCore.Connections.Abstractions (2)
ConnectionBuilderExtensions.cs (2)
46public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Func<Task>, Task> middleware) 52Func<Task> simpleNext = () => next(context);
Microsoft.AspNetCore.Cryptography.Internal (3)
Cng\CachedAlgorithmHandles.cs (2)
79private readonly Func<BCryptAlgorithmHandle> _factory; 81public CachedAlgorithmInfo(Func<BCryptAlgorithmHandle> factory)
WeakReferenceHelpers.cs (1)
12public static T GetSharedInstance<T>(ref WeakReference<T>? weakReference, Func<T> factory)
Microsoft.AspNetCore.Cryptography.Internal.Tests (3)
Cng\CachedAlgorithmHandlesTests.cs (3)
107private static void RunAesBlockCipherAlgorithmTest(Func<BCryptAlgorithmHandle> getter) 125Func<BCryptAlgorithmHandle> getter, 156Func<BCryptAlgorithmHandle> getter,
Microsoft.AspNetCore.DataProtection (17)
AuthenticatedEncryption\ManagedAuthenticatedEncryptorFactory.cs (5)
58private Func<KeyedHashAlgorithm> GetKeyedHashAlgorithmFactory(ManagedAuthenticatedEncryptorConfiguration configuration) 82private Func<SymmetricAlgorithm> GetSymmetricBlockCipherAlgorithmFactory(ManagedAuthenticatedEncryptorConfiguration configuration) 116public static Func<T> CreateFactory<T>([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type implementation) where T : class 123Func<T> Creator { get; } 128public Func<T> Creator { get; } = Activator.CreateInstance<T>;
KeyManagement\Key.cs (4)
24private readonly Func<IAuthenticatedEncryptorDescriptor>? _descriptorFactory; // May not be used 83Func<IAuthenticatedEncryptorDescriptor>? descriptorFactory) 102Func<IAuthenticatedEncryptorDescriptor>? descriptorFactory, 223private static Func<IAuthenticatedEncryptorDescriptor> GetLazyDescriptorDelegate(IInternalXmlKeyManager keyManager, XElement keyElement)
KeyManagement\XmlKeyManager.cs (1)
142internal Func<DateTimeOffset> GetUtcNow { get; set; } = () => DateTimeOffset.UtcNow;
Managed\ManagedAuthenticatedEncryptor.cs (4)
36private readonly Func<SymmetricAlgorithm> _symmetricAlgorithmFactory; 41private readonly Func<KeyedHashAlgorithm> _validationAlgorithmFactory; 43public ManagedAuthenticatedEncryptor(Secret keyDerivationKey, Func<SymmetricAlgorithm> symmetricAlgorithmFactory, int symmetricAlgorithmKeySizeInBytes, Func<KeyedHashAlgorithm> validationAlgorithmFactory, IManagedGenRandom? genRandom = null)
RegistryPolicyResolver.cs (1)
25private readonly Func<RegistryKey?> _getPolicyRegKey;
XmlEncryption\CertificateXmlEncryptor.cs (2)
21private readonly Func<X509Certificate2> _certFactory; 101private Func<X509Certificate2> CreateCertFactory(string thumbprint, ICertificateResolver resolver)
Microsoft.AspNetCore.DataProtection.StackExchangeRedis (4)
RedisDataProtectionBuilderExtensions.cs (2)
27public static IDataProtectionBuilder PersistKeysToStackExchangeRedis(this IDataProtectionBuilder builder, Func<IDatabase> databaseFactory, RedisKey key) 59private static IDataProtectionBuilder PersistKeysToStackExchangeRedisInternal(IDataProtectionBuilder builder, Func<IDatabase> databaseFactory, RedisKey key)
RedisXmlRepository.cs (2)
18private readonly Func<IDatabase> _databaseFactory; 26public RedisXmlRepository(Func<IDatabase> databaseFactory, RedisKey key)
Microsoft.AspNetCore.DataProtection.Tests (3)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorTests.cs (2)
104public static TheoryData<EncryptionAlgorithm, ValidationAlgorithm, Func<HMAC>> CreateAuthenticatedEncryptor_RoundTripsData_ManagedImplementationData 120Func<HMAC> validationAlgorithmFactory)
KeyManagement\KeyRingTests.cs (1)
97private readonly Func<IAuthenticatedEncryptor> _encryptorFactory;
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (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.Grpc.JsonTranscoding.Tests (3)
Infrastructure\SyncPoint.cs (3)
49public static Func<Task> Create(out SyncPoint syncPoint, bool runContinuationsAsynchronously = true) 51var handler = Create(1, out var syncPoints, runContinuationsAsynchronously); 62public static Func<Task> Create(int count, out SyncPoint[] syncPoints, bool runContinuationsAsynchronously = true)
Microsoft.AspNetCore.Grpc.Swagger (2)
GrpcSwaggerGenOptionsExtensions.cs (2)
22Func<XPathDocument> xmlDocFactory) 38Func<XPathDocument> xmlDocFactory,
Microsoft.AspNetCore.Hosting.Tests (4)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
WebHostTests.cs (1)
1238public Func<IFeatureCollection> CreateRequestFeatures { get; set; } = NewFeatureCollection;
Microsoft.AspNetCore.Http (1)
src\Http\WebUtilities\src\AspNetCoreTempDirectory.cs (1)
34public static Func<string> TempDirectoryFactory => () => TempDirectory;
Microsoft.AspNetCore.Http.Abstractions (5)
Extensions\UseExtensions.cs (2)
29public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, Func<Task>, Task> middleware) 35Func<Task> simpleNext = () => next(context);
HttpResponse.cs (3)
19private static readonly Func<object, Task> _callbackDelegate = callback => ((Func<Task>)callback)(); 103public virtual void OnStarting(Func<Task> callback) => OnStarting(_callbackDelegate, callback); 128public virtual void OnCompleted(Func<Task> callback) => OnCompleted(_callbackDelegate, callback);
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
UseWhenExtensionsTests.cs (1)
123private static Func<HttpContext, Func<Task>, Task> Increment(string key, bool terminate = false)
Microsoft.AspNetCore.Http.Connections.Client (5)
HttpConnection.cs (1)
53private Func<Task<string?>>? _accessTokenProvider;
HttpConnectionOptions.cs (1)
186public Func<Task<string?>>? AccessTokenProvider { get; set; }
Internal\DefaultTransportFactory.cs (2)
15private readonly Func<Task<string?>> _accessTokenProvider; 20public DefaultTransportFactory(HttpTransportType requestedTransportType, ILoggerFactory loggerFactory, HttpClient? httpClient, HttpConnectionOptions httpConnectionOptions, Func<Task<string?>> accessTokenProvider)
Internal\WebSocketsTransport.cs (1)
74public WebSocketsTransport(HttpConnectionOptions httpConnectionOptions, ILoggerFactory loggerFactory, Func<Task<string?>> accessTokenProvider, HttpClient? httpClient,
Microsoft.AspNetCore.Http.Connections.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
105private static readonly MemberExpression CompletedTaskExpr = Expression.Property(null, (PropertyInfo)GetMemberInfo<Func<Task>>(() => Task.CompletedTask));
Microsoft.AspNetCore.Http.Results.Tests (4)
ResultsTests.cs (4)
1700public void FactoryMethod_ReturnsCorrectResultType(Expression<Func<IResult>> expression, Type expectedReturnType) 1702var method = expression.Compile(); 1728private static IEnumerable<(Expression<Func<IResult>>, Type)> FactoryMethodsTuples { get; } = new List<(Expression<Func<IResult>>, Type)>
Microsoft.AspNetCore.HttpLogging.Tests (1)
FileLoggerProcessorTests.cs (1)
571private async Task WaitForCondition(Func<bool> waitForLog)
Microsoft.AspNetCore.Identity.Test (2)
SecurityStampValidatorTest.cs (1)
95private async Task RunApplicationCookieTest(PocoUser user, Mock<HttpContext> httpContext, bool shouldStampValidate, Func<Task> testCode)
UserManagerTest.cs (1)
1300private async Task VerifyException<TException>(Func<Task> code, string expectedMessage) where TException : Exception
Microsoft.AspNetCore.InternalTesting (7)
ExceptionAssertions.cs (6)
50public static async Task<TException> ThrowsAsync<TException>(Func<Task> testCode, string exceptionMessage) 69public static TException Throws<TException>(Func<object> testCode, string exceptionMessage) 109public static Task<ArgumentException> ThrowsArgumentAsync(Func<Task> testCode, string paramName, string exceptionMessage) 115Func<Task> testCode, 164public static Task<ArgumentException> ThrowsArgumentNullOrEmptyAsync(Func<Task> testCode, string paramName) 188public static Task<ArgumentException> ThrowsArgumentNullOrEmptyStringAsync(Func<Task> testCode, string paramName)
HttpClientSlim.cs (1)
109private static async Task<string> RetryRequest(Func<Task<string>> retryBlock)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (1)
JsonPatchDocumentTest.cs (1)
219var getTestObject = () => new SimpleObject() { SimpleObjectList = new() };
Microsoft.AspNetCore.Mvc.Abstractions (9)
ModelBinding\EnumGroupAndName.cs (3)
11private readonly Func<string> _name; 32/// <param name="name">A <see cref="Func{String}"/> which will return the name.</param> 35Func<string> name)
ModelBinding\Metadata\ModelBindingMessageProvider.cs (4)
25public virtual Func<string> MissingKeyOrValueAccessor { get; } = default!; 32public virtual Func<string> MissingRequestBodyRequiredValueAccessor { get; } = default!; 71public virtual Func<string> NonPropertyUnknownValueIsInvalidAccessor { get; } = default!; 93public virtual Func<string> NonPropertyValueMustBeANumberAccessor { get; } = default!;
ModelBinding\Validation\ValidationEntry.cs (2)
12private Func<object?>? _modelAccessor; 37public ValidationEntry(ModelMetadata metadata, string key, Func<object?> modelAccessor)
Microsoft.AspNetCore.Mvc.Core (29)
Infrastructure\IActionDescriptorCollectionProvider.cs (1)
22/// using <see cref="ChangeToken.OnChange(System.Func{IChangeToken}, System.Action)"/>.
ModelBinding\Binders\CollectionModelBinder.cs (2)
26private Func<object>? _modelCreator; 253.Lambda<Func<object>>(Expression.New(targetType))
ModelBinding\Binders\ComplexObjectModelBinder.cs (2)
36private Func<object>? _modelCreator; 215.Lambda<Func<object>>(Expression.New(bindingContext.ModelType))
ModelBinding\Binders\ComplexTypeModelBinder.cs (2)
36private Func<object> _modelCreator; 504.Lambda<Func<object>>(Expression.New(bindingContext.ModelType))
ModelBinding\Metadata\DefaultModelBindingMessageProvider.cs (12)
17private Func<string> _missingKeyOrValueAccessor; 18private Func<string> _missingRequestBodyRequiredValueAccessor; 23private Func<string> _nonPropertyUnknownValueIsInvalidAccessor; 26private Func<string> _nonPropertyValueMustBeANumberAccessor; 84public override Func<string> MissingKeyOrValueAccessor => _missingKeyOrValueAccessor; 91public void SetMissingKeyOrValueAccessor(Func<string> missingKeyOrValueAccessor) 99public override Func<string> MissingRequestBodyRequiredValueAccessor => _missingRequestBodyRequiredValueAccessor; 106public void SetMissingRequestBodyRequiredValueAccessor(Func<string> missingRequestBodyRequiredValueAccessor) 175public override Func<string> NonPropertyUnknownValueIsInvalidAccessor => _nonPropertyUnknownValueIsInvalidAccessor; 182public void SetNonPropertyUnknownValueIsInvalidAccessor(Func<string> nonPropertyUnknownValueIsInvalidAccessor) 220public override Func<string> NonPropertyValueMustBeANumberAccessor => _nonPropertyValueMustBeANumberAccessor; 227public void SetNonPropertyValueMustBeANumberAccessor(Func<string> nonPropertyValueMustBeANumberAccessor)
ModelBinding\Metadata\DisplayMetadata.cs (9)
13private Func<string?> _displayFormatStringProvider = () => null; 14private Func<string?> _editFormatStringProvider = () => null; 15private Func<string?> _nullDisplayTextProvider = () => null; 39public Func<string?>? Description { get; set; } 67public Func<string?> DisplayFormatStringProvider 85public Func<string?>? DisplayName { get; set; } 126public Func<string?> EditFormatStringProvider 213public Func<string?> NullDisplayTextProvider 237public Func<string?>? Placeholder { get; set; }
src\Http\Routing\src\DataSourceDependentCache.cs (1)
17private readonly Func<T> _initializer;
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\TestModelBinderProviderContext.cs (1)
92public void OnCreatingBinder(ModelMetadata metadata, Func<IModelBinder> binderCreator)
Microsoft.AspNetCore.Mvc.Razor (6)
Compilation\DefaultRazorPageFactoryProvider.cs (2)
51var pageFactory = Expression 52.Lambda<Func<IRazorPage>>(objectInitializeExpression)
RazorPageFactoryResult.cs (2)
22Func<IRazorPage>? razorPageFactory) 32public Func<IRazorPage>? RazorPageFactory { get; }
ViewLocationCacheItem.cs (2)
16public ViewLocationCacheItem(Func<IRazorPage> razorPageFactory, string location) 30public Func<IRazorPage> PageFactory { get; }
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RuntimeViewCompilerProvider.cs (1)
18private readonly Func<IViewCompiler> _createCompiler;
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorViewEngineTest.cs (1)
2039Func<IRazorPage> factory,
Microsoft.AspNetCore.Mvc.RazorPages (6)
Infrastructure\PageActionInvokerCache.cs (2)
113internal List<Func<IRazorPage>> GetViewStartFactories(CompiledPageActionDescriptor descriptor) 115var viewStartFactories = new List<Func<IRazorPage>>();
Infrastructure\PageActionInvokerCacheEntry.cs (2)
24IReadOnlyList<Func<IRazorPage>> viewStartFactories, 71public IReadOnlyList<Func<IRazorPage>> ViewStartFactories { get; }
PageContext.cs (2)
22private IList<Func<IRazorPage>>? _viewStartFactories; 112public virtual IList<Func<IRazorPage>> ViewStartFactories
Microsoft.AspNetCore.Mvc.RazorPages.Test (3)
Infrastructure\PageActionInvokerProviderTest.cs (2)
163Func<IRazorPage> factory1 = () => null; 164Func<IRazorPage> factory2 = () => null;
Infrastructure\PageActionInvokerTest.cs (1)
1510ViewStartFactories = new List<Func<IRazorPage>>(),
Microsoft.AspNetCore.Mvc.TagHelpers (1)
GlobbingUrlBuilder.cs (1)
60internal Func<Matcher> MatcherBuilder { get; set; }
Microsoft.AspNetCore.Mvc.TagHelpers.Test (8)
LabelTagHelperTest.cs (3)
14public static TheoryData<object, Type, Func<object>, string, TagHelperOutputContent> TestDataSet 40return new TheoryData<object, Type, Func<object>, string, TagHelperOutputContent> 155Func<object> modelAccessor,
SelectTagHelperTest.cs (5)
19public static TheoryData<object, Type, Func<object>, NameAndId, string> GeneratesExpectedDataSet 57return new TheoryData<object, Type, Func<object>, NameAndId, string> 167Func<object> modelAccessor, 256Func<object> modelAccessor, 436Func<object> modelAccessor,
Microsoft.AspNetCore.Mvc.Testing (7)
WebApplicationFactory.cs (7)
225private void TryConfigureServerPort(Func<IServerAddressesFeature?> serverAddressFeatureAccessor) 833private readonly Func<IWebHostBuilder?> _createWebHostBuilder; 834private readonly Func<IHostBuilder?> _createHostBuilder; 835private readonly Func<IEnumerable<Assembly>> _getTestAssemblies; 843Func<IWebHostBuilder?> createWebHostBuilder, 844Func<IHostBuilder?> createHostBuilder, 845Func<IEnumerable<Assembly>> getTestAssemblies,
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
DynamicViewData.cs (2)
15private readonly Func<ViewDataDictionary> _viewDataFunc; 17public DynamicViewData(Func<ViewDataDictionary> viewDataFunc)
ViewDataInfo.cs (3)
13private static readonly Func<object> _propertyInfoResolver = () => null; 16private Func<object> _valueAccessor; 51public ViewDataInfo(object container, PropertyInfo propertyInfo, Func<object> valueAccessor)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
Filters\SaveTempDataFilterTest.cs (2)
400private Func<Task> _responseStartingAsync = () => Task.FromResult(true); 422var prior = _responseStartingAsync;
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (2)
RedisOutputCacheOptions.cs (2)
32public Func<Task<IConnectionMultiplexer>>? ConnectionMultiplexerFactory { get; set; } 43public Func<ProfilingSession>? ProfilingSession { get; set; }
Microsoft.AspNetCore.Owin (12)
OwinEnvironment.cs (10)
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.RateLimiting.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Razor.Runtime (11)
Runtime\TagHelpers\TagHelperExecutionContext.cs (6)
17private readonly Func<TagHelperContent> _endTagHelperWritingScope; 19private Func<Task> _executeChildContentAsync; 56Func<Task> executeChildContentAsync, 58Func<TagHelperContent> endTagHelperWritingScope) 175/// <param name="executeChildContentAsync">The <see cref="Func{Task}"/> to use.</param> 181Func<Task> executeChildContentAsync)
Runtime\TagHelpers\TagHelperScopeManager.cs (5)
27Func<TagHelperContent> endTagHelperWritingScope) 47Func<Task> executeChildContentAsync) 104private readonly Func<TagHelperContent> _endTagHelperWritingScope; 110Func<TagHelperContent> endTagHelperWritingScope) 124Func<Task> executeChildContentAsync)
Microsoft.AspNetCore.Razor.Runtime.Test (5)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (5)
94Func<Task> executeChildContentAsync = () => 100Func<TagHelperContent> endTagHelperWritingScope = () => null; 112Func<Task> updatedExecuteChildContentAsync = () => 152Func<Task> executeChildContentAsync = () => 158Func<TagHelperContent> endWritingScope = () => null;
Microsoft.AspNetCore.Rewrite (5)
IISUrlRewrite\ServerVariables.cs (1)
22Func<PatternSegment>? managedVariableThunk = default;
PatternSegments\IISServerVariableSegment.cs (2)
11private readonly Func<PatternSegment> _fallbackThunk; 13public IISServerVariableSegment(string variableName, Func<PatternSegment> fallbackThunk)
UrlActions\ChangeCookieAction.cs (2)
10private readonly Func<DateTimeOffset> _timeSource; 19internal ChangeCookieAction(string name, Func<DateTimeOffset> timeSource)
Microsoft.AspNetCore.Routing (4)
Constraints\RegexRouteConstraint.cs (1)
27private readonly Func<Regex>? _regexFactory;
DataSourceDependentCache.cs (1)
17private readonly Func<T> _initializer;
Matching\DataSourceDependentMatcher.cs (2)
12private readonly Func<MatcherBuilder> _matcherBuilderFactory; 18Func<MatcherBuilder> matcherBuilderFactory)
Microsoft.AspNetCore.Routing.Tests (1)
Matching\DataSourceDependentMatcherTest.cs (1)
238public static Func<MatcherBuilder> Create = () => new TestMatcherBuilder();
Microsoft.AspNetCore.Server.HttpSys (2)
ResponseStream.cs (2)
9private readonly Func<Task> _onStart; 11internal ResponseStream(Stream innerStream, Func<Task> onStart)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\RetryHelper.cs (1)
20Func<Task<HttpResponseMessage>> retryBlock,
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (4)
Http1\Http1ConnectionTests.cs (1)
1091private static async Task WaitForCondition(TimeSpan timeout, Func<bool> condition)
KestrelServerTests.cs (1)
763Func<Task> changeCallback = null;
src\Servers\Kestrel\shared\test\TestServiceContext.cs (2)
83private readonly Func<MemoryPool<byte>> _memoryPoolFactory; 85public WrappingMemoryPoolFactory(Func<MemoryPool<byte>> memoryPoolFactory)
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
1939Func<Times> reloadTimes = loadInternal && reloadOnChange ? Times.AtLeastOnce : Times.Never;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Session (6)
DistributedSession.cs (2)
30private readonly Func<bool> _tryEstablishSession; 62Func<bool> tryEstablishSession,
DistributedSessionStore.cs (1)
33public ISession Create(string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey)
ISessionStore.cs (1)
30ISession Create(string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey);
SessionMiddleware.cs (2)
20private static readonly Func<bool> ReturnTrue = () => true; 63Func<bool> tryEstablishSession = ReturnTrue;
Microsoft.AspNetCore.Shared.Tests (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
Microsoft.AspNetCore.SignalR.Client.Core (5)
HubConnection.cs (2)
918Func<Task> createAndConsumeStream; 973private async Task CommonStreaming(ConnectionState connectionState, string streamId, Func<Task> createAndConsumeStream, CancellationTokenSource cts)
HubConnectionExtensions.cs (1)
227public static IDisposable On(this HubConnection hubConnection, string methodName, Func<Task> handler)
HubConnectionExtensions.OnResult.cs (2)
55public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Func<Task<TResult>> handler) 71public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Func<TResult> handler)
Microsoft.AspNetCore.SignalR.Client.Tests (18)
HttpConnectionFactoryTests.cs (1)
80Func<Task<string>> tokenProvider = () => Task.FromResult("");
HttpConnectionTests.Helpers.cs (1)
27Func<Task<string>> accessTokenProvider = null)
HubConnectionTests.ConnectionLifecycle.cs (1)
113var onDisposeForFirstConnection = SyncPoint.Create(out var syncPoint);
HubConnectionTests.cs (1)
764var accessTokenFactory = new Func<Task<string>>(() => Task.FromResult("fakeAccessToken"));
HubConnectionTests.Reconnect.cs (2)
1120public readonly Func<TestConnection> _testConnectionFactory; 1128public ReconnectingConnectionFactory(Func<TestConnection> testConnectionFactory)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
TestConnection.cs (4)
32private readonly Func<Task> _onStart; 33private readonly Func<Task> _onDispose; 48public TestConnection(Func<Task> onStart = null, Func<Task> onDispose = null, bool autoHandshake = true, bool hasInherentKeepAlive = false, PipeOptions pipeOptions = null)
TestHttpMessageHandler.cs (1)
135public void OnRequest(Func<HttpRequestMessage, Func<Task<HttpResponseMessage>>, CancellationToken, Task<HttpResponseMessage>> handler)
TestTransport.cs (4)
16private readonly Func<Task> _stopHandler; 17private readonly Func<Task> _startHandler; 29public TestTransport(Func<Task> onTransportStop = null, Func<Task> onTransportStart = null, TransferFormat transferFormat = TransferFormat.Text)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (5)
RedisProtocolTests.cs (4)
97private static readonly Dictionary<string, ProtocolTestData<Func<RedisInvocation>>> _invocationTestData = new[] 99CreateTestData<Func<RedisInvocation>>( 109CreateTestData<Func<RedisInvocation>>( 120CreateTestData<Func<RedisInvocation>>(
TestConnectionMultiplexer.cs (1)
212public void RegisterProfiler(Func<ProfilingSession> profilingSessionProvider)
Microsoft.AspNetCore.SignalR.Tests (11)
HubFilterTests.cs (6)
326var syncPoint1 = SyncPoint.Create(3, out var syncPoints1); 327var syncPoint2 = SyncPoint.Create(3, out var syncPoints2); 385var syncPoint1 = SyncPoint.Create(3, out var syncPoints1); 386var syncPoint2 = SyncPoint.Create(3, out var syncPoints2); 445var syncPoint1 = SyncPoint.Create(3, out var syncPoints1); 446var syncPoint2 = SyncPoint.Create(3, out var syncPoints2);
NativeAotTests.cs (1)
159private static void RunNativeAotTest(Func<Task> test)
SerializedHubMessageTests.cs (1)
65var onWrite = SyncPoint.Create(2, out var syncPoints);
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Proxying\SpaProxyingExtensions.cs (1)
58Func<Task<Uri>> baseUriTaskFactory)
Microsoft.AspNetCore.TestHost (10)
AsyncStreamWrapper.cs (2)
9private readonly Func<bool> _allowSynchronousIO; 11internal AsyncStreamWrapper(Stream inner, Func<bool> allowSynchronousIO)
ResponseBodyPipeWriter.cs (2)
11private readonly Func<Task> _onFirstWriteAsync; 17internal ResponseBodyPipeWriter(Pipe pipe, Func<Task> onFirstWriteAsync)
ResponseBodyWriterStream.cs (2)
9private readonly Func<bool> _allowSynchronousIO; 11public ResponseBodyWriterStream(ResponseBodyPipeWriter responseWriter, Func<bool> allowSynchronousIO)
ResponseFeature.cs (4)
15private Func<Task> _responseStartingAsync = () => Task.CompletedTask; 16private Func<Task> _responseCompletedAsync = () => Task.CompletedTask; 81var prior = _responseStartingAsync; 91var prior = _responseCompletedAsync;
Microsoft.AspNetCore.TestHost.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Testing.Tests (1)
TestResources\Startup.cs (1)
19public void Configure(IApplicationBuilder app) => app.Use((HttpContext _, Func<Task> _) => Task.CompletedTask);
Microsoft.AspNetCore.WebSockets.Tests (2)
KestrelWebSocketHelpers.cs (2)
90private readonly Func<ValueTask> _dispose; 92public Disposable(Func<ValueTask> dispose)
Microsoft.AspNetCore.WebUtilities (6)
AspNetCoreTempDirectory.cs (1)
34public static Func<string> TempDirectoryFactory => () => TempDirectory;
FileBufferingReadStream.cs (3)
25private readonly Func<string>? _tempFileDirectoryAccessor; 56Func<string> tempFileDirectoryAccessor) 73Func<string> tempFileDirectoryAccessor,
FileBufferingWriteStream.cs (2)
23private readonly Func<string> _tempFileDirectoryAccessor; 42Func<string>? tempFileDirectoryAccessor = null)
Microsoft.Build (27)
BackEnd\BuildManager\CacheAggregator.cs (2)
17private readonly Func<int> _nextConfigurationId; 25public CacheAggregator(Func<int> nextConfigurationId)
BackEnd\Client\MSBuildClient.cs (1)
420private bool TrySendPacket(Func<INodePacket> packetResolver)
BackEnd\Components\Communications\NodeLauncher.cs (1)
194private static Process DisableMSBuildServer(Func<Process> func)
BackEnd\Shared\BuildRequestConfiguration.cs (1)
509private void InitializeProject(BuildParameters buildParameters, Func<ProjectInstance> loadProjectFromFile)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 493private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 494private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 495private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 496private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 498private static Func<bool> s_runningTests = CheckIfRunningTests;
Definition\ToolsetConfigurationReader.cs (2)
33private readonly Func<Configuration> _readApplicationConfiguration; 69internal ToolsetConfigurationReader(PropertyDictionary<ProjectPropertyInstance> environmentProperties, PropertyDictionary<ProjectPropertyInstance> globalProperties, Func<Configuration> readApplicationConfiguration)
Graph\ParallelWorkSet.cs (1)
105internal void AddWork(TKey key, Func<TResult> workFunc)
Logging\TerminalLogger\TerminalLogger.cs (1)
81internal Func<StopwatchAbstraction>? CreateStopwatch = null;
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.Engine.OM.UnitTests (17)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 493private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 494private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 495private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 496private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 498private static Func<bool> s_runningTests = CheckIfRunningTests;
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (5)
241public static void VerifySameLocationWithException(Func<ElementLocation> expectedGetter, Func<ElementLocation> actualGetter, ValidationContext context = null) 352public static bool GetWithExceptionCheck<T>(Func<T> getter, out T result) 366public static void ValidateEqualWithException<T>(Func<T> viewGetter, Func<T> realGetter, ValidationContext context = null)
Microsoft.Build.Engine.UnitTests (4)
Graph\ParallelWorkSet_Tests.cs (1)
31internal Func<string> WorkFunc { get; set; }
Graph\ProjectGraph_Tests.cs (1)
2920var getTargetListsFunc = (() => projectGraph.GetTargetLists([entryTarget]));
NodeStatus_Transition_Tests.cs (1)
32Func<TerminalNodeStatus> newNodeStatus = () => new TerminalNodeStatus("project", "tfm", "rid", AnsiCodes.Colorize("colorized target", TerminalColor.Green), new MockStopwatch());
TerminalLogger_Tests.cs (1)
764Func<StopwatchAbstraction>? createStopwatch = _terminallogger.CreateStopwatch;
Microsoft.Build.Tasks.Core (19)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 493private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 494private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 495private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 496private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 498private static Func<bool> s_runningTests = CheckIfRunningTests;
Copy.cs (1)
868private bool TryPathOperation(Func<string> operation, string src, string dest, out string resultPathOperation)
FileIO\GetFileHash.cs (4)
26internal static readonly Dictionary<string, Func<HashAlgorithm>> SupportedAlgorithms 27= new Dictionary<string, Func<HashAlgorithm>>(StringComparer.OrdinalIgnoreCase) 69if (!SupportedAlgorithms.TryGetValue(Algorithm, out var algorithmFactory)) 141internal static byte[] ComputeHash(Func<HashAlgorithm> algorithmFactory, string filePath, CancellationToken ct)
FileIO\VerifyFileHash.cs (1)
48if (!GetFileHash.SupportedAlgorithms.TryGetValue(Algorithm, out var algorithmFactory))
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (1)
33Func<string>[] possibleLocations =
Microsoft.Build.UnitTests.Shared (12)
EngineTestEnvironment.cs (4)
153private IEnumerable<(ILogger logger, Func<string> textGetter)> GetLoggers() 155var result = new List<(ILogger logger, Func<string> textGetter)>(); 168private (ILogger logger, Func<string> textGetter) GetMockLogger() 186private (ILogger, Func<string>) GetBinaryLogger()
EnvironmentProvider.cs (3)
29private readonly Func<string?> _getCurrentProcessPath; 35public EnvironmentProvider(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath) 120public static string? GetDotnetExePath(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath)
TestEnvironment.cs (5)
211public TestInvariant WithStringInvariant(string name, Func<string> value) 441private readonly Func<string> _accessorFunc; 445public StringInvariant(string name, Func<string> accessorFunc) 578private readonly Func<bool> _condition; 580public CustomConditionInvariant(Func<bool> condition)
Microsoft.Build.Utilities.Core (12)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 493private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 494private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 495private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 496private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 498private static Func<bool> s_runningTests = CheckIfRunningTests;
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)
3288Func<Stream?>? getPortablePdbStream = 3291: (Func<Stream?>)(() => ConditionalGetOrCreateStream(pdbStreamProvider, metadataDiagnostics)); 3381Func<Stream?> getPeStream, 3382Func<Stream?>? getMetadataPeStreamOpt, 3383Func<Stream?>? getPortablePdbStreamOpt,
FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
InternalUtilities\ConcurrentLruCache.cs (1)
207public V GetOrAdd(K key, Func<V> creator)
InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
InternalUtilities\RoslynLazyInitializer.cs (4)
17/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, Func{T})"/> 18public static T EnsureInitialized<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 25/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, ref bool, ref object, Func{T})"/> 26public static T EnsureInitialized<T>([NotNull] ref T? target, ref bool initialized, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory)
InternalUtilities\UICultureUtilities.cs (2)
174public static Func<T> WithCurrentUICulture<T>(Func<T> func)
PEWriter\DebugSourceDocument.cs (1)
37public DebugSourceDocument(string location, Guid language, Func<DebugSourceInfo> sourceInfo)
PEWriter\ManagedResource.cs (2)
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\Dependencies\PooledObjects\PooledDelegates.cs (6)
171/// Gets a <see cref="Func{TResult}"/> delegate, which calls <paramref name="unboundFunction"/> with the 200public static Releaser GetPooledFunction<TArg, TResult>(Func<TArg, TResult> unboundFunction, TArg argument, out Func<TResult> boundFunction) 201=> GetPooledDelegate<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>>(unboundFunction, argument, out boundFunction); 204/// Equivalent to <see cref="GetPooledFunction{TArg, TResult}(Func{TArg, TResult}, TArg, out Func{TResult})"/>, 412: AbstractDelegateWithBoundArgument<FuncWithBoundArgument<TArg, TResult>, TArg, Func<TArg, TResult>, Func<TResult>> 414protected override Func<TResult> Bind()
Microsoft.CodeAnalysis.Analyzers (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.AnalyzerUtilities (23)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (2)
36private readonly Func<bool> _getIsInsideAnonymousObjectInitializer; 47Func<bool> getIsInsideAnonymousObjectInitializer,
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.BannedApiAnalyzers (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.CodeStyle (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
170var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<>), ContainingNamespace.Name: nameof(System) }
Microsoft.CodeAnalysis.Collections.Package (6)
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.CSharp (1)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
301private BoundStatement PossibleIteratorScope(ImmutableArray<LocalSymbol> locals, Func<BoundStatement> wrapped)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
310Name: nameof(Func<>) or nameof(Action<>),
Microsoft.CodeAnalysis.CSharp.EditorFeatures (9)
CompleteStatement\CompleteStatementCommandHandler.cs (1)
69public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler) => nextCommandHandler();
ConvertNamespace\ConvertNamespaceCommandHandler.cs (1)
58public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
37public CommandState GetCommandState(TabKeyCommandArgs args, Func<CommandState> nextHandler)
EventHookup\EventHookupCommandHandler_TypeCharCommand.cs (1)
83public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandler.cs (1)
90public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
RawStringLiteral\RawStringLiteralCommandHandler_TypeChar.cs (1)
22public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
72public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextCommandHandler)
StringCopyPaste\StringCopyPasteCommandHandler_CutCopy.cs (2)
25public CommandState GetCommandState(CutCommandArgs args, Func<CommandState> nextCommandHandler) 28public CommandState GetCommandState(CopyCommandArgs args, Func<CommandState> nextCommandHandler)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (9)
NavigateTo\NavigateToSearcherTests.cs (9)
48It.IsAny<Func<Task>>(), 57Func<Task> onProjectCompleted, 71It.IsAny<Func<Task>>(), 79Func<Task> onProjectCompleted, 98It.IsAny<Func<Task>>(), 107Func<Task> onProjectCompleted, 515public Task SearchCachedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 527public Task SearchGeneratedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 533public Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
Emit\ResourceTests.cs (5)
238Func<Stream> dataProvider = () => new MemoryStream(new byte[] { }); 258Func<Stream> dataProvider = () => new MemoryStream(new byte[] { }); 291Func<Stream> dataProvider = () => new MemoryStream(new byte[] { }); 311Func<Stream> dataProvider = () => new MemoryStream(new byte[] { }); 338Func<Stream> dataProvider = () => new MemoryStream(new byte[] { });
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Resources\CSharpMarkAssembliesWithNeutralResourcesLanguage.cs (1)
18protected override void RegisterAttributeAnalyzer(CompilationStartAnalysisContext context, Func<bool> shouldAnalyze, Action<SyntaxNodeAnalysisContext> onResourceFound, INamedTypeSymbol generatedCode)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ScriptTests.cs (1)
1151private async Task VerifyStackTraceAsync(Func<Script<object>> scriptProvider, int line = 0, int column = 0, string filename = null)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\NameLengthTests.cs (1)
568Func<Stream> dataProvider = () => new System.IO.MemoryStream();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
DocumentationComments\CrefTests.cs (1)
5514Func<Symbol> lookupSymbol = () =>
Microsoft.CodeAnalysis.CSharp.Test.Utilities (6)
CSharpTestBase.cs (6)
1846Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.Create( 1876private static void ValidateCompilation(Func<CSharpCompilation> createCompilationLambda) 1882private static void VerifyUsedAssemblyReferences(Func<CSharpCompilation> createCompilationLambda) 1976Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.Create(identity.Name, options: options ?? TestOptions.ReleaseDll, references: references, syntaxTrees: trees); 1995Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.CreateScriptCompilation( 2018Func<CSharpCompilation> createCompilationLambda = () => CSharpCompilation.CreateScriptCompilation(
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
310Name: nameof(Func<>) or nameof(Action<>),
Microsoft.CodeAnalysis.Debugging.Package (6)
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.EditorFeatures (37)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
46public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextCommandHandler)
AutomaticCompletion\AbstractAutomaticLineEnderCommandHandler.cs (1)
72public CommandState GetCommandState(AutomaticLineEnderCommandArgs args, Func<CommandState> nextHandler)
DocumentationComments\AbstractDocumentationCommentCommandHandler.cs (3)
115public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler) 228public CommandState GetCommandState(OpenLineAboveCommandArgs args, Func<CommandState> nextHandler) 264public CommandState GetCommandState(OpenLineBelowCommandArgs args, Func<CommandState> nextHandler)
DocumentationComments\AbstractXmlTagCompletionCommandHandler.cs (1)
45public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
DocumentationComments\DocumentationCommentSuggestion.cs (1)
158private async Task<T> RunWithEnqueueActionAsync<T>(string description, Func<Task<T>> action, CancellationToken cancellationToken)
Formatting\FormatCommandHandler.Paste.cs (1)
19public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextHandler)
Formatting\FormatCommandHandler.ReturnKey.cs (1)
13public CommandState GetCommandState(ReturnKeyCommandArgs args, Func<CommandState> nextHandler)
Formatting\FormatCommandHandler.TypeChar.cs (1)
13public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler.cs (1)
29private CommandState GetCommandState(Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_BackspaceDeleteHandler.cs (2)
16public CommandState GetCommandState(BackspaceKeyCommandArgs args, Func<CommandState> nextHandler) 19public CommandState GetCommandState(DeleteKeyCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_CutPasteHandler.cs (2)
14public CommandState GetCommandState(CutCommandArgs args, Func<CommandState> nextHandler) 25public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_OpenLineAboveHandler.cs (1)
13public CommandState GetCommandState(OpenLineAboveCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_OpenLineBelowHandler.cs (1)
13public CommandState GetCommandState(OpenLineBelowCommandArgs args, Func<CommandState> nextHandler)
InlineRename\CommandHandlers\AbstractRenameCommandHandler_TypeCharHandler.cs (1)
17public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
Interactive\InteractiveSession.cs (2)
55private readonly AsyncBatchingWorkQueue<Func<Task>> _workQueue; 113private async ValueTask ProcessWorkQueueAsync(ImmutableSegmentedList<Func<Task>> list, CancellationToken cancellationToken)
PasteTracking\PasteTrackingPasteCommandHandler.cs (1)
35public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextCommandHandler)
QuickInfo\ContentControlService.cs (1)
50public void AttachToolTipToControl(FrameworkElement element, Func<DisposableToolTip> createToolTip)
QuickInfo\IContentControlService.cs (1)
49void AttachToolTipToControl(FrameworkElement element, Func<DisposableToolTip> createToolTip);
QuickInfo\LazyToolTip.cs (3)
24private readonly Func<DisposableToolTip> _createToolTip; 33Func<DisposableToolTip> createToolTip) 53public static void AttachTo(FrameworkElement element, IThreadingContext threadingContext, Func<DisposableToolTip> createToolTip)
Shared\Utilities\WorkspaceThreadingService.cs (1)
23public TResult Run<TResult>(Func<Task<TResult>> asyncMethod)
SignatureHelp\Controller_InvokeSignatureHelp.cs (1)
17CommandState IChainedCommandHandler<InvokeSignatureHelpCommandArgs>.GetCommandState(InvokeSignatureHelpCommandArgs args, Func<CommandState> nextHandler)
SignatureHelp\Controller_TypeChar.cs (1)
20CommandState IChainedCommandHandler<TypeCharCommandArgs>.GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
SignatureHelp\SignatureHelpBeforeCompletionCommandHandler.cs (3)
70Func<CommandState> nextHandler) 96CommandState IChainedCommandHandler<TypeCharCommandArgs>.GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler) 108CommandState IChainedCommandHandler<InvokeSignatureHelpCommandArgs>.GetCommandState(InvokeSignatureHelpCommandArgs args, Func<CommandState> nextHandler)
Tagging\TaggerMainThreadManager.cs (3)
17using QueueData = (Func<TaggerUIData?> action, TaskCompletionSource<TaggerUIData?> taskCompletionSource, CancellationToken cancellationToken); 39Func<TaggerUIData?> action, 72public async ValueTask<TaggerUIData?> PerformWorkOnMainThreadAsync(Func<TaggerUIData?> action, CancellationToken cancellationToken)
ViewHostingControl.cs (2)
20private readonly Func<ITextBuffer> _createBuffer; 27Func<ITextBuffer> createBuffer)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Emit\CompilationOutputsTests.cs (4)
19private readonly Func<Stream?>? _openAssemblyStream; 20private readonly Func<Stream?>? _openPdbStream; 22public TestCompilationOutputs(Func<Stream?>? openAssemblyStream = null, Func<Stream?>? openPdbStream = null)
Microsoft.CodeAnalysis.Extensions.Package (6)
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.FSharp (1)
Internal\NavigateTo\FSharpNavigateToSearchService.cs (1)
55Func<Task> onProjectCompleted,
Microsoft.CodeAnalysis.ExternalAccess.HotReload (2)
Api\HotReloadService.cs (2)
17internal sealed class HotReloadService(SolutionServices services, Func<ValueTask<ImmutableArray<string>>> capabilitiesProvider) 19private sealed class DebuggerService(Func<ValueTask<ImmutableArray<string>>> capabilitiesProvider) : IManagedHotReloadService
Microsoft.CodeAnalysis.Features (21)
EditAndContinue\DebuggingSession.cs (1)
968public 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 (3)
32private readonly AsyncBatchingWorkQueue<Func<Task>> _eventProcessingQueue; 73private async ValueTask ProcessWorkQueueAsync(ImmutableSegmentedList<Func<Task>> list, CancellationToken cancellationToken) 75foreach (var taskCreator in list)
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (1)
57Func<Task> onProjectCompleted,
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (2)
66Func<Task> onProjectCompleted, 106Func<Task> onProjectCompleted,
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (2)
27Func<Task> onProjectCompleted, 65Func<Task> onProjectCompleted,
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (2)
152Func<Task> onProjectCompleted, 192Func<Task> onProjectCompleted,
NavigateTo\INavigateToSearchService.cs (3)
43Func<Task> onProjectCompleted, 70Func<Task> onProjectCompleted, 88Func<Task> onProjectCompleted,
NavigateTo\IRemoteNavigateToSearchService.cs (1)
52Func<Task>? onProjectCompleted,
NavigateTo\NavigateToSearcher.cs (2)
350Func<INavigateToSearchService, ImmutableArray<Project>, Func<ImmutableArray<INavigateToSearchResult>, Task>, Func<Task>, Task> processProjectAsync, 535public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
170var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<>), ContainingNamespace.Name: nameof(System) }
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (2)
467FileInfo databaseFileInfo, XElement patchElement, Func<byte[]> getDatabaseBytes, CancellationToken cancellationToken) 491FileInfo databaseFileInfo, XElement patchElement, Func<byte[]> getDatabaseBytes, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\MockCompilationOutputs.cs (2)
15public Func<Stream?>? OpenAssemblyStreamImpl { get; set; } 16public Func<Stream?>? OpenPdbStreamImpl { get; set; }
EditAndContinue\MockManagedEditAndContinueDebuggerService.cs (2)
19public Func<ImmutableArray<ManagedActiveStatementDebugInfo>>? GetActiveStatementsImpl; 20public Func<ImmutableArray<string>>? GetCapabilitiesImpl;
Microsoft.CodeAnalysis.InteractiveHost (13)
Interactive\Core\InteractiveHost.Service.cs (4)
33private readonly Func<Func<object>, object> _invokeOnMainThread; 119private Service(Func<Func<object>, object> invokeOnMainThread) 219public static async Task RunServerAsync(string pipeName, int clientProcessId, Func<Func<object>, object> invokeOnMainThread) 752return (Task<ScriptState<object>>)_invokeOnMainThread((Func<Task<ScriptState<object>>>)(async () =>
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Extensions\Extensions.cs (1)
143Func<T> defaultGetter)
Protocol\SumType.cs (3)
154public TResult Match<TResult>(Func<T1, TResult> firstMatch, Func<T2, TResult> secondMatch, Func<TResult>? defaultMatch = null) 427public TResult Match<TResult>(Func<T1, TResult> firstMatch, Func<T2, TResult> secondMatch, Func<T3, TResult> thirdMatch, Func<TResult>? defaultMatch = null) 798public TResult Match<TResult>(Func<T1, TResult> firstMatch, Func<T2, TResult> secondMatch, Func<T3, TResult> thirdMatch, Func<T4, TResult> fourthMatch, Func<TResult>? defaultMatch = null)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.PooledObjects.Package (6)
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.PublicApiAnalyzers (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\NavigateToSearch\RemoteNavigateToSearchService.cs (1)
31private (Func<ImmutableArray<RoslynNavigateToItem>, VoidResult, CancellationToken, Task> onItemsFound, Func<Task> onProjectCompleted) GetCallbacks(
Services\ProcessTelemetry\RemoteProcessTelemetryService.cs (1)
91private static void SetRoslynLogger<T>(ImmutableArray<string> loggerTypes, Func<T> creator) where T : ILogger
Microsoft.CodeAnalysis.ResxSourceGenerator (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Microsoft.CodeAnalysis.Test.Utilities (16)
Compilation\CompilationExtensions.cs (1)
273public static void ValidateIOperations(Func<Compilation> createCompilation)
Compilation\ControlFlowGraphVerifier.cs (6)
362Func<string> finalGraph = () => stringBuilder.ToString(); 380void verifyCaptures(Func<string> finalGraph) 457void verifyLeftRegions(BasicBlock block, PooledHashSet<CaptureId> longLivedIds, PooledHashSet<CaptureId> referencedIds, ArrayBuilder<ControlFlowRegion> regions, Func<string> finalGraph) 771PooledHashSet<CaptureId> longLivedIds, PooledHashSet<CaptureId> referencedIds, Func<string> finalGraph) 1646void validateLifetimeOfReferences(BasicBlock block, Func<string> finalGraph) 1787private static void AssertTrueWithGraph([DoesNotReturnIf(false)] bool value, string message, Func<string> finalGraph)
Compilation\TestDesktopStrongNameProvider.cs (1)
25internal Func<IClrStrongName> GetStrongNameInterfaceFunc { get; set; }
LazyToString.cs (2)
13private readonly Func<object> _evaluator; 15public LazyToString(Func<object> evaluator)
Mocks\TestStream.cs (2)
17private readonly Func<long> _getPosition; 28Func<long> getPosition = null,
ObjectReference.cs (1)
29public static ObjectReference<T> CreateFromFactory<T>(Func<T> targetFactory) where T : class
SourceGeneration\TestGenerators.cs (3)
84Func<ImmutableArray<(string hintName, SourceText? sourceText)>> computeSourceTexts) 92public CallbackGenerator(Action<GeneratorInitializationContext> onInit, Action<GeneratorExecutionContext> onExecute, Func<(string hintName, string? source)> computeSource) 103public CallbackGenerator(Func<(string hintName, string? source)> computeSource)
Microsoft.CodeAnalysis.Threading.Package (6)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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.UnitTests (8)
Collections\ImmutablesTestBase.cs (2)
201private readonly Func<string> _generator; 203internal DeferredToString(Func<string> generator)
Collections\SegmentedCollectionsMarshalTests.cs (2)
699static void test<TValue>(Func<TValue> createValue) 766static void test<T>(Func<T> createValue)
CommonCommandLineParserTests.cs (1)
51private void VerifyRuleSetError(string source, Func<string> messageFormatter, bool locSpecific = true, params string[] otherSources)
MetadataReferences\MetadataReferenceTests.cs (1)
587Assert.Throws<BadImageFormatException>((Func<object>)((AssemblyMetadata)r.GetMetadataNoCopy()).GetAssembly);
ResourceDescriptionTests.cs (1)
19Func<Stream> data = () => null;
Text\StringTextDecodingTests.cs (1)
40Func<Encoding> getEncoding,
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Source\SourcePropertySymbol.vb (1)
362Dim 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.Workspaces (30)
ExtensionManager\IExtensionManagerExtensions.cs (2)
33Func<T> function, 51Func<Task?> function)
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
60private Task CreateWorkAsync(Func<Task> createWorkAsync, CancellationToken cancellationToken)
Shared\Utilities\IOUtilities.cs (2)
25public static T PerformIO<T>(Func<T> function, T defaultValue = default) 38public static async Task<T> PerformIOAsync<T>(Func<Task<T>> function, T defaultValue = default)
Shared\Utilities\IWorkspaceThreadingService.cs (1)
30TResult Run<TResult>(Func<Task<TResult>> asyncMethod);
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Storage\SQLite\v2\SQLitePersistentStorage_Threading.cs (1)
22using var _ = PooledDelegates.GetPooledFunction(func, arg, out var boundFunction);
Workspace\IsolatedAnalyzerReferenceSet.Core.cs (1)
221Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
Workspace\IsolatedAnalyzerReferenceSet.cs (1)
39Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
Workspace\Solution\SolutionCompilationState.cs (1)
55private static readonly Func<ConditionalWeakTable<ISymbol, OriginatingProjectInfo?>> s_createTable = () => new();
Workspace\Workspace.cs (1)
617protected internal async Task<T> ScheduleTask<T>(Func<T> func, string? taskName = "Workspace.Task")
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
99private async Task<TResult> DoOperationAndReportProgressAsync<TResult>(ProjectLoadOperation operation, string? projectPath, string? targetFramework, Func<Task<TResult>> doFunc)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (18)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
207public V GetOrAdd(K key, Func<V> creator)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Compilers\Core\Portable\InternalUtilities\RoslynLazyInitializer.cs (4)
17/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, Func{T})"/> 18public static T EnsureInitialized<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 25/// <inheritdoc cref="LazyInitializer.EnsureInitialized{T}(ref T, ref bool, ref object, Func{T})"/> 26public static T EnsureInitialized<T>([NotNull] ref T? target, ref bool initialized, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory)
src\Compilers\Core\Portable\InternalUtilities\UICultureUtilities.cs (2)
174public static Func<T> WithCurrentUICulture<T>(Func<T> func)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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.Workspaces.MSBuild.UnitTests (1)
MSBuildWorkspaceTestBase.cs (1)
195protected static async Task AssertThrowsExceptionForInvalidPath(Func<Task> testCode)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Remote\InProcRemostHostClient.cs (3)
155private readonly Dictionary<ServiceMoniker, Func<object>> _inProcBrokeredServicesMap = []; 224public void RegisterInProcBrokeredService(ServiceDescriptor serviceDescriptor, Func<object> serviceFactory) 237if (_inProcBrokeredServicesMap.TryGetValue(descriptor.Moniker, out var inProcFactory))
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
UtilityTest\AsyncLazyTests.cs (1)
199var lazy = AsyncLazy.Create(static (cancellationTokenSource, c) => Task.Run((Func<object>)(() =>
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
178new PredefinedTypeInfo(PredefinedType.PT_FUNC, typeof(Func<>), "System.Func`1")
Microsoft.DotNet.ApiCompat.Task (1)
ApiCompatServiceProvider.cs (1)
21Func<ISuppressionEngine> suppressionEngineFactory,
Microsoft.DotNet.ApiCompat.Tests (1)
ApiCompatServiceProvider.cs (1)
21Func<ISuppressionEngine> suppressionEngineFactory,
Microsoft.DotNet.ApiCompat.Tool (1)
ApiCompatServiceProvider.cs (1)
21Func<ISuppressionEngine> suppressionEngineFactory,
Microsoft.DotNet.Build.Tasks.Feed (1)
src\common\TokenCredentialShortCache.cs (1)
64public async ValueTask<AccessToken> GetToken(TokenRequestContext requestContext, Func<ValueTask<AccessToken>> getFreshToken)
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
GeneralTests.cs (1)
189Func<bool> action = () => defaultLeft.Equals(defaultRight);
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.Helix.Sdk (4)
AzureDevOpsTask.cs (4)
81protected async Task RetryAsync(Func<Task> function) 101protected async Task<T> RetryAsync<T>(Func<Task<T>> function) 189public Task<T> RetryAsync<T>(Func<Task<T>> function, Action<Exception> logRetry, 195public async Task<T> RetryAsync<T>(Func<Task<T>> function, Action<Exception> logRetry,
Microsoft.DotNet.Helix.Sdk.Tests (2)
InstallDotNetToolTests.cs (2)
55.Setup(x => x.DirectoryMutexExec(It.IsAny<Func<bool>>(), It.IsAny<string>())) 56.Callback<Func<bool>, string>((function, path) => {
Microsoft.DotNet.MSBuildSdkResolver (9)
EnvironmentProvider.cs (3)
15private readonly Func<string?> _getCurrentProcessPath; 21public EnvironmentProvider(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath) 115public static string? GetDotnetExeDirectory(Func<string, string?> getEnvironmentVariable, Func<string?>? getCurrentProcessPath, Action<FormattableString>? log = null)
MSBuildSdkResolver.cs (2)
31private readonly Func<string>? _getCurrentProcessPath; 83public DotNetMSBuildSdkResolver(Func<string, string?> getEnvironmentVariable, Func<string>? getCurrentProcessPath, Func<string, string, string?> getMsbuildRuntime, VSSettings vsSettings)
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.DotNet.NativeWrapper (3)
EnvironmentProvider.cs (3)
15private readonly Func<string?> _getCurrentProcessPath; 21public EnvironmentProvider(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath) 115public static string? GetDotnetExeDirectory(Func<string, string?> getEnvironmentVariable, Func<string?>? getCurrentProcessPath, Action<FormattableString>? log = null)
Microsoft.DotNet.PackageInstall.Tests (2)
NuGetPackageInstallerTests.cs (2)
187Func<Task> a = () => _toolInstaller.DownloadPackageAsync( 208Func<Task> a = () => _toolInstaller.DownloadPackageAsync(
Microsoft.DotNet.RemoteExecutor (3)
RemoteExecutor.cs (3)
184public static RemoteInvokeHandle Invoke(Func<Task<int>> method, RemoteInvokeOptions options = null) 252public static RemoteInvokeHandle Invoke(Func<Task> method, RemoteInvokeOptions options = null) 320public static RemoteInvokeHandle Invoke(Func<int> method, RemoteInvokeOptions options = null)
Microsoft.DotNet.TemplateLocator (6)
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.DotNet.VersionTools.Tests (1)
BuildManifest\BuildManifestClientTests.cs (1)
195Func<Task> act = async () => { await pushClient; };
Microsoft.DotNet.XUnitExtensions (3)
DiscovererHelpers.cs (1)
53Func<bool> conditionFunc = ConditionalTestDiscoverer.LookupConditionalMember(calleeType, entry);
Discoverers\ConditionalTestDiscoverer.cs (2)
63Func<bool> conditionFunc; 123internal static Func<bool> LookupConditionalMember(Type t, string name)
Microsoft.Extensions.AI.Evaluation (5)
Utilities\TimingHelper.cs (5)
28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 79Func<Task<TResult>> operation) 97Func<ValueTask<TResult>> operation)
Microsoft.Extensions.AI.Evaluation.Console (10)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (5)
28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 79Func<Task<TResult>> operation) 97Func<ValueTask<TResult>> operation)
Utilities\LoggerExtensions.cs (5)
39Func<TResult> operation, 62Func<Task> operation, 81Func<ValueTask> operation, 100Func<Task<TResult>> operation, 122Func<ValueTask<TResult>> operation,
Microsoft.Extensions.AI.Evaluation.NLP (5)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (5)
28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 79Func<Task<TResult>> operation) 97Func<ValueTask<TResult>> operation)
Microsoft.Extensions.AI.Evaluation.Quality (5)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (5)
28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 79Func<Task<TResult>> operation) 97Func<ValueTask<TResult>> operation)
Microsoft.Extensions.AI.Evaluation.Reporting (5)
Storage\DiskBasedResponseCache.cs (3)
30private readonly Func<DateTime> _provideDateTime; 37Func<DateTime> provideDateTime, 236Func<DateTime> provideDateTime,
Storage\DiskBasedResponseCacheProvider.cs (2)
27private readonly Func<DateTime> _provideDateTime = () => DateTime.UtcNow; 34Func<DateTime> provideDateTime,
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (5)
Storage\AzureStorageResponseCache.cs (3)
27Func<DateTime> provideDateTime, 38private readonly Func<DateTime> _provideDateTime = provideDateTime; 195Func<DateTime> provideDateTime,
Storage\AzureStorageResponseCacheProvider.cs (2)
28private readonly Func<DateTime> _provideDateTime = () => DateTime.Now; 35Func<DateTime> provideDateTime,
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (3)
AzureStorage\AzureResponseCacheTests.cs (1)
53internal override IEvaluationResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime)
DiskBased\DiskBasedResponseCacheTests.cs (1)
51internal override IEvaluationResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime)
ResponseCacheTester.cs (1)
24internal abstract IEvaluationResponseCacheProvider CreateResponseCacheProvider(Func<DateTime> provideDateTime);
Microsoft.Extensions.AI.Evaluation.Safety (5)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (5)
28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 79Func<Task<TResult>> operation) 97Func<ValueTask<TResult>> operation)
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
417Func<AIFunctionFactoryOptions> createOptions = () =>
Microsoft.Extensions.AI.Tests (8)
ChatCompletion\DistributedCachingChatClientTest.cs (3)
779=> ToAsyncEnumerableAsync(preTask, valueFactories.Select<T, Func<T>>(v => () => v)); 781private static async IAsyncEnumerable<T> ToAsyncEnumerableAsync<T>(Task preTask, IEnumerable<Func<T>> values) 785foreach (var value in values)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (2)
513Func<Queue<List<ChatMessage>>> expectedDownstreamClientInput = () => new Queue<List<ChatMessage>>( 527Func<Queue<List<ChatMessage>>> downstreamClientOutput = () => new Queue<List<ChatMessage>>(
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
685async Task InvokeAsync(Func<Task> work) 884async Task InvokeAsync(Func<Task<List<ChatMessage>>> work)
Functions\AIFunctionFactoryTest.cs (1)
216Func<string> dotnetFunc = () => "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.MicroBenchmarks (4)
DistributedCacheBenchmarks.cs (4)
130Func<Task<byte[]?>> callback = () => _backend.GetAsync(RandomKey()); 158Func<Task<byte[]?>> callback = () => _backend.GetAsync(RandomKey()); 185Func<Task<byte[]?>> callback = () => _backend.GetAsync(FixedKey()); 212Func<Task<byte[]?>> callback = () => _backend.GetAsync(FixedKey());
Microsoft.Extensions.Caching.StackExchangeRedis (2)
RedisCacheOptions.cs (2)
32public Func<Task<IConnectionMultiplexer>>? ConnectionMultiplexerFactory { get; set; } 43public Func<ProfilingSession>? ProfilingSession { get; set; }
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (1)
TimeExpirationAsyncTests.cs (1)
20static async Task ThrowsArgumentOutOfRangeAsync(Func<Task> test, string paramName, string message, object actualValue)
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Classification\DataClassificationTypeConverterTests.cs (1)
141var act = () => converter.ConvertFrom(null, null, input!);
Microsoft.Extensions.Configuration.Binder (2)
BindingPoint.cs (2)
11private readonly Func<object?>? _initialValueProvider; 22public BindingPoint(Func<object?> initialValueProvider, bool isReadOnly)
Microsoft.Extensions.DependencyModel (2)
DependencyContextLoader.cs (2)
20private readonly Func<IDependencyContextReader> _jsonReaderFactory; 34Func<IDependencyContextReader> jsonReaderFactory)
Microsoft.Extensions.Diagnostics.HealthChecks (4)
DependencyInjection\HealthChecksBuilderDelegateExtensions.cs (4)
31Func<HealthCheckResult> check, 50Func<HealthCheckResult> check, 117Func<Task<HealthCheckResult>> check, 136Func<Task<HealthCheckResult>> check,
Microsoft.Extensions.Diagnostics.ResourceMonitoring (11)
Linux\LinuxUtilizationProvider.cs (2)
280private Measurement<T>[] GetMeasurementWithRetry<T>(Func<T> func) 291private bool TryGetValueWithRetry<T>(Func<T> func, out T value)
Linux\Network\LinuxNetworkMetrics.cs (1)
89Func<TcpStateInfo> getStateInfoFunc,
Windows\WindowsContainerSnapshotProvider.cs (2)
27private readonly Func<IJobHandle> _createJobHandleObject; 74Func<IJobHandle> createJobHandleObject,
Windows\WindowsSnapshotProvider.cs (6)
29private readonly Func<long> _getCpuTicksFunc; 30private readonly Func<long> _getMemoryUsageFunc; 53Func<int> getCpuUnitsFunc, 54Func<long> getCpuTicksFunc, 55Func<long> getMemoryUsageFunc, 56Func<ulong> getTotalMemoryInBytesFunc)
Microsoft.Extensions.FileProviders.Physical (2)
PhysicalFileProvider.cs (1)
31private readonly Func<PhysicalFilesWatcher> _fileWatcherFactory;
PhysicalFilesWatcher.cs (1)
40private readonly Func<Timer> _timerFactory;
Microsoft.Extensions.Hosting (4)
HostApplicationBuilder.cs (1)
28private Func<IServiceProvider> _createServiceProvider;
HostBuilder.cs (1)
298Func<IServiceProvider> serviceProviderGetter)
Internal\ServiceFactoryAdapter.cs (2)
13private readonly Func<HostBuilderContext>? _contextResolver; 23public ServiceFactoryAdapter(Func<HostBuilderContext> contextResolver, Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factoryResolver)
Microsoft.Extensions.Http (5)
DefaultTypedHttpClientFactory.cs (1)
38private static readonly Func<ObjectFactory> _createActivator = () =>
DependencyInjection\HttpClientBuilderExtensions.cs (4)
74public static IHttpClientBuilder AddHttpMessageHandler(this IHttpClientBuilder builder, Func<DelegatingHandler> configureHandler) 154public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler(this IHttpClientBuilder builder, Func<HttpMessageHandler> configureHandler) 280/// <see cref="ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func{HttpMessageHandler})"/> or 317/// <see cref="ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func{HttpMessageHandler})"/> or
Microsoft.Extensions.Http.Diagnostics.Tests (18)
Latency\HttpClientLatencyTelemetryExtensionsTest.cs (1)
23var act = () => ((IServiceCollection)null!).AddHttpClientLatencyTelemetry();
Logging\HttpClientLoggerTest.cs (6)
72var act = async () => 107var act = async () => 150var act = async () => 439var act = () => client.SendAsync(httpRequestMessage, CancellationToken.None); 555var act = async () => await client 825var act = () => client.SendAsync(httpRequestMessage, CancellationToken.None);
Logging\HttpClientLoggingExtensionsTest.cs (5)
37var act = () => ((IHttpClientBuilder)null!).AddExtendedHttpClientLogging(); 56var act = () => ((IServiceCollection)null!).AddExtendedHttpClientLogging(); 75var act = () => ((IServiceCollection)null!).AddHttpClientLogEnricher<EmptyEnricher>(); 215var act = async () => await host.StartAsync().ConfigureAwait(false); 324var act = () =>
Logging\HttpRequestBodyReaderTest.cs (1)
113var act = async () =>
Logging\HttpResponseBodyReaderTest.cs (4)
34var act = () => new HttpResponseBodyReader(null!); 136var act = async () => await httpResponseBodyReader.ReadAsync(httpResponse, token); 199var act = async () => await responseStream.ReadAsync(buffer, 0, BodySize, cts.Token); 255var act = async () => await httpResponseBodyReader.ReadAsync(httpResponse, token);
Logging\LoggingOptionsValidatorTest.cs (1)
16var act = () => _ = new LoggingOptionsValidator();
Microsoft.Extensions.Http.Polly.Tests (1)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (1)
559public Func<Exception> CreateException { get; set; } = () => new OverflowException();
Microsoft.Extensions.Http.Resilience (4)
Routing\Internal\RequestRoutingOptions.cs (1)
10public Func<RequestRoutingStrategy>? RoutingStrategyProvider { get; set; }
Routing\Internal\RoutingResilienceStrategy.cs (2)
18private readonly Func<RequestRoutingStrategy>? _provider; 20public RoutingResilienceStrategy(Func<RequestRoutingStrategy>? provider)
Routing\RoutingStrategyBuilderExtensions.cs (1)
117internal static IRoutingStrategyBuilder ConfigureRoutingStrategy(this IRoutingStrategyBuilder builder, Func<IServiceProvider, Func<RequestRoutingStrategy>> factory)
Microsoft.Extensions.Http.Resilience.Tests (7)
Hedging\HedgingTests.cs (2)
35private readonly Func<RequestRoutingStrategy> _requestRoutingStrategyFactory; 41private protected HedgingTests(Func<IHttpClientBuilder, Func<RequestRoutingStrategy>, TBuilder> createDefaultBuilder)
Hedging\StandardHedgingTests.cs (1)
33private static IStandardHedgingHandlerBuilder ConfigureDefaultBuilder(IHttpClientBuilder builder, Func<RequestRoutingStrategy> factory)
Routing\RoutingResilienceStrategyTests.cs (1)
46private static ResiliencePipeline Create(Func<RequestRoutingStrategy>? provider) =>
Routing\RoutingStrategyTest.cs (3)
43var factory = CreateRoutingFactory(); 140var factory = CreateRoutingFactory(); 150internal Func<RequestRoutingStrategy> CreateRoutingFactory(string? name = null)
Microsoft.Extensions.ObjectPool (1)
DefaultObjectPool.cs (1)
17private readonly Func<T> _createFunc;
Microsoft.Extensions.Options (2)
IOptionsMonitorCache.cs (1)
22TOptions GetOrAdd(string? name, Func<TOptions> createOptions);
OptionsCache.cs (1)
31public virtual TOptions GetOrAdd(string? name, Func<TOptions> createOptions)
Microsoft.Extensions.Primitives (4)
ChangeToken.cs (4)
20public static IDisposable OnChange(Func<IChangeToken?> changeTokenProducer, Action changeTokenConsumer) 41public static IDisposable OnChange<TState>(Func<IChangeToken?> changeTokenProducer, Action<TState> changeTokenConsumer, TState state) 57private readonly Func<IChangeToken?> _changeTokenProducer; 64public ChangeTokenRegistration(Func<IChangeToken?> changeTokenProducer, Action<TState> changeTokenConsumer, TState state)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (7)
DnsServicePublicApiTests.cs (7)
17var action = () => services.AddDnsSrvServiceEndpointProvider(); 29var action = () => services.AddDnsSrvServiceEndpointProvider(configureOptions); 41var action = () => services.AddDnsSrvServiceEndpointProvider(configureOptions); 52var action = () => services.AddDnsServiceEndpointProvider(); 64var action = () => services.AddDnsServiceEndpointProvider(configureOptions); 75var action = () => services.ConfigureDnsResolver(_ => { }); 87var action = () => services.ConfigureDnsResolver(configureOptions);
Microsoft.Extensions.ServiceDiscovery.Tests (16)
ExtensionsServicePublicApiTests.cs (15)
24var action = () => httpClientBuilder.AddServiceDiscovery(); 35var action = () => services.AddServiceDiscovery(); 47var action = () => services.AddServiceDiscovery(configureOptions); 59var action = () => services.AddServiceDiscovery(configureOptions); 70var action = () => services.AddServiceDiscoveryCore(); 82var action = () => services.AddServiceDiscoveryCore(configureOptions); 94var action = () => services.AddServiceDiscoveryCore(configureOptions); 105var action = () => services.AddConfigurationServiceEndpointProvider(); 117var action = () => services.AddConfigurationServiceEndpointProvider(configureOptions); 129var action = () => services.AddConfigurationServiceEndpointProvider(configureOptions); 140var action = () => services.AddPassThroughServiceEndpointProvider(); 158var action = async () => await serviceEndpointResolver.GetEndpointsAsync(serviceName, CancellationToken.None); 169var action = () => ServiceEndpoint.Create(endPoint); 200var action = () => new ServiceEndpointSource(endpoints, changeToken, features); 213var action = () => new ServiceEndpointSource(endpoints, changeToken, features);
ServiceEndpointResolverTests.cs (1)
79private sealed class FakeEndpointResolver(Func<IServiceEndpointBuilder, CancellationToken, ValueTask> resolveAsync, Func<ValueTask> disposeAsync) : IServiceEndpointProvider
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (3)
YarpServiceDiscoveryPublicApiTests.cs (3)
18var action = () => builder.AddServiceDiscoveryDestinationResolver(); 29var action = () => services.AddHttpForwarderWithServiceDiscovery(); 40var action = () => services.AddServiceDiscoveryForwarderFactory();
Microsoft.Extensions.Telemetry.Tests (7)
Logging\TestConfiguration.cs (3)
14private Func<string> _json; 16public TestConfiguration(JsonConfigurationSource source, Func<string> json) 22public static ConfigurationRoot Create(Func<string> getJson)
Sampling\SamplingLoggerBuilderExtensionsTests.cs (4)
269Func<ILoggingBuilder> action = () => SamplingLoggerBuilderExtensions.AddTraceBasedSampler(builder!); 272Func<ILoggingBuilder> action2 = () => SamplingLoggerBuilderExtensions.AddRandomProbabilisticSampler(builder!, 1.0); 275Func<ILoggingBuilder> action3 = () => SamplingLoggerBuilderExtensions.AddSampler<MySampler>(builder!); 278Func<ILoggingBuilder> action4 = () => SamplingLoggerBuilderExtensions.AddSampler(builder!, new MySampler());
Microsoft.Extensions.WebEncoders (1)
EncoderServiceCollectionExtensions.cs (1)
61Func<TService> defaultFactory,
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesExtensions.cs (1)
34private Func<int>? FuncBase { get; set; } // Not supposed to be logged (delegate type)
Microsoft.Maui (8)
Dispatching\DispatcherExtensions.cs (4)
19 public static Task<T> DispatchAsync<T>(this IDispatcher dispatcher, Func<T> func) 59 public static Task<T> DispatchAsync<T>(this IDispatcher dispatcher, Func<Task<T>> funcTask) 85 public static Task DispatchAsync(this IDispatcher dispatcher, Func<Task> funcTask) => 108 public static void StartTimer(this IDispatcher dispatcher, TimeSpan interval, Func<bool> callback)
Fonts\FileSystemEmbeddedFontLoader.cs (2)
13 readonly Func<string>? _getRootPath; 36 private protected FileSystemEmbeddedFontLoader(Func<string> getRootPath, IServiceProvider? serviceProvider = null)
Hosting\MauiAppBuilder.cs (1)
18 private Func<IServiceProvider>? _createServiceProvider;
Platform\ImageSourcePartLoader.cs (1)
43 public ImageSourcePartLoader(IElementHandler handler, Func<IImageSourcePart?> imageSourcePart, Action<PlatformImage?> setImage)
Microsoft.Maui.Controls (64)
Animation.cs (1)
71 public void Commit(IAnimatable owner, string name, uint rate = 16, uint length = 250, Easing easing = null, Action<double, bool> finished = null, Func<bool> repeat = null)
AnimationExtensions.cs (7)
137 Func<bool> repeat = null) 143 Func<bool> r = () => 156 Action<double, bool> finished = null, Func<bool> repeat = null) 163 Func<bool> repeat = null) 172 Action<T, bool> finished = null, Func<bool> repeat = null, IAnimationManager animationManager = null) 256 uint rate, uint length, Easing easing, Action<T, bool> finished, Func<bool> repeat) 390 public Func<bool> Repeat;
BoundsConstraint.cs (4)
13 Func<Rect> _measureFunc; 23 public static BoundsConstraint FromExpression(Expression<Func<Rect>> expression, IEnumerable<View> parents = null) 28 internal static BoundsConstraint FromExpression(Expression<Func<Rect>> expression, bool fromExpression, IEnumerable<View> parents = null) 30 Func<Rect> compiled = expression.Compile();
Command.cs (1)
96 public Command(Action execute, Func<bool> canExecute) : this(o => execute(), o => canExecute())
ControlTemplate.cs (1)
23 public ControlTemplate(Func<object> createTemplate) : base(createTemplate)
DataTemplate.cs (1)
34 public DataTemplate(Func<object> loadTemplate) : base(loadTemplate)
Device.cs (4)
95 public static Task<T> InvokeOnMainThreadAsync<T>(Func<T> func) => 105 public static Task<T> InvokeOnMainThreadAsync<T>(Func<Task<T>> funcTask) => 110 public static Task InvokeOnMainThreadAsync(Func<Task> funcTask) => 134 public static void StartTimer(TimeSpan interval, Func<bool> callback)
DispatcherExtensions.cs (1)
77 public static Task DispatchIfRequiredAsync(this IDispatcher? dispatcher, Func<Task> action)
ElementTemplate.cs (2)
36 internal ElementTemplate(Func<object> loadTemplate) : this() => LoadTemplate = loadTemplate ?? throw new ArgumentNullException(nameof(loadTemplate)); 38 public Func<object> LoadTemplate { get; set; }
Hosting\Effects\AppHostBuilderExtensions.cs (4)
72 internal Dictionary<Type, Func<PlatformEffect>> RegisteredEffects { get; } = new Dictionary<Type, Func<PlatformEffect>>(); 103 private readonly Dictionary<Type, Func<PlatformEffect>> _registeredEffects; 120 if (_registeredEffects != null && _registeredEffects.TryGetValue(fromEffect.GetType(), out Func<PlatformEffect> effectType))
ImageSource.cs (1)
89 public static ImageSource FromStream(Func<Stream> stream)
Interactivity\PropertyCondition.cs (2)
38 Func<MemberInfo> minforetriever = () => 68 Func<MemberInfo> minforetriever = () =>
IValueConverterProvider.cs (1)
11 object Convert(object value, Type toType, Func<MemberInfo> minfoRetriever, IServiceProvider serviceProvider);
LegacyLayouts\Constraint.cs (2)
28 public static Constraint FromExpression(Expression<Func<double>> expression) 30 Func<double> compiled = expression.Compile();
LegacyLayouts\RelativeLayout.cs (18)
279 Func<double> x; 289 Func<double> y; 299 Func<double> width; 300 Func<double> height = null; 343 void Add(T view, Expression<Func<Rect>> bounds); 345 void Add(T view, Expression<Func<double>> x = null, Expression<Func<double>> y = null, Expression<Func<double>> width = null, Expression<Func<double>> height = null); 359 public void Add(View view, Expression<Func<Rect>> bounds) 368 public void Add(View view, Expression<Func<double>> x = null, Expression<Func<double>> y = null, Expression<Func<double>> width = null, Expression<Func<double>> height = null) 370 Func<double> xCompiled = x != null ? x.Compile() : () => 0; 371 Func<double> yCompiled = y != null ? y.Compile() : () => 0; 373 Func<double> widthCompiled = width != null ? width.Compile() : () => view.Measure(Parent.Width, Parent.Height, MeasureFlags.IncludeMargins).Request.Width; 374 Func<double> heightCompiled = height != null ? height.Compile() : () => view.Measure(Parent.Width, Parent.Height, MeasureFlags.IncludeMargins).Request.Height;
Shell\Shell.cs (1)
1792 Func<T> defaultValue,
Shell\ShellNavigatingEventArgs.cs (2)
13 Func<Task> _deferralFinishedTask; 108 internal void RegisterDeferralCompletedCallBack(Func<Task> deferralFinishedTask)
Shell\ShellNavigationManager.cs (1)
365 Func<Task> navigationTask = () => GoToAsync(navArgs.Target, navArgs.Animate, false, navArgs);
ShellToolbar.cs (1)
101 Func<bool> getDefaultNavBarIsVisible = () =>
StyleSheets\Style.cs (1)
98 Func<MemberInfo> minforetriever =
Xaml\TypeConversionExtensions.cs (7)
45 internal static object ConvertTo(this object value, Type toType, Func<ParameterInfo> pinfoRetriever, 48 Func<TypeConverter> getConverter = () => 62 internal static object ConvertTo(this object value, Type toType, Func<MemberInfo> minfoRetriever, 65 Func<TypeConverter> getConverter = () => 118 ret = value.ConvertTo(toType, (Func<TypeConverter>)null, serviceProvider, out exception); 123 Func<TypeConverter> getConverter = () => (TypeConverter)Activator.CreateInstance(convertertype); 130 internal static object ConvertTo(this object value, Type toType, Func<TypeConverter> getConverter,
Xaml\ValueConverterProvider.cs (1)
13 public object Convert(object value, Type toType, Func<MemberInfo> minfoRetriever, IServiceProvider serviceProvider)
Microsoft.Maui.Controls.Build.Tasks (1)
SetPropertiesVisitor.cs (1)
764 static IEnumerable<Instruction> DigProperties(IEnumerable<(PropertyDefinition property, TypeReference propDeclTypeRef, string indexArg)> properties, Dictionary<TypeReference, VariableDefinition> locs, Func<Instruction> fallback, IXmlLineInfo lineInfo, ModuleDefinition module)
Microsoft.Maui.Controls.Xaml (5)
ApplyPropertiesVisitor.cs (4)
174 addMethod.Invoke(source, new[] { value.ConvertTo(addMethod.GetParameters()[0].ParameterType, (Func<TypeConverter>)null, new XamlServiceProvider(node, Context), out xpe) }); 587 Func<MemberInfo> minforetriever; 753 addMethod.Invoke(collection, new[] { value.ConvertTo(addMethod.GetParameters()[0].ParameterType, (Func<TypeConverter>)null, serviceProvider, out exception) }); 821 addMethod.Invoke(collection, new[] { value.ConvertTo(addMethod.GetParameters()[0].ParameterType, (Func<TypeConverter>)null, serviceProvider, out exception) });
MarkupExtensionParser.cs (1)
100 (Func<TypeConverter>)null, serviceProvider, out Exception converterException);
Microsoft.Maui.Essentials (3)
MainThread\MainThread.shared.cs (3)
71 public static Task<T> InvokeOnMainThreadAsync<T>(Func<T> func) 101 public static Task InvokeOnMainThreadAsync(Func<Task> funcTask) 133 public static Task<T> InvokeOnMainThreadAsync<T>(Func<Task<T>> funcTask)
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (2)
src\Graphics\src\Graphics\Platforms\Windows\AsyncPump.cs (2)
27 public static void Run(Func<Task> func) 58 public static T Run<T>(Func<Task<T>> asyncMethod)
Microsoft.Maui.Resizetizer (3)
AsyncTaskExtensions.cs (1)
47 public static Task<TSource> RunTask<TSource>(this MauiAsyncTask asyncTask, Func<TSource> body) =>
SkiaSharpAppIconTools.cs (2)
38 public ResizedImageInfo Resize(DpiPath dpi, string destination, Func<Stream>? getStream = null) 63 void Save(SKBitmap tempBitmap, string destination, Func<Stream>? getStream)
Microsoft.ML.AutoML.Tests (3)
AutoMLExperimentTests.cs (3)
57var runExperimentAction = async () => await experiment.RunAsync(cts.Token); 87var runExperimentAction = async () => await experiment.RunAsync(); 114var runExperimentAction = async () => await experiment.RunAsync();
Microsoft.ML.Core (12)
Data\ServerChannel.cs (2)
90public void Register<TRet>(string name, Func<TRet> func) 223/// some variety of <see cref="Func{TResult}"/>, <see cref="Func{T1, TResult}"/>,
Utilities\FuncInstanceMethodInfo1`2.cs (4)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{TResult}"/>, 31public FuncInstanceMethodInfo1(Func<TResult> function) 56public static FuncInstanceMethodInfo1<TTarget, TResult> Create(Expression<Func<TTarget, Func<TResult>>> expression) 74Contracts.CheckParam((Type)((ConstantExpression)methodCallExpression.Arguments[0]).Value == typeof(Func<TResult>), nameof(expression), "Unexpected expression form");
Utilities\FuncMethodInfo1`1.cs (1)
15/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{TResult}"/>,
Utilities\FuncStaticMethodInfo1`1.cs (2)
14/// Represents the <see cref="MethodInfo"/> for a generic function corresponding to <see cref="Func{TResult}"/>, 26public FuncStaticMethodInfo1(Func<TResult> function)
Utilities\ObjectPool.cs (2)
23private readonly Func<T> _maker; 25public MadeObjectPool(Func<T> maker)
Utilities\Utils.cs (1)
1198/// <see cref="Action"/> instead of <see cref="Func{TRet}"/>.
Microsoft.ML.Core.Tests (13)
UnitTests\CoreBaseTestClass.cs (13)
29protected Func<bool> GetIdComparer(DataViewRow r1, DataViewRow r2, out ValueGetter<DataViewRowId> idGetter) 45protected Func<bool> GetComparerOne<T>(DataViewRow r1, DataViewRow r2, int col, Func<T, T, bool> fn) 68protected Func<bool> GetComparerVec<T>(DataViewRow r1, DataViewRow r2, int col, int size, Func<T, T, bool> fn) 83protected Func<bool> GetColumnComparer(DataViewRow r1, DataViewRow r2, int col, DataViewType type, bool exactDoubles) 250Func<bool>[] comps = new Func<bool>[colLim]; 269Func<bool> idComp = checkId ? GetIdComparer(curs1, curs2, out idGetter) : null; 309var comp = comps[col]; 341Func<bool>[] comps = new Func<bool>[colLim]; 343Func<bool>[] idComps = new Func<bool>[cursors.Length]; 381var comp = comps[col];
Microsoft.ML.CpuMath (3)
AlignedMatrix.cs (2)
129public void Randomize(Func<float> rand) 356public void Randomize(Func<float> rand)
ICpuBuffer.cs (1)
20void Randomize(Func<T> rand);
Microsoft.ML.Data (35)
Commands\CrossValidationCommand.cs (3)
187Func<IDataView> validDataCreator = null; 365private readonly Func<IDataView> _getValidationDataView; 394Func<IDataView> getValidationDataView = null,
Data\RowCursorUtils.cs (4)
22private static readonly FuncStaticMethodInfo1<DataViewRow, int, Func<bool>> _getIsNewGroupDelegateCoreMethodInfo 23= new FuncStaticMethodInfo1<DataViewRow, int, Func<bool>>(GetIsNewGroupDelegateCore<int>); 304public static Func<bool> GetIsNewGroupDelegate(DataViewRow cursor, int col) 313private static Func<bool> GetIsNewGroupDelegateCore<T>(DataViewRow cursor, int col)
DataLoadSave\Binary\BinarySaver.cs (4)
749var estimators = new Func<long>[actives.Length]; 755estimators[c] = (Func<long>)args[2]; 776out Func<long> fetchWriteEstimator, out IValueWriter writer); 779out Func<long> fetchWriteEstimator, out IValueWriter writer)
DataView\BatchDataViewMapperBase.cs (4)
67protected abstract Func<bool> GetLastInBatchDelegate(DataViewRowCursor lookAheadCursor); 68protected abstract Func<bool> GetIsNewBatchDelegate(DataViewRowCursor lookAheadCursor); 83private readonly Func<bool> _lastInBatchInLookAheadCursorDel; 84private readonly Func<bool> _firstInBatchInInputCursorDel;
EntryPoints\InputBase.cs (6)
59Func<ITrainer> createTrainer, 60Func<string> getLabel = null, 61Func<string> getWeight = null, 62Func<string> getGroup = null, 63Func<string> getName = null, 64Func<IEnumerable<KeyValuePair<RoleMappedSchema.ColumnRole, string>>> getCustom = null,
Evaluators\AnomalyDetectionEvaluator.cs (1)
129out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Evaluators\BinaryClassifierEvaluator.cs (2)
218out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate) 1176Func<bool> getPredictedLabel;
Evaluators\ClusteringEvaluator.cs (1)
160out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Evaluators\EvaluatorBase.cs (3)
133Func<bool> finishPass = 178Func<Dictionary<string, IDataView>> consolidate; 203out Action<uint, ReadOnlyMemory<char>, TAgg> addAgg, out Func<Dictionary<string, IDataView>> consolidate);
Evaluators\MulticlassClassificationEvaluator.cs (1)
141out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Evaluators\MultiOutputRegressionEvaluator.cs (1)
96out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Evaluators\RankingEvaluator.cs (2)
159out Action<uint, ReadOnlyMemory<char>, Aggregator> addAgg, out Func<Dictionary<string, IDataView>> consolidate) 426private Func<bool> _newGroupDel;
Evaluators\RegressionEvaluatorBase.cs (1)
51out Action<uint, ReadOnlyMemory<char>, TAgg> addAgg, out Func<Dictionary<string, IDataView>> consolidate)
Transforms\PerGroupTransformBase.cs (2)
240private readonly Func<bool> _newGroupInGroupCursorDel; 241private readonly Func<bool> _newGroupInInputCursorDel;
Microsoft.ML.FastTree (3)
FastTree.cs (3)
2194Func<FeatureFlockBase> createOneHotFlock = 2198Func<FeatureFlockBase> createNHotFlock = 2210Func<FeatureFlockBase> createFlock =
Microsoft.ML.Predictor.Tests (2)
TestTransposer.cs (2)
106int rowCount, Double density, Random rgen, Func<T> generator, int slotCount, params int[] forceDenseSlot) 139private static T[] GenerateHelper<T>(int rowCount, Double density, Random rgen, Func<T> generator)
Microsoft.ML.TestFramework (13)
DataPipe\TestDataPipeBase.cs (13)
707Func<bool>[] comps = new Func<bool>[colLim]; 726Func<bool> idComp = checkId ? GetIdComparer(curs1, curs2, out idGetter) : null; 767var comp = comps[col]; 799Func<bool>[] comps = new Func<bool>[colLim]; 801Func<bool>[] idComps = new Func<bool>[cursors.Length]; 839var comp = comps[col]; 865protected Func<bool> GetIdComparer(DataViewRow r1, DataViewRow r2, out ValueGetter<DataViewRowId> idGetter) 881protected Func<bool> GetColumnComparer(DataViewRow r1, DataViewRow r2, int col, DataViewType type, bool exactDoubles) 1000protected Func<bool> GetComparerOne<T>(DataViewRow r1, DataViewRow r2, int col, Func<T, T, bool> fn) 1017protected Func<bool> GetComparerVec<T>(DataViewRow r1, DataViewRow r2, int col, int size, Func<T, T, bool> fn)
Microsoft.ML.TestFrameworkCommon (1)
Datasets.cs (1)
28public Func<TextLoader.Column[]> GetLoaderColumns;
Microsoft.ML.Tests (3)
TrainerEstimators\TreeEstimators.cs (3)
1040var action = () => estimator.Fit(dataView); 1094var action = () => trainer.Fit(dataView); 1122var action = () => trainer.Fit(dataView);
Microsoft.ML.TimeSeries (2)
SrCnnEntireAnomalyDetector.cs (2)
234protected override Func<bool> GetIsNewBatchDelegate(DataViewRowCursor input) 239protected override Func<bool> GetLastInBatchDelegate(DataViewRowCursor input)
Microsoft.ML.Tokenizers.Data.Tests (1)
src\Common\tests\RetryHelper.cs (1)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null)
Microsoft.ML.Tokenizers.Tests (1)
src\Common\tests\RetryHelper.cs (1)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null)
Microsoft.ML.TorchSharp (2)
Utils\DefaultDictionary.cs (2)
21private readonly Func<TValue> _init; 24public DefaultDictionary(Func<TValue> init)
Microsoft.ML.Transforms (18)
CustomMappingFilter.cs (2)
94private readonly Func<bool> _accept; 160private readonly Func<bool> _accept;
Expression\BuiltinFunctions.cs (1)
72public static MethodInfo Fn<T1>(Func<T1> fn)
Expression\CodeGen.cs (2)
102private static readonly MethodInfo _methGetFalseBL = ((Func<BL>)BuiltinFunctions.False).GetMethodInfo(); 103private static readonly MethodInfo _methGetTrueBL = ((Func<BL>)BuiltinFunctions.True).GetMethodInfo();
GroupTransform.cs (4)
395private static readonly FuncStaticMethodInfo1<DataViewRow, int, Func<bool>> _makeSameCheckerMethodInfo 396= new FuncStaticMethodInfo1<DataViewRow, int, Func<bool>>(MakeSameChecker<int>); 398public readonly Func<bool> IsSameKey; 400private static Func<bool> MakeSameChecker<T>(DataViewRow row, int col)
PermutationFeatureImportance.cs (1)
25Func<TResult> resultInitializer,
PermutationFeatureImportanceExtensions.cs (1)
656Func<TResult> resultInitializer,
UngroupTransform.cs (7)
448private static readonly FuncInstanceMethodInfo1<Cursor, int, Func<int>> _makeSizeGetterMethodInfo 449= FuncInstanceMethodInfo1<Cursor, int, Func<int>>.Create(target => target.MakeSizeGetter<int>); 473private readonly Func<int>[] _sizeGetters; 489var needed = new List<Func<int>>(); 507var sizeGetter = Utils.MarshalInvoke(_makeSizeGetterMethodInfo, this, rawItemType, info.Index); 555foreach (var getter in _sizeGetters) 578private Func<int> MakeSizeGetter<T>(int col)
Microsoft.NET.Build.Containers (4)
Registry\Registry.cs (4)
79private readonly Func<TimeSpan> _retryDelayProvider; 92internal Registry(string registryName, ILogger logger, IRegistryAPI registryAPI, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null) : 101internal Registry(Uri baseUri, ILogger logger, IRegistryAPI registryAPI, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null) : 109private Registry(Uri baseUri, ILogger logger, RegistryApiFactory factory, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null)
Microsoft.NET.Build.Tasks (4)
ReadableWorkloadManifest.cs (4)
18readonly Func<Stream> _openManifestStreamFunc; 21readonly Func<Stream?> _openLocalizationStream; 23public ReadableWorkloadManifest(string manifestId, string manifestDirectory, string manifestPath, string manifestFeatureBand, string manifestVersion, Func<Stream> openManifestStreamFunc, Func<Stream?> openLocalizationStream)
Microsoft.NET.Sdk.Publish.Tasks (1)
Tasks\ZipDeploy\ZipDeploymentStatus.cs (1)
96private async System.Threading.Tasks.Task RetryAsync(Func<System.Threading.Tasks.Task> func, int retryCount, TimeSpan retryDelay)
Microsoft.NET.Sdk.WorkloadManifestReader (4)
ReadableWorkloadManifest.cs (4)
18readonly Func<Stream> _openManifestStreamFunc; 21readonly Func<Stream?> _openLocalizationStream; 23public ReadableWorkloadManifest(string manifestId, string manifestDirectory, string manifestPath, string manifestFeatureBand, string manifestVersion, Func<Stream> openManifestStreamFunc, Func<Stream?> openLocalizationStream)
Microsoft.NET.Sdk.WorkloadManifestReader.Tests (2)
FakeManifestProvider.cs (2)
61(Func<Stream>)(() => new MemoryStream(m.content)), 62(Func<Stream?>)(() => null)
Microsoft.TemplateEngine.Cli (8)
Commands\FilterOptionDefinition.cs (4)
19internal FilterOptionDefinition(Func<Option> optionFactory) 67internal Func<Option> OptionFactory { get; } 88Func<Option> optionFactory, 124Func<Option> optionFactory,
PostActionDispatcher.cs (2)
44private readonly Func<string> _inputGetter; 51internal PostActionDispatcher(IEngineEnvironmentSettings environment, Func<string> inputGetter)
TemplateInvoker.cs (2)
22private readonly Func<string> _inputGetter; 28Func<string> inputGetter)
Microsoft.VisualBasic.Tests (2)
Microsoft\VisualBasic\MyServices\SpecialDirectoriesProxyTests.cs (2)
25private static void VerifySpecialDirectory(Func<string> getExpected, Func<string> getActual)
Microsoft.VisualStudio.LanguageServices (8)
CallHierarchy\CallHierarchyItem.cs (2)
29private readonly Func<ImageSource> _glyphCreator; 37Func<ImageSource> glyphCreator,
ProjectSystem\VisualStudioWorkspaceImpl.cs (4)
91private ImmutableDictionary<ProjectId, Func<string?>> _projectToRuleSetFilePath = ImmutableDictionary<ProjectId, Func<string?>>.Empty; 188internal void AddProjectRuleSetFileToInternalMaps(ProjectSystemProject project, Func<string?> ruleSetFilePathFunc) 225if (_projectToRuleSetFilePath.TryGetValue(projectId, out var ruleSetPathFunc))
Snippets\AbstractSnippetCommandHandler.cs (1)
103public CommandState GetCommandState(AutomaticLineEnderCommandArgs args, Func<CommandState> nextCommandHandler)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
207public V GetOrAdd(K key, Func<V> creator)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\SnippetCommandHandler.cs (1)
80public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
PersistentStorage\AbstractPersistentStorageTests.cs (1)
907private static void DoSimultaneousReads(Func<Task<string>> read, string expectedValue)
Microsoft.VisualStudio.LanguageServices.Implementation (6)
CodeModel\FileCodeModel.cs (1)
320internal T EnsureEditor<T>(Func<T> action)
Options\AbstractOptionPageControl.cs (4)
83private protected void BindToOption(CheckBox checkbox, Option2<bool?> nullableOptionKey, Func<bool> onNullValue) 114private protected void BindToOption(CheckBox checkbox, PerLanguageOption2<bool?> nullableOptionKey, string languageName, Func<bool> onNullValue) 211private protected void BindToOption<T>(RadioButton radioButton, Option2<T?> nullableOptionKey, T optionValue, Func<bool> onNullValue) where T : struct 301public sealed class RadioButtonCheckedConverter<T>(Func<bool> onNullValue) : IValueConverter
Options\Converters\NullableBoolOptionConverter.cs (1)
12internal sealed class NullableBoolOptionConverter(Func<bool> onNullValue) : IValueConverter
MSBuild (12)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 493private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 494private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 495private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 496private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 498private static Func<bool> s_runningTests = CheckIfRunningTests;
MSBuildTaskHost (12)
BuildEnvironmentHelper.cs (12)
79var possibleLocations = new Func<BuildEnvironment>[] 90foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 493private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 494private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 495private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 496private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 498private static Func<bool> s_runningTests = CheckIfRunningTests;
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
234[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
Mvc.Api.Analyzers.Test (1)
TestFiles\ApiConventionAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForReturnStatementsInLambdas.cs (1)
18Func<IActionResult> someLambda = () =>
netstandard (1)
netstandard.cs (1)
794[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
PresentationCore (6)
System\Windows\Input\Stylus\Common\RawStylusInputReport.cs (2)
66private Func<StylusPointDescription> _stylusPointDescGenerator; 228Func<StylusPointDescription> stylusPointDescGenerator,
System\Windows\Input\Stylus\Common\RawStylusSystemGestureInputReport.cs (1)
88Func<StylusPointDescription> stylusPointDescGenerator,
System\Windows\Input\Stylus\Pointer\PointerInteractionEngine.cs (3)
314(Func<StylusPointDescription>)null, 351(Func<StylusPointDescription>)null, 444(Func<StylusPointDescription>)null,
PresentationFramework (21)
MS\Internal\WindowsRuntime\Generated\Windows.Data.Text.cs (1)
345public WordsSegmenter(string language) : this(((Func<global::MS.Internal.WindowsRuntime.ABI.Windows.Data.Text.IWordsSegmenter>)(() => {
MS\Internal\WindowsRuntime\Generated\Windows.Globalization.cs (1)
97public Language(string languageTag) : this(((Func<global::MS.Internal.WindowsRuntime.ABI.Windows.Globalization.ILanguage>)(() => {
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (10)
48Func<bool> dispose = () => { m.Dispose(); return false; }; 139Func<bool> dispose = () => { m.Dispose(); return false; }; 200Func<bool> dispose = () => 233Func<bool> dispose = () => { DisposeAbiArrayElements((i, data)); return false; }; 454Func<bool> dispose = () => { m.Dispose(); return false; }; 528Func<bool> dispose = () => 564Func<bool> dispose = () => { DisposeAbiArrayElements((i, data)); return false; }; 636Func<bool> dispose = () => { m.Dispose(); return false; }; 688Func<bool> dispose = () => 722Func<bool> dispose = () => { DisposeAbiArrayElements((i, data)); return false; };
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (2)
19private Func<T> _creationDelegate; 21public XamlContextStack(Func<T> creationDelegate)
System\Windows\Documents\MsSpellCheckLib\SpellCheckerFactory\SpellCheckerCreationHelper.cs (1)
104public bool CreateSpellCheckerRetryPreamble(out Func<RCW.ISpellChecker> func)
System\Windows\Documents\MsSpellCheckLib\Utils\RetryHelper.cs (3)
30internal delegate bool RetryFunctionPreamble<TResult>(out Func<TResult> func); 163Func<TResult> func, 225Func<TResult> func,
System\Windows\FrameworkElementFactory.cs (1)
1269private Func<object> _knownTypeFactory;
System\Windows\Markup\Baml2006\WpfKnownType.cs (2)
35private Func<object> _defaultConstructor; 201public Func<object> DefaultConstructor
Roslyn.Diagnostics.Analyzers (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
310Name: nameof(Func<>) or nameof(Action<>),
Roslyn.VisualStudio.DiagnosticsWindow (1)
OptionPages\PerformanceLoggersPage.cs (1)
96private static void SetRoslynLogger<T>(ImmutableArray<string> loggerTypeNames, Func<T> creator) where T : ILogger
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 = () =>
Sample (30)
artifacts\obj\Sample\Release\net10.0\generated\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Microsoft.AspNetCore.Http.RequestDelegateGenerator.RequestDelegateGenerator\GeneratedRouteBuilderExtensions.g.cs (30)
577var handler = Cast(del, global::TodoWithDueDate () => throw null!); 630var castHandler = Cast(handler, global::TodoWithDueDate () => throw null!); 662var handler = Cast(del, global::Triangle () => throw null!); 715var castHandler = Cast(handler, global::Triangle () => throw null!); 747var handler = Cast(del, global::Shape () => throw null!); 800var castHandler = Cast(handler, global::Shape () => throw null!); 831var handler = Cast(del, global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Triangle> () => throw null!); 887var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Triangle> () => throw null!); 918var handler = Cast(del, global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Triangle>, global::Microsoft.AspNetCore.Http.HttpResults.NotFound<global::System.String>> () => throw null!); 974var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Triangle>, global::Microsoft.AspNetCore.Http.HttpResults.NotFound<global::System.String>> () => throw null!); 1005var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult () => throw null!); 1061var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult () => throw null!); 1869var handler = Cast(del, global::System.Collections.Generic.Dictionary<global::System.String, global::System.Int32> () => throw null!); 1922var castHandler = Cast(handler, global::System.Collections.Generic.Dictionary<global::System.String, global::System.Int32> () => throw null!); 1954var handler = Cast(del, global::System.Collections.Immutable.ImmutableDictionary<global::System.String, global::System.Int32> () => throw null!); 2007var castHandler = Cast(handler, global::System.Collections.Immutable.ImmutableDictionary<global::System.String, global::System.Int32> () => throw null!); 3368var handler = Cast(del, global::SchemasEndpointsExtensions.CustomIResultImplementor () => throw null!); 3424var castHandler = Cast(handler, global::SchemasEndpointsExtensions.CustomIResultImplementor () => throw null!); 3824var handler = Cast(del, global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::SchemasEndpointsExtensions.NullableResponseModel> () => throw null!); 3880var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::SchemasEndpointsExtensions.NullableResponseModel> () => throw null!); 3912var handler = Cast(del, global::SchemasEndpointsExtensions.NullableResponseModel? () => throw null!); 3965var castHandler = Cast(handler, global::SchemasEndpointsExtensions.NullableResponseModel? () => throw null!); 4365var handler = Cast(del, global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::SchemasEndpointsExtensions.ModelWithDefaults> () => throw null!); 4421var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::SchemasEndpointsExtensions.ModelWithDefaults> () => throw null!); 4452var handler = Cast(del, global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::SchemasEndpointsExtensions.EnumNullableModel> () => throw null!); 4508var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::SchemasEndpointsExtensions.EnumNullableModel> () => throw null!); 4913var handler = Cast(del, global::System.String[] () => throw null!); 4966var castHandler = Cast(handler, global::System.String[] () => throw null!); 4996var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult () => throw null!); 5052var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult () => throw null!);
ScenarioTests.Common.Tests (1)
ScenarioTestTypes.cs (1)
269public static void Run(Func<Task> asyncMethod)
SimpleWebSiteWithWebApplicationBuilderException (1)
Program.cs (1)
6app.MapGet("/", (Func<string>)(() => "Hello World"));
Sockets.BindTests (2)
src\Servers\Kestrel\shared\test\TestServiceContext.cs (2)
83private readonly Func<MemoryPool<byte>> _memoryPoolFactory; 85public WrappingMemoryPoolFactory(Func<MemoryPool<byte>> memoryPoolFactory)
Sockets.FunctionalTests (6)
src\Servers\Kestrel\shared\test\TestServiceContext.cs (2)
83private readonly Func<MemoryPool<byte>> _memoryPoolFactory; 85public WrappingMemoryPoolFactory(Func<MemoryPool<byte>> memoryPoolFactory)
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (2)
139Func<Task> sendFunc = async () => 232Func<Task> sendFunc = async () =>
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
49public static Dictionary<string, Func<ListenOptions>> ConnectionMiddlewareData { get; } = new Dictionary<string, Func<ListenOptions>>
Swaggatherer (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
System.ComponentModel.Annotations (5)
System\ComponentModel\DataAnnotations\LocalizableString.cs (1)
18private Func<string?>? _cachedResult;
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (4)
27private Func<string>? _errorMessageResourceAccessor; 64/// <param name="errorMessageAccessor">The <see cref="Func{T}" /> that will return an error message.</param> 65protected ValidationAttribute(Func<string> errorMessageAccessor) 102private protected Func<string> ErrorMessageResourceAccessor
System.ComponentModel.Composition (16)
System\ComponentModel\Composition\ExportFactoryOfT.cs (2)
8private readonly Func<Tuple<T, Action>> _exportLifetimeContextCreator; 10public ExportFactory(Func<Tuple<T, Action>> exportLifetimeContextCreator)
System\ComponentModel\Composition\ExportFactoryOfTTMetadata.cs (1)
10public ExportFactory(Func<Tuple<T, Action>> exportLifetimeContextCreator, TMetadata metadata)
System\ComponentModel\Composition\ExportServices.DisposableLazy.cs (2)
14public DisposableLazy(Func<T> valueFactory, TMetadataView metadataView, IDisposable disposable, LazyThreadSafetyMode mode) 32public DisposableLazy(Func<T> valueFactory, IDisposable disposable, LazyThreadSafetyMode mode)
System\ComponentModel\Composition\Primitives\Export.cs (7)
19private readonly Func<object?>? _exportedValueGetter; 45/// A <see cref="Func{T}"/> that is called to create the exported value of the 58public Export(string contractName, Func<object?> exportedValueGetter) 78/// A <see cref="Func{T}"/> that is called to create the exported value of the 91public Export(string contractName, IDictionary<string, object?>? metadata, Func<object?> exportedValueGetter) 105/// A <see cref="Func{T}"/> that is called to create the exported value of the 115public Export(ExportDefinition definition, Func<object?> exportedValueGetter)
System\ComponentModel\Composition\ReflectionModel\ExportfactoryCreator.cs (2)
49Func<Tuple<T, Action>> exportLifetimeContextCreator = () => LifetimeContext.GetExportLifetimeContextFromExport<T>(export); 62Func<Tuple<T, Action>> exportLifetimeContextCreator = () => LifetimeContext.GetExportLifetimeContextFromExport<T>(export);
System\ComponentModel\Composition\ReflectionModel\LazyMemberInfo.cs (2)
15private readonly Func<MemberInfo[]>? _accessorsCreator; 61public LazyMemberInfo(MemberTypes memberType, Func<MemberInfo[]> accessorsCreator)
System.Composition.Hosting (3)
System\Composition\Hosting\Core\ExportDescriptorPromise.cs (1)
40Func<IEnumerable<CompositionDependency>> dependencies,
System\Composition\Hosting\Core\ExportDescriptorProvider.cs (1)
31protected static readonly Func<IEnumerable<CompositionDependency>> NoDependencies = Enumerable.Empty<CompositionDependency>;
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
18private static readonly Func<CompositionDependency[]> s_noDependencies = () => s_noDependenciesValue;
System.Composition.Runtime (3)
System\Composition\ExportFactoryOfT.cs (2)
12private readonly Func<Tuple<T, Action>> _exportLifetimeContextCreator; 18public ExportFactory(Func<Tuple<T, Action>> exportCreator)
System\Composition\ExportFactoryOfTTMetadata.cs (1)
18public ExportFactory(Func<Tuple<T, Action>> exportCreator, TMetadata metadata)
System.Configuration.ConfigurationManager (1)
System\Configuration\ConfigurationFileMap.cs (1)
18private Func<string> _getFilenameThunk;
System.Core (1)
System.Core.cs (1)
84[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
System.Diagnostics.DiagnosticSource (53)
System\Diagnostics\Activity.cs (2)
1013public static Func<ActivityTraceId>? TraceIdGenerator { get; set; } 1289Func<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)
266public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 280public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 294public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 308public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 321public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 335public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 348public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 362public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 375public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 389public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 403public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 417public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 427public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 438public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 448public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 459public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 469public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 480public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 544private Instrument GetOrCreateInstrument<T>(Type instrumentType, string name, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags, Func<Instrument> instrumentCreator)
System\Diagnostics\Metrics\ObservableCounter.cs (6)
20internal ObservableCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 24internal ObservableCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 30internal ObservableCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 34internal ObservableCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 40internal ObservableCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description) : this(meter, name, observeValues, unit, description, tags: null) 44internal ObservableCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags)
System\Diagnostics\Metrics\ObservableGauge.cs (6)
20internal ObservableGauge(Meter meter, string name, Func<T> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 24internal ObservableGauge(Meter meter, string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 30internal ObservableGauge(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 34internal ObservableGauge(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 40internal ObservableGauge(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description) : this(meter, name, observeValues, unit, description, tags: null) 44internal ObservableGauge(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags)
System\Diagnostics\Metrics\ObservableInstrument.cs (3)
74if (callback is Func<T> valueOnlyFunc) 79if (callback is Func<Measurement<T>> measurementOnlyFunc) 84if (callback is Func<IEnumerable<Measurement<T>>> listOfMeasurementsFunc)
System\Diagnostics\Metrics\ObservableUpDownCounter.cs (6)
20internal ObservableUpDownCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 24internal ObservableUpDownCounter(Meter meter, string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 30internal ObservableUpDownCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description) : this(meter, name, observeValue, unit, description, tags: null) 34internal ObservableUpDownCounter(Meter meter, string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags) 40internal ObservableUpDownCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description) : this(meter, name, observeValues, unit, description, tags: null) 44internal ObservableUpDownCounter(Meter meter, string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) : base(meter, name, unit, description, tags)
System.Drawing.Common.Tests (12)
System\Drawing\BrushesTests.cs (2)
153public static object[] Brush(Func<Brush> getBrush, Color expectedColor) => [getBrush, expectedColor]; 157public void Brushes_Get_ReturnsExpected(Func<Brush> getBrush, Color expectedColor)
System\Drawing\PensTests.cs (2)
155public static object[] Pen(Func<Pen> getPen, Color expectedColor) => [getPen, expectedColor]; 159public void Pens_Get_ReturnsExpected(Func<Pen> getPen, Color expectedColor)
System\Drawing\SystemBrushesTests.cs (2)
45public static object[] Brush(Func<Brush> getBrush, Color expectedColor) => [getBrush, expectedColor]; 49public void SystemBrushes_Get_ReturnsExpected(Func<Brush> getBrush, Color expectedColor)
System\Drawing\SystemFontsTests.cs (2)
22public void SystemFont_Get_ReturnsExpected(Func<Font> getFont) 75public void SystemFont_Get_ReturnsExpected_WindowsNames(Func<Font> getFont, string systemFontName, string windowsFontName)
System\Drawing\SystemIconsTests.cs (2)
22public static object[] Icon(Func<Icon> getIcon) => [getIcon]; 26public void SystemIcons_Get_ReturnsExpected(Func<Icon> getIcon)
System\Drawing\SystemPensTest.cs (2)
47public static object[] Pen(Func<Pen> getPen, Color expectedColor) => [getPen, expectedColor]; 51public void SystemPens_Get_ReturnsExpected(Func<Pen> getPen, Color expectedColor)
System.Linq.Expressions (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\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System.Net.Security (2)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System.Private.CoreLib (69)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (8)
1675Func<EventSource?> eventSourceFactory = () => this; 2487public OverrideEventProvider(Func<EventSource?> eventSourceFactory, EventProviderType providerType) 2501private readonly Func<EventSource?> _eventSourceFactory; 3917private static List<Func<EventSource?>> s_preregisteredEventSourceFactories = new List<Func<EventSource?>>(); 3935internal static unsafe void PreregisterEventProviders(Guid id, string name, Func<EventSource?> eventSourceFactory) 3998Func<EventSource?>[] factories; 4004foreach (Func<EventSource?> factory in factories)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\IncrementingPollingCounter.cs (2)
30public IncrementingPollingCounter(string name, EventSource eventSource, Func<double> totalValueProvider) : base(name, eventSource) 43private readonly Func<double> _totalValueProvider;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\PollingCounter.cs (2)
29public PollingCounter(string name, EventSource eventSource, Func<double> metricProvider) : base(name, eventSource) 39private readonly Func<double> _metricProvider;
src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (3)
16private readonly Func<bool>? _callback0; 20private Gen2GcCallback(Func<bool> callback) 35public static void Register(Func<bool> callback)
src\libraries\System.Private.CoreLib\src\System\Lazy.cs (10)
195private Func<T>? _factory; 230/// The <see cref="Func{T}"/> invoked to produce the lazily-initialized value when it is 238public Lazy(Func<T> valueFactory) 270/// The <see cref="Func{T}"/> invoked to produce the lazily-initialized value when it is needed. 276public Lazy(Func<T> valueFactory, bool isThreadSafe) : 286/// The <see cref="Func{T}"/> invoked to produce the lazily-initialized value when it is needed. 292public Lazy(Func<T> valueFactory, LazyThreadSafetyMode mode) 297private Lazy(Func<T>? valueFactory, LazyThreadSafetyMode mode, bool useDefaultConstructor) 318Func<T> factory = _factory ?? throw new InvalidOperationException(SR.Lazy_Value_RecursiveCallsToValue); 369Func<T>? factory = _factory;
src\libraries\System.Private.CoreLib\src\System\LazyOfTTMetadata.cs (3)
13public Lazy(Func<T> valueFactory, TMetadata metadata) : 32public Lazy(Func<T> valueFactory, TMetadata metadata, bool isThreadSafe) : 44public Lazy(Func<T> valueFactory, TMetadata metadata, LazyThreadSafetyMode mode) :
src\libraries\System.Private.CoreLib\src\System\Threading\LazyInitializer.cs (11)
81/// <param name="valueFactory">The <see cref="Func{T}"/> invoked to initialize the 102public static T EnsureInitialized<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class => 112private static T EnsureInitializedCore<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 190/// <param name="valueFactory">The <see cref="Func{T}"/> invoked to initialize the 193public static T EnsureInitialized<T>([AllowNull] ref T target, ref bool initialized, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory) 214/// The <see cref="Func{T}"/> to invoke in order to produce the lazily-initialized value. 217private static T EnsureInitializedCore<T>([AllowNull] ref T target, ref bool initialized, [NotNull] ref object? syncLock, Func<T> valueFactory) 240/// <param name="valueFactory">The <see cref="Func{T}"/> invoked to initialize the reference.</param> 242public static T EnsureInitialized<T>([NotNull] ref T? target, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory) where T : class => 254/// The <see cref="Func{T}"/> to invoke in order to produce the lazily-initialized value. 257private static T EnsureInitializedCore<T>([NotNull] ref T? target, [NotNull] ref object? syncLock, Func<T> valueFactory) where T : class
src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (3)
260public static void SpinUntil(Func<bool> condition) 283public static bool SpinUntil(Func<bool> condition, TimeSpan timeout) 307public static bool SpinUntil(Func<bool> condition, int millisecondsTimeout)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (7)
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\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (4)
256public Task<TResult> StartNew(Func<TResult> function) 283public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken) 312public Task<TResult> StartNew(Func<TResult> function, TaskCreationOptions creationOptions) 352public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (6)
5561public static Task<TResult> Run<TResult>(Func<TResult> function) 5579public static Task<TResult> Run<TResult>(Func<TResult> function, CancellationToken cancellationToken) 5594public static Task Run(Func<Task?> function) 5612public static Task Run(Func<Task?> function, CancellationToken cancellationToken) 5640public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function) 5656public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (4)
520public Task<TResult> StartNew<TResult>(Func<TResult> function) 551public Task<TResult> StartNew<TResult>(Func<TResult> function, CancellationToken cancellationToken) 583public Task<TResult> StartNew<TResult>(Func<TResult> function, TaskCreationOptions creationOptions) 626public Task<TResult> StartNew<TResult>(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (6)
31private Func<T>? _valueFactory; 90/// The <see cref="Func{T}"/> invoked to produce a lazily-initialized value when 96public ThreadLocal(Func<T> valueFactory) 108/// The <see cref="Func{T}"/> invoked to produce a lazily-initialized value when 115public ThreadLocal(Func<T> valueFactory, bool trackAllValues) 122private void Initialize(Func<T>? valueFactory, bool trackAllValues)
System.Private.DataContractSerialization (5)
System\Runtime\Serialization\AccessorBuilder.cs (3)
32public static Func<object> GetMakeNewInstanceFunc( 36Func<object> make = s_make.MakeGenericMethod(type).CreateDelegate<Func<object>>();
System\Runtime\Serialization\ClassDataContract.cs (2)
155private Func<object>? _makeNewInstance; 159private Func<object> MakeNewInstance => _makeNewInstance ??= FastInvokerBuilder.GetMakeNewInstanceFunc(UnderlyingType);
System.Private.Windows.Core.TestUtilities (1)
AppContextSwitchScope.cs (1)
25public AppContextSwitchScope(string switchName, Func<bool>? getDefaultValue, bool enable)
System.Private.Xml (3)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (3)
1456Func<object?> getSource = () => GetMemberValue(o, member.Mapping.MemberInfo!); 1462private object? WriteAddCollectionFixup(Func<object?> getSource, Action<object?> setSource, object memberValue, TypeDesc typeDesc, bool readOnly) 2091public Func<object?>? GetSource;
System.Reflection.Metadata (3)
System\Reflection\Internal\Utilities\ObjectPool`1.cs (3)
38private readonly Func<T> _factory; 41internal ObjectPool(Func<T> factory) 45internal ObjectPool(Func<T> factory, int size)
System.Reflection.MetadataLoadContext (5)
System\Reflection\TypeLoading\CustomAttributes\CustomAttributeHelpers.cs (2)
86public static CustomAttributeData? TryComputeMarshalAsCustomAttributeData(Func<MarshalAsAttribute> marshalAsAttributeComputer, MetadataLoadContext loader) 102Func<CustomAttributeArguments> argumentsPromise =
System\Reflection\TypeLoading\CustomAttributes\RoPseudoCustomAttributeData.cs (2)
11private readonly Func<CustomAttributeArguments>? _argumentsPromise; 19internal RoPseudoCustomAttributeData(ConstructorInfo constructor, Func<CustomAttributeArguments> argumentsPromise)
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.DllImport.cs (1)
31Func<CustomAttributeArguments> argumentsPromise =
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
193[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
System.Runtime.InteropServices.JavaScript (2)
artifacts\obj\System.Runtime.InteropServices.JavaScript\Debug\net10.0\System.Runtime.InteropServices.JavaScript.notsupported.cs (2)
290public void ToManaged<TResult>(out Func<TResult>? value, ArgumentToManagedCallback<TResult> resMarshaler) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 291public void ToJS<TResult>(Func<TResult>? value, ArgumentToJSCallback<TResult> resMarshaler) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); }
System.Security.Claims (2)
System\Security\Claims\ClaimsPrincipal.cs (2)
31private static Func<ClaimsPrincipal?>? s_principalSelector; 81public static Func<ClaimsPrincipal?>? ClaimsPrincipalSelector
System.Security.Cryptography (5)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (2)
1901private static TAlg CreateAndImport<TAlg>(ReadOnlySpan<char> keyPem, Func<TAlg> factory) where TAlg : AsymmetricAlgorithm 1911Func<TAlg> factory) where TAlg : AsymmetricAlgorithm
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (1)
704internal AsymmetricAlgorithmPkcs12PrivateKey(ReadOnlySpan<byte> pkcs8, Func<AsymmetricAlgorithm> factory)
System.Security.Principal.Windows (3)
artifacts\obj\System.Security.Principal.Windows\Debug\net10.0\System.Security.Principal.Windows.notsupported.cs (3)
269public static System.Threading.Tasks.Task RunImpersonatedAsync(Microsoft.Win32.SafeHandles.SafeAccessTokenHandle safeAccessTokenHandle, System.Func<System.Threading.Tasks.Task> func) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } 270public static System.Threading.Tasks.Task<T> RunImpersonatedAsync<T>(Microsoft.Win32.SafeHandles.SafeAccessTokenHandle safeAccessTokenHandle, System.Func<System.Threading.Tasks.Task<T>> func) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); } 271public static T RunImpersonated<T>(Microsoft.Win32.SafeHandles.SafeAccessTokenHandle safeAccessTokenHandle, System.Func<T> func) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); }
System.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)
68Func<object>? createObject = DetermineCreateObjectDelegate(type, converter); 451private static Func<object>? DetermineCreateObjectDelegate(Type type, JsonConverter converter)
System\Text\Json\Serialization\Metadata\JsonCollectionInfoValuesOfTCollection.cs (2)
17/// A <see cref="Func{TResult}"/> to create an instance of the collection when deserializing. 20public Func<TCollection>? ObjectCreator { get; init; }
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (1)
116private static void PopulateParameterInfoValues(JsonTypeInfo typeInfo, Func<JsonParameterInfoValues[]?>? paramFactory)
System\Text\Json\Serialization\Metadata\JsonObjectInfoValuesOfT.cs (3)
21public Func<T>? ObjectCreator { get; init; } 39public Func<JsonParameterInfoValues[]>? ConstructorParameterMetadataInitializer { get; init; } 44public Func<ICustomAttributeProvider>? ConstructorAttributeProviderFactory { get; init; }
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (2)
168Func<ICustomAttributeProvider>? attributeProviderFactory = Volatile.Read(ref AttributeProviderFactory); 190internal Func<ICustomAttributeProvider>? AttributeProviderFactory;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs (1)
89public Func<ICustomAttributeProvider>? AttributeProviderFactory { get; init; }
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (5)
93public Func<object>? CreateObject 103private protected Func<object>? _createObject; 105internal Func<object>? CreateObjectForExtensionDataProperty { get; set; } 647Func<ICustomAttributeProvider>? ctorAttrProviderFactory = Volatile.Read(ref ConstructorAttributeProviderFactory); 669internal Func<ICustomAttributeProvider>? ConstructorAttributeProviderFactory;
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (10)
17private Func<T>? _typedCreateObject; 49public new Func<T>? CreateObject 60Debug.Assert(createObject is null or Func<object> or Func<T>); 78Func<object>? untypedCreateObject; 79Func<T>? typedCreateObject; 86else if (createObject is Func<T> typedDelegate) 89untypedCreateObject = createObject is Func<object> untypedDelegate ? untypedDelegate : () => typedDelegate()!; 93Debug.Assert(createObject is Func<object>); 94untypedCreateObject = (Func<object>)createObject;
System\Text\Json\Serialization\Metadata\MemberAccessor.cs (1)
12public abstract Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo);
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.cs (1)
31public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? ctorInfo) =>
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (2)
21public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo) 68return CreateDelegate<Func<object>>(dynamicMethod);
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (1)
19public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? ctorInfo)
System.Text.RegularExpressions (1)
System\Threading\StackHelper.cs (1)
121public static TResult CallOnEmptyStack<TResult>(Func<TResult> func) =>
System.Text.RegularExpressions.Generator (1)
src\libraries\System.Text.RegularExpressions\src\System\Threading\StackHelper.cs (1)
121public static TResult CallOnEmptyStack<TResult>(Func<TResult> func) =>
System.Threading.Tasks.Dataflow (1)
Internal\Common.cs (1)
596internal static readonly Func<T> DefaultTResultFunc = static () => default(T)!;
System.Threading.Tasks.Parallel (17)
System\Threading\Tasks\Parallel.cs (17)
692Func<TLocal> localInit, 745Func<TLocal> localInit, 809Func<TLocal> localInit, 874Func<TLocal> localInit, 920Func<TLocal>? localInit, Action<TLocal>? localFinally) 1416public static ParallelLoopResult ForEach<TSource, TLocal>(IEnumerable<TSource> source, Func<TLocal> localInit, 1481ParallelOptions parallelOptions, Func<TLocal> localInit, 1535public static ParallelLoopResult ForEach<TSource, TLocal>(IEnumerable<TSource> source, Func<TLocal> localInit, 1599public static ParallelLoopResult ForEach<TSource, TLocal>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TLocal> localInit, 1643Func<TLocal>? localInit, Action<TLocal>? localFinally) 1701Func<TLocal>? localInit, Action<TLocal>? localFinally) 1760Func<TLocal>? localInit, Action<TLocal>? localFinally) 2022Func<TLocal> localInit, 2100Func<TLocal> localInit, 2396Func<TLocal> localInit, 2487Func<TLocal> localInit, 2514Func<TLocal>? localInit,
System.Windows.Controls.Ribbon (4)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (4)
1013Func<bool> getter, 1177Func<bool> getter, 1220Func<bool> getter, 1245object sender, KeyEventArgs e, Func<bool> gettor, Action<bool> settor, UIElement targetFocusOnFalse, UIElement targetFocusContainerOnTrue)
System.Windows.Forms (4)
System\Windows\Forms\Control.cs (1)
6077public T Invoke<T>(Func<T> method) => (T)Invoke(method, null);
System\Windows\Forms\Control_InvokeAsync.cs (3)
175public async Task<T> InvokeAsync<T>(Func<T> callback, CancellationToken cancellationToken = default) 254/// <see cref="InvokeAsync{T}(Func{T}, CancellationToken)"/>. 359/// <see cref="InvokeAsync{T}(Func{T}, CancellationToken)"/>.
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\CommandSet.cs (1)
424private static bool ExecuteSafely<T>(Func<T> func, bool throwOnException, [MaybeNullWhen(false)] out T result)
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Internals\ScaleHelper.cs (1)
516public static T InvokeInSystemAwareContext<T>(Func<T> func)
System.Windows.Forms.Primitives.Tests (4)
Interop\Oleaut32\SAFEARRAYTests.cs (1)
131public Func<(Guid, HRESULT)> GetGuidAction { get; set; }
Interop\Oleaut32\VARIANTTests.cs (1)
5698public Func<(Guid, HRESULT)> GetGuidAction { get; set; }
Interop\User32\GetWindowTextTests.cs (2)
45public Func<string>? BeforeGetTextLengthCallback 51public Func<string>? BeforeGetTextCallback
System.Windows.Forms.Primitives.TestUtilities (5)
Extensions\AssertExtensions.cs (5)
58public static void Throws<T>(string netCoreParamName, string netFxParamName, Func<object> testCode) 94public static TException Throws<TException, TResult>(Func<TResult> func) 128public static T Throws<T>(string expectedParamName, Func<object> testCode) 138public static async Task<T> ThrowsAsync<T>(string expectedParamName, Func<Task> testCode) 271public static async Task CanceledAsync(CancellationToken cancellationToken, Func<Task> testCode)
System.Windows.Forms.Tests (27)
System\Windows\Forms\CursorsTests.cs (4)
17static Func<Cursor> I(Func<Cursor> factory) => factory; 51public void Cursors_KnownCursor_Get_ReturnsExpected(Func<Cursor> getCursor) 77public void Cursors_ToString_KnownCursor_ReturnsExpected(Func<Cursor> getCursor)
System\Windows\Forms\ListViewTests.cs (6)
801foreach (Func<ImageList> imageListFactory in new Func<ImageList>[] { () => new ImageList(), () => null }) 907foreach (Func<ImageList> imageListFactory in new Func<ImageList>[] { () => new ImageList(), () => null }) 941foreach (Func<ImageList> imageListFactory in new Func<ImageList>[] { () => new ImageList(), () => null })
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (1)
134Func<SelectionRange> func = () => (SelectionRange)_converter.CreateInstance(null, propertyValues);
System\Windows\Forms\MonthCalendarTests.cs (1)
4527private void ShouldSerializeProperty(Func<bool> shouldSerializeFunc, Action setPropertyAction)
System\Windows\Forms\ProfessionalColorsTests.cs (4)
14static Func<T> I<T>(Func<T> t) => t; 75public void ProfessionalColors_Properties_Get_ReturnsExpected(Func<Color> factory) 83public void ProfessionalColors_Properties_GetToolStripManagerVisualStylesEnabled_ReturnsExpected(Func<Color> factory)
System\Windows\Forms\ProgressBarRendererTest.cs (1)
79private void TestChunkProperty(Func<int> propertyGetter, VisualStyleElement styleElement, int expectedValue)
System\Windows\Forms\ScrollableControlTests.cs (6)
1570Func<Control> controlFactory = () => new Control 1574Func<TabPage> tabPageFactory = () => new TabPage 1578foreach (Func<Control> parentFactory in new Func<Control>[] { controlFactory, tabPageFactory }) 1618foreach (Func<Control> parentFactory in new Func<Control>[] { CreateControl, CreateTabPage })
System\Windows\Forms\UnsupportedTypesTests.cs (1)
68((Func<bool>)(() => TestDataGridColumnStyle.Call_DGEditColumnEditing())).Should().Throw<PlatformNotSupportedException>();
System\Windows\Forms\VisualStyles\VisualStyleElementTests.cs (3)
36static Func<VisualStyleElement> I(Func<VisualStyleElement> factory) => factory; 652public void VisualStyleElement_KnownElements_Get_ReturnsExpected(Func<VisualStyleElement> elementFactory, string expectedClassName, int expectedPart, int expectedState)
System.Windows.Forms.UI.IntegrationTests (6)
Infra\ControlTestBase.cs (4)
234protected async Task RunSingleControlTestAsync<T>(Func<Form, T, Task> testDriverAsync, Func<T> createControl, Func<Form>? createForm = null) 291protected async Task RunFormAsync<T>(Func<(Form dialog, T control)> createDialog, Func<Form, T, Task> testDriverAsync) 337protected async Task RunFormWithoutControlAsync<TForm>(Func<TForm> createForm, Func<TForm, Task> testDriverAsync)
Infra\SendInput.cs (2)
12private readonly Func<Task> _waitForIdleAsync; 14public SendInput(Func<Task> waitForIdleAsync)
System.Windows.Input.Manipulations (7)
System\Windows\Input\Manipulations\InertiaParameters2D.cs (1)
27internal void ProtectedChangeProperty(Func<bool> isEqual, Action setNewValue, string paramName)
System\Windows\Input\Manipulations\Lazy.cs (2)
17private Func<T> getValue; 29public Lazy(Func<T> getValue)
System\Windows\Input\Manipulations\ManipulationVelocities2D.cs (4)
104Func<float> getLinearVelocityX, 105Func<float> getLinearVelocityY, 106Func<float> getAngularVelocity, 107Func<float> getExpansionVelocity)
System.Xaml (4)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (2)
19private Func<T> _creationDelegate; 21public XamlContextStack(Func<T> creationDelegate)
System\Xaml\Schema\BuiltInValueConverter.cs (2)
17private Func<TConverterBase> _factory; 19internal BuiltInValueConverter(Type converterType, Func<TConverterBase> factory)
System.Xaml.Tests (2)
Common\Optional.cs (1)
14public readonly T Or(Func<T> valueFactory) => HasValue ? Value : valueFactory();
System\Xaml\Replacements\EventConverterTests.cs (1)
226public Func<Type>? GetDestinationTypeAction { get; set; }
Templates.Blazor.Tests (8)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
Templates.Blazor.WebAssembly.Auth.Tests (22)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
src\Shared\E2ETesting\WaitAssert.cs (14)
26public static void Equal<T>(this IWebDriver driver, T expected, Func<T> actual) 29public static void NotEqual<T>(this IWebDriver driver, T expected, Func<T> actual) 32public static void True(this IWebDriver driver, Func<bool> actual) 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 40public static void True(this IWebDriver driver, Func<bool> actual, string message) 43public static void False(this IWebDriver driver, Func<bool> actual, string message) 46public static void False(this IWebDriver driver, Func<bool> actual) 49public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 52public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 55public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 58public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 64public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 94private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Templates.Blazor.WebAssembly.Tests (22)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
src\Shared\E2ETesting\WaitAssert.cs (14)
26public static void Equal<T>(this IWebDriver driver, T expected, Func<T> actual) 29public static void NotEqual<T>(this IWebDriver driver, T expected, Func<T> actual) 32public static void True(this IWebDriver driver, Func<bool> actual) 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 40public static void True(this IWebDriver driver, Func<bool> actual, string message) 43public static void False(this IWebDriver driver, Func<bool> actual, string message) 46public static void False(this IWebDriver driver, Func<bool> actual) 49public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 52public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 55public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 58public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 64public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 94private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Templates.Mvc.Tests (22)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
src\Shared\E2ETesting\WaitAssert.cs (14)
26public static void Equal<T>(this IWebDriver driver, T expected, Func<T> actual) 29public static void NotEqual<T>(this IWebDriver driver, T expected, Func<T> actual) 32public static void True(this IWebDriver driver, Func<bool> actual) 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 40public static void True(this IWebDriver driver, Func<bool> actual, string message) 43public static void False(this IWebDriver driver, Func<bool> actual, string message) 46public static void False(this IWebDriver driver, Func<bool> actual) 49public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 52public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 55public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 58public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 64public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 94private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Templates.Tests (22)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
257internal Task<HttpResponseMessage> SendRequest(Func<HttpRequestMessage> requestFactory)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
src\Shared\E2ETesting\WaitAssert.cs (14)
26public static void Equal<T>(this IWebDriver driver, T expected, Func<T> actual) 29public static void NotEqual<T>(this IWebDriver driver, T expected, Func<T> actual) 32public static void True(this IWebDriver driver, Func<bool> actual) 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 40public static void True(this IWebDriver driver, Func<bool> actual, string message) 43public static void False(this IWebDriver driver, Func<bool> actual, string message) 46public static void False(this IWebDriver driver, Func<bool> actual) 49public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 52public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 55public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 58public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 64public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 94private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Text.Analyzers (19)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (1)
47Func<TValue> getValue)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (2)
317public static T RethrowExceptionsAsIOException<T>(Func<T> operation) 334public static Task<T> RethrowExceptionsAsIOExceptionAsync<T>(Func<Task<T>> operation)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (3)
33public static T Initialize<T>([NotNull] ref T? target, Func<T> valueFactory) where T : class 85public static T? Initialize<T>([NotNull] ref StrongBox<T?>? target, Func<T?> valueFactory) 170public static ImmutableArray<T> Initialize<T>(ref ImmutableArray<T> target, Func<ImmutableArray<T>> createArray)
src\Dependencies\PooledObjects\PooledDelegates.cs (6)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (2)
71public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug) 174public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (3)
20public static LogMessage Create(Func<string> messageGetter, LogLevel logLevel) 95private Func<string>? _messageGetter; 97public static LogMessage Construct(Func<string> messageGetter, LogLevel logLevel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (1)
67public static readonly Func<NonReentrantLock> Factory = () => new NonReentrantLock(useThisInstanceForSynchronization: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SemaphoreSlimFactory.cs (1)
18public static readonly Func<SemaphoreSlim> Instance = () => new SemaphoreSlim(initialCount: 1);
UnitTests.Common (11)
IMockCommunicationObject.cs (2)
15Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 16Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockChannelBase.cs (3)
49public Func<EndpointAddress> GetEndpointPropertyOverride { get; set; } 55public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 56public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockChannelFactory.cs (2)
54public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 55public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockCommunicationObject.cs (2)
50public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 51public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockTransportBindingElement.cs (1)
16public Func<String> SchemePropertyOverride { get; set; }
TestTypes.cs (1)
337public static void Run(Func<Task> asyncMethod)
VBCSCompiler (1)
src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (1)
165Func<BuildResponse> func = () =>
VBCSCompiler.UnitTests (5)
CompilerServerTests.cs (1)
122Func<T> func)
TestableClientConnectionHost.cs (4)
18private readonly Queue<Func<Task<IClientConnection>>> _waitingTasks = new Queue<Func<Task<IClientConnection>>>(); 47Func<Task<IClientConnection>>? func = null; 66public void Add(Func<Task<IClientConnection>> func)
Wasm.Performance.ConsoleHost (10)
NullDispatcher.cs (3)
21public override Task InvokeAsync(Func<Task> workItem) 24public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 27public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
Wasm.Performance.TestApp (2)
Pages_PersonDisplay_razor.g.cs (2)
176__builder2.AddComponentParameter(25, nameof(global::Microsoft.AspNetCore.Components.Forms.InputCheckbox.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<global::System.Boolean>>>(() => Person.IsAdmin)); 311public static void CreateInputNumber_0<[global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(unchecked((global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes)0xffffffff))] TValue>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, TValue __arg0, int __seq1, global::Microsoft.AspNetCore.Components.EventCallback<TValue> __arg1, int __seq2, global::System.Linq.Expressions.Expression<global::System.Func<TValue>> __arg2)
WindowsBase.Tests (4)
Helpers.cs (1)
40public static T ExecuteOnDifferentThread<T>(Func<T> action, ApartmentState? state = null)
System\Windows\FreezableTests.cs (2)
7278public Func<Freezable>? CreateInstanceCoreAction { get; set; } 7344public Func<Freezable>? CreateInstanceCoreAction { get; set; }
System\Windows\WeakEventManagerTests.cs (1)
6047public Func<ListenerList>? CloneAction { get; set; }
XmlFileLogger (1)
LogProcessNode.cs (1)
158protected void WriteChildren<T>(XElement parentElement, Func<XElement> subNodeFactory) where T : ILogNode
xunit.assert (21)
EventAsserts.cs (3)
77 Func<Task> testCode) 102 Func<Task> testCode) 145 Func<Task> testCode)
ExceptionAsserts.cs (11)
40 public static T Throws<T>(Func<object?> testCode) 50 public static T Throws<T>(Func<Task> testCode) 74 public static async Task<T> ThrowsAsync<T>(Func<Task> testCode) 111 public static T ThrowsAny<T>(Func<object?> testCode) 125 public static async Task<T> ThrowsAnyAsync<T>(Func<Task> testCode) 165 Func<object?> testCode) => 176 Func<Task> testCode) 202 Func<Task> testCode) => 290 Func<object?> testCode) 311 Func<Task> testCode) 348 Func<Task> testCode)
PropertyAsserts.cs (2)
60 Func<Task> testCode) 76 Func<Task> testCode)
Record.cs (3)
49 protected static Exception? RecordException(Func<object?> testCode) 75 protected static Exception RecordException(Func<Task> testCode) 104 protected static async Task<Exception?> RecordExceptionAsync(Func<Task> testCode)
Sdk\ArgumentFormatter.cs (1)
397 Func<object?> getter,
Sdk\AssertEqualityComparer.cs (1)
26 readonly Func<IEqualityComparer> innerComparerFactory;
xunit.console (3)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (2)
19private readonly Func<IDependencyContextReader> _jsonReaderFactory; 33Func<IDependencyContextReader> jsonReaderFactory)
common\DictionaryExtensions.cs (1)
18public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TValue> newValue)