1240 references to Func
Client.ClientBase.IntegrationTests (1)
MessageInspectorTestHelpers.cs (1)
49public TResult Call<TResult>(Func<TResult> action) where TResult : class
Client.ExpectedExceptions.IntegrationTests (2)
ExpectedExceptionTests.4.0.0.cs (1)
295Func<string> callFunc = () =>
ExpectedExceptionTests.4.1.0.cs (1)
545Func<string> callFunc = () =>
ClientSample (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
DefaultBuilder.SampleApp (1)
Program.cs (1)
15app.MapGet("/", (Func<string>)(() => "Hello, World!"));
dotnet-dev-certs (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-getdocument (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-openapi (8)
Commands\BaseCommand.cs (1)
298Func<Task<IHttpResponseMessageWrapper>> retryBlock,
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-sql-cache (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-svcutil-lib (17)
FrameworkFork\Microsoft.Xml\Xml\AsyncHelper.cs (6)
65public static Task CallTaskFuncWhenFinish(this Task task, Func<Task> func) 77private static async Task _CallTaskFuncWhenFinish(Task task, Func<Task> func) 83public static Task<bool> CallBoolTaskFuncWhenFinish(this Task task, Func<Task<bool>> func) 95private static async Task<bool> _CallBoolTaskFuncWhenFinish(this Task task, Func<Task<bool>> func) 101public static Task<bool> ContinueBoolTaskFuncWhenFalse(this Task<bool> task, Func<Task<bool>> func) 116private static async Task<bool> _ContinueBoolTaskFuncWhenFalse(Task<bool> task, Func<Task<bool>> func)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InputQueue.cs (3)
38public InputQueue(Func<Action<AsyncCallback, IAsyncResult>> asyncCallbackGenerator) 64private Func<Action<AsyncCallback, IAsyncResult>> AsyncCallbackGenerator 356public void Shutdown(Func<Exception> pendingExceptionGenerator)
FrameworkFork\System.ServiceModel\System\IdentityModel\CryptoHelper.cs (2)
16private static Dictionary<string, Func<object>> s_algorithmDelegateDictionary = new Dictionary<string, Func<object>>();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (3)
26private Func<IEnumerable<DelegatingHandler>> _handlerFunc; 92public HttpMessageHandlerFactory(Func<IEnumerable<DelegatingHandler>> handlers) 194private static string GetFuncDetails(Func<IEnumerable<DelegatingHandler>> func)
Shared\Options\OptionValueParser.cs (1)
246public static object CreateValue<TValue>(Func<object> GetValueFunc, OptionBase option, object originalValue)
Shared\Utilities\AsyncHelper.cs (2)
38public static async Task<T> RunAsync<T>(Func<T> func, CancellationToken cancellationToken) 43public static async Task<T> RunAsync<T>(Func<T> func, Action onCancellation, CancellationToken cancellationToken)
dotnet-user-jwts (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
dotnet-user-secrets (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
ExceptionHandlerSample (1)
StartupWithWebSocket.cs (1)
25app.Use(async (HttpContext context, Func<Task> next) =>
GetDocument.Insider (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
IIS.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.LongTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.NewHandler.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.NewShim.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IIS.ShadowCopy.Tests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
131public static Task Retry(Func<Task> func, TimeSpan maxTime) 136public static async Task Retry(Func<Task> func, int attempts, int msDelay) 168public static async Task AssertRecycledAsync(this IISDeploymentResult deploymentResult, Func<Task> verificationAction = null)
illink (2)
Infrastructure.Common (1)
ConditionalWcfTest.cs (1)
29private static bool GetConditionValue(string conditionName, Func<bool> detectFunc = null)
InMemory.FunctionalTests (4)
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
73public Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Interop.FunctionalTests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
InteropClient (1)
Assert.cs (1)
62public static async Task<TException> ThrowsAsync<TException>(Func<Task> action) where TException : Exception
Microsoft.Arcade.Common (12)
Helpers.cs (6)
32public T MutexExec<T>(Func<T> function, string mutexName) 59public T MutexExec<T>(Func<Task<T>> function, string mutexName) => 63public void MutexExec(Func<Task> function, string mutexName) => 66public T DirectoryMutexExec<T>(Func<T> function, string path) => 69public T DirectoryMutexExec<T>(Func<Task<T>> function, string path) => 73public void DirectoryMutexExec(Func<Task> function, string path) =>
IHelpers.cs (6)
13T MutexExec<T>(Func<T> function, string mutexName); 14T MutexExec<T>(Func<Task<T>> function, string mutexName); 15void MutexExec(Func<Task> function, string mutexName); 17T DirectoryMutexExec<T>(Func<T> function, string path); 18T DirectoryMutexExec<T>(Func<Task<T>> function, string path); 19void DirectoryMutexExec(Func<Task> function, string path);
Microsoft.AspNetCore.Analyzer.Testing (1)
DiagnosticProject.cs (1)
31public static Project Create(Assembly testAssembly, string[] sources, Func<Workspace> workspaceFactory = null, Type analyzerReference = null)
Microsoft.AspNetCore.App.Analyzers.Test (1)
TestDiagnosticAnalyzer.cs (1)
152Func<Workspace> createWorkspace = CreateWorkspace;
Microsoft.AspNetCore.Authentication.Test (2)
JwtBearerTests.cs (1)
1159private static async Task<IHost> CreateHost(Action<JwtBearerOptions> options = null, Func<HttpContext, Func<Task>, Task> handlerBeforeAuth = null)
JwtBearerTests_Handler.cs (1)
1191private 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)
24private Func<TValue>? _initialValueFactory; 53public CascadingValueSource(Func<TValue> initialValueFactory, bool isFixed) : this(isFixed) 64public 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)
208protected 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:
Infrastructure\ComponentStatePersistenceManager.cs (1)
162static Task ExecuteCallback(Func<Task> callback, ILogger<ComponentStatePersistenceManager> logger)
PersistComponentStateRegistration.cs (2)
7Func<Task> callback, 10public Func<Task> Callback { get; } = callback;
PersistentComponentState.cs (2)
45public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback) 55public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback, IComponentRenderMode? renderMode)
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 (13)
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 (6)
31public static FieldIdentifier Create<TField>(Expression<Func<TField>> accessor) 95private static void ParseAccessor<T>(Expression<Func<T>> accessor, out object model, out string fieldName) 130var modelLambdaCompiled = (Func<object?>)modelLambda.Compile(); 205var methodCallObjectLambdaCompiled = (Func<object?>)methodCallObjectLambda.Compile();
ValidationMessageStore.cs (4)
38public void Add(Expression<Func<object>> accessor, string message) 54public void Add(Expression<Func<object>> accessor, IEnumerable<string> messages) 74public IEnumerable<string> this[Expression<Func<object>> accessor] 94public void Clear(Expression<Func<object>> accessor)
Microsoft.AspNetCore.Components.Forms.Tests (6)
FieldIdentifierTest.cs (1)
184Expression<Func<object>> accessor = () => model.IntProperty;
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.Server (6)
Circuits\CircuitHost.cs (4)
25private Func<Func<Task>, Task> _dispatchInboundActivity; 619internal Task HandleInboundActivityAsync(Func<Task> handler) 623internal async Task<TResult> HandleInboundActivityAsync<TResult>(Func<Task<TResult>> handler) 630private static Func<Func<Task>, Task> BuildInboundActivityDispatcher(IReadOnlyList<CircuitHandler> circuitHandlers, Circuit circuit)
Circuits\CircuitInboundActivityContext.cs (2)
11internal Func<Task> Handler { get; } 18internal CircuitInboundActivityContext(Func<Task> handler, Circuit circuit)
Microsoft.AspNetCore.Components.Tests (46)
EventCallbackFactoryTest.cs (14)
166var @delegate = (Func<Task>)component.SomeFuncTask; 182var @delegate = (Func<Task>)component.SomeFuncTask; 200var @delegate = (Func<Task>)(() => Task.CompletedTask); 236var callback = EventCallback.Factory.Create(component, (Func<Task>)null); 453var @delegate = (Func<Task>)component.SomeFuncTask; 469var @delegate = (Func<Task>)component.SomeFuncTask; 487var @delegate = (Func<Task>)(() => Task.CompletedTask); 507var callback = EventCallback.Factory.Create<string>(component, (Func<Task>)null);
EventCallbackTest.cs (4)
173var callback = new EventCallback(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 190var callback = new EventCallback(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 353var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; })); 370var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; }));
RendererTest.cs (19)
629OnArbitraryDelegateEvent = (Func<Task>)(() => Task.CompletedTask), 1183builder.AddComponentParameter(1, nameof(EventComponent.OnClickEventCallback), EventCallback.Factory.Create(parentComponent, (Func<Task>)(() => 1302builder.AddComponentParameter(1, nameof(EventComponent.OnClickEventCallbackOfT), EventCallback.Factory.Create<DerivedEventArgs>(parentComponent, (Func<Task>)(() => 1648builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 1759builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 1879builder.AddComponentParameter(1, nameof(EventComponent.OnClickAsyncAction), (Func<Task>)(async () => 2320builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => throw exception1)); 2354builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => default)); 2394builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => { await tcs.Task; })); 2439builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => { await tcs.Task; throw exception1; })); 2478builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => throw new TaskCanceledException())); 2516(Func<ValueTask>)(() => new ValueTask(tcs.Task))); 4274builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(() => { disposed = true; throw exception1; })); 4302builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => { await tcs.Task; disposed = true; throw exception1; })); 4911builder.AddComponentParameter(1, nameof(AsyncDisposableComponent.AsyncDisposeAction), (Func<ValueTask>)(async () => await exception2Tcs.Task)); 5292public Func<Task> OnClickAsyncAction { get; set; } 5546public Func<ValueTask> AsyncDisposeAction { get; set; } 5800public Func<Task<(int id, EventType @event)>> EventAction { get; set; } 6052public Func<Task> Callback { get; set; }
Rendering\RendererSynchronizationContextTest.cs (4)
554var task = context.InvokeAsync<string>((Func<string>)(() => 570var task = context.InvokeAsync<string>((Func<string>)(() => 736var task = context.InvokeAsync<string>((Func<Task<string>>)(() => 752var task = context.InvokeAsync<string>((Func<Task<string>>)(() =>
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.Web (7)
Forms\EditContextFieldClassExtensions.cs (1)
23public static string FieldCssClass<TField>(this EditContext editContext, Expression<Func<TField>> accessor)
Forms\EditForm.cs (1)
15private readonly Func<Task> _handleSubmitDelegate; // Cache to avoid per-render allocations
Forms\Editor.cs (1)
25[Parameter] public Expression<Func<T>> ValueExpression { get; set; } = default!;
Forms\InputBase.cs (1)
55[Parameter] public Expression<Func<TValue>>? ValueExpression { get; set; }
Forms\ValidationMessage.cs (2)
15private Expression<Func<TValue>>? _previousFieldAccessor; 29[Parameter] public Expression<Func<TValue>>? For { get; set; }
JSComponents\JSComponentInterop.cs (1)
176var callback = jsObjectReference is null ? null : new Func<Task>(
Microsoft.AspNetCore.Components.Web.Tests (7)
Forms\InputRadioTest.cs (1)
87private static RenderFragment RadioButtonsWithGroup(string name, Expression<Func<TestEnum>> valueExpression) => (builder) =>
Forms\TestInputHostComponent.cs (1)
20public Expression<Func<TValue>> ValueExpression { get; set; }
src\Components\Shared\test\TestServiceProvider.cs (5)
12private readonly Dictionary<Type, Func<object?>> _factories = new(); 14private Dictionary<(Type, object?), Func<object?>>? _keyedFactories; 16private Dictionary<(Type, object?), Func<object?>> KeyedFactories 26=> _factories.TryGetValue(serviceType, out var factory) 31=> KeyedFactories.TryGetValue((serviceType, serviceKey), out var factory)
Microsoft.AspNetCore.Components.WebAssembly (10)
Hosting\WebAssemblyHostBuilder.cs (1)
30private Func<IServiceProvider> _createServiceProvider;
Rendering\NullDispatcher.cs (3)
24public override Task InvokeAsync(Func<Task> workItem) 31public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 38public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
Rendering\WebAssemblyDispatcher.cs (6)
51public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem) 64var state = ((TaskCompletionSource<TResult> tcs, Func<TResult> workItem))o!; 79public override Task InvokeAsync(Func<Task> workItem) 94var state = ((TaskCompletionSource tcs, Func<Task> workItem))o!; 124public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem) 139var state = ((TaskCompletionSource<TResult> tcs, Func<Task<TResult>> workItem))o!;
Microsoft.AspNetCore.Components.WebView.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.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)
34private readonly Func<SymmetricAlgorithm> _symmetricAlgorithmFactory; 39private readonly Func<KeyedHashAlgorithm> _validationAlgorithmFactory; 41public 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)
105=> new TheoryData<EncryptionAlgorithm, ValidationAlgorithm, Func<HMAC>> 120Func<HMAC> validationAlgorithmFactory)
KeyManagement\KeyRingTests.cs (1)
97private readonly Func<IAuthenticatedEncryptor> _encryptorFactory;
Microsoft.AspNetCore.Grpc.JsonTranscoding.IntegrationTests (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.JsonTranscoding.Tests (3)
Infrastructure\SyncPoint.cs (3)
49public static Func<Task> Create(out SyncPoint syncPoint, bool runContinuationsAsynchronously = true) 51var handler = Create(1, out var syncPoints, runContinuationsAsynchronously); 62public static Func<Task> Create(int count, out SyncPoint[] syncPoints, bool runContinuationsAsynchronously = true)
Microsoft.AspNetCore.Grpc.Swagger (2)
GrpcSwaggerGenOptionsExtensions.cs (2)
22Func<XPathDocument> xmlDocFactory) 38Func<XPathDocument> xmlDocFactory,
Microsoft.AspNetCore.Hosting.Tests (4)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
WebHostTests.cs (1)
1234public Func<IFeatureCollection> CreateRequestFeatures { get; set; } = NewFeatureCollection;
Microsoft.AspNetCore.Http (1)
src\Http\WebUtilities\src\AspNetCoreTempDirectory.cs (1)
34public static Func<string> TempDirectoryFactory => () => TempDirectory;
Microsoft.AspNetCore.Http.Abstractions (5)
Extensions\UseExtensions.cs (2)
29public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, Func<Task>, Task> middleware) 35Func<Task> simpleNext = () => next(context);
HttpResponse.cs (3)
19private static readonly Func<object, Task> _callbackDelegate = callback => ((Func<Task>)callback)(); 103public virtual void OnStarting(Func<Task> callback) => OnStarting(_callbackDelegate, callback); 128public virtual void OnCompleted(Func<Task> callback) => OnCompleted(_callbackDelegate, callback);
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
UseWhenExtensionsTests.cs (1)
123private static Func<HttpContext, Func<Task>, Task> Increment(string key, bool terminate = false)
Microsoft.AspNetCore.Http.Connections.Client (5)
HttpConnection.cs (1)
53private Func<Task<string?>>? _accessTokenProvider;
HttpConnectionOptions.cs (1)
186public Func<Task<string?>>? AccessTokenProvider { get; set; }
Internal\DefaultTransportFactory.cs (2)
15private readonly Func<Task<string?>> _accessTokenProvider; 20public DefaultTransportFactory(HttpTransportType requestedTransportType, ILoggerFactory loggerFactory, HttpClient? httpClient, HttpConnectionOptions httpConnectionOptions, Func<Task<string?>> accessTokenProvider)
Internal\WebSocketsTransport.cs (1)
74public WebSocketsTransport(HttpConnectionOptions httpConnectionOptions, ILoggerFactory loggerFactory, Func<Task<string?>> accessTokenProvider, HttpClient? httpClient,
Microsoft.AspNetCore.Http.Connections.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
106private static readonly MemberExpression CompletedTaskExpr = Expression.Property(null, (PropertyInfo)GetMemberInfo<Func<Task>>(() => Task.CompletedTask));
Microsoft.AspNetCore.Http.Extensions.Tests (53)
RequestDelegateFactoryTests.cs (53)
1325new object[] { (Func<JsonTodo>)TestAction }, 1326new object[] { (Func<Task<JsonTodo>>)TaskTestAction}, 1327new object[] { (Func<Task<JsonTodo>>)TaskTestActionAwaited}, 1328new object[] { (Func<ValueTask<JsonTodo>>)ValueTaskTestAction}, 1329new object[] { (Func<ValueTask<JsonTodo>>)ValueTaskTestActionAwaited}, 1446new object[] { (Func<CustomResult>)TestAction }, 1447new object[] { (Func<Task<CustomResult>>)TaskTestAction}, 1448new object[] { (Func<ValueTask<CustomResult>>)ValueTaskTestAction}, 1449new object[] { (Func<FSharp.Control.FSharpAsync<CustomResult>>)FSharpAsyncTestAction }, 1451new object[] { (Func<CustomResult>)StaticTestAction}, 1452new object[] { (Func<Task<CustomResult>>)StaticTaskTestAction}, 1453new object[] { (Func<ValueTask<CustomResult>>)StaticValueTaskTestAction}, 1454new object[] { (Func<FSharp.Control.FSharpAsync<CustomResult>>)StaticFSharpAsyncTestAction }, 1456new object[] { (Func<object>)StaticResultAsObject}, 1458new object[] { (Func<Task<object>>)StaticTaskOfIResultAsObject}, 1459new object[] { (Func<ValueTask<object>>)StaticValueTaskOfIResultAsObject}, 1460new object[] { (Func<FSharp.Control.FSharpAsync<object>>)StaticFSharpAsyncOfIResultAsObject}, 1462new object[] { (Func<StructResult>)TestStructAction }, 1463new object[] { (Func<Task<StructResult>>)TaskTestStructAction }, 1464new object[] { (Func<ValueTask<StructResult>>)ValueTaskTestStructAction }, 1465new object[] { (Func<FSharp.Control.FSharpAsync<StructResult>>)FSharpAsyncTestStructAction }, 1500new object[] { (Func<IResult?>)TestAction, "The IResult returned by the Delegate must not be null." }, 1501new object[] { (Func<Task<IResult?>?>)TaskNullAction, "The IResult in Task<IResult> response must not be null." }, 1502new object[] { (Func<Task<bool?>?>)TaskBoolAction, "The Task returned by the Delegate must not be null." }, 1503new object[] { (Func<Task<IResult?>>)TaskTestAction, "The IResult returned by the Delegate must not be null." }, 1504new object[] { (Func<ValueTask<IResult?>>)ValueTaskTestAction, "The IResult returned by the Delegate must not be null." }, 2264new object[] { (Func<FSharp.Control.FSharpAsync<string>>)FSharpAsyncOfTMethod }, 2265new object[] { (Func<FSharp.Control.FSharpAsync<string>>)FSharpAsyncOfTWithYieldMethod }, 2266new object[] { (Func<FSharp.Control.FSharpAsync<object>>)FSharpAsyncOfObjectWithYieldMethod } 2354new object[] { (Func<ValueTask>)ValueTaskMethod }, 2355new object[] { (Func<ValueTask<FSharp.Core.Unit>>)ValueTaskOfUnitMethod }, 2356new object[] { (Func<Task>)TaskMethod }, 2357new object[] { (Func<Task<FSharp.Core.Unit>>)TaskOfUnitMethod }, 2358new object[] { (Func<FSharp.Control.FSharpAsync<FSharp.Core.Unit>>)FSharpAsyncOfUnitMethod }, 2359new object[] { (Func<ValueTask>)ValueTaskWithYieldMethod }, 2360new object[] { (Func<Task>)TaskWithYieldMethod}, 2361new object[] { (Func<FSharp.Control.FSharpAsync<FSharp.Core.Unit>>)FSharpAsyncOfUnitWithYieldMethod } 2475new object[] { (Func<ValueTask<TodoStruct>>)ValueTaskOfStructMethod }, 2476new object[] { (Func<ValueTask<TodoStruct>>)ValueTaskOfStructWithYieldMethod }, 2477new object[] { (Func<Task<TodoStruct>>)TaskOfStructMethod }, 2478new object[] { (Func<Task<TodoStruct>>)TaskOfStructWithYieldMethod }, 2479new object[] { (Func<FSharp.Control.FSharpAsync<TodoStruct>>)FSharpAsyncOfStructMethod }, 2480new object[] { (Func<FSharp.Control.FSharpAsync<TodoStruct>>)FSharpAsyncOfStructWithYieldMethod } 2533var @delegate = () => new object(); 2545var @delegate = () => "Hello"; 2619var @delegate = () => new AddsCustomEndpointMetadataResult(); 2632var @delegate = () => Task.FromResult(new AddsCustomEndpointMetadataResult()); 2645var @delegate = () => ValueTask.FromResult(new AddsCustomEndpointMetadataResult()); 2658var @delegate = () => FSharp.Core.ExtraTopLevelOperators.DefaultAsyncBuilder.Return(new AddsCustomEndpointMetadataResult()); 2671var @delegate = () => new CountsDefaultEndpointMetadataResult(); 2693var @delegate = () => Task.FromResult(new CountsDefaultEndpointMetadataResult()); 2715var @delegate = () => ValueTask.FromResult(new CountsDefaultEndpointMetadataResult()); 2737var @delegate = () => FSharp.Core.ExtraTopLevelOperators.DefaultAsyncBuilder.Return(new CountsDefaultEndpointMetadataResult());
Microsoft.AspNetCore.Http.Results.Tests (4)
ResultsTests.cs (4)
1621public void FactoryMethod_ReturnsCorrectResultType(Expression<Func<IResult>> expression, Type expectedReturnType) 1623var method = expression.Compile(); 1649private static IEnumerable<(Expression<Func<IResult>>, Type)> FactoryMethodsTuples { get; } = new List<(Expression<Func<IResult>>, Type)>
Microsoft.AspNetCore.HttpLogging.Tests (1)
FileLoggerProcessorTests.cs (1)
571private async Task WaitForCondition(Func<bool> waitForLog)
Microsoft.AspNetCore.Identity.Test (2)
SecurityStampValidatorTest.cs (1)
95private async Task RunApplicationCookieTest(PocoUser user, Mock<HttpContext> httpContext, bool shouldStampValidate, Func<Task> testCode)
UserManagerTest.cs (1)
968private async Task VerifyException<TException>(Func<Task> code, string expectedMessage) where TException : Exception
Microsoft.AspNetCore.InternalTesting (7)
ExceptionAssertions.cs (6)
50public static async Task<TException> ThrowsAsync<TException>(Func<Task> testCode, string exceptionMessage) 69public static TException Throws<TException>(Func<object> testCode, string exceptionMessage) 109public static Task<ArgumentException> ThrowsArgumentAsync(Func<Task> testCode, string paramName, string exceptionMessage) 115Func<Task> testCode, 164public static Task<ArgumentException> ThrowsArgumentNullOrEmptyAsync(Func<Task> testCode, string paramName) 188public static Task<ArgumentException> ThrowsArgumentNullOrEmptyStringAsync(Func<Task> testCode, string paramName)
HttpClientSlim.cs (1)
109private static async Task<string> RetryRequest(Func<Task<string>> retryBlock)
Microsoft.AspNetCore.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 (6)
WebApplicationFactory.cs (6)
607private readonly Func<IWebHostBuilder?> _createWebHostBuilder; 608private readonly Func<IHostBuilder?> _createHostBuilder; 609private readonly Func<IEnumerable<Assembly>> _getTestAssemblies; 616Func<IWebHostBuilder?> createWebHostBuilder, 617Func<IHostBuilder?> createHostBuilder, 618Func<IEnumerable<Assembly>> getTestAssemblies,
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
DynamicViewData.cs (2)
15private readonly Func<ViewDataDictionary> _viewDataFunc; 17public DynamicViewData(Func<ViewDataDictionary> viewDataFunc)
ViewDataInfo.cs (3)
13private static readonly Func<object> _propertyInfoResolver = () => null; 16private Func<object> _valueAccessor; 51public ViewDataInfo(object container, PropertyInfo propertyInfo, Func<object> valueAccessor)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
Filters\SaveTempDataFilterTest.cs (2)
400private Func<Task> _responseStartingAsync = () => Task.FromResult(true); 422var prior = _responseStartingAsync;
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (2)
RedisOutputCacheOptions.cs (2)
32public Func<Task<IConnectionMultiplexer>>? ConnectionMultiplexerFactory { get; set; } 43public Func<ProfilingSession>? ProfilingSession { get; set; }
Microsoft.AspNetCore.Owin (12)
OwinEnvironment.cs (10)
329public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory) 352public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter) 365public FeatureMap(Type featureInterface, Func<object, object> getter, Func<object> defaultFactory, Action<object, object> setter, Func<object> featureFactory) 377private Func<object> DefaultFactory { get; set; } 378private Func<object> FeatureFactory { get; set; } 443public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory) 464public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory, Action<TFeature, object> setter) 476public FeatureMap(Func<TFeature, object> getter, Func<object> defaultFactory, Action<TFeature, object> setter, Func<TFeature> featureFactory)
OwinFeatureCollection.cs (2)
264var loadAsync = Prop<Func<Task>>(OwinConstants.CommonKeys.LoadClientCertAsync);
Microsoft.AspNetCore.RateLimiting.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Razor.Runtime (11)
Runtime\TagHelpers\TagHelperExecutionContext.cs (6)
17private readonly Func<TagHelperContent> _endTagHelperWritingScope; 19private Func<Task> _executeChildContentAsync; 56Func<Task> executeChildContentAsync, 58Func<TagHelperContent> endTagHelperWritingScope) 175/// <param name="executeChildContentAsync">The <see cref="Func{Task}"/> to use.</param> 181Func<Task> executeChildContentAsync)
Runtime\TagHelpers\TagHelperScopeManager.cs (5)
27Func<TagHelperContent> endTagHelperWritingScope) 47Func<Task> executeChildContentAsync) 104private readonly Func<TagHelperContent> _endTagHelperWritingScope; 110Func<TagHelperContent> endTagHelperWritingScope) 124Func<Task> executeChildContentAsync)
Microsoft.AspNetCore.Razor.Runtime.Test (5)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (5)
94Func<Task> executeChildContentAsync = () => 100Func<TagHelperContent> endTagHelperWritingScope = () => null; 112Func<Task> updatedExecuteChildContentAsync = () => 152Func<Task> executeChildContentAsync = () => 158Func<TagHelperContent> endWritingScope = () => null;
Microsoft.AspNetCore.Rewrite (5)
IISUrlRewrite\ServerVariables.cs (1)
22Func<PatternSegment>? managedVariableThunk = default;
PatternSegments\IISServerVariableSegment.cs (2)
11private readonly Func<PatternSegment> _fallbackThunk; 13public IISServerVariableSegment(string variableName, Func<PatternSegment> fallbackThunk)
UrlActions\ChangeCookieAction.cs (2)
10private readonly Func<DateTimeOffset> _timeSource; 19internal ChangeCookieAction(string name, Func<DateTimeOffset> timeSource)
Microsoft.AspNetCore.Routing (4)
Constraints\RegexRouteConstraint.cs (1)
27private readonly Func<Regex>? _regexFactory;
DataSourceDependentCache.cs (1)
17private readonly Func<T> _initializer;
Matching\DataSourceDependentMatcher.cs (2)
12private readonly Func<MatcherBuilder> _matcherBuilderFactory; 18Func<MatcherBuilder> matcherBuilderFactory)
Microsoft.AspNetCore.Routing.Tests (1)
Matching\DataSourceDependentMatcherTest.cs (1)
238public static Func<MatcherBuilder> Create = () => new TestMatcherBuilder();
Microsoft.AspNetCore.Server.HttpSys (2)
ResponseStream.cs (2)
9private readonly Func<Task> _onStart; 11internal ResponseStream(Stream innerStream, Func<Task> onStart)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\RetryHelper.cs (1)
20Func<Task<HttpResponseMessage>> retryBlock,
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
Http1\Http1ConnectionTests.cs (1)
1088private static async Task WaitForCondition(TimeSpan timeout, Func<bool> condition)
KestrelServerTests.cs (1)
761Func<Task> changeCallback = null;
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
73public Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
1663Func<Times> reloadTimes = loadInternal && reloadOnChange ? Times.AtLeastOnce : Times.Never;
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
NamedPipeTransportOptions.cs (1)
63internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = PinnedBlockMemoryPoolFactory.Create;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
src\Shared\SyncPoint\SyncPoint.cs (3)
38public static Func<Task> Create(out SyncPoint syncPoint) 40var handler = Create(1, out var syncPoints); 51public static Func<Task> Create(int count, out SyncPoint[] syncPoints)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
SocketConnectionFactoryOptions.cs (1)
70internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = PinnedBlockMemoryPoolFactory.Create;
SocketTransportOptions.cs (1)
169internal Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
Microsoft.AspNetCore.Session (6)
DistributedSession.cs (2)
30private readonly Func<bool> _tryEstablishSession; 62Func<bool> tryEstablishSession,
DistributedSessionStore.cs (1)
33public ISession Create(string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey)
ISessionStore.cs (1)
30ISession Create(string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey);
SessionMiddleware.cs (2)
20private static readonly Func<bool> ReturnTrue = () => true; 63Func<bool> tryEstablishSession = ReturnTrue;
Microsoft.AspNetCore.Shared.Tests (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
Microsoft.AspNetCore.SignalR.Client.Core (4)
HubConnection.cs (1)
914private 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)
51public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Func<Task<TResult>> handler) 67public 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 (10)
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);
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.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 (20)
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)
499private void InitializeProject(BuildParameters buildParameters, Func<ProjectInstance> loadProjectFromFile)
BuildEnvironmentHelper.cs (12)
80var possibleLocations = new Func<BuildEnvironment>[] 91foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
Definition\ToolsetConfigurationReader.cs (2)
33private readonly Func<Configuration> _readApplicationConfiguration; 69internal ToolsetConfigurationReader(PropertyDictionary<ProjectPropertyInstance> environmentProperties, PropertyDictionary<ProjectPropertyInstance> globalProperties, Func<Configuration> readApplicationConfiguration)
Graph\ParallelWorkSet.cs (1)
105internal void AddWork(TKey key, Func<TResult> workFunc)
Microsoft.Build.CommandLine.UnitTests (2)
NodeStatus_Transition_Tests.cs (1)
36Func<NodeStatus> newNodeStatus = () => new NodeStatus("project", "tfm", AnsiCodes.Colorize("colorized target", TerminalColor.Green), new MockStopwatch());
TerminalLogger_Tests.cs (1)
585Func<StopwatchAbstraction>? createStopwatch = _terminallogger.CreateStopwatch;
Microsoft.Build.Engine.OM.UnitTests (17)
BuildEnvironmentHelper.cs (12)
80var possibleLocations = new Func<BuildEnvironment>[] 91foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (5)
242public static void VerifySameLocationWithException(Func<ElementLocation> expectedGetter, Func<ElementLocation> actualGetter, ValidationContext context = null) 353public static bool GetWithExceptionCheck<T>(Func<T> getter, out T result) 367public static void ValidateEqualWithException<T>(Func<T> viewGetter, Func<T> realGetter, ValidationContext context = null)
Microsoft.Build.Engine.UnitTests (2)
Graph\ParallelWorkSet_Tests.cs (1)
31internal Func<string> WorkFunc { get; set; }
Graph\ProjectGraph_Tests.cs (1)
2920var getTargetListsFunc = (() => projectGraph.GetTargetLists([entryTarget]));
Microsoft.Build.Tasks.Core (19)
BuildEnvironmentHelper.cs (12)
80var possibleLocations = new Func<BuildEnvironment>[] 91foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
Copy.cs (1)
817private 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)
29Func<string>[] possibleLocations =
Microsoft.Build.UnitTests.Shared (12)
EngineTestEnvironment.cs (4)
152private IEnumerable<(ILogger logger, Func<string> textGetter)> GetLoggers() 154var result = new List<(ILogger logger, Func<string> textGetter)>(); 168private (ILogger logger, Func<string> textGetter) GetMockLogger() 194private (ILogger, Func<string>) GetBinaryLogger()
EnvironmentProvider.cs (3)
29private readonly Func<string?> _getCurrentProcessPath; 35public EnvironmentProvider(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath) 118public static string? GetDotnetExePath(Func<string, string?> getEnvironmentVariable, Func<string?> getCurrentProcessPath)
TestEnvironment.cs (5)
172public TestInvariant WithStringInvariant(string name, Func<string> value) 402private readonly Func<string> _accessorFunc; 406public StringInvariant(string name, Func<string> accessorFunc) 534private readonly Func<bool> _condition; 536public CustomConditionInvariant(Func<bool> condition)
Microsoft.Build.Utilities.Core (12)
BuildEnvironmentHelper.cs (12)
80var possibleLocations = new Func<BuildEnvironment>[] 91foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
176new PredefinedTypeInfo(PredefinedType.PT_FUNC, typeof(Func<>), "System.Func`1")
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
GeneralTests.cs (1)
190Func<bool> action = () => defaultLeft.Equals(defaultRight);
Microsoft.DotNet.Helix.Sdk (4)
AzureDevOpsTask.cs (4)
84protected async Task RetryAsync(Func<Task> function) 104protected async Task<T> RetryAsync<T>(Func<Task<T>> function) 192public Task<T> RetryAsync<T>(Func<Task<T>> function, Action<Exception> logRetry, 198public async Task<T> RetryAsync<T>(Func<Task<T>> function, Action<Exception> logRetry,
Microsoft.DotNet.Helix.Sdk.Tests (2)
InstallDotNetToolTests.cs (2)
55.Setup(x => x.DirectoryMutexExec(It.IsAny<Func<bool>>(), It.IsAny<string>())) 56.Callback<Func<bool>, string>((function, path) => {
Microsoft.DotNet.RemoteExecutor (3)
RemoteExecutor.cs (3)
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.VersionTools.Tests (1)
BuildManifest\BuildManifestClientTests.cs (1)
195Func<Task> act = async () => { await pushClient; };
Microsoft.DotNet.XUnitAssert.Tests (8)
ExceptionAssertsTests.cs (7)
91 Assert.Throws<ArgumentNullException>("testCode", () => Assert.Throws(typeof(Exception), default(Func<object>)!)); 244 Assert.Throws<ArgumentNullException>("testCode", () => Assert.Throws<ArgumentException>(default(Func<object>)!)); 413 Assert.Throws<ArgumentNullException>("testCode", () => Assert.Throws<ArgumentException>(default(Func<object>)!)); 561 Assert.Throws<ArgumentNullException>("testCode", () => Assert.ThrowsAny<ArgumentException>(default(Func<object>)!)); 632 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.ThrowsAnyAsync<ArgumentException>(default(Func<Task>)!)); 691 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.ThrowsAsync<ArgumentException>(default(Func<Task>)!)); 760 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.ThrowsAsync<ArgumentException>("paramName", default(Func<Task>)!));
PropertyAssertsTests.cs (1)
69 await Assert.ThrowsAsync<ArgumentNullException>("testCode", () => Assert.PropertyChangedAsync(Substitute.For<INotifyPropertyChanged>(), "propertyName", default(Func<Task>)!));
Microsoft.DotNet.XUnitExtensions (3)
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.Caching.MicroBenchmarks (4)
DistributedCacheBenchmarks.cs (4)
148Func<Task<byte[]?>> callback = () => _backend.GetAsync(RandomKey()); 193Func<Task<byte[]?>> callback = () => _backend.GetAsync(RandomKey()); 237Func<Task<byte[]?>> callback = () => _backend.GetAsync(FixedKey()); 281Func<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.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.FileProviders.Physical (2)
PhysicalFileProvider.cs (1)
31private readonly Func<PhysicalFilesWatcher> _fileWatcherFactory;
PhysicalFilesWatcher.cs (1)
44private readonly Func<Timer> _timerFactory;
Microsoft.Extensions.Hosting (4)
HostApplicationBuilder.cs (1)
28private Func<IServiceProvider> _createServiceProvider;
HostBuilder.cs (1)
294Func<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 = () => ActivatorUtilities.CreateFactory(typeof(TClient), new Type[] { typeof(HttpClient), });
DependencyInjection\HttpClientBuilderExtensions.cs (4)
74public static IHttpClientBuilder AddHttpMessageHandler(this IHttpClientBuilder builder, Func<DelegatingHandler> configureHandler) 153public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler(this IHttpClientBuilder builder, Func<HttpMessageHandler> configureHandler) 279/// <see cref="ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func{HttpMessageHandler})"/> or 316/// <see cref="ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func{HttpMessageHandler})"/> or
Microsoft.Extensions.Http.Polly.Tests (1)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (1)
559public Func<Exception> CreateException { get; set; } = () => new OverflowException();
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.WebEncoders (1)
EncoderServiceCollectionExtensions.cs (1)
61Func<TService> defaultFactory,
MSBuild (13)
BuildEnvironmentHelper.cs (12)
80var possibleLocations = new Func<BuildEnvironment>[] 91foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
TerminalLogger\TerminalLogger.cs (1)
71internal Func<StopwatchAbstraction>? CreateStopwatch = null;
MSBuildTaskHost (12)
BuildEnvironmentHelper.cs (12)
80var possibleLocations = new Func<BuildEnvironment>[] 91foreach (var location in possibleLocations) 465internal static void ResetInstance_ForUnitTestsOnly(Func<string> getProcessFromRunningProcess = null, 466Func<string> getExecutingAssemblyPath = null, Func<string> getAppContextBaseDirectory = null, 467Func<IEnumerable<VisualStudioInstance>> getVisualStudioInstances = null, 469Func<bool> runningTests = null) 491private static Func<string> s_getProcessFromRunningProcess = GetProcessFromRunningProcess; 492private static Func<string> s_getExecutingAssemblyPath = GetExecutingAssemblyPath; 493private static Func<string> s_getAppContextBaseDirectory = GetAppContextBaseDirectory; 494private static Func<IEnumerable<VisualStudioInstance>> s_getVisualStudioInstances = VisualStudioLocationHelper.GetInstances; 496private static Func<bool> s_runningTests = CheckIfRunningTests;
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
234[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
Mvc.Api.Analyzers.Test (1)
TestFiles\ApiConventionAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForReturnStatementsInLambdas.cs (1)
18Func<IActionResult> someLambda = () =>
netstandard (1)
netstandard.cs (1)
794[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
PresentationCore (6)
System\Windows\Input\Stylus\Common\RawStylusInputReport.cs (2)
77Func<StylusPointDescription> _stylusPointDescGenerator; 239Func<StylusPointDescription> stylusPointDescGenerator,
System\Windows\Input\Stylus\Common\RawStylusSystemGestureInputReport.cs (1)
93Func<StylusPointDescription> stylusPointDescGenerator,
System\Windows\Input\Stylus\Pointer\PointerInteractionEngine.cs (3)
331(Func<StylusPointDescription>)null, 368(Func<StylusPointDescription>)null, 461(Func<StylusPointDescription>)null,
PresentationFramework (21)
MS\Internal\WindowsRuntime\Generated\Windows.Data.Text.cs (1)
353public WordsSegmenter(string language) : this(((Func<global::MS.Internal.WindowsRuntime.ABI.Windows.Data.Text.IWordsSegmenter>)(() => {
MS\Internal\WindowsRuntime\Generated\Windows.Globalization.cs (1)
105public Language(string languageTag) : this(((Func<global::MS.Internal.WindowsRuntime.ABI.Windows.Globalization.ILanguage>)(() => {
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (10)
56Func<bool> dispose = () => { m.Dispose(); return false; }; 147Func<bool> dispose = () => { m.Dispose(); return false; }; 208Func<bool> dispose = () => 241Func<bool> dispose = () => { DisposeAbiArrayElements((i, data)); return false; }; 465Func<bool> dispose = () => { m.Dispose(); return false; }; 539Func<bool> dispose = () => 575Func<bool> dispose = () => { DisposeAbiArrayElements((i, data)); return false; }; 647Func<bool> dispose = () => { m.Dispose(); return false; }; 699Func<bool> dispose = () => 733Func<bool> dispose = () => { DisposeAbiArrayElements((i, data)); return false; };
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (2)
23Func<T> _creationDelegate; 25public XamlContextStack(Func<T> creationDelegate)
System\Windows\Documents\MsSpellCheckLib\SpellCheckerFactory\SpellCheckerCreationHelper.cs (1)
107public bool CreateSpellCheckerRetryPreamble(out Func<RCW.ISpellChecker> func)
System\Windows\Documents\MsSpellCheckLib\Utils\RetryHelper.cs (3)
34internal delegate bool RetryFunctionPreamble<TResult>(out Func<TResult> func); 167Func<TResult> func, 229Func<TResult> func,
System\Windows\FrameworkElementFactory.cs (1)
1280private Func<object> _knownTypeFactory;
System\Windows\Markup\Baml2006\WpfKnownType.cs (2)
39Func<object> _defaultConstructor; 205public Func<object> DefaultConstructor
ScenarioTests.Common.Tests (1)
ScenarioTestTypes.cs (1)
268public static void Run(Func<Task> asyncMethod)
SimpleWebSiteWithWebApplicationBuilderException (1)
Program.cs (1)
6app.MapGet("/", (Func<string>)(() => "Hello World"));
Sockets.BindTests (2)
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
73public Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
src\Servers\Kestrel\test\Sockets.FunctionalTests\TransportSelector.cs (1)
13public static IHostBuilder GetHostBuilder(Func<MemoryPool<byte>> memoryPoolFactory = null,
Sockets.FunctionalTests (7)
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
73public Func<MemoryPool<byte>> MemoryPoolFactory { get; set; } = System.Buffers.PinnedBlockMemoryPoolFactory.Create;
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (3)
145Func<Task> sendFunc = async () => 238Func<Task> sendFunc = async () => 305Func<MemoryPool<byte>> memoryPoolFactory = null)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
47public static Dictionary<string, Func<ListenOptions>> ConnectionMiddlewareData { get; } = new Dictionary<string, Func<ListenOptions>>
TransportSelector.cs (1)
13public static IHostBuilder GetHostBuilder(Func<MemoryPool<byte>> memoryPoolFactory = null,
Swaggatherer (7)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (7)
59public Func<int> Invoke { get; set; } 60public Func<string> LongVersionGetter { get; set; } 61public Func<string> ShortVersionGetter { get; set; } 133public void OnExecute(Func<int> invoke) 138public void OnExecute(Func<Task<int>> invoke) 407Func<string> shortFormVersionGetter, 408Func<string> longFormVersionGetter = null)
System.ComponentModel.Annotations (5)
System\ComponentModel\DataAnnotations\LocalizableString.cs (1)
18private Func<string?>? _cachedResult;
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (4)
27private Func<string>? _errorMessageResourceAccessor; 64/// <param name="errorMessageAccessor">The <see cref="Func{T}" /> that will return an error message.</param> 65protected ValidationAttribute(Func<string> errorMessageAccessor) 102private protected Func<string> ErrorMessageResourceAccessor
System.ComponentModel.Composition (16)
System\ComponentModel\Composition\ExportFactoryOfT.cs (2)
8private readonly Func<Tuple<T, Action>> _exportLifetimeContextCreator; 10public ExportFactory(Func<Tuple<T, Action>> exportLifetimeContextCreator)
System\ComponentModel\Composition\ExportFactoryOfTTMetadata.cs (1)
10public ExportFactory(Func<Tuple<T, Action>> exportLifetimeContextCreator, TMetadata metadata)
System\ComponentModel\Composition\ExportServices.DisposableLazy.cs (2)
14public DisposableLazy(Func<T> valueFactory, TMetadataView metadataView, IDisposable disposable, LazyThreadSafetyMode mode) 32public DisposableLazy(Func<T> valueFactory, IDisposable disposable, LazyThreadSafetyMode mode)
System\ComponentModel\Composition\Primitives\Export.cs (7)
19private readonly Func<object?>? _exportedValueGetter; 45/// A <see cref="Func{T}"/> that is called to create the exported value of the 58public Export(string contractName, Func<object?> exportedValueGetter) 78/// A <see cref="Func{T}"/> that is called to create the exported value of the 91public Export(string contractName, IDictionary<string, object?>? metadata, Func<object?> exportedValueGetter) 105/// A <see cref="Func{T}"/> that is called to create the exported value of the 115public Export(ExportDefinition definition, Func<object?> exportedValueGetter)
System\ComponentModel\Composition\ReflectionModel\ExportfactoryCreator.cs (2)
49Func<Tuple<T, Action>> exportLifetimeContextCreator = () => LifetimeContext.GetExportLifetimeContextFromExport<T>(export); 62Func<Tuple<T, Action>> exportLifetimeContextCreator = () => LifetimeContext.GetExportLifetimeContextFromExport<T>(export);
System\ComponentModel\Composition\ReflectionModel\LazyMemberInfo.cs (2)
15private readonly Func<MemberInfo[]>? _accessorsCreator; 61public LazyMemberInfo(MemberTypes memberType, Func<MemberInfo[]> accessorsCreator)
System.Composition.Hosting (3)
System\Composition\Hosting\Core\ExportDescriptorPromise.cs (1)
40Func<IEnumerable<CompositionDependency>> dependencies,
System\Composition\Hosting\Core\ExportDescriptorProvider.cs (1)
31protected static readonly Func<IEnumerable<CompositionDependency>> NoDependencies = Enumerable.Empty<CompositionDependency>;
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
18private static readonly Func<CompositionDependency[]> s_noDependencies = () => s_noDependenciesValue;
System.Composition.Runtime (3)
System\Composition\ExportFactoryOfT.cs (2)
12private readonly Func<Tuple<T, Action>> _exportLifetimeContextCreator; 18public ExportFactory(Func<Tuple<T, Action>> exportCreator)
System\Composition\ExportFactoryOfTTMetadata.cs (1)
18public ExportFactory(Func<Tuple<T, Action>> exportCreator, TMetadata metadata)
System.Configuration.ConfigurationManager (1)
System\Configuration\ConfigurationFileMap.cs (1)
18private Func<string> _getFilenameThunk;
System.Core (1)
System.Core.cs (1)
84[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
System.Diagnostics.DiagnosticSource (51)
System\Diagnostics\Activity.cs (2)
998public static Func<ActivityTraceId>? TraceIdGenerator { get; set; } 1257Func<ActivityTraceId>? traceIdGenerator = TraceIdGenerator;
System\Diagnostics\ActivityCreationOptions.cs (1)
135Func<ActivityTraceId>? traceIdGenerator = Activity.TraceIdGenerator;
System\Diagnostics\Metrics\AggregationManager.cs (2)
284Func<Aggregator?>? createAggregatorFunc = GetAggregatorFactory(instrument); 294private 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)
25public InstrumentState(Func<TAggregator?> createAggregatorFunc)
System\Diagnostics\Metrics\Meter.cs (19)
207public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 221public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 235public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 249public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 262public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 276public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 289public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 303public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 316public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 330public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 344public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 358public ObservableCounter<T> CreateObservableCounter<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 368public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit = null, string? description = null) where T : struct => 379public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<T> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 389public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<Measurement<T>> observeValue, string? unit = null, string? description = null) where T : struct => 400public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<Measurement<T>> observeValue, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 410public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit = null, string? description = null) where T : struct => 421public ObservableGauge<T> CreateObservableGauge<T>(string name, Func<IEnumerable<Measurement<T>>> observeValues, string? unit, string? description, IEnumerable<KeyValuePair<string, object?>>? tags) where T : struct => 485private 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.Linq.Expressions (8)
System\Dynamic\Utils\DelegateHelpers.cs (4)
46public static Func<IDisposable>? ForceAllowDynamicCodeDelegate { get; } 49private static Func<IDisposable>? ForceAllowDynamicCodeDelegateInternal() 52?.CreateDelegate<Func<IDisposable>>(); 107private static MethodInfo GetEmptyObjectArrayMethod() => ((Func<object[]>)Array.Empty<object>).GetMethodInfo();
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (1)
193return typeof(Func<>).MakeGenericType(types);
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
397private readonly Func<TRet> _target; 403_target = (Func<TRet>)target.CreateDelegate(typeof(Func<TRet>));
System.Linq.Parallel (3)
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (2)
63private readonly Func<TIntermediate>? _seedFactory; 72internal AssociativeAggregationOperator(IEnumerable<TInput> child, TIntermediate seed, Func<TIntermediate>? seedFactory, bool seedIsSpecified,
System\Linq\ParallelEnumerable.cs (1)
1810Func<TAccumulate> seedFactory,
System.Linq.Queryable (5)
System\Linq\EnumerableExecutor.cs (3)
45Expression<Func<T>> f = Expression.Lambda<Func<T>>(body, (IEnumerable<ParameterExpression>?)null); 46Func<T> func = f.Compile();
System\Linq\EnumerableQuery.cs (2)
110Expression<Func<IEnumerable<T>>> f = Expression.Lambda<Func<IEnumerable<T>>>(body, (IEnumerable<ParameterExpression>?)null);
System.Net.Http (9)
System\Net\Http\Headers\MediaTypeHeaderParser.cs (2)
10private readonly Func<MediaTypeHeaderValue> _mediaTypeCreator; 16private MediaTypeHeaderParser(bool supportsMultipleValues, Func<MediaTypeHeaderValue> mediaTypeCreator)
System\Net\Http\Headers\MediaTypeHeaderValue.cs (1)
176Func<MediaTypeHeaderValue> mediaTypeCreator, out MediaTypeHeaderValue? parsedValue)
System\Net\Http\Headers\NameValueHeaderValue.cs (2)
15private static readonly Func<NameValueHeaderValue> s_defaultNameValueCreator = CreateNameValue; 207Func<NameValueHeaderValue> nameValueCreator, out NameValueHeaderValue? parsedValue)
System\Net\Http\Headers\NameValueWithParametersHeaderValue.cs (1)
16private static readonly Func<NameValueHeaderValue> s_nameValueCreator = CreateNameValue;
System\Net\Http\Headers\TransferCodingHeaderParser.cs (2)
10private readonly Func<TransferCodingHeaderValue> _transferCodingCreator; 22Func<TransferCodingHeaderValue> transferCodingCreator)
System\Net\Http\Headers\TransferCodingHeaderValue.cs (1)
61Func<TransferCodingHeaderValue> transferCodingCreator, out TransferCodingHeaderValue? parsedValue)
System.Net.Quic (2)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System.Net.Security (2)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System.Private.CoreLib (65)
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (4)
26private Func<IPrincipal>? s_getWindowsPrincipal; 27private Func<IPrincipal>? s_getUnauthenticatedPrincipal; 417s_getUnauthenticatedPrincipal = mi.CreateDelegate<Func<IPrincipal>>(); 432s_getWindowsPrincipal = mi.CreateDelegate<Func<IPrincipal>>();
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\IncrementingPollingCounter.cs (2)
32public IncrementingPollingCounter(string name, EventSource eventSource, Func<double> totalValueProvider) : base(name, eventSource) 45private readonly Func<double> _totalValueProvider;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\PollingCounter.cs (2)
31public PollingCounter(string name, EventSource eventSource, Func<double> metricProvider) : base(name, eventSource) 41private 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; 371Func<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 195/// <param name="valueFactory">The <see cref="Func{T}"/> invoked to initialize the 198public static T EnsureInitialized<T>([AllowNull] ref T target, ref bool initialized, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory) 219/// The <see cref="Func{T}"/> to invoke in order to produce the lazily-initialized value. 222private static T EnsureInitializedCore<T>([AllowNull] ref T target, ref bool initialized, [NotNull] ref object? syncLock, Func<T> valueFactory) 245/// <param name="valueFactory">The <see cref="Func{T}"/> invoked to initialize the reference.</param> 247public static T EnsureInitialized<T>([NotNull] ref T? target, [NotNullIfNotNull(nameof(syncLock))] ref object? syncLock, Func<T> valueFactory) where T : class => 259/// The <see cref="Func{T}"/> to invoke in order to produce the lazily-initialized value. 262private 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)
256public static void SpinUntil(Func<bool> condition) 279public static bool SpinUntil(Func<bool> condition, TimeSpan timeout) 303public static bool SpinUntil(Func<bool> condition, int millisecondsTimeout)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (7)
107public Task(Func<TResult> function) 128public Task(Func<TResult> function, CancellationToken cancellationToken) 152public Task(Func<TResult> function, TaskCreationOptions creationOptions) 179public Task(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions) 286internal Task(Func<TResult> valueSelector, Task? parent, CancellationToken cancellationToken, 310internal static Task<TResult> StartNew(Task? parent, Func<TResult> function, CancellationToken cancellationToken, 488if (m_action is Func<TResult> func)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (4)
256public Task<TResult> StartNew(Func<TResult> function) 283public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken) 312public Task<TResult> StartNew(Func<TResult> function, TaskCreationOptions creationOptions) 352public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (6)
5511public static Task<TResult> Run<TResult>(Func<TResult> function) 5529public static Task<TResult> Run<TResult>(Func<TResult> function, CancellationToken cancellationToken) 5544public static Task Run(Func<Task?> function) 5562public static Task Run(Func<Task?> function, CancellationToken cancellationToken) 5590public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function) 5606public 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.Xml (3)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (3)
1468Func<object?> getSource = () => GetMemberValue(o, member.Mapping.MemberInfo!); 1475private object? WriteAddCollectionFixup(Func<object?> getSource, Action<object?> setSource, object memberValue, TypeDesc typeDesc, bool readOnly) 2068public 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\net9.0\System.Runtime.Forwards.cs (1)
188[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Func<>))]
System.Runtime.InteropServices.JavaScript (2)
artifacts\obj\System.Runtime.InteropServices.JavaScript\Debug\net9.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 = ClaimsPrincipalSelector; 87public static Func<ClaimsPrincipal> ClaimsPrincipalSelector
System.Security.Cryptography (4)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
22internal static T GetInvalidHandle(Func<T> invalidHandleFactory) 26static T CreateInvalidHandle(Func<T> invalidHandleFactory)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (2)
1429Func<TAlg> factory, 1463Func<TAlg> factory,
System.Security.Principal.Windows (3)
artifacts\obj\System.Security.Principal.Windows\Debug\net9.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.Http (3)
System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (3)
27private Func<IEnumerable<DelegatingHandler>> _handlerFunc; 89public HttpMessageHandlerFactory(Func<IEnumerable<DelegatingHandler>> handlers) 186private static string GetFuncDetails(Func<IEnumerable<DelegatingHandler>> func)
System.ServiceModel.Primitives (12)
Internals\System\Runtime\InputQueue.cs (3)
34public InputQueue(Func<Action<AsyncCallback, IAsyncResult>> asyncCallbackGenerator) 60private Func<Action<AsyncCallback, IAsyncResult>> AsyncCallbackGenerator 411public void Shutdown(Func<Exception> pendingExceptionGenerator)
System\IdentityModel\CryptoHelper.cs (5)
21private static Dictionary<string, Func<object>> s_algorithmDelegateDictionary = new Dictionary<string, Func<object>>(); 276Func<object> delegateFunction = null; 309Linq.Expressions.LambdaExpression creationFunction = Linq.Expressions.Expression.Lambda<Func<object>>(algorithmCreationExpression); 310delegateFunction = creationFunction.Compile() as Func<object>;
System\ServiceModel\Channels\ServiceChannelProxy.cs (3)
285private Func<object> _createDelegate; 310_createDelegate = (Func<object>)Delegate.CreateDelegate(typeof(Func<object>), createTcsGenericMethod);
System\ServiceModel\Diagnostics\TraceUtility.cs (1)
32public static Func<Action<AsyncCallback, IAsyncResult>> asyncCallbackGenerator;
System.Text.Json (33)
System\Text\Json\Serialization\Converters\Collection\StackOrQueueConverter.cs (1)
31Func<object>? constructorDelegate = typeInfo.CreateObject;
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (1)
133Func<object>? createObjectForExtensionDataProp = jsonPropertyInfo.JsonTypeInfo.CreateObject
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (2)
71Func<object>? createObject = DetermineCreateObjectDelegate(type, converter); 457private 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)
119private static void PopulateParameterInfoValues(JsonTypeInfo typeInfo, Func<JsonParameterInfoValues[]?>? paramFactory)
System\Text\Json\Serialization\Metadata\JsonObjectInfoValuesOfT.cs (3)
21public Func<T>? ObjectCreator { get; init; } 39public Func<JsonParameterInfoValues[]>? ConstructorParameterMetadataInitializer { get; init; } 44public Func<ICustomAttributeProvider>? ConstructorAttributeProviderFactory { get; init; }
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (2)
168Func<ICustomAttributeProvider>? attributeProviderFactory = Volatile.Read(ref AttributeProviderFactory); 190internal Func<ICustomAttributeProvider>? AttributeProviderFactory;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs (1)
89public Func<ICustomAttributeProvider>? AttributeProviderFactory { get; init; }
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (5)
91public Func<object>? CreateObject 101private protected Func<object>? _createObject; 103internal Func<object>? CreateObjectForExtensionDataProperty { get; set; } 637Func<ICustomAttributeProvider>? ctorAttrProviderFactory = Volatile.Read(ref ConstructorAttributeProviderFactory); 659internal 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)
23public override Func<object>? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo) 70return CreateDelegate<Func<object>>(dynamicMethod);
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (1)
21public 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)
1021Func<bool> getter, 1188Func<bool> getter, 1231Func<bool> getter, 1256object sender, KeyEventArgs e, Func<bool> gettor, Action<bool> settor, UIElement targetFocusOnFalse, UIElement targetFocusContainerOnTrue)
System.Windows.Input.Manipulations (7)
System\Windows\Input\Manipulations\InertiaParameters2D.cs (1)
28internal void ProtectedChangeProperty(Func<bool> isEqual, Action setNewValue, string paramName)
System\Windows\Input\Manipulations\Lazy.cs (2)
18private Func<T> getValue; 30public Lazy(Func<T> getValue)
System\Windows\Input\Manipulations\ManipulationVelocities2D.cs (4)
107Func<float> getLinearVelocityX, 108Func<float> getLinearVelocityY, 109Func<float> getAngularVelocity, 110Func<float> getExpansionVelocity)
System.Xaml (4)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (2)
23Func<T> _creationDelegate; 25public XamlContextStack(Func<T> creationDelegate)
System\Xaml\Schema\BuiltInValueConverter.cs (2)
18private Func<TConverterBase> _factory; 20internal BuiltInValueConverter(Type converterType, Func<TConverterBase> factory)
Templates.Blazor.Tests (8)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
250internal 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 (19)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
250internal 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 (11)
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 False(this IWebDriver driver, Func<bool> actual) 41public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 44public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 47public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 50public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 56public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 86private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Templates.Blazor.WebAssembly.Tests (19)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
250internal 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 (11)
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 False(this IWebDriver driver, Func<bool> actual) 41public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 44public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 47public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 50public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 56public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 86private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Templates.Mvc.Tests (19)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
250internal 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 (11)
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 False(this IWebDriver driver, Func<bool> actual) 41public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 44public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 47public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 50public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 56public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 86private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
Templates.Tests (19)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
250internal 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 (11)
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 False(this IWebDriver driver, Func<bool> actual) 41public static void Contains(this IWebDriver driver, string expectedSubstring, Func<string> actualString) 44public static void Collection<T>(this IWebDriver driver, Func<IEnumerable<T>> actualValues, params Action<T>[] elementInspectors) 47public static void Empty(this IWebDriver driver, Func<IEnumerable> actualValues) 50public static void Single(this IWebDriver driver, Func<IEnumerable> actualValues) 56public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 86private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
UnitTests.Common (11)
IMockCommunicationObject.cs (2)
15Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 16Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockChannelBase.cs (3)
49public Func<EndpointAddress> GetEndpointPropertyOverride { get; set; } 55public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 56public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockChannelFactory.cs (2)
54public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 55public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockCommunicationObject.cs (2)
50public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 51public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; }
MockTransportBindingElement.cs (1)
16public Func<String> SchemePropertyOverride { get; set; }
TestTypes.cs (1)
337public static void Run(Func<Task> asyncMethod)
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)
WasmAppBuilder (1)
JsonExtensions.cs (1)
11public static T GetOrCreate<T>(this JsonObject json, string name, Func<JsonNode> creator) where T : JsonNode
XmlFileLogger (1)
LogProcessNode.cs (1)
158protected void WriteChildren<T>(XElement parentElement, Func<XElement> subNodeFactory) where T : ILogNode
xunit.assert (31)
EventAsserts.cs (12)
102 Func<RaisedEvent<T>?> handler, 197 Func<Task> testCode) 219 Func<Task> testCode) 241 Func<Task> testCode) 262 Func<Task> testCode) 280 Func<Task> testCode) 305 Func<Task> testCode) 406 Func<RaisedEvent<T>?> handler, 429 Func<Task> testCode) 451 Func<Task> testCode) 476 Func<Task> testCode) 498 Func<Task> testCode)
ExceptionAsserts.cs (12)
63 Func<object?> testCode) => 74 Func<Task> testCode) 99 public static T Throws<T>(Func<object?> testCode) 111 public static T Throws<T>(Func<Task> testCode) 151 Func<object?> testCode) 175 Func<Task> testCode) 218 public static T ThrowsAny<T>(Func<object?> testCode) 228 public static T ThrowsAny<T>(Func<Task> testCode) 240 public static async Task<T> ThrowsAnyAsync<T>(Func<Task> testCode) 252 Func<Task> testCode) => 261 public static async Task<T> ThrowsAsync<T>(Func<Task> testCode) 280 Func<Task> testCode)
PropertyAsserts.cs (2)
61 Func<Task> testCode) 77 Func<Task> testCode)
Record.cs (3)
56 Func<object?> testCode, 85 protected static Exception RecordException(Func<Task> testCode) 96 protected static async Task<Exception?> RecordExceptionAsync(Func<Task> testCode)
Sdk\ArgumentFormatter.cs (1)
603 Func<object?> getter,
Sdk\CollectionTracker.cs (1)
599 Func<bool> moreItemsPastEndIndex,
xunit.console (3)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (2)
19private readonly Func<IDependencyContextReader> _jsonReaderFactory; 33Func<IDependencyContextReader> jsonReaderFactory)
common\DictionaryExtensions.cs (1)
21public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TValue> newValue)