16 types derived from Task
Microsoft.AspNetCore.Mvc.Core.Test (1)
Microsoft.AspNetCore.SignalR.Tests (1)
System.Private.CoreLib (14)
32 instantiations of Task
Microsoft.ML.Data (1)
Microsoft.ML.TestFramework (2)
System.Private.CoreLib (27)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (2)
323Task<TResult> f = new Task<TResult>(function, parent, cancellationToken, creationOptions, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler);
343Task<TResult> f = new Task<TResult>(function, state, parent, cancellationToken, creationOptions, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (8)
1467internal static readonly Task<VoidTaskResult> s_cachedCompleted = new Task<VoidTaskResult>(false, default, (TaskCreationOptions)InternalTaskOptions.DoNotDispose, default);
5435return new Task<TResult>(result);
5459var task = new Task<TResult>();
5483return new Task<TResult>(true, default, TaskCreationOptions.None, cancellationToken);
5507var task = new Task<TResult>();
6249return new Task<TResult[]>(false, Array.Empty<TResult>(), TaskCreationOptions.None, default);
6283new Task<TResult[]>(false, Array.Empty<TResult>(), TaskCreationOptions.None, default) :
6360return new Task<TResult[]>(false, Array.Empty<TResult>(), TaskCreationOptions.None, default);
System.Threading.Tasks.Dataflow (1)
VBCSCompiler (1)
12511 references to Task
AnalyzerRunner (8)
DiagnosticAnalyzerRunner.cs (6)
178private static async Task<DocumentAnalyzerPerformance> TestDocumentPerformanceAsync(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, Project project, DocumentId documentId, Options analyzerOptionsInternal, CancellationToken cancellationToken)
314private static async Task<ImmutableDictionary<ProjectId, AnalysisResult>> GetAnalysisResultAsync(
324var projectDiagnosticTasks = new List<KeyValuePair<ProjectId, Task<AnalysisResult>>>();
339var resultTask = GetProjectAnalysisResultAsync(languageAnalyzers, project, options, cancellationToken);
345projectDiagnosticTasks.Add(new KeyValuePair<ProjectId, Task<AnalysisResult>>(project.Id, resultTask));
379private static async Task<AnalysisResult> GetProjectAnalysisResultAsync(
ApiExplorerWebSite (10)
aspire (98)
Commands\AddCommand.cs (6)
61protected override async Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
195private async Task<(string FriendlyName, NuGetPackage Package)> GetPackageByInteractiveFlow(IEnumerable<(string FriendlyName, NuGetPackage Package)> possiblePackages, string? preferredVersion, CancellationToken cancellationToken)
249Task<(string FriendlyName, NuGetPackage Package)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package)> packages, CancellationToken cancellationToken);
250Task<(string FriendlyName, NuGetPackage Package)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package)> packages, CancellationToken cancellationToken);
255public virtual async Task<(string FriendlyName, NuGetPackage Package)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package)> packages, CancellationToken cancellationToken)
266public virtual async Task<(string FriendlyName, NuGetPackage Package)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package)> packages, CancellationToken cancellationToken)
Commands\NewCommand.cs (10)
72private async Task<ITemplate> GetProjectTemplateAsync(ParseResult parseResult, CancellationToken cancellationToken)
88protected override async Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
100Task<NuGetPackage> PromptForTemplatesVersionAsync(IEnumerable<NuGetPackage> candidatePackages, CancellationToken cancellationToken);
101Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken);
102Task<string> PromptForProjectNameAsync(string defaultName, CancellationToken cancellationToken);
103Task<string> PromptForOutputPath(string v, CancellationToken cancellationToken);
108public virtual async Task<NuGetPackage> PromptForTemplatesVersionAsync(IEnumerable<NuGetPackage> candidatePackages, CancellationToken cancellationToken)
118public virtual async Task<string> PromptForOutputPath(string path, CancellationToken cancellationToken)
127public virtual async Task<string> PromptForProjectNameAsync(string defaultName, CancellationToken cancellationToken)
138public virtual async Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken)
DotNetCliRunner.cs (21)
21Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
22Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
23Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
24Task<int> CheckHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
25Task<int> TrustHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
26Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, string? nugetSource, bool force, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
27Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
28Task<int> BuildAsync(FileInfo projectFilePath, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
29Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
30Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
46public async Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
129public async Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
183public async Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
209public async Task<int> CheckHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
223public async Task<int> TrustHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
237public async Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, string? nugetSource, bool force, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
348public async Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
377public virtual async Task<int> ExecuteAsync(string[] args, IDictionary<string, string>? env, DirectoryInfo workingDirectory, TaskCompletionSource<IAppHostBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
570public async Task<int> BuildAsync(FileInfo projectFilePath, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
583public async Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
627public async Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
Interaction\ConsoleInteractionService.cs (5)
22public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
36public async Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, CancellationToken cancellationToken = default)
55public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
146public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
Interaction\IInteractionService.cs (5)
11Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action);
13Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, CancellationToken cancellationToken = default);
14public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default);
15Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull;
NuGet\NuGetPackageCache.cs (5)
14Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, string? source, CancellationToken cancellationToken);
15Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, string? source, CancellationToken cancellationToken);
23public async Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, string? source, CancellationToken cancellationToken)
35public async Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, string? source, CancellationToken cancellationToken)
40internal async Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, string? source, CancellationToken cancellationToken)
Templating\DotNetTemplateFactory.cs (8)
77private async Task<string[]> PromptForExtraAspireStarterOptionsAsync(ParseResult result, CancellationToken cancellationToken)
87private async Task<string[]> PromptForExtraAspireXUnitOptionsAsync(ParseResult result, CancellationToken cancellationToken)
189private async Task<int> ApplyTemplateWithNoExtraArgsAsync(CallbackTemplate template, ParseResult parseResult, CancellationToken cancellationToken)
194private async Task<int> ApplyTemplateAsync(CallbackTemplate template, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
284private async Task<string> GetProjectNameAsync(ParseResult parseResult, CancellationToken cancellationToken)
295private async Task<string> GetOutputPathAsync(ParseResult parseResult, Func<string, string> pathDeriver, string projectName, CancellationToken cancellationToken)
305private async Task<string> GetProjectTemplatesVersionAsync(ParseResult parseResult, bool prerelease, string? source, CancellationToken cancellationToken)
Utils\AppHostHelper.cs (3)
16internal static async Task<(bool IsCompatibleAppHost, bool SupportsBackchannel, string? AspireHostingVersion)> CheckAppHostCompatibilityAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, AspireCliTelemetry telemetry, CancellationToken cancellationToken)
52internal static async Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, AspireCliTelemetry telemetry, CancellationToken cancellationToken)
66internal static async Task<int> BuildAppHostAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
Aspire.Azure.AI.OpenAI.Tests (2)
Aspire.Azure.Messaging.WebPubSub (1)
Aspire.Azure.Search.Documents (1)
Aspire.Cli.Tests (40)
TestServices\TestConsoleInteractionService.cs (5)
14public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
24public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, CancellationToken cancellationToken = default)
29public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
69public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
TestServices\TestDotNetCliRunner.cs (11)
19public Func<FileInfo, bool, bool, string[], IDictionary<string, string>?, TaskCompletionSource<IAppHostBackchannel>?, DotNetCliRunnerInvocationOptions, CancellationToken, Task<int>>? RunAsyncCallback { get; set; }
23public Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
30public Task<int> BuildAsync(FileInfo projectFilePath, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
37public Task<int> CheckHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
44public Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
53public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
60public Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, string? nugetSource, bool force, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
67public Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
74public Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
81public Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
88public Task<int> TrustHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
Aspire.Components.Common.TestUtilities (1)
Aspire.Confluent.Kafka (2)
Aspire.Dashboard (41)
Aspire.Dashboard.Components.Tests (18)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Dashboard.Tests (32)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.EndToEnd.Tests (12)
Aspire.Hosting (86)
ApplicationModel\InteractionService.cs (7)
44public async Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
64public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
73private async Task<InteractionResult<bool>> PromptMessageBoxCoreAsync(string title, string message, MessageBoxInteractionOptions options, CancellationToken cancellationToken)
103public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
119public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
141public async Task<InteractionResult<IReadOnlyList<InteractionInput>>> PromptInputsAsync(string title, string? message, IEnumerable<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
169public async Task<InteractionResult<bool>> PromptMessageBarAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
ApplicationModel\ResourceNotificationService.cs (7)
117/// <returns>A <see cref="Task{String}"/> representing the wait operation and which of the target states the resource reached.</returns>
120public async Task<string> WaitForResourceAsync(string resourceName, IEnumerable<string> targetStates, CancellationToken cancellationToken = default)
242public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, CancellationToken cancellationToken = default)
275public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, WaitBehavior waitBehavior, CancellationToken cancellationToken = default)
405/// <returns>A <see cref="Task{ResourceEvent}"/> representing the wait operation and which of the target states the resource reached.</returns>
408public async Task<ResourceEvent> WaitForResourceAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default)
417private async Task<ResourceEvent> WaitForResourceCoreAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default)
Dcp\DcpExecutor.cs (4)
1669private async Task<(List<(string Value, bool IsSensitive)>, bool)> BuildArgsAsync(ILogger resourceLogger, IResource modelResource, CancellationToken cancellationToken)
1697private async Task<List<ContainerCreateFileSystem>> BuildCreateFilesAsync(IResource modelResource, CancellationToken cancellationToken)
1727private async Task<(List<EnvVar>, bool)> BuildEnvVarsAsync(ILogger resourceLogger, IResource modelResource, CancellationToken cancellationToken)
1754private async Task<(List<string>, bool)> BuildRunArgsAsync(ILogger resourceLogger, IResource modelResource, CancellationToken cancellationToken)
Dcp\KubernetesService.cs (16)
37Task<T> GetAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
39Task<T> CreateAsync<T>(T obj, CancellationToken cancellationToken = default)
41Task<T> PatchAsync<T>(T obj, V1Patch patch, CancellationToken cancellationToken = default)
43Task<List<T>> ListAsync<T>(string? namespaceParameter = null, CancellationToken cancellationToken = default)
45Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
64Task<Stream> GetLogStreamAsync<T>(
94public Task<T> GetAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
125public Task<T> CreateAsync<T>(T obj, CancellationToken cancellationToken = default)
158public Task<T> PatchAsync<T>(T obj, V1Patch patch, CancellationToken cancellationToken = default)
193public Task<List<T>> ListAsync<T>(string? namespaceParameter = null, CancellationToken cancellationToken = default)
223public Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
272var responseTask = string.IsNullOrEmpty(namespaceParameter)
299public Task<Stream> GetLogStreamAsync<T>(
445private Task<TResult> ExecuteWithRetry<TResult>(
460private async Task<TResult> ExecuteWithRetry<TResult>(
463Func<DcpKubernetesClient, Task<TResult>> operation,
Aspire.Hosting.Azure (24)
Aspire.Hosting.Azure.AppContainers (1)
Aspire.Hosting.Azure.AppService (1)
Aspire.Hosting.Azure.KeyVault (2)
Aspire.Hosting.Azure.Tests (15)
Aspire.Hosting.Docker (1)
Aspire.Hosting.Garnet.Tests (1)
Aspire.Hosting.Kafka.Tests (9)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Kubernetes (2)
Aspire.Hosting.MySql.Tests (11)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Nats (2)
Aspire.Hosting.NodeJs.Tests (9)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.PostgreSQL.Tests (11)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Qdrant (1)
Aspire.Hosting.RabbitMQ (1)
Aspire.Hosting.RabbitMQ.Tests (9)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Redis.Tests (1)
Aspire.Hosting.Testing (16)
DistributedApplicationTestingBuilder.cs (11)
30public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(CancellationToken cancellationToken = default)
43public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, CancellationToken cancellationToken = default)
58public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(string[] args, CancellationToken cancellationToken = default)
72public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, CancellationToken cancellationToken = default)
88public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder, CancellationToken cancellationToken = default)
102public static async Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder, CancellationToken cancellationToken = default)
160public async Task<IDistributedApplicationTestingBuilder> CreateBuilderAsync(CancellationToken cancellationToken)
185public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
225public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
366public Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
455Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken = default);
Aspire.Hosting.Testing.Tests (3)
Aspire.Hosting.Tests (55)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Valkey.Tests (10)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Milvus.Client (1)
Aspire.NATS.Net (2)
Aspire.OpenAI.Tests (2)
Aspire.Playground.Tests (11)
tests\Shared\AsyncTestHelpers.cs (9)
96public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
111public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
203public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Qdrant.Client (1)
Aspire.RabbitMQ.Client (1)
Aspire.RabbitMQ.Client.Tests (1)
Aspire.RabbitMQ.Client.v7.Tests (1)
Aspire.Seq (1)
Aspire.StackExchange.Redis.Tests (1)
Aspire.Templates.Tests (20)
TemplateTestsBase.cs (7)
35var t = Task.Run(async () => await PlaywrightProvider.CreateBrowserAsync());
47public async Task<string> CreateAndAddTestTemplateProjectAsync(
146public static Task<IBrowserContext> CreateNewBrowserContextAsync()
151protected Task<ResourceRow[]> CheckDashboardHasResourcesAsync(WrapperForIPage dashboardPageWrapper, IEnumerable<ResourceRow> expectedResources, string logPath, int timeoutSecs = 120)
154protected static async Task<ResourceRow[]> CheckDashboardHasResourcesAsync(WrapperForIPage dashboardPageWrapper,
173private static async Task<ResourceRow[]> CheckDashboardHasResourcesActualAsync(WrapperForIPage dashboardPageWrapper, IEnumerable<ResourceRow> expectedResources, ITestOutputHelper testOutput, int timeoutSecs = 120)
317public static async Task<CommandResult?> AssertTestProjectRunAsync(string testProjectDirectory, string testType, ITestOutputHelper testOutput, string config = "Debug", int testRunTimeoutSecs = 3 * 60)
AuthSamples.FunctionalTests (5)
AzureFunctionsEndToEnd.Functions (1)
BasicTestApp (22)
BasicWebSite (20)
BasketService (14)
Binding.Http.IntegrationTests (3)
Binding.ReliableSession.IntegrationTests (10)
BlazorServerApp (1)
BlazorUnitedApp (1)
CatalogDb (3)
CatalogModel (2)
CdkSample.ApiService (9)
ClaimsTransformation (3)
Client.ClientBase.IntegrationTests (1)
Client.ExpectedExceptions.IntegrationTests (7)
Client.TypedClient.IntegrationTests (3)
ClientSample (10)
Contract.Service.IntegrationTests (6)
Contract.XmlSerializer.IntegrationTests (1)
Cookies (2)
CookieSessionSample (2)
CosmosEndToEnd.ApiService (1)
csc (12)
CustomAuthorizationFailureResponse (1)
CustomPolicyProvider (5)
Diagnostics.EFCore.FunctionalTests (1)
dotnet-dev-certs (1)
dotnet-getdocument (1)
dotnet-openapi (18)
dotnet-sql-cache (1)
dotnet-svcutil.xmlserializer.IntegrationTests (1)
dotnet-svcutil-lib (323)
FrameworkFork\Microsoft.Xml\Xml\Core\ReadContentAsBinaryHelperAsync.cs (9)
17internal async Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
73internal async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
129internal async Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
185internal async Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
261private async Task<bool> InitAsync()
274private async Task<bool> InitOnElementAsync()
302private async Task<int> ReadContentAsBinaryAsync(byte[] buffer, int index, int count)
361private async Task<int> ReadElementContentAsBinaryAsync(byte[] buffer, int index, int count)
386private async Task<bool> MoveToNextContentNodeAsync(bool moveIfOnContentNode)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlAsyncCheckReader.cs (32)
802public override Task<string> GetValueAsync()
805var task = _coreReader.GetValueAsync();
810public override Task<object> ReadContentAsObjectAsync()
813var task = _coreReader.ReadContentAsObjectAsync();
818public override Task<string> ReadContentAsStringAsync()
821var task = _coreReader.ReadContentAsStringAsync();
826public override Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
829var task = _coreReader.ReadContentAsAsync(returnType, namespaceResolver);
834public override Task<object> ReadElementContentAsObjectAsync()
837var task = _coreReader.ReadElementContentAsObjectAsync();
842public override Task<string> ReadElementContentAsStringAsync()
845var task = _coreReader.ReadElementContentAsStringAsync();
850public override Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
853var task = _coreReader.ReadElementContentAsAsync(returnType, namespaceResolver);
858public override Task<bool> ReadAsync()
861var task = _coreReader.ReadAsync();
874public override Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
877var task = _coreReader.ReadContentAsBase64Async(buffer, index, count);
882public override Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
885var task = _coreReader.ReadElementContentAsBase64Async(buffer, index, count);
890public override Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
893var task = _coreReader.ReadContentAsBinHexAsync(buffer, index, count);
898public override Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
901var task = _coreReader.ReadElementContentAsBinHexAsync(buffer, index, count);
906public override Task<int> ReadValueChunkAsync(char[] buffer, int index, int count)
909var task = _coreReader.ReadValueChunkAsync(buffer, index, count);
914public override Task<XmlNodeType> MoveToContentAsync()
917var task = _coreReader.MoveToContentAsync();
922public override Task<string> ReadInnerXmlAsync()
925var task = _coreReader.ReadInnerXmlAsync();
930public override Task<string> ReadOuterXmlAsync()
933var task = _coreReader.ReadOuterXmlAsync();
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReaderAsync.cs (19)
28public virtual Task<string> GetValueAsync()
35public virtual async Task<object> ReadContentAsObjectAsync()
46public virtual Task<string> ReadContentAsStringAsync()
57public virtual async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
87public virtual async Task<object> ReadElementContentAsObjectAsync()
99public virtual async Task<string> ReadElementContentAsStringAsync()
111public virtual async Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
125public virtual Task<bool> ReadAsync()
141public virtual Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
147public virtual Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
153public virtual Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
159public virtual Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
166public virtual Task<int> ReadValueChunkAsync(char[] buffer, int index, int count)
174public virtual async Task<XmlNodeType> MoveToContentAsync()
196public virtual async Task<string> ReadInnerXmlAsync()
283public virtual async Task<string> ReadOuterXmlAsync()
322private async Task<bool> SkipSubtreeAsync()
346internal async Task<string> InternalReadContentAsStringAsync()
397private async Task<bool> SetupReadElementContentAsXxxAsync(string methodName)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlSubtreeReaderAsync.cs (13)
21public override Task<string> GetValueAsync()
33public override async Task<bool> ReadAsync()
188public override async Task<object> ReadContentAsObjectAsync()
204public override async Task<string> ReadContentAsStringAsync()
220public override async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
236public override async Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
315public override async Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
372public override async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
451public override async Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
507public override Task<int> ReadValueChunkAsync(char[] buffer, int index, int count)
558private async Task<bool> InitReadElementContentAsBinaryAsync(State binaryState)
589private async Task<bool> FinishReadElementContentAsBinaryAsync()
623private async Task<bool> FinishReadContentAsBinaryAsync()
FrameworkFork\Microsoft.Xml\Xml\Core\XsdValidatingReaderAsync.cs (26)
26public override Task<string> GetValueAsync()
35public override Task<object> ReadContentAsObjectAsync()
45public override async Task<string> ReadContentAsStringAsync()
78public override async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
123public override async Task<object> ReadElementContentAsObjectAsync()
135public override async Task<string> ReadElementContentAsStringAsync()
173public override async Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
219private Task<bool> ReadAsync_Read(Task<bool> task)
243private async Task<bool> _ReadAsync_Read(Task<bool> task)
261private Task<bool> ReadAsync_ReadAhead(Task task)
274private async Task<bool> _ReadAsync_ReadAhead(Task task)
282public override Task<bool> ReadAsync()
287Task<bool> readTask = _coreReader.ReadAsync();
373public override async Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
399public override async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
425public override async Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
451public override async Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
649private Task<object> InternalReadContentAsObjectAsync()
654private async Task<object> InternalReadContentAsObjectAsync(bool unwrapTypedValue)
661private async Task<Tuple<string, object>> InternalReadContentAsObjectTupleAsync(bool unwrapTypedValue)
732private Task<Tuple<XmlSchemaType, object>> InternalReadElementContentAsObjectAsync()
737private async Task<Tuple<XmlSchemaType, object>> InternalReadElementContentAsObjectAsync(bool unwrapTypedValue)
744private async Task<Tuple<XmlSchemaType, string, object>> InternalReadElementContentAsObjectTupleAsync(bool unwrapTypedValue)
820private async Task<object> ReadTillEndElementAsync()
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Connection.cs (10)
39Task<IConnection> ConnectAsync(Uri uri, TimeSpan timeout);
378public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
448private Action<Task<int>, object> _onRead;
450private Task<int> _readResult;
464_onRead = new Action<Task<int>, object>(OnRead);
675Task<int> localTask = _stream.ReadAsync(AsyncReadBuffer, offset, size);
696Task<int> localResult = _readResult;
714private void OnRead(Task<int> antecedant, object state)
828internal static async Task<int> ReadAsync(this IConnection connection, int offset, int size, TimeSpan timeout)
846internal static async Task<int> ReadAsync(this IConnection connection, byte[] buffer, int offset, int size, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncoder.cs (5)
37public virtual Task<Message> ReadMessageAsync(Stream stream, int maxSizeOfHeaders, string contentType)
42public virtual Task<Message> ReadMessageAsync(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType)
58internal async Task<ArraySegment<byte>> BufferMessageStreamAsync(Stream stream, BufferManager bufferManager, int maxBufferSize)
93internal virtual async Task<Message> ReadMessageAsync(Stream stream, BufferManager bufferManager, int maxBufferSize, string contentType)
130public virtual Task<ArraySegment<byte>> WriteMessageAsync(Message message, int maxMessageSize,
Shared\MSBuildProj.cs (12)
145public static async Task<MSBuildProj> FromPathAsync(string filePath, ILogger logger, CancellationToken cancellationToken)
152internal static async Task<MSBuildProj> FromPathAsync(string filePath, ILogger logger, string tfMoniker, CancellationToken cancellationToken)
159public static async Task<MSBuildProj> ParseAsync(string projectText, string projectFullPath, ILogger logger, CancellationToken cancellationToken, string tfMoniker = "")
374public static async Task<MSBuildProj> DotNetNewAsync(string fullPath, ILogger logger, CancellationToken cancellationToken, string optional = "")
711public async Task<ProcessRunner.ProcessResult> RestoreAsync(ILogger logger, CancellationToken cancellationToken)
731public async Task<ProcessRunner.ProcessResult> BuildAsync(bool restore, ILogger logger, CancellationToken cancellationToken)
740public async Task<ProcessRunner.ProcessResult> BuildAsync(ILogger logger, CancellationToken cancellationToken)
750public async Task<IEnumerable<ProjectDependency>> ResolveProjectReferencesAsync(IEnumerable<ProjectDependency> excludeDependencies, ILogger logger, CancellationToken cancellationToken)
783private async Task<List<ProjectDependency>> ResolvePackageReferencesAsync(ILogger logger, CancellationToken cancellationToken)
861private async Task<List<ProjectDependency>> ResolveAssemblyReferencesAsync(ILogger logger, CancellationToken cancellationToken)
949public async Task<IEnumerable<KeyValuePair<string, string>>> ResolveProperyValuesAsync(IEnumerable<string> propertyNames, ILogger logger, CancellationToken cancellationToken)
988private async Task<string> ResolveDepsFilePathFromBuildConfigAsync(string outputPath, ILogger logger, CancellationToken cancellationToken)
Shared\ProjectPropertyResolver.cs (4)
23public async Task<Dictionary<string, string>> EvaluateProjectPropertiesAsync(string projectPath, string targetFramework, IEnumerable<string> propertyNames, IDictionary<string, string> globalProperties, ILogger logger, CancellationToken cancellationToken)
117public static async Task<string> GetSdkVersionAsync(string workingDirectory, ILogger logger, CancellationToken cancellationToken)
137public static async Task<string> GetSdkPathAsync(string workingDirectory, ILogger logger, CancellationToken cancellationToken)
171private async Task<Assembly> LoadMSBuildAssembliesAsync(string sdkPath, ILogger logger, CancellationToken cancellationToken)
Shared\Utilities\PathHelper.cs (4)
203public static async Task<string> TryCopyFileIfFoundAsync(string fileName, string workingDirectory, string destinationDir, ILogger logger, CancellationToken cancellationToken)
228public static async Task<string> TryFindFileAsync(string fileName, string workingDir, ILogger logger, CancellationToken cancellationToken)
233public static async Task<string> TryFindFolderAsync(string folderName, string workingDir, ILogger logger, CancellationToken cancellationToken)
238private static async Task<string> TryFindItemAsync(Func<string, IEnumerable<string>> EnumerateItems, string itemName, string workingDir, ILogger logger, CancellationToken cancellationToken)
Shared\Utilities\ProcessRunner.cs (5)
33public static async Task<ProcessResult> RunAsync(string processName, string processArgs, string currentDir, ILogger logger, CancellationToken cancellationToken)
38public static async Task<ProcessResult> RunAsync(string processName, string processArgs, string currentDir, bool redirectOutput, ILogger logger, CancellationToken cancellationToken)
43public static async Task<ProcessResult> TryRunAsync(string processName, string processArgs, string currentDir, ILogger logger, CancellationToken cancellationToken)
47public static async Task<ProcessResult> RunAsync(string processName, string processArgs, string currentDir, bool redirectOutput, bool throwOnError, ILogger logger, CancellationToken cancellationToken)
53public static async Task<ProcessResult> RunAsync(string processName, string processArgs, string currentDir, bool redirectOutput, bool throwOnError, IDictionary<string, string> environmentVariables, ILogger logger, CancellationToken cancellationToken)
dotnet-svcutil-lib.Tests (1)
dotnet-user-jwts (1)
dotnet-user-secrets (1)
DynamicSchemes (2)
FilesWebSite (2)
FormatterWebSite (6)
GenerateDocumentationAndConfigFiles (15)
GenerateDocumentationAndConfigFilesForBrokenRuntime (1)
GenerateRulesMissingDocumentation (1)
GetDocument.Insider (1)
HealthChecksSample (3)
HelixTestRunner (4)
HostedBlazorWebassemblyApp.Client (1)
HostedBlazorWebassemblyApp.Server (2)
HostedBlazorWebassemblyApp.Shared (1)
http2cat (7)
src\Shared\Http2cat\Http2Utilities.cs (5)
499internal async Task<bool> SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
564internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerator<KeyValuePair<string, string>> headersEnumerator)
592internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
833internal async Task<Http2FrameWithPayload> ReceiveFrameAsync(uint maxFrameSize = Http2PeerSettings.DefaultMaxFrameSize)
872internal async Task<Http2FrameWithPayload> ExpectAsync(Http2FrameType type, int withLength, byte withFlags, int withStreamId)
HttpStress (2)
IdeBenchmarks (3)
IdeCoreBenchmarks (2)
Identity.DefaultUI.WebSite (32)
src\Identity\test\InMemory.Test\InMemoryUserStore.cs (30)
33public Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
80public Task<string> GetEmailAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
85public Task<string> GetNormalizedEmailAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
96public Task<bool> GetEmailConfirmedAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
107public Task<TUser> FindByEmailAsync(string email, CancellationToken cancellationToken = default(CancellationToken))
114public Task<DateTimeOffset?> GetLockoutEndDateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
125public Task<int> IncrementAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
137public Task<int> GetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
142public Task<bool> GetLockoutEnabledAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
188public Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
195public Task<TUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken))
205public Task<string> GetUserIdAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
210public Task<string> GetUserNameAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
221public Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
227public Task<IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
233public Task<TUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
246public Task<TUser> FindByNameAsync(string userName, CancellationToken cancellationToken = default(CancellationToken))
253public Task<IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
269public Task<string> GetPasswordHashAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
274public Task<bool> HasPasswordAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
285public Task<string> GetPhoneNumberAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
290public Task<bool> GetPhoneNumberConfirmedAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
307public Task<string> GetSecurityStampAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
318public Task<bool> GetTwoFactorEnabledAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
323public Task<string> GetNormalizedUserNameAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
334public Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
383public Task<string> GetTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken)
402public Task<string> GetAuthenticatorKeyAsync(TUser user, CancellationToken cancellationToken)
413public async Task<bool> RedeemCodeAsync(TUser user, string code, CancellationToken cancellationToken)
426public async Task<int> CountCodesAsync(TUser user, CancellationToken cancellationToken)
Identity.ExternalClaims (31)
IdentitySample.DefaultUI (4)
IdentitySample.Mvc (32)
IIS.Common.TestLib (7)
IIS.FunctionalTests (22)
src\Shared\Http2cat\Http2Utilities.cs (5)
499internal async Task<bool> SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
564internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerator<KeyValuePair<string, string>> headersEnumerator)
592internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
833internal async Task<Http2FrameWithPayload> ReceiveFrameAsync(uint maxFrameSize = Http2PeerSettings.DefaultMaxFrameSize)
872internal async Task<Http2FrameWithPayload> ExpectAsync(Http2FrameType type, int withLength, byte withFlags, int withStreamId)
IIS.LongTests (18)
src\Shared\Http2cat\Http2Utilities.cs (5)
499internal async Task<bool> SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
564internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerator<KeyValuePair<string, string>> headersEnumerator)
592internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
833internal async Task<Http2FrameWithPayload> ReceiveFrameAsync(uint maxFrameSize = Http2PeerSettings.DefaultMaxFrameSize)
872internal async Task<Http2FrameWithPayload> ExpectAsync(Http2FrameType type, int withLength, byte withFlags, int withStreamId)
IIS.NewHandler.FunctionalTests (18)
src\Shared\Http2cat\Http2Utilities.cs (5)
499internal async Task<bool> SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
564internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerator<KeyValuePair<string, string>> headersEnumerator)
592internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
833internal async Task<Http2FrameWithPayload> ReceiveFrameAsync(uint maxFrameSize = Http2PeerSettings.DefaultMaxFrameSize)
872internal async Task<Http2FrameWithPayload> ExpectAsync(Http2FrameType type, int withLength, byte withFlags, int withStreamId)
IIS.NewShim.FunctionalTests (18)
src\Shared\Http2cat\Http2Utilities.cs (5)
499internal async Task<bool> SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
564internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerator<KeyValuePair<string, string>> headersEnumerator)
592internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
833internal async Task<Http2FrameWithPayload> ReceiveFrameAsync(uint maxFrameSize = Http2PeerSettings.DefaultMaxFrameSize)
872internal async Task<Http2FrameWithPayload> ExpectAsync(Http2FrameType type, int withLength, byte withFlags, int withStreamId)
IIS.ShadowCopy.Tests (12)
IIS.Tests (4)
IISExpress.FunctionalTests (24)
src\Shared\Http2cat\Http2Utilities.cs (5)
499internal async Task<bool> SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
564internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerator<KeyValuePair<string, string>> headersEnumerator)
592internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
833internal async Task<Http2FrameWithPayload> ReceiveFrameAsync(uint maxFrameSize = Http2PeerSettings.DefaultMaxFrameSize)
872internal async Task<Http2FrameWithPayload> ExpectAsync(Http2FrameType type, int withLength, byte withFlags, int withStreamId)
ILLink.CodeFixProvider (2)
ILLink.RoslynAnalyzer (1)
Infrastructure.Common (3)
InMemory.FunctionalTests (36)
Http2\Http2TestBase.cs (8)
344var stalledReadTask = context.Request.Body.ReadAsync(buffer, 0, buffer.Length);
867internal async Task<bool> SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, Http2HeadersEnumerator headersEnumerator)
883internal Task<bool> SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
937internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, Http2HeadersEnumerator headersEnumerator)
965internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
1210internal async Task<byte[]> ReadAllAsync()
1226internal async Task<Http2FrameWithPayload> ReceiveFrameAsync(uint maxFrameSize = uint.MaxValue)
1266internal async Task<Http2FrameWithPayload> ExpectAsync(Http2FrameType type, int withLength, byte withFlags, int withStreamId)
src\Servers\Kestrel\shared\test\StreamExtensions.cs (4)
15public static async Task<int> FillBufferUntilEndAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
34public static async Task<int> FillEntireBufferAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
49public static async Task<byte[]> ReadAtLeastLengthAsync(this Stream stream, int length, int bufferLength = 1024, bool allowEmpty = false, CancellationToken cancellationToken = default)
76public static async Task<byte[]> ReadUntilEndAsync(this Stream stream, int bufferLength = 1024, CancellationToken cancellationToken = default)
InProcessWebSite (1)
IntegrationTestsWebsite (15)
artifacts\obj\IntegrationTestsWebsite\Release\net10.0\Protos\GreetGrpc.cs (14)
189public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHello(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
195public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloPost(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
201public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloComplex(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
207public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloPostEnum(global::IntegrationTestsWebsite.EnumHelloRequest request, grpc::ServerCallContext context)
213public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloComplexCatchAll1(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
219public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloComplexCatchAll2(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
225public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloComplexCatchAll3(global::IntegrationTestsWebsite.ComplextHelloRequest request, grpc::ServerCallContext context)
231public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloComplexCatchAll4(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
237public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloCustomVerbOne(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
243public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloCustomVerbTwo(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
249public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloCatchAllCustomVerbOne(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
255public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloCatchAllCustomVerbTwo(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
261public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloPostCustomVerbOne(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
267public virtual global::System.Threading.Tasks.Task<global::IntegrationTestsWebsite.HelloReply> SayHelloPostCustomVerbTwo(global::IntegrationTestsWebsite.HelloRequest request, grpc::ServerCallContext context)
InteractiveHost.UnitTests (5)
InteractiveHost32 (1)
InteractiveHost64 (1)
Interop.FunctionalTests (45)
Http3\Http3RequestTests.cs (19)
60public Task<Stream> GetStreamAsync()
300var responseTask = client.SendAsync(request, CancellationToken.None).DefaultTimeout();
370static async Task<HttpResponseMessage> SendRequestAsync(HttpProtocols protocol, IHost host, HttpMessageInvoker client)
380var responseTask = client.SendAsync(request, CancellationToken.None).DefaultTimeout();
424var responseTask = client.SendAsync(request, CancellationToken.None);
495var responseTask = client.SendAsync(request, cts.Token);
566var sendTask = client.SendAsync(request, CancellationToken.None);
625var sendTask = client.SendAsync(request, CancellationToken.None);
734var responseTask = client.SendAsync(request, cts.Token);
781var connectionRequestTasks = new List<Task<int>>();
797static async Task<int> RunConnection(string address)
1020var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1117var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1263var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1781var responseTask1 = client.SendAsync(CreateHttp3Request(HttpMethod.Get, $"https://127.0.0.1:{port}/1"), CancellationToken.None);
1890var responseTask = client.SendAsync(request1, CancellationToken.None);
2010var readTask = context.Request.Body.ReadUntilEndAsync();
2045var responseTask = client.SendAsync(request, CancellationToken.None);
2145var responseTask = client.SendAsync(request, CancellationToken.None);
HttpClientHttp2InteropTests.cs (18)
299var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
376var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
792var requestTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
823var readTask = context.Request.Body.ReadAsync(new byte[11], 0, 11);
844var requestTask = client.SendAsync(request);
870var readTask = context.Request.Body.ReadAsync(new byte[11], 0, 11);
889var requestTask = client.SendAsync(request);
932var requestTask = client.GetAsync(url, requestCancellation.Token);
1063var requestTask = client.SendAsync(request);
1172var requestTask = client.SendAsync(request);
1226var tasks = new List<Task<HttpResponseMessage>>(10);
1229var requestTask = client.GetAsync(url).DefaultTimeout();
1287var tasks = new List<Task<HttpResponseMessage>>(10);
1290var requestTask = client.PostAsync(url, new StringContent("Hello World")).DefaultTimeout();
1433var requestTask = client.PostAsync(url, streamingContent);
1481var requestTask = client.GetStreamAsync(url);
1518var requestTask0 = client.PostAsync(url, streamingContent0);
1519var requestTask1 = client.PostAsync(url, streamingContent1);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (4)
15public static async Task<int> FillBufferUntilEndAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
34public static async Task<int> FillEntireBufferAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
49public static async Task<byte[]> ReadAtLeastLengthAsync(this Stream stream, int length, int bufferLength = 1024, bool allowEmpty = false, CancellationToken cancellationToken = default)
76public static async Task<byte[]> ReadUntilEndAsync(this Stream stream, int bufferLength = 1024, CancellationToken cancellationToken = default)
InteropClient (4)
InteropWebsite (11)
JwtClientSample (3)
Kestrel.SampleApp (1)
Keycloak.Web (2)
Metrics (26)
Metrics.Legacy (26)
Microsoft.Analyzers.Extra (10)
Microsoft.Analyzers.Extra.Tests (10)
Microsoft.Analyzers.Local.Tests (11)
Microsoft.Arcade.Common (14)
Microsoft.Arcade.Test.Common (2)
Microsoft.AspNetCore.Analyzer.Testing (6)
Microsoft.AspNetCore.Analyzers (1)
Microsoft.AspNetCore.Antiforgery (5)
Microsoft.AspNetCore.App.Analyzers (4)
Microsoft.AspNetCore.App.Analyzers.Test (13)
Microsoft.AspNetCore.App.CodeFixes (8)
Microsoft.AspNetCore.Authentication (13)
Microsoft.AspNetCore.Authentication.Abstractions (19)
Microsoft.AspNetCore.Authentication.BearerToken (1)
Microsoft.AspNetCore.Authentication.Certificate (4)
Microsoft.AspNetCore.Authentication.Cookies (11)
Microsoft.AspNetCore.Authentication.Core (22)
Microsoft.AspNetCore.Authentication.Core.Test (10)
Microsoft.AspNetCore.Authentication.Facebook (1)
Microsoft.AspNetCore.Authentication.Google (1)
Microsoft.AspNetCore.Authentication.JwtBearer (3)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
Microsoft.AspNetCore.Authentication.Negotiate (5)
Microsoft.AspNetCore.Authentication.Negotiate.Test (5)
Microsoft.AspNetCore.Authentication.OAuth (4)
Microsoft.AspNetCore.Authentication.OpenIdConnect (15)
OpenIdConnectHandler.cs (15)
86protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new OpenIdConnectEvents());
89public override Task<bool> HandleRequestAsync()
104protected virtual async Task<bool> HandleRemoteSignOutAsync()
312protected virtual async Task<bool> HandleSignOutCallbackAsync()
604private async Task<string> GetPushedAuthorizationRequestUri(HttpResponseMessage parResponseMessage)
629protected override async Task<HandleRequestResult> HandleRemoteAuthenticateAsync()
983protected virtual async Task<OpenIdConnectMessage> RedeemAuthorizationCodeAsync(OpenIdConnectMessage tokenEndpointRequest)
1036protected virtual async Task<HandleRequestResult> GetUserInformationAsync(
1204private async Task<MessageReceivedContext> RunMessageReceivedEventAsync(OpenIdConnectMessage message, AuthenticationProperties? properties)
1228private async Task<TokenValidatedContext> RunTokenValidatedEventAsync(OpenIdConnectMessage authorizationResponse, OpenIdConnectMessage? tokenEndpointResponse, ClaimsPrincipal user, AuthenticationProperties properties, JwtSecurityToken jwt, string? nonce)
1254private async Task<AuthorizationCodeReceivedContext> RunAuthorizationCodeReceivedEventAsync(OpenIdConnectMessage authorizationResponse, ClaimsPrincipal? user, AuthenticationProperties properties, JwtSecurityToken? jwt)
1300private async Task<TokenResponseReceivedContext> RunTokenResponseReceivedEventAsync(
1329private async Task<UserInformationReceivedContext> RunUserInformationReceivedEventAsync(ClaimsPrincipal principal, AuthenticationProperties properties, OpenIdConnectMessage message, JsonDocument user)
1355private async Task<AuthenticationFailedContext> RunAuthenticationFailedEventAsync(OpenIdConnectMessage message, Exception exception)
1437private async Task<TokenValidationResult> ValidateTokenUsingHandlerAsync(string idToken, AuthenticationProperties properties, TokenValidationParameters validationParameters)
Microsoft.AspNetCore.Authentication.Test (63)
Microsoft.AspNetCore.Authentication.Twitter (7)
Microsoft.AspNetCore.Authentication.WsFederation (5)
Microsoft.AspNetCore.Authorization (33)
AuthorizationServiceExtensions.cs (4)
27public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, object? resource, IAuthorizationRequirement requirement)
46public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, object? resource, AuthorizationPolicy policy)
64public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, AuthorizationPolicy policy)
82public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, string policyName)
Microsoft.AspNetCore.Authorization.Policy (4)
Microsoft.AspNetCore.Authorization.Test (16)
PolicyEvaluatorTests.cs (6)
171public Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)
174public Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, string policyName)
180public Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)
183public Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, string policyName)
189public Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string scheme)
209public Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string scheme)
Microsoft.AspNetCore.BrowserTesting (9)
BrowserManager.cs (9)
43public static async Task<BrowserManager> CreateAsync(BrowserManagerConfiguration configuration, ILoggerFactory loggerFactory)
85public Task<IBrowserContext> GetBrowserInstance(BrowserKind browserInstance, ContextInformation contextInfo) =>
88public Task<IBrowserContext> GetBrowserInstance(string browserInstance, ContextInformation contextInfo)
97public Task<IBrowserContext> GetBrowserInstance(BrowserKind browserInstance, string contextName, ContextInformation contextInfo) =>
100public Task<IBrowserContext> GetBrowserInstance(string browserInstance, string contextName, ContextInformation contextInfo)
109public Task<IBrowserContext> GetBrowserInstance(BrowserKind browserInstance, string contextName, BrowserNewContextOptions options, ContextInformation contextInfo) =>
112public Task<IBrowserContext> GetBrowserInstance(string browserInstance, string contextName, BrowserNewContextOptions options, ContextInformation contextInfo)
135private async Task<IBrowserContext> AttachContextInfo(Task<IBrowserContext> browserContextTask, ContextInformation contextInfo)
Microsoft.AspNetCore.Components (22)
Microsoft.AspNetCore.Components.Analyzers (1)
Microsoft.AspNetCore.Components.Analyzers.Tests (3)
Microsoft.AspNetCore.Components.Authorization (11)
Microsoft.AspNetCore.Components.Authorization.Tests (20)
Microsoft.AspNetCore.Components.Endpoints (10)
Microsoft.AspNetCore.Components.QuickGrid (2)
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (3)
Microsoft.AspNetCore.Components.Server (26)
Microsoft.AspNetCore.Components.Server.Tests (23)
Circuits\CircuitRegistryTest.cs (6)
311var connectCore = registry.ConnectAsync(circuitHost.CircuitId, client, newId, default);
364var connectCore = registry.ConnectAsync(circuitHost.CircuitId, client, newId, default);
395var connect = Task.Run(() => registry.ConnectAsync(circuitHost.CircuitId, client, newId, default));
521var connectTask = Task.Run(async () =>
526var connectResultAttempt = registry.ConnectAsync(circuitHost.CircuitId, newClient, newConnectionId, default);
641public Task<PersistedCircuitState> RestoreCircuitAsync(CircuitId circuitId, CancellationToken cancellation = default)
Microsoft.AspNetCore.Components.Tests (44)
NavigationManagerTest.cs (18)
225var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
254var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
280var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
311var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
336var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
367var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
403var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
442var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
484var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
516var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
571var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
573var navigation2 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir2", null, false);
625var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
626var navigation2 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir2", null, false);
634var navigation3 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir3", null, false);
694var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
838var navigation1 = navigationManager.RunNotifyLocationChangingAsync($"{baseUri}/subdir1", null, false);
906public async Task<bool> RunNotifyLocationChangingAsync(string uri, string state, bool isNavigationIntercepted)
Microsoft.AspNetCore.Components.Web (7)
Microsoft.AspNetCore.Components.Web.Tests (5)
Microsoft.AspNetCore.Components.WebAssembly (18)
Microsoft.AspNetCore.Components.WebAssembly.Server (7)
Microsoft.AspNetCore.Components.WebView (4)
Microsoft.AspNetCore.Components.WebView.Maui (7)
Microsoft.AspNetCore.Components.WebView.Photino (8)
Microsoft.AspNetCore.Components.WebView.WindowsForms (7)
Microsoft.AspNetCore.Components.WebView.Wpf (6)
Microsoft.AspNetCore.Components.WebViewE2E.Test (1)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (4)
Microsoft.AspNetCore.CookiePolicy.Test (2)
Microsoft.AspNetCore.Cors (7)
Microsoft.AspNetCore.DataProtection (3)
Microsoft.AspNetCore.DataProtection.Tests (2)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Microsoft.AspNetCore.FunctionalTests (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (14)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (25)
artifacts\obj\Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests\Release\net10.0\Proto\TranscodingGrpc.cs (16)
140public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> SayHello(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
146public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> ResponseBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
152public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> Custom(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
158public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> AdditionalBindings(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
164public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> NoOption(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
176public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> Body(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
182public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> SubBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
188public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> SubRepeatedBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
497public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> BadResponseBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
640public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> BadResponseBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
783public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> BadBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
926public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> BadBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
1069public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> BadPattern(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
1234public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> GetClientStreaming(grpc::IAsyncStreamReader<global::Transcoding.HelloRequest> requestStream, grpc::ServerCallContext context)
1405public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> StartFrameImport(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
1411public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply> GetFrameImport(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
Microsoft.AspNetCore.Grpc.Swagger.Tests (36)
artifacts\obj\Microsoft.AspNetCore.Grpc.Swagger.Tests\Release\net10.0\Proto\ParametersGrpc.cs (11)
170public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersOne(global::Params.RequestOne request, grpc::ServerCallContext context)
182public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersTwo(global::Params.RequestOne request, grpc::ServerCallContext context)
194public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersThree(global::Params.RequestTwo request, grpc::ServerCallContext context)
206public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersFour(global::Params.RequestTwo request, grpc::ServerCallContext context)
218public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersFive(global::Params.RequestTwo request, grpc::ServerCallContext context)
230public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersSix(global::Params.RequestThree request, grpc::ServerCallContext context)
242public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersSeven(global::Params.RequestFour request, grpc::ServerCallContext context)
248public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersEight(global::Params.RequestFour request, grpc::ServerCallContext context)
254public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersNine(global::Params.RequestFive request, grpc::ServerCallContext context)
260public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersTenOne(global::Params.RequestOne request, grpc::ServerCallContext context)
266public virtual global::System.Threading.Tasks.Task<global::Params.ParamResponse> DemoParametersTenTwo(global::Params.RequestOne request, grpc::ServerCallContext context)
Microsoft.AspNetCore.HeaderPropagation (1)
Microsoft.AspNetCore.HeaderPropagation.Tests (3)
Microsoft.AspNetCore.Http (11)
Microsoft.AspNetCore.Http.Abstractions (5)
Microsoft.AspNetCore.Http.Connections (12)
Microsoft.AspNetCore.Http.Connections.Client (12)
Microsoft.AspNetCore.Http.Connections.Tests (18)
Microsoft.AspNetCore.Http.Extensions (24)
RequestDelegateFactory.cs (17)
540returnType.GetGenericTypeDefinition() == typeof(Task<>))
570private static ValueTask<object?> TaskOfTToValueTaskOfObject<T>(Task<T> task)
572static async ValueTask<object?> ExecuteAwaited(Task<T> task)
1082else if (returnType == typeof(Task<object>))
1112returnType.GetGenericTypeDefinition() == typeof(Task<>))
1367static async Task<(object? FormValue, bool Successful)> TryReadBodyAsync(
1496static async Task<(object? FormValue, bool Successful)> TryReadFormAsync(
2411private static Task ExecuteTaskOfObject(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo)
2413static async Task ExecuteAwaited(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo)
2431private static Task ExecuteTaskOfTFast<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2435static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2448private static Task ExecuteTaskOfT<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2452static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2465private static Task ExecuteTaskOfString(Task<string?> task, HttpContext httpContext)
2470static async Task ExecuteAwaited(Task<string> task, HttpContext httpContext)
2600private static async Task ExecuteTaskResult<T>(Task<T?> task, HttpContext httpContext) where T : IResult
2804private static void EnsureRequestTaskOfNotNull<T>(Task<T?> task) where T : IResult
Microsoft.AspNetCore.Http.Extensions.Tests (38)
RequestDelegateFactoryTests.cs (31)
972public static Task<BadBindAsyncStruct> BindAsync(HttpContext context, ParameterInfo parameter) =>
978public static Task<BadBindAsyncClass> BindAsync(HttpContext context, ParameterInfo parameter) =>
1309Task<JsonTodo> TaskTestAction() => Task.FromResult<JsonTodo>(originalTodo);
1310async Task<JsonTodo> TaskTestActionAwaited()
1326new object[] { (Func<Task<JsonTodo>>)TaskTestAction},
1327new object[] { (Func<Task<JsonTodo>>)TaskTestActionAwaited},
1422Task<CustomResult> TaskTestAction() => Task.FromResult(new CustomResult(resultString));
1427static Task<CustomResult> StaticTaskTestAction() => Task.FromResult(new CustomResult("Still not enough tests!"));
1435static Task<object> StaticTaskOfIResultAsObject() => Task.FromResult<object>(new CustomResult("Still not enough tests!"));
1440Task<StructResult> TaskTestStructAction() => Task.FromResult(new StructResult(resultString));
1447new object[] { (Func<Task<CustomResult>>)TaskTestAction},
1452new object[] { (Func<Task<CustomResult>>)StaticTaskTestAction},
1458new object[] { (Func<Task<object>>)StaticTaskOfIResultAsObject},
1463new object[] { (Func<Task<StructResult>>)TaskTestStructAction },
1493Task<bool?>? TaskBoolAction() => null;
1494Task<IResult?>? TaskNullAction() => null;
1495Task<IResult?> TaskTestAction() => Task.FromResult<IResult?>(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." },
2244async Task<string> Yield()
2255async Task<object> Yield()
2320Task<FSharp.Core.Unit> TaskOfUnitMethod()
2344async Task<FSharp.Core.Unit> Yield()
2357new object[] { (Func<Task<FSharp.Core.Unit>>)TaskOfUnitMethod },
2446Task<TodoStruct> TaskOfStructMethod()
2451async Task<TodoStruct> TaskOfStructWithYieldMethod()
2466async Task<TodoStruct> Yield()
2477new object[] { (Func<Task<TodoStruct>>)TaskOfStructMethod },
2478new object[] { (Func<Task<TodoStruct>>)TaskOfStructWithYieldMethod },
3850public Task<X509Certificate2?> GetClientCertificateAsync(CancellationToken cancellationToken)
Microsoft.AspNetCore.Http.Features (4)
Microsoft.AspNetCore.Http.Microbenchmarks (4)
Microsoft.AspNetCore.Http.Tests (2)
Microsoft.AspNetCore.HttpLogging (4)
Microsoft.AspNetCore.HttpOverrides (2)
Microsoft.AspNetCore.Identity (48)
IdentityApiEndpointRouteBuilderExtensions.cs (11)
57routeGroup.MapPost("/register", async Task<Results<Ok, ValidationProblem>>
90routeGroup.MapPost("/login", async Task<Results<Ok<AccessTokenResponse>, EmptyHttpResult, ProblemHttpResult>>
122routeGroup.MapPost("/refresh", async Task<Results<Ok<AccessTokenResponse>, UnauthorizedHttpResult, SignInHttpResult, ChallengeHttpResult>>
142routeGroup.MapGet("/confirmEmail", async Task<Results<ContentHttpResult, UnauthorizedHttpResult>>
193routeGroup.MapPost("/resendConfirmationEmail", async Task<Ok>
206routeGroup.MapPost("/forgotPassword", async Task<Results<Ok, ValidationProblem>>
225routeGroup.MapPost("/resetPassword", async Task<Results<Ok, ValidationProblem>>
260accountGroup.MapPost("/2fa", async Task<Results<Ok<TwoFactorResponse>, ValidationProblem, NotFound>>
336accountGroup.MapGet("/info", async Task<Results<Ok<InfoResponse>, ValidationProblem, NotFound>>
348accountGroup.MapPost("/info", async Task<Results<Ok<InfoResponse>, ValidationProblem, NotFound>>
457private static async Task<InfoResponse> CreateInfoResponseAsync<TUser>(TUser user, UserManager<TUser> userManager)
SignInManager.cs (28)
114public virtual async Task<ClaimsPrincipal> CreateUserPrincipalAsync(TUser user) => await ClaimsFactory.CreateAsync(user);
136public virtual async Task<bool> CanSignInAsync(TUser user)
285public virtual async Task<TUser?> ValidateSecurityStampAsync(ClaimsPrincipal? principal)
308public virtual async Task<TUser?> ValidateTwoFactorSecurityStampAsync(ClaimsPrincipal? principal)
330public virtual async Task<bool> ValidateSecurityStampAsync(TUser? user, string? securityStamp)
345public virtual async Task<SignInResult> PasswordSignInAsync(TUser user, string password,
366public virtual async Task<SignInResult> PasswordSignInAsync(string userName, string password,
387public virtual async Task<SignInResult> CheckPasswordSignInAsync(TUser user, string password, bool lockoutOnFailure)
444public virtual async Task<bool> IsTwoFactorClientRememberedAsync(TUser user)
484public virtual async Task<SignInResult> TwoFactorRecoveryCodeSignInAsync(string recoveryCode)
502private async Task<SignInResult> DoTwoFactorSignInAsync(TUser user, TwoFactorAuthenticationInfo twoFactorInfo, bool isPersistent, bool rememberClient)
547public virtual async Task<SignInResult> TwoFactorAuthenticatorSignInAsync(string code, bool isPersistent, bool rememberClient)
595public virtual async Task<SignInResult> TwoFactorSignInAsync(string provider, string code, bool isPersistent, bool rememberClient)
637public virtual async Task<TUser?> GetTwoFactorAuthenticationUserAsync()
656public virtual Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent)
668public virtual async Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
688public virtual async Task<IEnumerable<AuthenticationScheme>> GetExternalAuthenticationSchemesAsync()
700public virtual async Task<ExternalLoginInfo?> GetExternalLoginInfoAsync(string? expectedXsrf = null)
738public virtual async Task<IdentityResult> UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo externalLogin)
798internal async Task<ClaimsPrincipal> StoreRememberClient(TUser user)
818public virtual async Task<bool> IsTwoFactorEnabledAsync(TUser user)
832protected virtual async Task<SignInResult> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
872private async Task<TwoFactorAuthenticationInfo?> RetrieveTwoFactorInfoAsync()
909protected virtual async Task<bool> IsLockedOut(TUser user)
919protected virtual Task<SignInResult> LockedOut(TUser user)
930protected virtual async Task<SignInResult?> PreSignInCheck(TUser user)
962private async Task<IdentityResult> ResetLockoutWithResult(TUser user)
979if (resetLockoutTask is Task<IdentityResult> resultTask)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (55)
UserOnlyStore.cs (15)
149public override async Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
165public override async Task<IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
191public override async Task<IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
217public override Task<TUser?> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
233public override Task<TUser?> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = default(CancellationToken))
255protected override Task<TUser?> FindUserAsync(TKey userId, CancellationToken cancellationToken)
268protected override Task<TUserLogin?> FindUserLoginAsync(TKey userId, string loginProvider, string providerKey, CancellationToken cancellationToken)
280protected override Task<TUserLogin?> FindUserLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)
290/// <returns>A <see cref="Task{TResult}"/> that contains the claims granted to a user.</returns>
291public override async Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
410public override async Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
429public override async Task<TUser?> FindByLoginAsync(string loginProvider, string providerKey,
450public override Task<TUser?> FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken))
466public override async Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
489protected override Task<TUserToken?> FindTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken)
UserStore.cs (22)
151public override async Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
167public override async Task<IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
193public override async Task<IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
219public override Task<TUser?> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
235public override Task<TUser?> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = default(CancellationToken))
257protected override Task<TRole?> FindRoleAsync(string normalizedRoleName, CancellationToken cancellationToken)
269protected override Task<TUserRole?> FindUserRoleAsync(TKey userId, TKey roleId, CancellationToken cancellationToken)
280protected override Task<TUser?> FindUserAsync(TKey userId, CancellationToken cancellationToken)
293protected override Task<TUserLogin?> FindUserLoginAsync(TKey userId, string loginProvider, string providerKey, CancellationToken cancellationToken)
305protected override Task<TUserLogin?> FindUserLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)
362/// <returns>A <see cref="Task{TResult}"/> that contains the roles the user is a member of.</returns>
363public override async Task<IList<string>> GetRolesAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
382/// <returns>A <see cref="Task{TResult}"/> containing a flag indicating if the specified user is a member of the given group. If the
384public override async Task<bool> IsInRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken))
405/// <returns>A <see cref="Task{TResult}"/> that contains the claims granted to a user.</returns>
406public override async Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
525public override async Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
544public override async Task<TUser?> FindByLoginAsync(string loginProvider, string providerKey,
565public override Task<TUser?> FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken))
581public override async Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
604public override async Task<IList<TUser>> GetUsersInRoleAsync(string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken))
632protected override Task<TUserToken?> FindTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken)
Microsoft.AspNetCore.Identity.FunctionalTests (86)
MapIdentityApiTests.cs (7)
1277private async Task<WebApplication> CreateAppAsync<TUser, TContext>(Action<IServiceCollection>? configureServices, bool autoStart = true)
1344private Task<WebApplication> CreateAppAsync(Action<IServiceCollection>? configureServices = null)
1388private async Task<string> LoginAsync(HttpClient client, string? groupPrefix = null, string? email = null)
1405private async Task<string> LoginWithEmailConfirmationAsync(HttpClient client, TestEmailSender emailSender, string? groupPrefix = null, string? email = null)
1489public async Task<string> GenerateAsync(string purpose, UserManager<TUser> manager, TUser user)
1494public async Task<bool> ValidateAsync(string purpose, string token, UserManager<TUser> manager, TUser user)
1499public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<TUser> manager, TUser user)
UserStories.cs (23)
16internal static async Task<Index> RegisterNewUserAsync(HttpClient client, string userName = null, string password = null)
27internal static async Task<RegisterConfirmation> RegisterNewUserAsyncWithConfirmation(HttpClient client, string userName = null, string password = null, bool hasRealEmailSender = false)
38internal static async Task<Index> LoginExistingUserAsync(HttpClient client, string userName, string password)
56internal static async Task<DefaultUIPage> LockoutExistingUserAsync(HttpClient client, string userName, string password)
66internal static async Task<Index> RegisterNewUserWithSocialLoginAsync(HttpClient client, string userName, string email)
79internal static async Task<RegisterConfirmation> RegisterNewUserWithSocialLoginWithConfirmationAsync(HttpClient client, string userName, string email, bool hasRealEmailSender = false)
92internal static async Task<Index> RegisterNewUserWithSocialLoginAsyncViaRegisterPage(HttpClient client, string userName, string email)
105internal static async Task<Email> SendEmailConfirmationLinkAsync(Index index)
112internal static async Task<Email> SendUpdateEmailAsync(Index index, string newEmail)
119internal static async Task<Index> LoginWithSocialLoginAsync(HttpClient client, string userName)
134internal static async Task<Index> LoginExistingUser2FaAsync(HttpClient client, string userName, string password, string twoFactorKey)
145internal static async Task<ShowRecoveryCodes> EnableTwoFactorAuthentication(Index index, bool consent = true)
157internal static async Task<ResetAuthenticator> ResetAuthenticator(Index index)
165internal static async Task<Index> LoginExistingUserRecoveryCodeAsync(
182internal static async Task<ConfirmEmail> ConfirmEmailAsync(IdentityEmail email, HttpClient client)
203internal static async Task<ForgotPasswordConfirmation> ForgotPasswordAsync(HttpClient client, string userName)
214internal static async Task<ResetPasswordConfirmation> ResetPasswordAsync(HttpClient client, IdentityEmail resetPasswordEmail, string email, string newPassword)
224internal static async Task<ChangePassword> ChangePasswordAsync(Index index, string oldPassword, string newPassword)
232internal static async Task<SetPassword> SetPasswordAsync(Index index, string newPassword)
240internal static async Task<ManageExternalLogin> LinkExternalLoginAsync(Index index, string loginEmail)
248internal static async Task<RemoveExternalLogin> RemoveExternalLoginAsync(ManageExternalLogin manageExternalLogin, string loginEmail)
257internal static async Task<Index> DeleteUser(Index index, string password)
265internal static async Task<JObject> DownloadPersonalData(Index index, string userName)
Microsoft.AspNetCore.Identity.InMemory.Test (44)
InMemoryStore.cs (12)
40public Task<IList<string>> GetRolesAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
50public Task<bool> IsInRoleAsync(TUser user, string role, CancellationToken cancellationToken = default(CancellationToken))
58public Task<IList<TUser>> GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken = default(CancellationToken))
72public Task<IdentityResult> CreateAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
78public Task<IdentityResult> DeleteAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
88public Task<string> GetRoleIdAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
93public Task<string> GetRoleNameAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
104public Task<IdentityResult> UpdateAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
110Task<TRole> IRoleStore<TRole>.FindByIdAsync(string roleId, CancellationToken cancellationToken)
119Task<TRole> IRoleStore<TRole>.FindByNameAsync(string roleName, CancellationToken cancellationToken)
126public Task<IList<Claim>> GetClaimsAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
150public Task<string> GetNormalizedRoleNameAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
InMemoryUserStore.cs (30)
33public Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
80public Task<string> GetEmailAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
85public Task<string> GetNormalizedEmailAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
96public Task<bool> GetEmailConfirmedAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
107public Task<TUser> FindByEmailAsync(string email, CancellationToken cancellationToken = default(CancellationToken))
114public Task<DateTimeOffset?> GetLockoutEndDateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
125public Task<int> IncrementAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
137public Task<int> GetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
142public Task<bool> GetLockoutEnabledAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
188public Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
195public Task<TUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken))
205public Task<string> GetUserIdAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
210public Task<string> GetUserNameAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
221public Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
227public Task<IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
233public Task<TUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
246public Task<TUser> FindByNameAsync(string userName, CancellationToken cancellationToken = default(CancellationToken))
253public Task<IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
269public Task<string> GetPasswordHashAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
274public Task<bool> HasPasswordAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
285public Task<string> GetPhoneNumberAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
290public Task<bool> GetPhoneNumberConfirmedAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
307public Task<string> GetSecurityStampAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
318public Task<bool> GetTwoFactorEnabledAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
323public Task<string> GetNormalizedUserNameAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
334public Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
383public Task<string> GetTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken)
402public Task<string> GetAuthenticatorKeyAsync(TUser user, CancellationToken cancellationToken)
413public async Task<bool> RedeemCodeAsync(TUser user, string code, CancellationToken cancellationToken)
426public async Task<int> CountCodesAsync(TUser user, CancellationToken cancellationToken)
Microsoft.AspNetCore.Identity.Specification.Tests (13)
UserManagerSpecificationTests.cs (10)
145public Task<IdentityResult> ValidateAsync(UserManager<TUser> manager, TUser user, string password)
150public Task<IdentityResult> ValidateAsync(UserManager<TUser> manager, TUser user)
159public Task<IdentityResult> ValidateAsync(UserManager<TUser> manager, TUser user, string password)
164public Task<IdentityResult> ValidateAsync(UserManager<TUser> manager, TUser user)
961public async Task<string> GenerateAsync(string purpose, UserManager<TUser> manager, TUser user)
966public async Task<bool> ValidateAsync(string purpose, string token, UserManager<TUser> manager, TUser user)
971public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<TUser> manager, TUser user)
1415public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<TUser> manager, TUser user)
1418public Task<string> GenerateAsync(string purpose, UserManager<TUser> manager, TUser user)
1421public Task<bool> ValidateAsync(string purpose, string token, UserManager<TUser> manager, TUser user)
Microsoft.AspNetCore.Identity.Test (128)
IdentityBuilderTest.cs (19)
273public Task<IdentityResult> CreateAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
278public Task<IdentityResult> CreateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
283public Task<IdentityResult> DeleteAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
288public Task<IdentityResult> DeleteAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
298public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
303public Task<PocoUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = default(CancellationToken))
308public Task<string> GetNormalizedRoleNameAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
313public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
318public Task<string> GetRoleIdAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
323public Task<string> GetRoleNameAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
328public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
333public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
358public Task<IdentityResult> UpdateAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
363public Task<IdentityResult> UpdateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
368public Task<IdentityResult> ValidateAsync(RoleManager<PocoRole> manager, PocoRole role)
373public Task<IdentityResult> ValidateAsync(UserManager<PocoUser> manager, PocoUser user)
378public Task<IdentityResult> ValidateAsync(UserManager<PocoUser> manager, PocoUser user, string password)
383Task<PocoRole> IRoleStore<PocoRole>.FindByIdAsync(string roleId, CancellationToken cancellationToken)
388Task<PocoRole> IRoleStore<PocoRole>.FindByNameAsync(string roleName, CancellationToken cancellationToken)
UserManagerTest.cs (72)
771public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<PocoUser> manager, PocoUser user)
776public Task<string> GenerateAsync(string purpose, UserManager<PocoUser> manager, PocoUser user)
781public Task<bool> ValidateAsync(string purpose, string token, UserManager<PocoUser> manager, PocoUser user)
828public Task<IdentityResult> CreateAsync(PocoUser user, CancellationToken cancellationToken)
833public Task<IdentityResult> DeleteAsync(PocoUser user, CancellationToken cancellationToken)
843public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken)
848public Task<PocoUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)
853public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken)
858public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken)
863public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken)
878public Task<IdentityResult> UpdateAsync(PocoUser user, CancellationToken cancellationToken)
1203public Task<IdentityResult> ValidateAsync(UserManager<TUser> manager, TUser user, string password)
1218public Task<IList<Claim>> GetClaimsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1243public Task<string> GetEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1248public Task<bool> GetEmailConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1258public Task<PocoUser> FindByEmailAsync(string email, CancellationToken cancellationToken = default(CancellationToken))
1263public Task<DateTimeOffset?> GetLockoutEndDateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1273public Task<int> IncrementAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1283public Task<int> GetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1288public Task<bool> GetLockoutEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1308public Task<IList<UserLoginInfo>> GetLoginsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1313public Task<PocoUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken))
1327public Task<IdentityResult> CreateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1332public Task<IdentityResult> UpdateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1337public Task<IdentityResult> DeleteAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1342public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
1347public Task<PocoUser> FindByNameAsync(string userName, CancellationToken cancellationToken = default(CancellationToken))
1357public Task<string> GetPasswordHashAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1362public Task<bool> HasPasswordAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1372public Task<string> GetPhoneNumberAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1377public Task<bool> GetPhoneNumberConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1397public Task<IList<string>> GetRolesAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1402public Task<bool> IsInRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken))
1412public Task<string> GetSecurityStampAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1422public Task<bool> GetTwoFactorEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1427public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1432public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1437public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1447public Task<IList<PocoUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
1452public Task<IList<PocoUser>> GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken = default(CancellationToken))
1457public Task<string> GetNormalizedEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1472public Task<string> GenerateAsync(string purpose, UserManager<PocoUser> manager, PocoUser user)
1477public Task<bool> ValidateAsync(string purpose, string token, UserManager<PocoUser> manager, PocoUser user)
1482public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<PocoUser> manager, PocoUser user)
1498public Task<IList<Claim>> GetClaimsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1523public Task<string> GetEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1528public Task<bool> GetEmailConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1538public Task<PocoUser> FindByEmailAsync(string email, CancellationToken cancellationToken = default(CancellationToken))
1543public Task<DateTimeOffset?> GetLockoutEndDateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1553public Task<int> IncrementAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1563public Task<int> GetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1568public Task<bool> GetLockoutEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1588public Task<IList<UserLoginInfo>> GetLoginsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1593public Task<PocoUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken))
1603public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1608public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1618public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
1623public Task<PocoUser> FindByNameAsync(string userName, CancellationToken cancellationToken = default(CancellationToken))
1633public Task<string> GetPasswordHashAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1638public Task<bool> HasPasswordAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1648public Task<string> GetPhoneNumberAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1653public Task<bool> GetPhoneNumberConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1668public Task<bool> GetTwoFactorEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1683public Task<IList<string>> GetRolesAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1688public Task<bool> IsInRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken))
1693public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1703public Task<IList<PocoUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
1708public Task<IList<PocoUser>> GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken = default(CancellationToken))
1713Task<IdentityResult> IUserStore<PocoUser>.CreateAsync(PocoUser user, CancellationToken cancellationToken)
1718Task<IdentityResult> IUserStore<PocoUser>.UpdateAsync(PocoUser user, CancellationToken cancellationToken)
1723Task<IdentityResult> IUserStore<PocoUser>.DeleteAsync(PocoUser user, CancellationToken cancellationToken)
1728public Task<string> GetNormalizedEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
Microsoft.AspNetCore.Identity.UI (168)
Microsoft.AspNetCore.InternalTesting (31)
src\Shared\TaskExtensions.cs (8)
54public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default)
59public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default)
64public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default)
69public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default)
75public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
Microsoft.AspNetCore.InternalTesting.Tests (1)
Microsoft.AspNetCore.Localization (9)
Microsoft.AspNetCore.Localization.Routing (1)
Microsoft.AspNetCore.Mvc.Abstractions (9)
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (13)
Microsoft.AspNetCore.Mvc.Core (57)
Infrastructure\AsyncEnumerableReader.cs (5)
34private readonly ConcurrentDictionary<Type, Func<object, CancellationToken, Task<ICollection>>?> _asyncEnumerableConverters = new();
52public bool TryGetReader(Type type, [NotNullWhen(true)] out Func<object, CancellationToken, Task<ICollection>>? reader)
67var converter = (Func<object, CancellationToken, Task<ICollection>>)Converter
69.CreateDelegate(typeof(Func<object, CancellationToken, Task<ICollection>>), this);
79private async Task<ICollection> ReadInternal<T>(object value, CancellationToken cancellationToken)
Microsoft.AspNetCore.Mvc.Core.Test (45)
ModelBinding\Binders\BodyModelBinderTests.cs (10)
725private readonly Func<InputFormatterContext, Encoding, Task<InputFormatterResult>> _readRequestBodyAsync;
727public XyzFormatter(Func<InputFormatterContext, Encoding, Task<InputFormatterResult>> readRequestBodyAsync)
739public override Task<InputFormatterResult> ReadRequestBodyAsync(
761public Task<InputFormatterResult> ReadAsync(InputFormatterContext context)
783public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
805public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
827public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
853public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
875public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
895public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
Microsoft.AspNetCore.Mvc.FunctionalTests (10)
Microsoft.AspNetCore.Mvc.IntegrationTests (6)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (7)
src\Mvc\Mvc.Core\src\Infrastructure\AsyncEnumerableReader.cs (5)
34private readonly ConcurrentDictionary<Type, Func<object, CancellationToken, Task<ICollection>>?> _asyncEnumerableConverters = new();
52public bool TryGetReader(Type type, [NotNullWhen(true)] out Func<object, CancellationToken, Task<ICollection>>? reader)
67var converter = (Func<object, CancellationToken, Task<ICollection>>)Converter
69.CreateDelegate(typeof(Func<object, CancellationToken, Task<ICollection>>), this);
79private async Task<ICollection> ReadInternal<T>(object value, CancellationToken cancellationToken)
Microsoft.AspNetCore.Mvc.Razor (16)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (8)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (5)
Microsoft.AspNetCore.Mvc.RazorPages (39)
Infrastructure\ExecutorFactory.cs (11)
42var taskType = ClosedGenericMatcher.ExtractGenericInterface(returnType, typeof(Task<>));
74public abstract Task<IActionResult?> Execute(object receiver, object?[]? arguments);
96public override async Task<IActionResult?> Execute(object receiver, object?[]? arguments)
109private readonly Func<object, object?[]?, Task<object>> _thunk;
117_thunk = Expression.Lambda<Func<object, object?[]?, Task<object>>>(
130public override async Task<IActionResult?> Execute(object receiver, object?[]? arguments)
136private static async Task<object?> Convert<T>(object taskAsObject)
138var task = (Task<T>)taskAsObject;
162public override Task<IActionResult?> Execute(object receiver, object?[]? arguments)
190public override Task<IActionResult?> Execute(object receiver, object?[]? arguments)
Microsoft.AspNetCore.Mvc.RazorPages.Test (12)
Microsoft.AspNetCore.Mvc.TagHelpers (15)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (3)
Microsoft.AspNetCore.Mvc.Testing (4)
Microsoft.AspNetCore.Mvc.ViewFeatures (29)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (15)
Microsoft.AspNetCore.OpenApi (24)
Services\Schemas\OpenApiSchemaService.cs (2)
120internal async Task<OpenApiSchema> GetOrCreateUnresolvedSchemaAsync(OpenApiDocument? document, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
139internal async Task<IOpenApiSchema> GetOrCreateSchemaAsync(OpenApiDocument document, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.OpenApi.Tests (1)
Microsoft.AspNetCore.OutputCaching (11)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
Microsoft.AspNetCore.OutputCaching.Tests (4)
Microsoft.AspNetCore.Owin (11)
Microsoft.AspNetCore.Razor (6)
Microsoft.AspNetCore.Razor.Runtime (1)
Microsoft.AspNetCore.Razor.Test (1)
Microsoft.AspNetCore.RequestDecompression (1)
Microsoft.AspNetCore.RequestDecompression.Tests (6)
Microsoft.AspNetCore.ResponseCaching (3)
Microsoft.AspNetCore.ResponseCaching.Tests (1)
Microsoft.AspNetCore.ResponseCompression (1)
Microsoft.AspNetCore.ResponseCompression.Tests (1)
Microsoft.AspNetCore.Routing (7)
Microsoft.AspNetCore.Routing.FunctionalTests (1)
Microsoft.AspNetCore.Routing.Tests (1)
Microsoft.AspNetCore.Server.HttpSys (11)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (140)
Listener\RequestBodyTests.cs (13)
25Task<string> responseTask = SendRequestAsync(address, "Hello World");
51Task<string> responseTask = SendRequestAsync(address, "Hello World");
59Task<int> task = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
76Task<string> responseTask = SendRequestAsync(address, content);
100Task<string> responseTask = SendRequestAsync(address, content);
125Task<string> responseTask = SendRequestAsync(address, content);
132var readTask = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
150Task<string> responseTask = SendRequestAsync(address, content);
158var readTask = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token);
178var responseTask = client.PostAsync(address, content);
185var assertTask = Assert.ThrowsAsync<IOException>(async () => await context.Request.Body.ReadAsync(input, 0, input.Length, context.DisconnectToken));
195private Task<string> SendRequestAsync(string uri, string upload)
200private async Task<string> SendRequestAsync(string uri, HttpContent content)
Listener\ResponseHeaderTests.cs (12)
33Task<HttpResponseMessage> responseTask = SendRequestAsync(address);
55Task<HttpResponseMessage> responseTask = SendRequestAsync(address, usehttp11: false);
78Task<HttpResponseMessage> responseTask = SendHeadRequestAsync(address);
106Task<HttpResponseMessage> responseTask = SendHeadRequestAsync(address, usehttp11: false);
135Task<HttpResponseMessage> responseTask = SendHeadRequestAsync(address);
164Task<HttpResponseMessage> responseTask = SendRequestAsync(address);
187Task<HttpResponseMessage> responseTask = SendHeadRequestAsync(address);
228Task<HttpResponseMessage> responseTask = SendRequestAsync(address, usehttp11: false, sendKeepAlive: true, httpClient: client);
259Task<HttpResponseMessage> responseTask = SendRequestAsync(address, usehttp11: false, sendKeepAlive: true);
299Task<HttpResponseMessage> responseTask = SendRequestAsync(address);
339private async Task<HttpResponseMessage> SendRequestAsync(string uri, bool usehttp11 = true, bool sendKeepAlive = false, HttpClient httpClient = null)
354private async Task<HttpResponseMessage> SendHeadRequestAsync(string uri, bool usehttp11 = true)
src\Shared\Http2cat\Http2Utilities.cs (5)
499internal async Task<bool> SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
564internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerator<KeyValuePair<string, string>> headersEnumerator)
592internal async Task<bool> SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerable<KeyValuePair<string, string>> headers)
833internal async Task<Http2FrameWithPayload> ReceiveFrameAsync(uint maxFrameSize = Http2PeerSettings.DefaultMaxFrameSize)
872internal async Task<Http2FrameWithPayload> ExpectAsync(Http2FrameType type, int withLength, byte withFlags, int withStreamId)
Microsoft.AspNetCore.Server.IIS (13)
Microsoft.AspNetCore.Server.IISIntegration (2)
Microsoft.AspNetCore.Server.IntegrationTesting (10)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (5)
Microsoft.AspNetCore.Server.Kestrel.Core (17)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (12)
src\Servers\Kestrel\shared\test\StreamExtensions.cs (4)
15public static async Task<int> FillBufferUntilEndAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
34public static async Task<int> FillEntireBufferAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
49public static async Task<byte[]> ReadAtLeastLengthAsync(this Stream stream, int length, int bufferLength = 1024, bool allowEmpty = false, CancellationToken cancellationToken = default)
76public static async Task<byte[]> ReadUntilEndAsync(this Stream stream, int bufferLength = 1024, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (24)
src\Servers\Kestrel\shared\test\StreamExtensions.cs (4)
15public static async Task<int> FillBufferUntilEndAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
34public static async Task<int> FillEntireBufferAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
49public static async Task<byte[]> ReadAtLeastLengthAsync(this Stream stream, int length, int bufferLength = 1024, bool allowEmpty = false, CancellationToken cancellationToken = default)
76public static async Task<byte[]> ReadUntilEndAsync(this Stream stream, int bufferLength = 1024, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.Session.Tests (1)
Microsoft.AspNetCore.Shared.Tests (19)
Microsoft.AspNetCore.SignalR.Client.Core (113)
HubConnection.cs (16)
355public virtual IDisposable On(string methodName, Type[] parameterTypes, Func<object?[], object, Task<object?>> handler, object state)
428/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
429/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
434public virtual async Task<ChannelReader<object?>> StreamAsChannelCoreAsync(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken = default)
450/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
451/// The <see cref="Task{TResult}.Result"/> property returns an <see cref="object"/> for the hub method return value.
456public virtual async Task<object?> InvokeCoreAsync(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken = default)
701private async Task<ChannelReader<object?>> StreamAsChannelCoreAsyncCore(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken)
1021private async Task<(ConnectionState, Activity?)> WaitForActiveConnectionWithActivityAsync(string sendingMethodName, string invokedMethodName, CancellationToken token)
1030var connectionStateTask = _state.WaitForActiveConnectionAsync(sendingMethodName, token);
1079private async Task<object?> InvokeCoreAsyncCore(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken)
1087Task<object?> invocationTask;
1287private async Task<CloseMessage?> ProcessMessagesAsync(HubMessage message, ConnectionState connectionState, ChannelWriter<InvocationMessage> invocationMessageWriter)
1409if (handler.HasResult && task is Task<object?> resultTask)
2105public bool HasResult => _callback.Method.ReturnType == typeof(Task<object>);
2507public async Task<ConnectionState> WaitForActiveConnectionAsync(string methodName, CancellationToken token)
HubConnectionExtensions.InvokeAsyncGeneric.cs (36)
25/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
26/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
29public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, CancellationToken cancellationToken = default)
43/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
44/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
47public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default)
62/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
63/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
66public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default)
82/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
83/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
86public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default)
103/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
104/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
107public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default)
125/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
126/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
129public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default)
148/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
149/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
152public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default)
172/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
173/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
176public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default)
197/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
198/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
201public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default)
223/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
224/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
227public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default)
250/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
251/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
254public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default)
268/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
269/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
271public static async Task<TResult> InvokeCoreAsync<TResult>(this HubConnection hubConnection, string methodName, object?[] args, CancellationToken cancellationToken = default)
HubConnectionExtensions.OnResult.cs (11)
37public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Func<object?[], Task<TResult>> handler)
41var currentHandler = (Func<object?[], Task<TResult>>)state;
55public static IDisposable On<TResult>(this HubConnection hubConnection, string methodName, Func<Task<TResult>> handler)
268public static IDisposable On<T1, TResult>(this HubConnection hubConnection, string methodName, Func<T1, Task<TResult>> handler)
288public static IDisposable On<T1, T2, TResult>(this HubConnection hubConnection, string methodName, Func<T1, T2, Task<TResult>> handler)
309public static IDisposable On<T1, T2, T3, TResult>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, Task<TResult>> handler)
331public static IDisposable On<T1, T2, T3, T4, TResult>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, Task<TResult>> handler)
354public static IDisposable On<T1, T2, T3, T4, T5, TResult>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, Task<TResult>> handler)
378public static IDisposable On<T1, T2, T3, T4, T5, T6, TResult>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, Task<TResult>> handler)
403public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, TResult>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, Task<TResult>> handler)
429public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, T8, Task<TResult>> handler)
HubConnectionExtensions.StreamAsChannelAsync.cs (36)
26/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
27/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
30public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, CancellationToken cancellationToken = default)
44/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
45/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
48public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default)
63/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
64/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
67public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default)
83/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
84/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
87public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default)
104/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
105/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
108public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default)
126/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
127/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
130public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default)
149/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
150/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
153public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default)
173/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
174/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
177public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default)
198/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
199/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
202public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default)
224/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
225/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
228public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default)
251/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
252/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
255public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default)
269/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
270/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
272public static async Task<ChannelReader<TResult>> StreamAsChannelCoreAsync<TResult>(this HubConnection hubConnection, string methodName, object?[] args, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (12)
Microsoft.AspNetCore.SignalR.Client.Tests (88)
HubConnectionTests.cs (11)
134var invokeTask = hubConnection.InvokeAsync<int>("testMethod").DefaultTimeout();
156var invokeTask = hubConnection.InvokeAsync<int>("testMethod").DefaultTimeout();
175var invokeTask = hubConnection.InvokeAsync<int>("testMethod", cancellationToken: cts.Token).DefaultTimeout();
439var invokeTask = hubConnection.InvokeAsync<int>("SomeMethod", channel.Reader);
510var invokeTask = hubConnection.InvokeAsync<SampleObject>("UploadMethod", channel.Reader);
555var invokeTask = hubConnection.InvokeAsync<object>("UploadMethod", channel.Reader, cts.Token);
587var invokeTask = hubConnection.InvokeAsync<object>("UploadMethod", channel.Reader, cts.Token);
612var invokeTask = hubConnection.InvokeAsync<object>("UploadMethod", channel.Reader);
646var invokeTask = hubConnection.InvokeAsync<long>("UploadMethod", channel.Reader);
679var invokeTask = hubConnection.InvokeAsync<int>("SumInts", channel.Reader);
764var accessTokenFactory = new Func<Task<string>>(() => Task.FromResult("fakeAccessToken"));
LongPollingTransportTests.cs (15)
35.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
70.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
104.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
159.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
187.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
233.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
278.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
327.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
369.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
406.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
463.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
531.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
587.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
616.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
642.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
ServerSentEventsTransportTests.cs (10)
31.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
72.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
125.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
175.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
230.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
273.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
304.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
362.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
389.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
474.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
TestHttpMessageHandler.cs (18)
15delegate Task<HttpResponseMessage> RequestDelegate(HttpRequestMessage requestMessage, CancellationToken cancellationToken);
77protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
135public void OnRequest(Func<HttpRequestMessage, Func<Task<HttpResponseMessage>>, CancellationToken, Task<HttpResponseMessage>> handler)
151public void OnGet(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Get, pathAndQuery, handler);
152public void OnPost(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Post, pathAndQuery, handler);
153public void OnPut(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Put, pathAndQuery, handler);
154public void OnDelete(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Delete, pathAndQuery, handler);
155public void OnHead(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Head, pathAndQuery, handler);
156public void OnOptions(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Options, pathAndQuery, handler);
157public void OnTrace(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Trace, pathAndQuery, handler);
159public void OnRequest(HttpMethod method, string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler)
177public void OnNegotiate(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler)
194public void OnLongPollDelete(Func<CancellationToken, Task<HttpResponseMessage>> handler)
211public void OnLongPoll(Func<CancellationToken, Task<HttpResponseMessage>> handler)
221public void OnLongPoll(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler)
238public void OnSocketSend(Func<byte[], CancellationToken, Task<HttpResponseMessage>> handler)
254private Task<HttpResponseMessage> BaseHandler(HttpRequestMessage request, CancellationToken cancellationToken)
Microsoft.AspNetCore.SignalR.Core (37)
ClientProxyExtensions.cs (11)
230public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, CancellationToken cancellationToken)
244public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, CancellationToken cancellationToken)
259public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, object? arg2, CancellationToken cancellationToken)
275public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken)
292public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken)
310public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken)
329public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken)
349public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken)
370public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken)
392public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken)
415public static Task<T> InvokeAsync<T>(this ISingleClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken)
Internal\DefaultHubDispatcher.cs (4)
318private async Task<bool> Invoke(HubMethodDescriptor descriptor, HubConnectionContext connection,
665private static Task<bool> IsHubMethodAuthorized(IServiceProvider provider, HubConnectionContext hubConnectionContext, HubMethodDescriptor descriptor, object?[] hubMethodArguments, Hub hub)
676private static async Task<bool> IsHubMethodAuthorizedSlow(IServiceProvider provider, ClaimsPrincipal principal, IList<IAuthorizeData> policies, HubInvocationContext resource)
690private async Task<bool> ValidateInvocationMode(HubMethodDescriptor hubMethodDescriptor, bool isStreamResponse,
Microsoft.AspNetCore.SignalR.Microbenchmarks (3)
Microsoft.AspNetCore.SignalR.Specification.Tests (41)
HubLifetimeManagerTestBase.cs (7)
189var resultTask = manager.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
216var resultTask = manager.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
246var resultTask = manager.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
302var invoke1 = manager1.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
303var invoke2 = manager1.InvokeConnectionAsync<int>(connection2.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
332var invoke1 = manager1.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
358var invoke1 = manager1.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cts.Token);
ScaleoutHubLifetimeManagerTests.cs (6)
485var resultTask = manager2.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
516var resultTask = manager2.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
568var invoke1 = manager1.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
597var invoke1 = manager1.InvokeConnectionAsync<int>(connection.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
600var invoke2 = manager2.InvokeConnectionAsync<int>(connection.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
648var resultTask = manager2.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default);
src\Shared\TaskExtensions.cs (8)
54public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default)
59public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default)
64public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default)
69public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default)
75public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
src\SignalR\common\testassets\Tests.Utils\TestClient.cs (16)
68public async Task<Task> ConnectAsync(
91public Task<IList<HubMessage>> StreamAsync(string methodName, params object[] args)
96public async Task<IList<HubMessage>> StreamAsync(string methodName, string[] streamIds, params object[] args)
102public async Task<IList<HubMessage>> StreamAsync(string methodName, string[] streamIds, IDictionary<string, string> headers, params object[] args)
108public async Task<IList<HubMessage>> ListenAllAsync(string invocationId)
149public async Task<CompletionMessage> InvokeAsync(string methodName, params object[] args)
189public Task<string> SendInvocationAsync(string methodName, params object[] args)
194public Task<string> SendInvocationAsync(string methodName, IDictionary<string, string> headers, params object[] args)
199public Task<string> SendInvocationAsync(string methodName, bool nonBlocking, params object[] args)
204public Task<string> SendInvocationAsync(string methodName, bool nonBlocking, IDictionary<string, string> headers, params object[] args)
210public Task<string> SendStreamInvocationAsync(string methodName, params object[] args)
215public Task<string> SendStreamInvocationAsync(string methodName, string[] streamIds, params object[] args)
220public Task<string> SendStreamInvocationAsync(string methodName, string[] streamIds, IDictionary<string, string> headers, params object[] args)
226public Task<string> BeginUploadStreamAsync(string invocationId, string methodName, string[] streamIds, params object[] args)
232public async Task<string> SendHubMessageAsync(HubMessage message)
240public async Task<HubMessage> ReadAsync(bool isHandshake = false)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (6)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (10)
Microsoft.AspNetCore.SignalR.Tests (55)
Microsoft.AspNetCore.SignalR.Tests.Utils (27)
TestClient.cs (16)
68public async Task<Task> ConnectAsync(
91public Task<IList<HubMessage>> StreamAsync(string methodName, params object[] args)
96public async Task<IList<HubMessage>> StreamAsync(string methodName, string[] streamIds, params object[] args)
102public async Task<IList<HubMessage>> StreamAsync(string methodName, string[] streamIds, IDictionary<string, string> headers, params object[] args)
108public async Task<IList<HubMessage>> ListenAllAsync(string invocationId)
149public async Task<CompletionMessage> InvokeAsync(string methodName, params object[] args)
189public Task<string> SendInvocationAsync(string methodName, params object[] args)
194public Task<string> SendInvocationAsync(string methodName, IDictionary<string, string> headers, params object[] args)
199public Task<string> SendInvocationAsync(string methodName, bool nonBlocking, params object[] args)
204public Task<string> SendInvocationAsync(string methodName, bool nonBlocking, IDictionary<string, string> headers, params object[] args)
210public Task<string> SendStreamInvocationAsync(string methodName, params object[] args)
215public Task<string> SendStreamInvocationAsync(string methodName, string[] streamIds, params object[] args)
220public Task<string> SendStreamInvocationAsync(string methodName, string[] streamIds, IDictionary<string, string> headers, params object[] args)
226public Task<string> BeginUploadStreamAsync(string invocationId, string methodName, string[] streamIds, params object[] args)
232public async Task<string> SendHubMessageAsync(HubMessage message)
240public async Task<HubMessage> ReadAsync(bool isHandshake = false)
Microsoft.AspNetCore.SpaProxy (2)
Microsoft.AspNetCore.SpaServices.Extensions (14)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (2)
Microsoft.AspNetCore.StaticAssets.Tests (1)
Microsoft.AspNetCore.StaticFiles.Tests (1)
Microsoft.AspNetCore.TestHost (14)
Microsoft.AspNetCore.TestHost.Tests (15)
Microsoft.AspNetCore.Testing.Tests (2)
Microsoft.AspNetCore.Tests (2)
Microsoft.AspNetCore.WebSockets (2)
Microsoft.AspNetCore.WebSockets.ConformanceTests (2)
Microsoft.AspNetCore.WebSockets.Tests (4)
Microsoft.AspNetCore.WebUtilities (19)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (1)
Microsoft.AspNetCore.WebUtilities.Tests (17)
HttpRequestStreamReaderTest.cs (9)
150public static async Task ReadLine_ReadMultipleLines(Func<HttpRequestStreamReader, Task<string>> action)
172public static async Task ReadLine_ReadWithNoNewlines(Func<HttpRequestStreamReader, Task<string>> action)
189public static async Task ReadLine_MultipleContinuousLines(Func<HttpRequestStreamReader, Task<string>> action)
213public static async Task ReadLine_CarriageReturnAndLineFeedAcrossBufferBundaries(Func<HttpRequestStreamReader, Task<string>> action)
237public static async Task ReadLine_EOF(Func<HttpRequestStreamReader, Task<string>> action)
250public static async Task ReadLine_NewLineOnly(Func<HttpRequestStreamReader, Task<string>> action)
483yield return new object[] { new Func<HttpRequestStreamReader, Task<string?>>((httpRequestStreamReader) =>
486yield return new object[] { new Func<HttpRequestStreamReader, Task<string?>>((httpRequestStreamReader) =>
529public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Microsoft.Bcl.TimeProvider (2)
Microsoft.Build (36)
BackEnd\Components\RequestBuilder\TargetBuilder.cs (5)
108public async Task<BuildResult> BuildTargets(ProjectLoggingContext loggingContext, BuildRequestEntry entry, IRequestBuilderCallback callback, (string name, TargetBuiltReason reason)[] targetNames, Lookup baseLookup, CancellationToken cancellationToken)
250async Task<ITargetResult[]> ITargetBuilderCallback.LegacyCallTarget(string[] targets, bool continueOnError, ElementLocation taskLocation)
329async Task<BuildResult[]> IRequestBuilderCallback.BuildProjects(string[] projectFiles, Microsoft.Build.Collections.PropertyDictionary<ProjectPropertyInstance>[] properties, string[] toolsVersions, string[] targets, bool waitForResults, bool skipNonexistentTargets)
665private async Task<bool> PushTargets(IList<TargetSpecification> targets, TargetEntry parentTargetEntry, Lookup baseLookup, bool addAsErrorTarget, bool stopProcessingOnCompletion, TargetBuiltReason buildReason)
768private async Task<bool> CompleteOutstandingActiveRequests(string targetName)
BackEnd\Components\RequestBuilder\TaskBuilder.cs (2)
152public async Task<WorkUnitResult> ExecuteTask(TargetLoggingContext loggingContext, BuildRequestEntry requestEntry, ITargetBuilderCallback targetBuilderCallback, ProjectTargetInstanceChild taskInstance, TaskExecutionMode mode, Lookup inferLookup, Lookup executeLookup, CancellationToken cancellationToken)
657private async Task<WorkUnitResult> InitializeAndExecuteTask(TaskLoggingContext taskLoggingContext, ItemBucket bucket, IDictionary<string, string> taskIdentityParameters, TaskHost taskHost, TaskExecutionMode howToExecuteTask)
BackEnd\Components\RequestBuilder\TaskHost.cs (2)
969public async Task<BuildEngineResult> InternalBuildProjects(string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IList<String>[] undefineProperties, string[] toolsVersion, bool returnTargetOutputs, bool skipNonexistentTargets = false)
1142private async Task<BuildEngineResult> BuildProjectFilesInParallelAsync(string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IList<String>[] undefineProperties, string[] toolsVersion, bool returnTargetOutputs, bool skipNonexistentTargets = false)
Microsoft.Build.Engine.UnitTests (34)
BackEnd\MockTaskBuilder.cs (5)
78public Task<WorkUnitResult> ExecuteTask(TargetLoggingContext targetLoggingContext, BuildRequestEntry requestEntry, ITargetBuilderCallback targetBuilderCallback, ProjectTargetInstanceChild task, TaskExecutionMode mode, Lookup lookupForInference, Lookup lookupForExecution, CancellationToken cancellationToken)
82return Task<WorkUnitResult>.FromResult(new WorkUnitResult(WorkUnitResultCode.Canceled, WorkUnitActionCode.Stop, null));
115return Task<WorkUnitResult>.FromResult(new WorkUnitResult(WorkUnitResultCode.Failed, WorkUnitActionCode.Continue, null));
118return Task<WorkUnitResult>.FromResult(new WorkUnitResult(WorkUnitResultCode.Failed, WorkUnitActionCode.Stop, null));
122return Task<WorkUnitResult>.FromResult(new WorkUnitResult(WorkUnitResultCode.Success, WorkUnitActionCode.Continue, null));
ProjectCache\ProjectCacheTests.cs (16)
196private readonly Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<CacheResult>> _getCacheResultDelegate;
198public DelegatingMockCache(Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<CacheResult>> getCacheResultDelegate)
208public override async Task<CacheResult> GetCacheResultAsync(BuildRequestData buildRequest, PluginLoggerBase logger, CancellationToken cancellationToken)
237public Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<CacheResult>>? GetCacheResultImplementation { get; set; }
246public override Task<CacheResult> GetCacheResultAsync(
289public override async Task<CacheResult> GetCacheResultAsync(
701foreach (var task in referenceBuildTasks)
1405var task2 = BuildProjectFileAsync(2);
1406var task3 = BuildProjectFileAsync(3);
1407var task4 = BuildProjectFileAsync(4);
1423var task1 = BuildProjectFileAsync(1);
1427Task<BuildResult> BuildProjectFileAsync(int projectNumber)
1476var buildResultTasks = new List<Task<BuildResult>>();
1483Task<BuildResult> buildResultTask = buildSession.BuildProjectFileAsync(
1494foreach (var buildResultTask in buildResultTasks)
1622var buildTasks = new List<Task<BuildResult>>();
Microsoft.Build.Tasks.CodeAnalysis (10)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (10)
Microsoft.Build.Tasks.Core (5)
Microsoft.Build.Tasks.UnitTests (3)
Microsoft.Build.UnitTests.Shared (3)
Microsoft.CodeAnalysis (80)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (37)
233public Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync()
242public async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync(CancellationToken cancellationToken = default)
253public async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
263public async Task<AnalysisResult> GetAnalysisResultAsync(CancellationToken cancellationToken)
273public async Task<AnalysisResult> GetAnalysisResultAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
284public Task<ImmutableArray<Diagnostic>> GetAllDiagnosticsAsync()
292public async Task<ImmutableArray<Diagnostic>> GetAllDiagnosticsAsync(CancellationToken cancellationToken = default)
302async Task<ImmutableArray<Diagnostic>> getAllDiagnosticsWithoutStateTrackingAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
324public async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsAsync(CancellationToken cancellationToken)
335public async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
342private async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
349private async Task<AnalysisResult> GetAnalysisResultCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
356private async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
363private static async Task<AnalyzerDriver> CreateAndInitializeDriverAsync(
395public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, CancellationToken cancellationToken)
411public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken)
427public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
445public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
459public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, CancellationToken cancellationToken)
474public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken)
488public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
505public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
520public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, CancellationToken cancellationToken)
535public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
552public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, CancellationToken cancellationToken)
569public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
577private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SourceOrAdditionalFile file, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken)
584private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsCoreAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken)
598public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, CancellationToken cancellationToken)
613public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
628public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, CancellationToken cancellationToken)
643public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
651private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
658private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
830static async Task<(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts, bool hasAnyActionsRequiringCompilationEvents)> getAnalyzerActionCountsAsync(
1276public async Task<AnalyzerTelemetryInfo> GetAnalyzerTelemetryInfoAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
1296private async Task<AnalyzerActionCounts> GetAnalyzerActionCountsAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Analyzers (49)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (5)
64private async Task<Document> ConvertToEqualsAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
79private async Task<Document> CallOverloadWithEqualityComparerAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
115private static async Task<Document> CallOverloadWithEqualityComparerAsync(Document document, SyntaxNode nodeToReplace, IMethodSymbol? methodSymbol,
186private async Task<Document> EnsureEqualsCorrectAsync(Document document, SemanticModel semanticModel, IInvocationOperation invocationOperation, CancellationToken cancellationToken)
256private static async Task<Document> ConvertToEqualsAsync(Document document, SemanticModel semanticModel, IBinaryOperation binaryOperation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.AnalyzerUtilities (13)
Microsoft.CodeAnalysis.BannedApiAnalyzers (23)
Microsoft.CodeAnalysis.CodeStyle (88)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (10)
339public static Task<TRootNode> ReplaceNodesAsync<TRootNode>(
342Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>> computeReplacementAsync,
361public static Task<TRootNode> ReplaceTokensAsync<TRootNode>(
364Func<SyntaxToken, SyntaxToken, CancellationToken, Task<SyntaxToken>> computeReplacementAsync,
374public static Task<TRoot> ReplaceTriviaAsync<TRoot>(
377Func<SyntaxTrivia, SyntaxTrivia, CancellationToken, Task<SyntaxTrivia>> computeReplacementAsync,
387public static async Task<TRoot> ReplaceSyntaxAsync<TRoot>(
390Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>>? computeReplacementNodeAsync,
392Func<SyntaxToken, SyntaxToken, CancellationToken, Task<SyntaxToken>>? computeReplacementTokenAsync,
394Func<SyntaxTrivia, SyntaxTrivia, CancellationToken, Task<SyntaxTrivia>>? computeReplacementTriviaAsync,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (4)
13public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, Func<TArg, CancellationToken, T>? synchronousComputeFunction, TArg arg)
16public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, TArg arg)
28public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction)
38public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction, Func<CancellationToken, T> synchronousComputeFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (15)
19public abstract Task<T> GetValueAsync(CancellationToken cancellationToken);
22Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction,
50private Func<TData, CancellationToken, Task<T>>? _asynchronousComputeFunction;
62private Task<T>? _cachedResult;
112Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction,
126Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction,
326public override Task<T> GetValueAsync(CancellationToken cancellationToken)
335var cachedResult = _cachedResult;
386private readonly struct AsynchronousComputationToStart(Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, CancellationTokenSource cancellationTokenSource)
388public readonly Func<TData, CancellationToken, Task<T>> AsynchronousComputeFunction = asynchronousComputeFunction;
409var task = computationToStart.AsynchronousComputeFunction(_data, cancellationToken);
454private void CompleteWithTask(Task<T> task, CancellationToken cancellationToken)
486private Task<T> GetCachedValueAndCacheThisValueIfNoneCached_NoLock(Task<T> task)
569public void CompleteFromTask(Task<T> task)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (13)
41private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
175public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
178Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
189public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
192Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
209public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
222public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
241private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
244Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
337private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
340Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
361var readTask = ReadFromChannelAndConsumeItemsAsync();
366async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
Microsoft.CodeAnalysis.CodeStyle.Fixes (206)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (4)
345? new Func<CancellationToken, Task<Solution>>(cancellationToken => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, cancellationToken))
373private async Task<Solution> FixAsync(
401private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken)
410private static async Task<(string argumentNameSuggestion, bool isNamed)> GetNameSuggestionForArgumentAsync(
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (6)
300static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey)
313private static async Task<Document> AddEditsAsync(
379private static Task<Document> TakeTopAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
382private static Task<Document> TakeBottomAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
385private static Task<Document> TakeBothAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
391private async Task<Document> FixAllAsync(
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (9)
272private static async Task<Document> PreprocessDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
292private async Task<SyntaxNode> GetNewRootAsync(
744private async Task<SyntaxNode> PostProcessDocumentAsync(
773private static async Task<SyntaxNode> PostProcessDocumentCoreAsync(
774Func<SyntaxNode, Document, SyntaxFormattingOptions, CancellationToken, Task<SyntaxNode>> processMemberDeclarationAsync,
805private async Task<SyntaxNode> ReplaceDiscardDeclarationsWithAssignmentsAsync(SyntaxNode memberDeclaration, Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken)
821private async Task<SyntaxNode> AdjustLocalDeclarationsAsync(
890async Task<bool> TryRemoveUnusedLocalAsync(TLocalDeclarationStatementSyntax newDecl, TLocalDeclarationStatementSyntax originalDecl)
914private static async Task<bool> IsLocalDeclarationWithNoReferencesAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (10)
229private async Task<Document> GetEditAsync(
391public virtual Task<Document> AddEventAsync(
401public Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken)
410public Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken)
419public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
428public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
437public Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken)
446public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
455public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
464public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (9)
29public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
36public static Task<Document> AddFieldDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken)
43public static Task<Document> AddMethodDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
50public static Task<Document> AddPropertyDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken)
57public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
64public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
71public static Task<Document> AddNamespaceDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken)
78public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
85public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (9)
133Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken);
138Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken);
143Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken);
148Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken);
153Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken);
158Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken);
163Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken);
168Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken);
173Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.Collections.Package (6)
Microsoft.CodeAnalysis.CSharp (3)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (55)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (19)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (43)
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (269)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (6)
68private static async Task<Solution> EnableNullableReferenceTypesAsync(
96private static async Task<SyntaxNode> EnableNullableReferenceTypesAsync(Document document, CancellationToken cancellationToken)
161private static async Task<SyntaxNode> DisableNullableReferenceTypesInExistingDocumentIfNecessaryAsync(Document document, SyntaxNode root, SyntaxToken firstToken, CancellationToken cancellationToken)
266Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution)
272private readonly Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution = createChangedSolution;
274protected override async Task<IEnumerable<CodeActionOperation>> ComputePreviewOperationsAsync(CancellationToken cancellationToken)
DecompiledSource\CSharpDecompiledSourceService.cs (4)
31public async Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken)
55public static async Task<Document> FormatDocumentAsync(Document document, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken)
70private static async Task<Document> AddAssemblyInfoRegionAsync(Document document, ISymbol symbol, IDecompilationService decompilationService, CancellationToken cancellationToken)
98private static async Task<Document> ConvertDocCommentsToRegularCommentsAsync(Document document, IDocumentationCommentFormattingService docCommentFormattingService, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (20)
Copilot\CSharpImplementNotImplementedExceptionFixProviderTests.cs (16)
579protected override Task<Workspace> CreateWorkspaceImplAsync()
619public Task<bool> IsRefineOptionEnabledAsync()
622public Task<bool> IsCodeAnalysisOptionEnabledAsync()
625public Task<bool> IsOnTheFlyDocsOptionEnabledAsync()
628public Task<bool> IsGenerateDocumentationCommentOptionEnabledAsync()
631public Task<bool> IsImplementNotImplementedExceptionEnabledAsync()
651public Task<ImmutableArray<string>> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken)
654public Task<ImmutableArray<Diagnostic>> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray<string> promptTitles, CancellationToken cancellationToken)
657public Task<(string responseString, bool isQuotaExceeded)> GetOnTheFlyDocsAsync(string symbolSignature, ImmutableArray<string> declarationCode, string language, CancellationToken cancellationToken)
660public Task<bool> IsAvailableAsync(CancellationToken cancellationToken)
663public Task<bool> IsFileExcludedAsync(string filePath, CancellationToken cancellationToken)
669Task<(Dictionary<string, string>? responseDictionary, bool isQuotaExceeded)> ICopilotCodeAnalysisService.GetDocumentationCommentAsync(DocumentationCommentProposal proposal, CancellationToken cancellationToken)
672public Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsAsync(
703public Task<bool> IsImplementNotImplementedExceptionsAvailableAsync(CancellationToken cancellationToken)
708public Task<string> GetOnTheFlyDocsPromptAsync(OnTheFlyDocsInfo onTheFlyDocsInfo, CancellationToken cancellationToken)
713public Task<(string responseString, bool isQuotaExceeded)> GetOnTheFlyDocsResponseAsync(string prompt, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Scripting (4)
CSharpScript.cs (4)
98public static Task<ScriptState<T>> RunAsync<T>(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken))
112public static Task<ScriptState<object>> RunAsync(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken))
128public static Task<T> EvaluateAsync<T>(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken))
143public static Task<object> EvaluateAsync(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken))
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (7)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (36)
InteractiveSessionTests.cs (31)
423var s0 = CSharpScript.RunAsync("", ScriptOptions.AddReferences(HostAssembly));
425var state = s0.
465var state = CSharpScript.RunAsync("Environment.ProcessorCount", options);
476var state1 = CSharpScript.RunAsync("internal class C1 { } protected int X; 1", ScriptOptions);
485var state2 = state1.ContinueWith("internal class C2 : C1 { } 2");
496var state3 = state2.ContinueWith("private class C3 : C2 { } 3");
518var state = CSharpScript.RunAsync("", ScriptOptions);
682var state0 = CSharpScript.RunAsync("", ScriptOptions);
761var state = CSharpScript.RunAsync(@"
794var state = CSharpScript.RunAsync(@"
858var s = CSharpScript.RunAsync(@"
916var s = CSharpScript.RunAsync(@"
1058Assert.Equal(1, ((Task<int>)result).Result);
1082var task = CSharpScript.EvaluateAsync<object>("await System.Threading.Tasks.Task.Run(() => { })", ScriptOptions);
1381var s1 = CSharpScript.RunAsync("new int[] { 1, 2, 3 }.First()", options);
1384var s2 = s1.ContinueWith("new List<int>()", options.AddImports("System.Collections.Generic"));
1531var s0 = CSharpScript.RunAsync<int>("x + Y + Z()", options: ScriptOptions, globals: c);
1534var s1 = s0.ContinueWith<int>("x");
1537var s2 = s1.ContinueWith<int>("int x = 20;");
1539var s3 = s2.ContinueWith<int>("x");
1547var result = CSharpScript.EvaluateAsync<string>("G()", options: ScriptOptions, globals: m);
1592var result = CSharpScript.EvaluateAsync<int>("Z()", options: ScriptOptions, globals: c, globalsType: typeof(I));
1599var s0 = CSharpScript.RunAsync("static int goo = StaticField;", options: ScriptOptions, globals: new C());
1600var s1 = s0.ContinueWith("static int bar { get { return goo; } }");
1601var s2 = s1.ContinueWith("class C { public static int baz() { return bar; } }");
1602var s3 = s2.ContinueWith("C.baz()");
1618var s0 = CSharpScript.RunAsync("int goo(double a) { return 2; }", options: ScriptOptions, globals: new D());
1619var s1 = s0.ContinueWith("goo(1)");
1622var s2 = s1.ContinueWith("goo(1.0)");
1630var r0 = CSharpScript.EvaluateAsync<int>("X + Y + Z", options: ScriptOptions, globals: obj);
1634var r1 = CSharpScript.EvaluateAsync<int>("X", options: ScriptOptions, globals: obj);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (6)
Microsoft.CodeAnalysis.EditorFeatures (269)
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (4)
27protected abstract Task<bool> TryNavigateToItemAsync(Document document, WrappedNavigationBarItem item, ITextView textView, ITextVersion textVersion, CancellationToken cancellationToken);
29public async Task<ImmutableArray<NavigationBarItem>> GetItemsAsync(
41public Task<bool> TryNavigateToItemAsync(Document document, NavigationBarItem item, ITextView textView, ITextVersion textVersion, CancellationToken cancellationToken)
70internal virtual Task<(DocumentId documentId, int position, int virtualSpace)> GetNavigationLocationAsync(
ExternalAccess\VSTypeScript\Api\IVSTypeScriptFormattingInteractionService.cs (4)
31Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, TextSpan? textSpan, DocumentOptionSet? documentOptions, CancellationToken cancellationToken);
36Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, TextSpan textSpan, DocumentOptionSet? documentOptions, CancellationToken cancellationToken);
43Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, char typedChar, int position, DocumentOptionSet? documentOptions, CancellationToken cancellationToken);
48Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int position, DocumentOptionSet? documentOptions, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\VSTypeScriptFormattingInteractionService.cs (4)
33public Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, TextSpan? textSpan, CancellationToken cancellationToken)
36public Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken)
39public Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken)
42public Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken)
Formatting\IFormattingInteractionService.cs (4)
31Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, TextSpan? textSpan, CancellationToken cancellationToken);
36Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken);
43Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken);
48Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken);
Lightup\ISmartRenameSessionWrapper.cs (6)
37private static readonly Func<object, CancellationToken, Task<IReadOnlyList<string>>> s_getSuggestionsAsync;
38private static readonly Func<object, object, CancellationToken, Task<IReadOnlyList<string>>>? s_getSuggestionsAsync_WithContext;
74s_getSuggestionsAsync_WithContext = LightupHelpers.CreateFunctionAccessor<object, object, CancellationToken, Task<IReadOnlyList<string>>>(s_wrappedType,
81s_getSuggestionsAsync = LightupHelpers.CreateFunctionAccessor<object, CancellationToken, Task<IReadOnlyList<string>>>(s_wrappedType, nameof(GetSuggestionsAsync), typeof(CancellationToken), SpecializedTasks.EmptyReadOnlyList<string>());
126public Task<IReadOnlyList<string>> GetSuggestionsAsync(CancellationToken cancellationToken)
129public Task<IReadOnlyList<string>> GetSuggestionsAsync(ImmutableDictionary<string, ImmutableArray<(string filePath, string content)>> context, CancellationToken cancellationToken)
Organizing\OrganizeDocumentCommandHandler.cs (4)
97Func<ITextSnapshot, IUIThreadOperationContext, Task<Document?>> getCurrentDocumentAsync,
98Func<Document, CancellationToken, Task<Document>> getChangedDocumentAsync)
113Func<ITextSnapshot, IUIThreadOperationContext, Task<Document?>> getCurrentDocumentAsync,
114Func<Document, CancellationToken, Task<Document>> getChangedDocumentAsync)
Preview\AbstractPreviewFactoryService.cs (16)
249public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedDocumentPreviewViewAsync(Document document, CancellationToken cancellationToken)
273private async Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedTextDocumentPreviewViewAsync<TDocument>(
297public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedDocumentPreviewViewAsync(Document document, double zoomLevel, CancellationToken cancellationToken)
305public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedAdditionalDocumentPreviewViewAsync(TextDocument document, double zoomLevel, CancellationToken cancellationToken)
313public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedAnalyzerConfigDocumentPreviewViewAsync(TextDocument document, double zoomLevel, CancellationToken cancellationToken)
321public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedDocumentPreviewViewAsync(Document document, CancellationToken cancellationToken)
345private async Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedTextDocumentPreviewViewAsync<TDocument>(
379public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedDocumentPreviewViewAsync(Document document, double zoomLevel, CancellationToken cancellationToken)
387public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedAdditionalDocumentPreviewViewAsync(TextDocument document, double zoomLevel, CancellationToken cancellationToken)
395public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedAnalyzerConfigDocumentPreviewViewAsync(TextDocument document, double zoomLevel, CancellationToken cancellationToken)
403public Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedDocumentPreviewViewAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken)
406public async Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedDocumentPreviewViewAsync(Document oldDocument, Document newDocument, double zoomLevel, CancellationToken cancellationToken)
510private async Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedAdditionalOrAnalyzerConfigDocumentPreviewViewAsync(
566public Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedAdditionalDocumentPreviewViewAsync(TextDocument oldDocument, TextDocument newDocument, double zoomLevel, CancellationToken cancellationToken)
572public Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedAnalyzerConfigDocumentPreviewViewAsync(TextDocument oldDocument, TextDocument newDocument, double zoomLevel, CancellationToken cancellationToken)
672protected abstract Task<TDifferenceViewer> CreateDifferenceViewAsync(IDifferenceBuffer diffBuffer, ITextViewRoleSet previewRoleSet, DifferenceViewMode mode, double zoomLevel, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (32)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (29)
ValueTracking\AbstractBaseValueTrackingTests.cs (4)
26internal static async Task<ImmutableArray<ValueTrackedItem>> GetTrackedItemsAsync(TestWorkspace testWorkspace, CancellationToken cancellationToken = default)
36internal static async Task<ImmutableArray<ValueTrackedItem>> GetTrackedItemsAsync(TestWorkspace testWorkspace, ValueTrackedItem item, CancellationToken cancellationToken = default)
42internal static async Task<ImmutableArray<ValueTrackedItem>> ValidateItemsAsync(TestWorkspace testWorkspace, (int line, string text)[] itemInfo, CancellationToken cancellationToken = default)
55internal static async Task<ImmutableArray<ValueTrackedItem>> ValidateChildrenAsync(TestWorkspace testWorkspace, ValueTrackedItem item, (int line, string text)[] childInfo, CancellationToken cancellationToken = default)
Microsoft.CodeAnalysis.Extensions.Package (7)
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (3)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (44)
Internal\Analyzer\AbstractCopilotCodeAnalysisService.cs (20)
40protected abstract Task<bool> IsAvailableCoreAsync(CancellationToken cancellationToken);
41protected abstract Task<ImmutableArray<string>> GetAvailablePromptTitlesCoreAsync(Document document, CancellationToken cancellationToken);
42protected abstract Task<ImmutableArray<Diagnostic>> AnalyzeDocumentCoreAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken);
43protected abstract Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsCoreAsync(Document document, string promptTitle, CancellationToken cancellationToken);
45protected abstract Task<string> GetOnTheFlyDocsPromptCoreAsync(OnTheFlyDocsInfo onTheFlyDocsInfo, CancellationToken cancellationToken);
46protected abstract Task<(string responseString, bool isQuotaExceeded)> GetOnTheFlyDocsResponseCoreAsync(string prompt, CancellationToken cancellationToken);
47protected abstract Task<bool> IsFileExcludedCoreAsync(string filePath, CancellationToken cancellationToken);
48protected abstract Task<(Dictionary<string, string>? responseDictionary, bool isQuotaExceeded)> GetDocumentationCommentCoreAsync(DocumentationCommentProposal proposal, CancellationToken cancellationToken);
49protected abstract Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsCoreAsync(Document document, ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> methodOrProperties, CancellationToken cancellationToken);
52public Task<bool> IsAvailableAsync(CancellationToken cancellationToken)
55public async Task<ImmutableArray<string>> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken)
66private static async Task<bool> ShouldSkipAnalysisAsync(Document document, CancellationToken cancellationToken)
135public async Task<ImmutableArray<Diagnostic>> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray<string> promptTitles, CancellationToken cancellationToken)
169protected virtual Task<ImmutableArray<Diagnostic>> GetDiagnosticsIntersectWithSpanAsync(Document document, IReadOnlyList<Diagnostic> diagnostics, TextSpan span, CancellationToken cancellationToken)
183public async Task<string> GetOnTheFlyDocsPromptAsync(OnTheFlyDocsInfo onTheFlyDocsInfo, CancellationToken cancellationToken)
187public async Task<(string responseString, bool isQuotaExceeded)> GetOnTheFlyDocsResponseAsync(string prompt, CancellationToken cancellationToken)
195public async Task<bool> IsFileExcludedAsync(string filePath, CancellationToken cancellationToken)
203public async Task<(Dictionary<string, string>? responseDictionary, bool isQuotaExceeded)> GetDocumentationCommentAsync(DocumentationCommentProposal proposal, CancellationToken cancellationToken)
211public async Task<bool> IsImplementNotImplementedExceptionsAvailableAsync(CancellationToken cancellationToken)
217public async Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsAsync(
Internal\Analyzer\CSharp\CSharpCopilotCodeAnalysisService.cs (10)
62protected override Task<ImmutableArray<Diagnostic>> AnalyzeDocumentCoreAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken)
70protected override Task<ImmutableArray<string>> GetAvailablePromptTitlesCoreAsync(Document document, CancellationToken cancellationToken)
78protected override Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsCoreAsync(Document document, string promptTitle, CancellationToken cancellationToken)
86protected override Task<bool> IsAvailableCoreAsync(CancellationToken cancellationToken)
102protected override Task<string> GetOnTheFlyDocsPromptCoreAsync(OnTheFlyDocsInfo onTheFlyDocsInfo, CancellationToken cancellationToken)
110protected override Task<(string responseString, bool isQuotaExceeded)> GetOnTheFlyDocsResponseCoreAsync(string prompt, CancellationToken cancellationToken)
118protected override async Task<ImmutableArray<Diagnostic>> GetDiagnosticsIntersectWithSpanAsync(
138protected override Task<bool> IsFileExcludedCoreAsync(string filePath, CancellationToken cancellationToken)
146protected override Task<(Dictionary<string, string>? responseDictionary, bool isQuotaExceeded)> GetDocumentationCommentCoreAsync(DocumentationCommentProposal proposal, CancellationToken cancellationToken)
159protected override async Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsCoreAsync(
Microsoft.CodeAnalysis.ExternalAccess.Extensions (5)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (81)
Internal\Editor\FSharpEditorFormattingService.cs (8)
44public Task<IList<TextChange>> GetFormattingChangesAsync(Document document, TextSpan? textSpan, CancellationToken cancellationToken)
49public Task<IList<TextChange>?> GetFormattingChangesAsync(Document document, char typedChar, int position, CancellationToken cancellationToken)
54public Task<IList<TextChange>> GetFormattingChangesOnPasteAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
59public Task<IList<TextChange>?> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken)
79async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, TextSpan? textSpan, CancellationToken cancellationToken)
85async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken)
91async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken)
97async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (13)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (47)
Microsoft.CodeAnalysis.ExternalAccess.Xaml (12)
Microsoft.CodeAnalysis.Features (1261)
AddImport\SymbolReferenceFinder.cs (16)
96internal Task<ImmutableArray<SymbolReference>> FindInAllSymbolsInStartingProjectAsync(bool exact, CancellationToken cancellationToken)
99internal Task<ImmutableArray<SymbolReference>> FindInSourceSymbolsInProjectAsync(ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>> projectToAssembly, Project project, bool exact, CancellationToken cancellationToken)
102internal Task<ImmutableArray<SymbolReference>> FindInMetadataSymbolsAsync(IAssemblySymbol assembly, Project assemblyProject, PortableExecutableReference metadataReference, bool exact, CancellationToken cancellationToken)
105private async Task<ImmutableArray<SymbolReference>> DoAsync(SearchScope searchScope, CancellationToken cancellationToken)
116using var _1 = ArrayBuilder<Task<ImmutableArray<SymbolReference>>>.GetInstance(out var tasks);
177private async Task<ImmutableArray<SymbolReference>> GetReferencesForMatchingTypesAsync(
262private async Task<ImmutableArray<SymbolReference>> GetReferencesForMatchingNamespacesAsync(
289private async Task<ImmutableArray<SymbolReference>> GetReferencesForMatchingFieldsAndPropertiesAsync(
353private async Task<ImmutableArray<SymbolReference>> GetReferencesForMatchingExtensionMethodsAsync(
412private async Task<ImmutableArray<SymbolReference>> GetReferencesForCollectionInitializerMethodsAsync(
443private async Task<ImmutableArray<SymbolReference>> GetReferencesForQueryPatternsAsync(
467private async Task<ImmutableArray<SymbolReference>> GetReferencesForGetAwaiterAsync(
492private async Task<ImmutableArray<SymbolReference>> GetReferencesForGetEnumeratorAsync(
517private async Task<ImmutableArray<SymbolReference>> GetReferencesForGetAsyncEnumeratorAsync(
542private async Task<ImmutableArray<SymbolReference>> GetReferencesForDeconstructAsync(
564private async Task<ImmutableArray<SymbolReference>> GetReferencesForExtensionMethodAsync(
ChangeSignature\AbstractChangeSignatureService.cs (8)
41public abstract Task<(ISymbol? symbol, int selectedIndex)> GetInvocationSymbolAsync(Document document, int position, bool restrictToDeclarations, CancellationToken cancellationToken);
49public abstract Task<ImmutableArray<ISymbol>> DetermineCascadedSymbolsFromDelegateInvokeAsync(
94public async Task<ImmutableArray<ChangeSignatureCodeAction>> GetChangeSignatureCodeActionAsync(Document document, TextSpan span, CancellationToken cancellationToken)
103internal async Task<ChangeSignatureAnalyzedContext> GetChangeSignatureContextAsync(
190internal async Task<ChangeSignatureResult> ChangeSignatureWithContextAsync(ChangeSignatureAnalyzedContext context, ChangeSignatureOptionsResult? options, CancellationToken cancellationToken)
199async Task<ChangeSignatureResult> GetChangeSignatureResultAsync(ChangeSignatureAnalysisSucceededContext context, ChangeSignatureOptionsResult? options, CancellationToken cancellationToken)
225private static async Task<ImmutableArray<ReferencedSymbol>> FindChangeSignatureReferencesAsync(
246private async Task<(Solution updatedSolution, string? confirmationMessage)> CreateUpdatedSolutionAsync(
CodeFixes\Service\ICodeFixService.cs (5)
25Task<CodeFixCollection?> GetMostSevereFixAsync(TextDocument document, TextSpan range, ICodeActionRequestPriorityProvider priorityProvider, CancellationToken cancellationToken);
27Task<CodeFixCollection?> GetDocumentFixAllForIdInSpanAsync(TextDocument document, TextSpan textSpan, string diagnosticId, DiagnosticSeverity severity, CancellationToken cancellationToken);
28Task<TDocument> ApplyCodeFixesForSpecificDiagnosticIdAsync<TDocument>(TDocument document, string diagnosticId, DiagnosticSeverity severity, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
38public static Task<ImmutableArray<CodeFixCollection>> GetFixesAsync(this ICodeFixService service, TextDocument document, TextSpan range, CancellationToken cancellationToken)
41public static Task<ImmutableArray<CodeFixCollection>> GetFixesAsync(this ICodeFixService service, TextDocument document, TextSpan textSpan, ICodeActionRequestPriorityProvider priorityProvider, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (7)
57Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
60protected override Task<Document> PostProcessChangesAsync(Document document, CancellationToken cancellationToken)
67private static async Task<Solution> CreateChangedSolutionAsync(
96private static async Task<Solution> CreateChangedSolutionAsync(
128protected override async Task<Document> GetChangedSuppressionDocumentAsync(CancellationToken cancellationToken)
152private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(AbstractSuppressionCodeFixProvider fixer, IEnumerable<KeyValuePair<Document, ImmutableArray<Diagnostic>>> diagnosticsByDocument, CancellationToken cancellationToken)
173private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(Project project, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
CodeLens\CodeLensReferencesService.cs (9)
42private static async Task<T?> FindAsync<T>(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
43Func<CodeLensFindReferencesProgress, Task<T>> onResults, Func<CodeLensFindReferencesProgress, Task<T>> onCapped,
89public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults, CancellationToken cancellationToken)
101private static async Task<ReferenceLocationDescriptor> GetDescriptorOfEnclosingSymbolAsync(Solution solution, Location location, CancellationToken cancellationToken)
202public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
245private static async Task<ReferenceMethodDescriptor> TryGetMethodDescriptorAsync(Location commonLocation, Solution solution, CancellationToken cancellationToken)
259public Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
275public async Task<string> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CodeLens\ICodeLensReferencesService.cs (4)
23Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, CancellationToken cancellationToken);
28Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
33Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
38Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (6)
29public abstract Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken);
30public abstract Task<ImmutableArray<CodeAction>> GetRefactoringAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
41protected abstract Task<TTypeDeclarationSyntax?> GetRelevantNodeAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
48public override async Task<ImmutableArray<CodeAction>> GetRefactoringAsync(
56public override async Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken)
70private async Task<TTypeDeclarationSyntax?> GetTypeDeclarationAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (24)
39public abstract Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken);
41public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken);
43public abstract Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
93protected abstract Task<SyntaxNode?> TryGetApplicableContainerFromSpanAsync(Document document, TextSpan span, CancellationToken cancellationToken);
106protected abstract Task<ImmutableArray<(DocumentId id, SyntaxNode container)>> GetValidContainersFromAllLinkedDocumentsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken);
114public override async Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken)
125public override async Task<Solution?> TryChangeTopLevelNamespacesAsync(
170static async Task<ImmutableArray<SyntaxNode>> GetTopLevelNamespacesAsync(Document document, CancellationToken cancellationToken)
181public override async Task<Solution> ChangeNamespaceAsync(
268protected async Task<ImmutableArray<(DocumentId, SyntaxNode)>> TryGetApplicableContainersFromAllDocumentsAsync(
311protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken)
323protected async Task<bool> ContainsPartialTypeWithMultipleDeclarationsAsync(
366private async Task<ImmutableArray<ISymbol>> GetDeclaredSymbolsInContainerAsync(
427private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync(
506private static async Task<ImmutableArray<LocationForAffectedSymbol>> FindReferenceLocationsForSymbolAsync(
540private static async Task<ImmutableArray<ReferencedSymbol>> FindReferencesAsync(ISymbol symbol, Document document, CancellationToken cancellationToken)
551private async Task<Document> FixDeclarationDocumentAsync(
672private static async Task<Document> FixReferencingDocumentAsync(
707private static async Task<Document> SimplifyTypeNamesAsync(
729private static async Task<(Document, ImmutableArray<SyntaxNode>)> FixReferencesAsync(
800private static async Task<Solution> RemoveUnnecessaryImportsAsync(
834async static Task<Document> RemoveUnnecessaryImportsWorkerAsync(
854private static async Task<Document> AddImportsInContainersAsync(
890private static async Task<Solution> MergeDiffAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken)
Completion\CommonCompletionProvider.cs (7)
56public sealed override Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken)
64internal override async Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
75private async Task<ImmutableArray<TaggedText>> TryAddSnippetInvocationPartAsync(
102internal virtual Task<CompletionDescription> GetDescriptionWorkerAsync(
110public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default)
117public virtual Task<TextChange?> GetTextChangeAsync(Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
120protected virtual Task<TextChange?> GetTextChangeAsync(CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
Completion\CompletionProvider.cs (4)
57internal virtual async Task<bool> IsSyntacticTriggerCharacterAsync(Document document, int caretPosition, CompletionTrigger trigger, CompletionOptions options, CancellationToken cancellationToken)
63public virtual Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken)
66internal virtual Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
78public virtual Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (6)
119private static async Task<bool> CheckTypeInfoOfAttributeAsync(Document document, SyntaxNode attributeNode, CancellationToken cancellationToken)
174private async Task<IImmutableSet<string>> GetAllInternalsVisibleToAssemblyNamesOfProjectAsync(CompletionContext completionContext, CancellationToken cancellationToken)
227private async Task<string> GetAssemblyNameFromInternalsVisibleToAttributeAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
248private static async Task<TextSpan> GetTextChangeSpanAsync(Document document, TextSpan startSpan, CancellationToken cancellationToken)
268public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default)
284private static async Task<string> GetPublicKeyOfProjectAsync(Project project, CancellationToken cancellationToken)
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (7)
22protected abstract Task<bool> ShouldPreselectInferredTypesAsync(CompletionContext? completionContext, int position, CompletionOptions options, CancellationToken cancellationToken);
23protected abstract Task<bool> ShouldProvideAvailableSymbolsInCurrentContextAsync(CompletionContext? completionContext, TSyntaxContext context, int position, CompletionOptions options, CancellationToken cancellationToken);
32protected sealed override async Task<ImmutableArray<SymbolAndSelectionInfo>> GetSymbolsAsync(
199internal sealed override async Task<CompletionDescription> GetDescriptionWorkerAsync(
227async Task<CompletionDescription?> TryGetDescriptionAsync(DocumentId documentId)
263protected sealed override async Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken)
269protected async Task<bool?> IsTriggerOnDotAsync(Document document, int characterPosition, CancellationToken cancellationToken)
Completion\Providers\AbstractSymbolCompletionProvider.cs (7)
30protected abstract Task<ImmutableArray<SymbolAndSelectionInfo>> GetSymbolsAsync(
298internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
338private async Task<ImmutableArray<CompletionItem>> GetItemsAsync(
381protected virtual Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken)
409private async Task<ImmutableArray<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)>> GetPerContextSymbolsAsync(
437protected async Task<ImmutableArray<SymbolAndSelectionInfo>> TryGetSymbolsForContextAsync(
468public sealed override Task<TextChange?> GetTextChangeAsync(Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (3)
22public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default)
102internal override async Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
120private static async Task<(Document, int)> GetDocumentWithoutInvokingTextAsync(Document document, int position, CancellationToken cancellationToken)
Copilot\ICopilotCodeAnalysisService.cs (9)
26Task<bool> IsAvailableAsync(CancellationToken cancellationToken);
36Task<ImmutableArray<string>> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken);
57Task<ImmutableArray<Diagnostic>> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray<string> promptTitles, CancellationToken cancellationToken);
72Task<string> GetOnTheFlyDocsPromptAsync(OnTheFlyDocsInfo onTheFlyDocsInfo, CancellationToken cancellationToken);
78Task<(string responseString, bool isQuotaExceeded)> GetOnTheFlyDocsResponseAsync(string prompt, CancellationToken cancellationToken);
83Task<bool> IsFileExcludedAsync(string filePath, CancellationToken cancellationToken);
89Task<(Dictionary<string, string>? responseDictionary, bool isQuotaExceeded)> GetDocumentationCommentAsync(DocumentationCommentProposal proposal, CancellationToken cancellationToken);
94Task<bool> IsImplementNotImplementedExceptionsAvailableAsync(CancellationToken cancellationToken);
100Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsAsync(
Diagnostics\IDiagnosticAnalyzerService.cs (6)
30Task<ImmutableArray<DiagnosticData>> ForceAnalyzeProjectAsync(Project project, CancellationToken cancellationToken);
53Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Project project, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
70Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Project project, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
80Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForSpanAsync(
96public static Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForSpanAsync(this IDiagnosticAnalyzerService service,
113public static Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForSpanAsync(this IDiagnosticAnalyzerService service,
EncapsulateField\AbstractEncapsulateFieldService.cs (10)
40protected abstract Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken);
41protected abstract Task<ImmutableArray<IFieldSymbol>> GetFieldsAsync(Document document, TextSpan span, CancellationToken cancellationToken);
44public async Task<EncapsulateFieldResult?> EncapsulateFieldsInSpanAsync(Document document, TextSpan span, bool useDefaultBehavior, CancellationToken cancellationToken)
57public async Task<ImmutableArray<CodeAction>> GetEncapsulateFieldCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken)
109public async Task<Solution> EncapsulateFieldsAsync(
140private async Task<Solution> EncapsulateFieldsInCurrentProcessAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken)
166private async Task<Solution?> EncapsulateFieldAsync(
229private async Task<Solution> UpdateReferencesAsync(
274private static async Task<Solution> RenameAsync(
315protected static async Task<Document> AddPropertyAsync(
GenerateEqualsAndGetHashCodeFromMembers\IGenerateEqualsAndGetHashCodeService.cs (5)
23Task<Document> FormatDocumentAsync(Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken);
29Task<IMethodSymbol> GenerateEqualsMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, string? localNameOpt, CancellationToken cancellationToken);
35Task<IMethodSymbol> GenerateEqualsMethodThroughIEquatableEqualsAsync(Document document, INamedTypeSymbol namedType, CancellationToken cancellationToken);
41Task<IMethodSymbol> GenerateIEquatableEqualsMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, INamedTypeSymbol constructedEquatableType, CancellationToken cancellationToken);
50Task<IMethodSymbol> GenerateGetHashCodeMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, CancellationToken cancellationToken);
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (10)
43public async Task<SyntaxNode> RewriteDocumentAsync(Compilation compilation, Document document, List<TExpressionSyntax> invocations, CancellationToken cancellationToken)
62private async Task<Dictionary<TIdentifierNameSyntax, IParameterSymbol>> MapExpressionToParametersAsync(CancellationToken cancellationToken)
84private async Task<string> GetNewParameterNameAsync(CancellationToken cancellationToken)
219private async Task<SyntaxNode> ModifyDocumentInvocationsTrampolineOverloadAndIntroduceParameterAsync(Compilation compilation, Document currentDocument,
344private async Task<ITypeSymbol> GetTypeOfExpressionAsync(CancellationToken cancellationToken)
388private async Task<SyntaxNode> ExtractMethodAsync(ImmutableArray<IParameterSymbol> validParameters, string newMethodIdentifier, SyntaxGenerator generator, CancellationToken cancellationToken)
420private async Task<SyntaxNode> GenerateNewMethodOverloadAsync(int insertionIndex, SyntaxGenerator generator, CancellationToken cancellationToken)
441private async Task<SyntaxNode> CreateMethodDeclarationAsync(SyntaxNode newStatement, ImmutableArray<IParameterSymbol>? validParameters,
481private async Task<SyntaxNode> ModifyDocumentInvocationsAndIntroduceParameterAsync(Compilation compilation, Document document, int insertionIndex,
666private async Task<IEnumerable<TExpressionSyntax>> FindMatchesAsync(CancellationToken cancellationToken)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.cs (4)
26public Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken)
29public async Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken)
35public async Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken)
46public async Task<IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>> ToDescriptionGroupsAsync(
LanguageServices\SymbolDisplayService\ISymbolDisplayService.cs (4)
15Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default);
16Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default);
17Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default);
18Task<IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>> ToDescriptionGroupsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken = default);
MoveToNamespace\AbstractMoveToNamespaceService.cs (13)
25Task<ImmutableArray<MoveToNamespaceCodeAction>> GetCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken);
26Task<MoveToNamespaceAnalysisResult> AnalyzeTypeAtPositionAsync(Document document, int position, CancellationToken cancellationToken);
27Task<MoveToNamespaceResult> MoveToNamespaceAsync(MoveToNamespaceAnalysisResult analysisResult, string targetNamespace, CancellationToken cancellationToken);
45public async Task<ImmutableArray<MoveToNamespaceCodeAction>> GetCodeActionsAsync(
63public async Task<MoveToNamespaceAnalysisResult> AnalyzeTypeAtPositionAsync(
87private async Task<MoveToNamespaceAnalysisResult?> TryAnalyzeNamespaceAsync(
112private async Task<MoveToNamespaceAnalysisResult> TryAnalyzeNamedTypeAsync(
170public Task<MoveToNamespaceResult> MoveToNamespaceAsync(
186private static async Task<ImmutableArray<ISymbol>> GetMemberSymbolsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken)
214private static async Task<MoveToNamespaceResult> MoveItemsInNamespaceAsync(
237private static async Task<MoveToNamespaceResult> MoveTypeToNamespaceAsync(
275private static async Task<Solution> PropagateChangeToLinkedDocumentsAsync(Document document, SyntaxFormattingOptions formattingOptions, CancellationToken cancellationToken)
305private static async Task<IEnumerable<string>> GetNamespacesAsync(Document document, CancellationToken cancellationToken)
Navigation\IDocumentNavigationService.cs (12)
19Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken);
25Task<bool> CanNavigateToPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken);
27Task<INavigableLocation?> GetLocationForSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken);
28Task<INavigableLocation?> GetLocationForPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken);
33public virtual Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken)
36public virtual Task<bool> CanNavigateToPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken)
39public virtual Task<INavigableLocation?> GetLocationForSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken)
42public virtual Task<INavigableLocation?> GetLocationForPositionAsync(Workspace workspace, DocumentId documentId, int position, int virtualSpace, bool allowInvalidPosition, CancellationToken cancellationToken)
48public static Task<bool> CanNavigateToSpanAsync(this IDocumentNavigationService service, Workspace workspace, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken)
51public static Task<bool> CanNavigateToPositionAsync(this IDocumentNavigationService service, Workspace workspace, DocumentId documentId, int position, CancellationToken cancellationToken)
54public static Task<INavigableLocation?> GetLocationForSpanAsync(this IDocumentNavigationService service, Workspace workspace, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken)
57public static Task<INavigableLocation?> GetLocationForPositionAsync(this IDocumentNavigationService service, Workspace workspace, DocumentId documentId, int position, CancellationToken cancellationToken)
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (3)
37public async Task<SourceFileInfo?> LoadSourceDocumentAsync(string tempFilePath, SourceDocument sourceDocument, Encoding encoding, TelemetryMessage telemetry, bool useExtendedTimeout, CancellationToken cancellationToken)
124private async Task<SourceFileInfo?> TryGetSourceLinkFileAsync(SourceDocument sourceDocument, Encoding encoding, TelemetryMessage telemetry, bool useExtendedTimeout, CancellationToken cancellationToken)
135var sourceFileTask = _sourceLinkService.Value.GetSourceFilePathAsync(sourceDocument.SourceLinkUrl, relativePath, cancellationToken);
Shared\Extensions\DocumentExtensions.cs (8)
19public static async Task<Document> ReplaceNodeAsync<TNode>(this Document document, TNode oldNode, TNode newNode, CancellationToken cancellationToken)
41public static async Task<Document> ReplaceNodesAsync(this Document document,
51public static async Task<ImmutableArray<T>> GetUnionItemsFromDocumentAndLinkedDocumentsAsync<T>(
54Func<Document, Task<ImmutableArray<T>>> getItemsWorker)
70public static async Task<bool> IsValidContextForDocumentOrLinkedDocumentsAsync(
72Func<Document, CancellationToken, Task<bool>> contextChecker,
93public static async Task<NamingRule> GetApplicableNamingRuleAsync(this Document document, ISymbol symbol, CancellationToken cancellationToken)
105public static async Task<NamingRule> GetApplicableNamingRuleAsync(
Snippets\RoslynLSPSnippetConverter.cs (2)
22public static async Task<string> GenerateLSPSnippetAsync(Document document, int caretPosition, ImmutableArray<SnippetPlaceholder> placeholders, TextChange textChange, int triggerLocation, CancellationToken cancellationToken)
108private static async Task<TextChange> ExtendSnippetTextChangeAsync(Document document, TextChange textChange, ImmutableArray<SnippetPlaceholder> placeholders, int caretPosition, int triggerLocation, CancellationToken cancellationToken)
Snippets\SnippetFunctionService.cs (7)
32public abstract Task<string?> GetContainingClassNameAsync(Document document, int position, CancellationToken cancellationToken);
38public static async Task<string?> GetSimplifiedTypeNameAsync(Document document, TextSpan fieldSpan, string fullyQualifiedTypeName, SimplifierOptions simplifierOptions, CancellationToken cancellationToken)
56public async Task<string?> GetSwitchExpansionAsync(Document document, TextSpan caseGenerationLocation, TextSpan switchExpressionLocation, SimplifierOptions simplifierOptions, CancellationToken cancellationToken)
120protected abstract Task<ITypeSymbol?> GetEnumSymbolAsync(Document document, TextSpan switchExpressionSpan, CancellationToken cancellationToken);
122protected abstract Task<(Document, TextSpan)> GetDocumentWithEnumCaseAsync(Document document, string fullyQualifiedTypeName, string firstEnumMemberName, TextSpan caseGenerationLocation, CancellationToken cancellationToken);
124private async Task<string?> GetSimplifiedEnumNameAsync(
140private static async Task<string?> GetSimplifiedTypeNameAtSpanAsync(Document documentWithFullyQualifiedTypeName, TextSpan fullyQualifiedTypeSpan, SimplifierOptions simplifierOptions, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractSnippetProvider.cs (9)
41protected abstract Task<ImmutableArray<TextChange>> GenerateSnippetTextChangesAsync(Document document, int position, CancellationToken cancellationToken);
70public async Task<SnippetChange> GetSnippetChangeAsync(Document document, int position, CancellationToken cancellationToken)
139private static async Task<Document> CleanupDocumentAsync(
167private async Task<Document> GetDocumentWithSnippetAndTriviaAsync(Document snippetDocument, int position, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken)
188private static async Task<Document> GetDocumentWithSnippetAsync(Document document, ImmutableArray<TextChange> snippets, CancellationToken cancellationToken)
198private async Task<Document> AddFormatAnnotationAsync(Document document, int position, CancellationToken cancellationToken)
208protected virtual async Task<SyntaxNode> AnnotateNodesToReformatAsync(
227private async Task<Document> AddIndentationToDocumentAsync(Document document, CancellationToken cancellationToken)
238protected virtual Task<Document> AddIndentationToDocumentAsync(Document document, TSnippetSyntax snippet, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (4)
345? new Func<CancellationToken, Task<Solution>>(cancellationToken => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, cancellationToken))
373private async Task<Solution> FixAsync(
401private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken)
410private static async Task<(string argumentNameSuggestion, bool isNamed)> GetNameSuggestionForArgumentAsync(
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (6)
300static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey)
313private static async Task<Document> AddEditsAsync(
379private static Task<Document> TakeTopAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
382private static Task<Document> TakeBottomAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
385private static Task<Document> TakeBothAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
391private async Task<Document> FixAllAsync(
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (9)
272private static async Task<Document> PreprocessDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
292private async Task<SyntaxNode> GetNewRootAsync(
744private async Task<SyntaxNode> PostProcessDocumentAsync(
773private static async Task<SyntaxNode> PostProcessDocumentCoreAsync(
774Func<SyntaxNode, Document, SyntaxFormattingOptions, CancellationToken, Task<SyntaxNode>> processMemberDeclarationAsync,
805private async Task<SyntaxNode> ReplaceDiscardDeclarationsWithAssignmentsAsync(SyntaxNode memberDeclaration, Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken)
821private async Task<SyntaxNode> AdjustLocalDeclarationsAsync(
890async Task<bool> TryRemoveUnusedLocalAsync(TLocalDeclarationStatementSyntax newDecl, TLocalDeclarationStatementSyntax originalDecl)
914private static async Task<bool> IsLocalDeclarationWithNoReferencesAsync(
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (11)
164private async Task<TimeSpan> UpdateDatabaseInBackgroundWorkerAsync(CancellationToken cancellationToken)
227private async Task<TimeSpan> DownloadFullDatabaseAsync(FileInfo databaseFileInfo, CancellationToken cancellationToken)
233private async Task<(bool succeeded, TimeSpan delay)> DownloadFullDatabaseWorkerAsync(FileInfo databaseFileInfo, CancellationToken cancellationToken)
249private async Task<(bool succeeded, TimeSpan delay)> ProcessFullDatabaseXElementAsync(
388private async Task<TimeSpan> PatchLocalDatabaseAsync(FileInfo databaseFileInfo, CancellationToken cancellationToken)
466private async Task<TimeSpan> ProcessPatchXElementAsync(
490private async Task<TimeSpan?> TryProcessPatchXElementAsync(
571private async Task<XElement> DownloadFileAsync(string serverPath, CancellationToken cancellationToken)
611private async Task<(XElement? element, TimeSpan delay)> TryDownloadFileAsync(IFileDownloader fileDownloader, CancellationToken cancellationToken)
686private async Task<(bool succeeded, byte[]? contentBytes)> TryParseDatabaseElementAsync(XElement element, CancellationToken cancellationToken)
720private static async Task<byte[]> ConvertContentAttributeAsync(XAttribute contentsAttribute, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features.Test.Utilities (3)
Microsoft.CodeAnalysis.Features.UnitTests (2)
Microsoft.CodeAnalysis.InteractiveHost (76)
Interactive\Core\InteractiveHost.Service.cs (25)
42private Task<EvaluationState> _lastTask;
163public Task<InteractiveHostPlatformInfo.Data> InitializeAsync(string replServiceProviderTypeName)
243public async Task<RemoteExecutionResult.Data> SetPathsAsync(
257private async Task<EvaluationState> SetPathsAsync(
258Task<EvaluationState> lastTask,
291public async Task<RemoteExecutionResult.Data> InitializeContextAsync(string? initializationFilePath, bool isRestarting)
305public async Task<bool> AddReferenceAsync(string reference)
316private async Task<EvaluationState> AddReferenceAsync(Task<EvaluationState> lastTask, TaskCompletionSource<bool> completionSource, string reference)
348public async Task<RemoteExecutionResult.Data> ExecuteAsync(string text)
359private async Task<EvaluationState> ExecuteAsync(TaskCompletionSource<RemoteExecutionResult> completionSource, Task<EvaluationState> lastTask, string text)
406public async Task<RemoteExecutionResult.Data> ExecuteFileAsync(string path)
467private static async Task<EvaluationState> ReportUnhandledExceptionIfAnyAsync(Task<EvaluationState> lastTask)
496private async Task<EvaluationState> InitializeContextAsync(
497Task<EvaluationState> lastTask,
678private async Task<EvaluationState> ExecuteFileAsync(
680Task<EvaluationState> lastTask,
704private async Task<ScriptState<object>?> TryExecuteFileAsync(EvaluationState state, string fullPath)
750private Task<ScriptState<object>> ExecuteOnUIThreadAsync(Script<object> script, ScriptState<object>? state, bool displayResult)
752return (Task<ScriptState<object>>)_invokeOnMainThread((Func<Task<ScriptState<object>>>)(async () =>
756var task = (state == null)
843public Task<string> GetRuntimeDirectoryAsync()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (4)
13public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, Func<TArg, CancellationToken, T>? synchronousComputeFunction, TArg arg)
16public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, TArg arg)
28public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction)
38public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction, Func<CancellationToken, T> synchronousComputeFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (15)
19public abstract Task<T> GetValueAsync(CancellationToken cancellationToken);
22Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction,
50private Func<TData, CancellationToken, Task<T>>? _asynchronousComputeFunction;
62private Task<T>? _cachedResult;
112Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction,
126Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction,
326public override Task<T> GetValueAsync(CancellationToken cancellationToken)
335var cachedResult = _cachedResult;
386private readonly struct AsynchronousComputationToStart(Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, CancellationTokenSource cancellationTokenSource)
388public readonly Func<TData, CancellationToken, Task<T>> AsynchronousComputeFunction = asynchronousComputeFunction;
409var task = computationToStart.AsynchronousComputeFunction(_data, cancellationToken);
454private void CompleteWithTask(Task<T> task, CancellationToken cancellationToken)
486private Task<T> GetCachedValueAndCacheThisValueIfNoneCached_NoLock(Task<T> task)
569public void CompleteFromTask(Task<T> task)
Microsoft.CodeAnalysis.LanguageServer (37)
Microsoft.CodeAnalysis.LanguageServer.Protocol (198)
Handler\Definitions\AbstractGoToDefinitionHandler.cs (3)
36public abstract Task<LSP.Location[]?> HandleRequestAsync(TextDocumentPositionParams request, RequestContext context, CancellationToken cancellationToken);
38protected Task<LSP.Location[]?> GetDefinitionAsync(LSP.TextDocumentPositionParams request, bool forSymbolType, RequestContext context, CancellationToken cancellationToken)
50internal static async Task<LSP.Location[]?> GetDefinitionsAsync(IGlobalOptionService globalOptions, IMetadataAsSourceFileService? metadataAsSourceFileService, Workspace workspace, Document document, bool forSymbolType, LinePosition linePosition, CancellationToken cancellationToken)
Handler\Highlights\DocumentHighlightHandler.cs (4)
43public Task<DocumentHighlight[]?> HandleRequestAsync(TextDocumentPositionParams request, RequestContext context, CancellationToken cancellationToken)
53internal static async Task<DocumentHighlight[]?> GetHighlightsAsync(IGlobalOptionService globalOptions, IHighlightingService highlightingService, Document document, LinePosition linePosition, CancellationToken cancellationToken)
76private static async Task<ImmutableArray<DocumentHighlight>> GetKeywordHighlightsAsync(IHighlightingService highlightingService, Document document, SourceText text, int position, CancellationToken cancellationToken)
90private static async Task<ImmutableArray<DocumentHighlight>> GetReferenceHighlightsAsync(IGlobalOptionService globalOptions, Document document, SourceText text, int position, CancellationToken cancellationToken)
Handler\InlayHint\InlayHintHandler.cs (3)
41public Task<LSP.InlayHint[]?> HandleRequestAsync(InlayHintParams request, RequestContext context, CancellationToken cancellationToken)
50internal static async Task<LSP.InlayHint[]?> GetInlayHintsAsync(Document document, TextDocumentIdentifier textDocumentIdentifier, LSP.Range range, InlineHintsOptions options, bool displayAllOverride, InlayHintCache inlayHintCache, CancellationToken cancellationToken)
97internal static async Task<ImmutableArray<InlineHint>> CalculateInlayHintsAsync(Document document, LSP.Range range, InlineHintsOptions options, bool displayAllOverride, CancellationToken cancellationToken)
Handler\InlineCompletions\InlineCompletionsHandler.cs (4)
104public async Task<VSInternalInlineCompletionList?> HandleRequestAsync(VSInternalInlineCompletionRequest request, RequestContext context, CancellationToken cancellationToken)
118internal static async Task<VSInternalInlineCompletionItem?> GetInlineCompletionItemsAsync(ILspLogger logger, Document document, LinePosition linePosition, LSP.FormattingOptions options, XmlSnippetParser xmlSnippetParser, CancellationToken cancellationToken)
172private static async Task<string> GetFormattedLspSnippetAsync(
252private static async Task<(string ReplacedSnippetText, ImmutableDictionary<SnippetFieldPart, ImmutableArray<TextSpan>> Fields, TextSpan? CaretSpan)> GetReplacedSnippetTextAsync(
Workspaces\LspWorkspaceManager.cs (5)
227public async Task<(Workspace?, Solution?)> GetLspSolutionInfoAsync(CancellationToken cancellationToken)
245public async Task<(Workspace?, Solution?, TextDocument?)> GetLspDocumentInfoAsync(TextDocumentIdentifier textDocumentIdentifier, CancellationToken cancellationToken)
312private async Task<ImmutableArray<(Workspace workspace, Solution Solution, bool IsForked)>> GetLspSolutionsAsync(CancellationToken cancellationToken)
337async Task<(Solution Solution, bool IsForked)> GetLspSolutionForWorkspaceAsync(Workspace workspace, CancellationToken cancellationToken)
492private async Task<bool> DoesAllTextMatchWorkspaceSolutionAsync(ImmutableDictionary<DocumentUri, ImmutableArray<TextDocument>> documentsInWorkspace, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (103)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (9)
58private protected static async Task<ImmutableArray<TestDiagnosticResult>> RunGetWorkspacePullDiagnosticsAsync(
80private protected static async Task<ImmutableArray<TestDiagnosticResult>> RunVSGetWorkspacePullDiagnosticsAsync(
114private protected static async Task<ImmutableArray<TestDiagnosticResult>> RunPublicGetWorkspacePullDiagnosticsAsync(
232private protected static Task<ImmutableArray<TestDiagnosticResult>> RunGetDocumentPullDiagnosticsAsync(
243private protected static async Task<ImmutableArray<TestDiagnosticResult>> RunGetDocumentPullDiagnosticsAsync(
317private protected Task<TestLspServer> CreateTestWorkspaceWithDiagnosticsAsync(string markup, bool mutatingLspWorkspace, BackgroundAnalysisScope analyzerDiagnosticsScope, bool useVSDiagnostics, CompilerDiagnosticsScope? compilerDiagnosticsScope = null, IEnumerable<DiagnosticAnalyzer>? additionalAnalyzers = null)
320private protected Task<TestLspServer> CreateTestWorkspaceWithDiagnosticsAsync(string[] markups, bool mutatingLspWorkspace, BackgroundAnalysisScope analyzerDiagnosticsScope, bool useVSDiagnostics, CompilerDiagnosticsScope? compilerDiagnosticsScope = null, IEnumerable<DiagnosticAnalyzer>? additionalAnalyzers = null)
323private protected Task<TestLspServer> CreateTestWorkspaceFromXmlAsync(string xmlMarkup, bool mutatingLspWorkspace, BackgroundAnalysisScope analyzerDiagnosticsScope, bool useVSDiagnostics, CompilerDiagnosticsScope? compilerDiagnosticsScope = null, IEnumerable<DiagnosticAnalyzer>? additionalAnalyzers = null)
379public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(TextDocument document, SyntaxTree? tree, CancellationToken cancellationToken)
Diagnostics\PullDiagnosticTests.cs (5)
2035var resultTask = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, triggerConnectionClose: false);
2063var resultTask = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, triggerConnectionClose: false);
2092var resultTask = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, triggerConnectionClose: false);
2119var resultTaskOne = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, category: PullDiagnosticCategories.WorkspaceDocumentsAndProject, triggerConnectionClose: false);
2120var resultTaskTwo = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, category: PullDiagnosticCategories.EditAndContinue, triggerConnectionClose: false);
HandlerTests.cs (11)
159var response = Task.FromException<TestConfigurableResponse>(new InvalidOperationException(nameof(HandlerTests)));
187var response = Task.FromException<TestConfigurableResponse>(new StreamJsonRpc.LocalRpcException(nameof(HandlerTests)) { ErrorCode = LspErrorCodes.ContentModified });
215var response = Task.FromException<TestConfigurableResponse>(new InvalidOperationException(nameof(HandlerTests)));
245var response = Task.FromException<TestConfigurableResponse>(new OperationCanceledException(nameof(HandlerTests)));
273var response = Task.FromException<TestConfigurableResponse>(new OperationCanceledException(nameof(HandlerTests)));
322public Task<string> HandleRequestAsync(TestRequestTypeOne request, RequestContext context, CancellationToken cancellationToken)
344public Task<string> HandleRequestAsync(TestRequestTypeOne request, RequestContext context, CancellationToken cancellationToken)
361public Task<string> HandleRequestAsync(RequestContext context, CancellationToken cancellationToken)
444public Task<string> HandleRequestAsync(TestRequestTypeOne request, RequestContext context, CancellationToken cancellationToken)
468public Task<string> HandleRequestAsync(TestRequestTypeTwo request, RequestContext context, CancellationToken cancellationToken)
487public Task<string> HandleRequestAsync(RequestContext context, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (14)
Microsoft.CodeAnalysis.PublicApiAnalyzers (23)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (12)
DeclarePublicApiFix.cs (6)
97private static async Task<Solution?> GetFixAsync(TextDocument? surfaceAreaDocument, bool isPublic, Project project, string newSymbolName, ImmutableHashSet<string> siblingSymbolNamesToRemove, CancellationToken cancellationToken)
202private readonly Func<CancellationToken, Task<Solution?>> _createChangedAdditionalDocument;
204public AdditionalDocumentChangeAction(string title, DocumentId? apiDocId, bool isPublic, Func<CancellationToken, Task<Solution?>> createChangedAdditionalDocument)
215protected override Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken)
239protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken)
352public override async Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext)
Microsoft.CodeAnalysis.Remote.ServiceHub (44)
Microsoft.CodeAnalysis.Remote.Workspaces (20)
AbstractAssetProvider.cs (11)
29public async Task<SolutionInfo> CreateSolutionInfoAsync(
42using var _1 = ArrayBuilder<Task<ProjectInfo>>.GetInstance(solutionChecksums.Projects.Length, out var projectsTasks);
73public async Task<ProjectInfo> CreateProjectInfoAsync(
89var projectReferencesTask = this.GetAssetsArrayAsync<ProjectReference>(new(AssetPathKind.ProjectProjectReferences, projectId), projectChecksums.ProjectReferences, cancellationToken);
90var metadataReferencesTask = this.GetAssetsArrayAsync<MetadataReference>(new(AssetPathKind.ProjectMetadataReferences, projectId), projectChecksums.MetadataReferences, cancellationToken);
91var analyzerReferencesTask = this.GetAssetsArrayAsync<AnalyzerReference>(new(AssetPathKind.ProjectAnalyzerReferences, projectId), projectChecksums.AnalyzerReferences, cancellationToken);
97var documentInfosTask = CreateDocumentInfosAsync(projectChecksums.Documents);
98var additionalDocumentInfosTask = CreateDocumentInfosAsync(projectChecksums.AdditionalDocuments);
99var analyzerConfigDocumentInfosTask = CreateDocumentInfosAsync(projectChecksums.AnalyzerConfigDocuments);
120async Task<ImmutableArray<DocumentInfo>> CreateDocumentInfosAsync(DocumentChecksumsAndIds checksumsAndIds)
163public async Task<DocumentInfo> CreateDocumentInfoAsync(
Microsoft.CodeAnalysis.ResxSourceGenerator (23)
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Microsoft.CodeAnalysis.Scripting (34)
Script.cs (19)
165internal Task<object> EvaluateAsync(object globals = null, CancellationToken cancellationToken = default(CancellationToken))
168internal abstract Task<object> CommonEvaluateAsync(object globals, CancellationToken cancellationToken);
179public Task<ScriptState> RunAsync(object globals, CancellationToken cancellationToken)
195public Task<ScriptState> RunAsync(object globals = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
198internal abstract Task<ScriptState> CommonRunAsync(object globals, Func<Exception, bool> catchException, CancellationToken cancellationToken);
208public Task<ScriptState> RunFromAsync(ScriptState previousState, CancellationToken cancellationToken)
223public Task<ScriptState> RunFromAsync(ScriptState previousState, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
226internal abstract Task<ScriptState> CommonRunFromAsync(ScriptState previousState, Func<Exception, bool> catchException, CancellationToken cancellationToken);
343private Func<object[], Task<T>> _lazyExecutor;
378internal override Task<object> CommonEvaluateAsync(object globals, CancellationToken cancellationToken)
381internal override Task<ScriptState> CommonRunAsync(object globals, Func<Exception, bool> catchException, CancellationToken cancellationToken)
384internal override Task<ScriptState> CommonRunFromAsync(ScriptState previousState, Func<Exception, bool> catchException, CancellationToken cancellationToken)
388private Func<object[], Task<T>> GetExecutor(CancellationToken cancellationToken)
455internal new Task<T> EvaluateAsync(object globals = null, CancellationToken cancellationToken = default(CancellationToken))
469public new Task<ScriptState<T>> RunAsync(object globals, CancellationToken cancellationToken)
487public new Task<ScriptState<T>> RunAsync(object globals = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
530public new Task<ScriptState<T>> RunFromAsync(ScriptState previousState, CancellationToken cancellationToken)
547public new Task<ScriptState<T>> RunFromAsync(ScriptState previousState, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
575private async Task<ScriptState<T>> RunSubmissionsAsync(
ScriptState.cs (4)
142public Task<ScriptState<object>> ContinueWithAsync(string code, ScriptOptions options, CancellationToken cancellationToken)
156public Task<ScriptState<object>> ContinueWithAsync(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
166public Task<ScriptState<TResult>> ContinueWithAsync<TResult>(string code, ScriptOptions options, CancellationToken cancellationToken)
180public Task<ScriptState<TResult>> ContinueWithAsync<TResult>(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
Microsoft.CodeAnalysis.Scripting.TestUtilities (15)
ScriptTaskExtensions.cs (10)
15public static async Task<ScriptState<object>> ContinueWith(this Task<ScriptState> task, string code, ScriptOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
20public static async Task<ScriptState<object>> ContinueWith(this Task<ScriptState<object>> task, string code, ScriptOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
25public static async Task<ScriptState<T>> ContinueWith<T>(this Task<ScriptState> task, string code, ScriptOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
30public static async Task<ScriptState<T>> ContinueWith<T>(this Task<ScriptState<object>> task, string code, ScriptOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
35public static async Task<ScriptState<object>> ContinueWith<S>(this Task<ScriptState<S>> task, string code, ScriptOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.Threading.Package (11)
Microsoft.CodeAnalysis.UnitTests (10)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.VisualBasic.Scripting (4)
Microsoft.CodeAnalysis.Workspaces (861)
CodeActions\CodeAction.cs (46)
119static codeAction => new Func<CancellationToken, Task<IEnumerable<CodeActionOperation>>>(codeAction.ComputeOperationsAsync).Method.DeclaringType != typeof(CodeAction));
127static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction));
228public Task<ImmutableArray<CodeActionOperation>> GetOperationsAsync(CancellationToken cancellationToken)
234public Task<ImmutableArray<CodeActionOperation>> GetOperationsAsync(
240private protected virtual async Task<ImmutableArray<CodeActionOperation>> GetOperationsCoreAsync(
256public Task<ImmutableArray<CodeActionOperation>> GetPreviewOperationsAsync(CancellationToken cancellationToken)
259internal async Task<ImmutableArray<CodeActionOperation>> GetPreviewOperationsAsync(
278protected virtual async Task<IEnumerable<CodeActionOperation>> ComputeOperationsAsync(CancellationToken cancellationToken)
294protected virtual async Task<ImmutableArray<CodeActionOperation>> ComputeOperationsAsync(
319protected virtual async Task<IEnumerable<CodeActionOperation>> ComputePreviewOperationsAsync(CancellationToken cancellationToken)
328protected virtual async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken)
340protected virtual async Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
357internal async Task<Solution> GetRequiredChangedSolutionAsync(IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
376protected virtual Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
392protected virtual Task<Document> GetChangedDocumentAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
398internal async Task<Solution?> GetChangedSolutionInternalAsync(
410internal Task<Document> GetChangedDocumentInternalAsync(CancellationToken cancellation)
420protected Task<ImmutableArray<CodeActionOperation>> PostProcessAsync(IEnumerable<CodeActionOperation> operations, CancellationToken cancellationToken)
424internal static async Task<ImmutableArray<CodeActionOperation>> PostProcessAsync(
450protected Task<Solution> PostProcessChangesAsync(Solution changedSolution, CancellationToken cancellationToken)
454private static async Task<Solution> PostProcessChangesAsync(
476protected virtual async Task<Document> PostProcessChangesAsync(Document document, CancellationToken cancellationToken)
497public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey)
501internal static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey)
504/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?)"/>
507public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
510/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?, CodeActionPriority)"/>
512public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
531public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey)
542public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
545/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Solution}}, string?, CodeActionPriority)"/>
547public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
659private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> _createChangedDocument;
660private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>>? _createChangedDocumentPreview;
664Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument,
665Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>>? createChangedDocumentPreview,
677Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument,
686Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument,
691protected override async Task<IEnumerable<CodeActionOperation>> ComputePreviewOperationsAsync(CancellationToken cancellationToken)
700protected sealed override Task<Document> GetChangedDocumentAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
706private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution;
710Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
721Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
730Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
735protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
756protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
CodeActions\CodeAction_Cleanup.cs (7)
29private static readonly ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> s_cleanupPasses =
47internal static async Task<Document> CleanupSyntaxAsync(Document document, CodeCleanupOptions options, CancellationToken cancellationToken)
73internal static async Task<Solution> CleanSyntaxAndSemanticsAsync(
88async Task<ImmutableArray<(DocumentId documentId, CodeCleanupOptions codeCleanupOptions)>> GetDocumentIdsAndOptionsToCleanAsync()
124private static async Task<Solution> RunAllCleanupPassesInOrderAsync(
139async Task<Solution> RunParallelCleanupPassAsync(
140Solution solution, Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>> cleanupDocumentAsync)
CodeCleanup\CodeCleaner.cs (6)
50public static async Task<Document> CleanupAsync(Document document, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default)
60public static async Task<Document> CleanupAsync(Document document, SyntaxAnnotation annotation, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default)
70public static Task<Document> CleanupAsync(Document document, TextSpan span, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default)
77public static async Task<Document> CleanupAsync(Document document, ImmutableArray<TextSpan> spans, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default)
87public static Task<SyntaxNode> CleanupAsync(SyntaxNode root, TextSpan span, SyntaxFormattingOptions options, SolutionServices services, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default)
94public static Task<SyntaxNode> CleanupAsync(SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SolutionServices services, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default)
CodeFixes\FixAllOccurrences\FixAllProvider.cs (6)
45public abstract Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext);
58public static FixAllProvider Create(Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync)
78Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync,
94Task<CodeAction?> IFixAllProvider.GetFixAsync(IFixAllContext fixAllContext)
99Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync,
102protected override Task<Document?> FixAllAsync(FixAllContext context, Document document, ImmutableArray<Diagnostic> diagnostics)
CodeRefactorings\FixAllOccurences\FixAllProvider.cs (6)
40public abstract Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext);
43Task<CodeAction?> IFixAllProvider.GetFixAsync(IFixAllContext fixAllContext)
58public static FixAllProvider Create(Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync)
78Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync,
94Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync,
97protected override Task<Document?> FixAllAsync(FixAllContext context, Document document, Optional<ImmutableArray<TextSpan>> fixAllSpans)
Diagnostics\CompilationWithAnalyzersPair.cs (5)
53public Task<AnalyzerTelemetryInfo> GetAnalyzerTelemetryInfoAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
66public async Task<AnalysisResultPair?> GetAnalysisResultAsync(CancellationToken cancellationToken)
78public async Task<AnalysisResultPair?> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken)
90public async Task<AnalysisResultPair?> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken)
102public async Task<AnalysisResultPair?> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken)
Editing\ImportAdder.cs (11)
33public static async Task<Document> AddImportsAsync(Document document, OptionSet? options = null, CancellationToken cancellationToken = default)
39public static Task<Document> AddImportsAsync(Document document, TextSpan span, OptionSet? options = null, CancellationToken cancellationToken = default)
45public static async Task<Document> AddImportsAsync(Document document, SyntaxAnnotation annotation, OptionSet? options = null, CancellationToken cancellationToken = default)
51public static Task<Document> AddImportsAsync(Document document, IEnumerable<TextSpan> spans, OptionSet? options = null, CancellationToken cancellationToken = default)
54private static async Task<Document> AddImportsFromSyntaxesAsync(Document document, IEnumerable<TextSpan> spans, OptionSet? _, CancellationToken cancellationToken)
70internal static async Task<Document> AddImportsFromSyntaxesAsync(Document document, AddImportPlacementOptions options, CancellationToken cancellationToken)
76internal static async Task<Document> AddImportsFromSyntaxesAsync(Document document, SyntaxAnnotation annotation, AddImportPlacementOptions options, CancellationToken cancellationToken)
82internal static Task<Document> AddImportsFromSyntaxesAsync(Document document, IEnumerable<TextSpan> spans, AddImportPlacementOptions options, CancellationToken cancellationToken)
88internal static async Task<Document> AddImportsFromSymbolAnnotationAsync(Document document, AddImportPlacementOptions options, CancellationToken cancellationToken)
94internal static async Task<Document> AddImportsFromSymbolAnnotationAsync(Document document, SyntaxAnnotation annotation, AddImportPlacementOptions options, CancellationToken cancellationToken)
97internal static Task<Document> AddImportsFromSymbolAnnotationAsync(Document document, IEnumerable<TextSpan> spans, AddImportPlacementOptions options, CancellationToken cancellationToken)
FindSymbols\SymbolFinder_Declarations_CustomQueries.cs (6)
28public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, CancellationToken cancellationToken = default)
34public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default)
43internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithCustomQueryAsync(
73public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, CancellationToken cancellationToken = default)
79public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default)
88internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithCustomQueryAsync(
FindSymbols\SymbolFinder_Declarations_SourceDeclarations.cs (8)
20public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, string name, bool ignoreCase, CancellationToken cancellationToken = default)
26public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(
40public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, string name, bool ignoreCase, CancellationToken cancellationToken = default)
46public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(
67public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(Solution solution, string pattern, CancellationToken cancellationToken = default)
77public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(
95public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(Project project, string pattern, CancellationToken cancellationToken = default)
105public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(
Formatting\Formatter.cs (11)
48public static Task<Document> FormatAsync(Document document, OptionSet? options = null, CancellationToken cancellationToken = default)
53internal static Task<Document> FormatAsync(Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken)
64public static Task<Document> FormatAsync(Document document, TextSpan span, OptionSet? options = null, CancellationToken cancellationToken = default)
69internal static Task<Document> FormatAsync(Document document, TextSpan span, SyntaxFormattingOptions options, CancellationToken cancellationToken)
80public static async Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, OptionSet? options = null, CancellationToken cancellationToken = default)
92internal static async Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, SyntaxFormattingOptions? options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
108public static Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, OptionSet? options = null, CancellationToken cancellationToken = default)
111internal static Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, CancellationToken cancellationToken)
114internal static async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
121internal static async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, OptionSet? optionSet, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
355public static async Task<Document> OrganizeImportsAsync(Document document, CancellationToken cancellationToken = default)
Rename\IRenameRewriterLanguageService.cs (4)
52Task<ImmutableArray<Location>> ComputeDeclarationConflictsAsync(
70Task<ImmutableArray<Location>> ComputeImplicitReferenceConflictsAsync(
124public abstract Task<ImmutableArray<Location>> ComputeDeclarationConflictsAsync(string replacementText, ISymbol renamedSymbol, ISymbol renameSymbol, IEnumerable<ISymbol> referencedSymbols, Solution baseSolution, Solution newSolution, IDictionary<Location, Location> reverseMappedLocations, CancellationToken cancellationToken);
125public abstract Task<ImmutableArray<Location>> ComputeImplicitReferenceConflictsAsync(ISymbol renameSymbol, ISymbol renamedSymbol, IEnumerable<ReferenceLocation> implicitReferenceLocations, CancellationToken cancellationToken);
Simplification\Simplifier.cs (12)
62public static async Task<TNode> ExpandAsync<TNode>(TNode node, Document document, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode
112public static async Task<SyntaxToken> ExpandAsync(SyntaxToken token, Document document, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default)
152public static async Task<Document> ReduceAsync(Document document, OptionSet? optionSet = null, CancellationToken cancellationToken = default)
165internal static async Task<Document> ReduceAsync(Document document, SimplifierOptions options, CancellationToken cancellationToken)
175public static async Task<Document> ReduceAsync(Document document, SyntaxAnnotation annotation, OptionSet? optionSet = null, CancellationToken cancellationToken = default)
193internal static async Task<Document> ReduceAsync(Document document, SyntaxAnnotation annotation, SimplifierOptions options, CancellationToken cancellationToken)
203public static Task<Document> ReduceAsync(Document document, TextSpan span, OptionSet? optionSet = null, CancellationToken cancellationToken = default)
215internal static Task<Document> ReduceAsync(Document document, TextSpan span, SimplifierOptions options, CancellationToken cancellationToken)
222public static async Task<Document> ReduceAsync(Document document, IEnumerable<TextSpan> spans, OptionSet? optionSet = null, CancellationToken cancellationToken = default)
240internal static Task<Document> ReduceAsync(Document document, IEnumerable<TextSpan> spans, SimplifierOptions options, CancellationToken cancellationToken)
244internal static async Task<Document> ReduceAsync(
255internal static async Task<SimplifierOptions> GetOptionsAsync(Document document, OptionSet? optionSet, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (10)
339public static Task<TRootNode> ReplaceNodesAsync<TRootNode>(
342Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>> computeReplacementAsync,
361public static Task<TRootNode> ReplaceTokensAsync<TRootNode>(
364Func<SyntaxToken, SyntaxToken, CancellationToken, Task<SyntaxToken>> computeReplacementAsync,
374public static Task<TRoot> ReplaceTriviaAsync<TRoot>(
377Func<SyntaxTrivia, SyntaxTrivia, CancellationToken, Task<SyntaxTrivia>> computeReplacementAsync,
387public static async Task<TRoot> ReplaceSyntaxAsync<TRoot>(
390Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>>? computeReplacementNodeAsync,
392Func<SyntaxToken, SyntaxToken, CancellationToken, Task<SyntaxToken>>? computeReplacementTokenAsync,
394Func<SyntaxTrivia, SyntaxTrivia, CancellationToken, Task<SyntaxTrivia>>? computeReplacementTriviaAsync,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (4)
13public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, Func<TArg, CancellationToken, T>? synchronousComputeFunction, TArg arg)
16public static AsyncLazy<T> Create<T, TArg>(Func<TArg, CancellationToken, Task<T>> asynchronousComputeFunction, TArg arg)
28public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction)
38public static AsyncLazy<T> Create<T>(Func<CancellationToken, Task<T>> asynchronousComputeFunction, Func<CancellationToken, T> synchronousComputeFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (15)
19public abstract Task<T> GetValueAsync(CancellationToken cancellationToken);
22Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction,
50private Func<TData, CancellationToken, Task<T>>? _asynchronousComputeFunction;
62private Task<T>? _cachedResult;
112Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction,
126Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction,
326public override Task<T> GetValueAsync(CancellationToken cancellationToken)
335var cachedResult = _cachedResult;
386private readonly struct AsynchronousComputationToStart(Func<TData, CancellationToken, Task<T>> asynchronousComputeFunction, CancellationTokenSource cancellationTokenSource)
388public readonly Func<TData, CancellationToken, Task<T>> AsynchronousComputeFunction = asynchronousComputeFunction;
409var task = computationToStart.AsynchronousComputeFunction(_data, cancellationToken);
454private void CompleteWithTask(Task<T> task, CancellationToken cancellationToken)
486private Task<T> GetCachedValueAndCacheThisValueIfNoneCached_NoLock(Task<T> task)
569public void CompleteFromTask(Task<T> task)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (13)
41private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
175public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
178Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
189public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
192Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
209public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
222public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
241private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
244Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
337private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
340Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
361var readTask = ReadFromChannelAndConsumeItemsAsync();
366async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (10)
229private async Task<Document> GetEditAsync(
391public virtual Task<Document> AddEventAsync(
401public Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken)
410public Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken)
419public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
428public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
437public Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken)
446public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
455public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
464public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (9)
29public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
36public static Task<Document> AddFieldDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken)
43public static Task<Document> AddMethodDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
50public static Task<Document> AddPropertyDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken)
57public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
64public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
71public static Task<Document> AddNamespaceDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken)
78public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
85public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (9)
133Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken);
138Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken);
143Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken);
148Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken);
153Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken);
158Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken);
163Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken);
168Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken);
173Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken);
Storage\SQLite\v2\SQLitePersistentStorage.Accessor.cs (3)
120public Task<bool> ChecksumMatchesAsync(TKey key, string name, Checksum checksum, CancellationToken cancellationToken)
137public Task<Stream?> ReadStreamAsync(TKey key, string name, Checksum? checksum, CancellationToken cancellationToken)
217public Task<bool> WriteStreamAsync(TKey key, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Storage\SQLite\v2\SQLitePersistentStorage_DocumentSerialization.cs (3)
17protected override Task<bool> ChecksumMatchesAsync(DocumentKey documentKey, Document? document, string name, Checksum checksum, CancellationToken cancellationToken)
20protected override Task<Stream?> ReadStreamAsync(DocumentKey documentKey, Document? document, string name, Checksum? checksum, CancellationToken cancellationToken)
23protected override Task<bool> WriteStreamAsync(DocumentKey documentKey, Document? document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Storage\SQLite\v2\SQLitePersistentStorage_ProjectSerialization.cs (3)
17protected override Task<bool> ChecksumMatchesAsync(ProjectKey projectKey, Project? project, string name, Checksum checksum, CancellationToken cancellationToken)
20protected override Task<Stream?> ReadStreamAsync(ProjectKey projectKey, Project? project, string name, Checksum? checksum, CancellationToken cancellationToken)
23protected override Task<bool> WriteStreamAsync(ProjectKey projectKey, Project? project, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Storage\SQLite\v2\SQLitePersistentStorage_Threading.cs (4)
15private static async Task<TResult> PerformTaskAsync<TArg, TResult>(
24var task = Task.Factory.StartNew(boundFunction, cancellationToken, TaskCreationOptions.None, scheduler);
31private Task<TResult> PerformReadAsync<TArg, TResult>(Func<TArg, TResult> func, TArg arg, CancellationToken cancellationToken) where TArg : struct
46public Task<TResult> PerformWriteAsync<TArg, TResult>(Func<TArg, TResult> func, TArg arg, CancellationToken cancellationToken) where TArg : struct
Workspace\Host\PersistentStorage\AbstractPersistentStorage.cs (27)
46public abstract Task<bool> ChecksumMatchesAsync(string name, Checksum checksum, CancellationToken cancellationToken);
47public abstract Task<Stream?> ReadStreamAsync(string name, Checksum? checksum, CancellationToken cancellationToken);
48public abstract Task<bool> WriteStreamAsync(string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken);
50protected abstract Task<bool> ChecksumMatchesAsync(ProjectKey projectKey, Project? project, string name, Checksum checksum, CancellationToken cancellationToken);
51protected abstract Task<bool> ChecksumMatchesAsync(DocumentKey documentKey, Document? document, string name, Checksum checksum, CancellationToken cancellationToken);
52protected abstract Task<Stream?> ReadStreamAsync(ProjectKey projectKey, Project? project, string name, Checksum? checksum, CancellationToken cancellationToken);
53protected abstract Task<Stream?> ReadStreamAsync(DocumentKey documentKey, Document? document, string name, Checksum? checksum, CancellationToken cancellationToken);
54protected abstract Task<bool> WriteStreamAsync(ProjectKey projectKey, Project? project, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken);
55protected abstract Task<bool> WriteStreamAsync(DocumentKey documentKey, Document? document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken);
57public Task<bool> ChecksumMatchesAsync(ProjectKey projectKey, string name, Checksum checksum, CancellationToken cancellationToken)
60public Task<bool> ChecksumMatchesAsync(DocumentKey documentKey, string name, Checksum checksum, CancellationToken cancellationToken)
63public Task<Stream?> ReadStreamAsync(ProjectKey projectKey, string name, Checksum? checksum, CancellationToken cancellationToken)
66public Task<Stream?> ReadStreamAsync(DocumentKey documentKey, string name, Checksum? checksum, CancellationToken cancellationToken)
69public Task<bool> WriteStreamAsync(ProjectKey projectKey, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
72public Task<bool> WriteStreamAsync(DocumentKey documentKey, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
75public Task<bool> ChecksumMatchesAsync(Project project, string name, Checksum checksum, CancellationToken cancellationToken)
78public Task<bool> ChecksumMatchesAsync(Document document, string name, Checksum checksum, CancellationToken cancellationToken)
81public Task<Stream?> ReadStreamAsync(Project project, string name, Checksum? checksum, CancellationToken cancellationToken)
84public Task<Stream?> ReadStreamAsync(Document document, string name, Checksum? checksum, CancellationToken cancellationToken)
87public Task<Stream?> ReadStreamAsync(string name, CancellationToken cancellationToken)
90public Task<Stream?> ReadStreamAsync(Project project, string name, CancellationToken cancellationToken)
93public Task<Stream?> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken)
96public Task<bool> WriteStreamAsync(Project project, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
99public Task<bool> WriteStreamAsync(Document document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
102public Task<bool> WriteStreamAsync(string name, Stream stream, CancellationToken cancellationToken)
105public Task<bool> WriteStreamAsync(Project project, string name, Stream stream, CancellationToken cancellationToken)
108public Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken)
Workspace\Host\PersistentStorage\IChecksummedPersistentStorage.cs (15)
23Task<bool> ChecksumMatchesAsync(string name, Checksum checksum, CancellationToken cancellationToken = default);
29Task<bool> ChecksumMatchesAsync(Project project, string name, Checksum checksum, CancellationToken cancellationToken = default);
35Task<bool> ChecksumMatchesAsync(Document document, string name, Checksum checksum, CancellationToken cancellationToken = default);
37Task<bool> ChecksumMatchesAsync(ProjectKey project, string name, Checksum checksum, CancellationToken cancellationToken = default);
38Task<bool> ChecksumMatchesAsync(DocumentKey document, string name, Checksum checksum, CancellationToken cancellationToken = default);
45Task<Stream?> ReadStreamAsync(string name, Checksum? checksum = null, CancellationToken cancellationToken = default);
52Task<Stream?> ReadStreamAsync(Project project, string name, Checksum? checksum = null, CancellationToken cancellationToken = default);
59Task<Stream?> ReadStreamAsync(Document document, string name, Checksum? checksum = null, CancellationToken cancellationToken = default);
61Task<Stream?> ReadStreamAsync(ProjectKey project, string name, Checksum? checksum = null, CancellationToken cancellationToken = default);
62Task<Stream?> ReadStreamAsync(DocumentKey document, string name, Checksum? checksum = null, CancellationToken cancellationToken = default);
73Task<bool> WriteStreamAsync(string name, Stream stream, Checksum? checksum = null, CancellationToken cancellationToken = default);
84Task<bool> WriteStreamAsync(Project project, string name, Stream stream, Checksum? checksum = null, CancellationToken cancellationToken = default);
95Task<bool> WriteStreamAsync(Document document, string name, Stream stream, Checksum? checksum = null, CancellationToken cancellationToken = default);
101Task<bool> WriteStreamAsync(ProjectKey projectKey, string name, Stream stream, Checksum? checksum = null, CancellationToken cancellationToken = default);
107Task<bool> WriteStreamAsync(DocumentKey documentKey, string name, Stream stream, Checksum? checksum = null, CancellationToken cancellationToken = default);
Workspace\Host\PersistentStorage\IPersistentStorage.cs (6)
18Task<Stream?> ReadStreamAsync(string name, CancellationToken cancellationToken = default);
19Task<Stream?> ReadStreamAsync(Project project, string name, CancellationToken cancellationToken = default);
20Task<Stream?> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken = default);
26Task<bool> WriteStreamAsync(string name, Stream stream, CancellationToken cancellationToken = default);
32Task<bool> WriteStreamAsync(Project project, string name, Stream stream, CancellationToken cancellationToken = default);
38Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken = default);
Workspace\Host\PersistentStorage\NoOpPersistentStorage.cs (21)
23public Task<bool> ChecksumMatchesAsync(string name, Checksum checksum, CancellationToken cancellationToken)
26public Task<bool> ChecksumMatchesAsync(Project project, string name, Checksum checksum, CancellationToken cancellationToken)
29public Task<bool> ChecksumMatchesAsync(Document document, string name, Checksum checksum, CancellationToken cancellationToken)
32public Task<bool> ChecksumMatchesAsync(ProjectKey project, string name, Checksum checksum, CancellationToken cancellationToken)
35public Task<bool> ChecksumMatchesAsync(DocumentKey document, string name, Checksum checksum, CancellationToken cancellationToken)
38public Task<Stream?> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken)
41public Task<Stream?> ReadStreamAsync(Project project, string name, CancellationToken cancellationToken)
44public Task<Stream?> ReadStreamAsync(string name, CancellationToken cancellationToken)
47public Task<Stream?> ReadStreamAsync(string name, Checksum? checksum, CancellationToken cancellationToken)
50public Task<Stream?> ReadStreamAsync(Project project, string name, Checksum? checksum, CancellationToken cancellationToken)
53public Task<Stream?> ReadStreamAsync(Document document, string name, Checksum? checksum, CancellationToken cancellationToken)
56public Task<Stream?> ReadStreamAsync(ProjectKey project, string name, Checksum? checksum, CancellationToken cancellationToken)
59public Task<Stream?> ReadStreamAsync(DocumentKey document, string name, Checksum? checksum, CancellationToken cancellationToken)
62public Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken)
65public Task<bool> WriteStreamAsync(Project project, string name, Stream stream, CancellationToken cancellationToken)
68public Task<bool> WriteStreamAsync(string name, Stream stream, CancellationToken cancellationToken)
71public Task<bool> WriteStreamAsync(string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
74public Task<bool> WriteStreamAsync(Project project, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
77public Task<bool> WriteStreamAsync(Document document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
80public Task<bool> WriteStreamAsync(ProjectKey projectKey, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
83public Task<bool> WriteStreamAsync(DocumentKey documentKey, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (12)
31public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
85public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
120public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
140public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
173public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
207public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
242public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
265public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
288public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
319public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
339public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
358public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.MSBuild (35)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (4)
186private async Task<ResolvedReferences> ResolveReferencesAsync(ProjectId id, ProjectFileInfo projectFileInfo, CommandLineArguments commandLineArgs, CancellationToken cancellationToken)
267private async Task<bool> TryLoadAndAddReferenceAsync(ProjectId id, string projectReferencePath, ImmutableArray<string> aliases, ResolvedReferencesBuilder builder, CancellationToken cancellationToken)
340private async Task<bool> VerifyUnloadableProjectOutputExistsAsync(string projectPath, ResolvedReferencesBuilder builder, CancellationToken cancellationToken)
349private async Task<bool> VerifyProjectOutputExistsAsync(string projectPath, ResolvedReferencesBuilder builder, CancellationToken cancellationToken)
MSBuild\SolutionFileReader.cs (3)
17public static Task<(string AbsoluteSolutionPath, ImmutableArray<(string ProjectPath, string ProjectGuid)> Projects)> ReadSolutionFileAsync(string solutionFilePath, DiagnosticReportingMode diagnosticReportingMode, CancellationToken cancellationToken)
22public static async Task<(string AbsoluteSolutionPath, ImmutableArray<(string ProjectPath, string ProjectGuid)> Projects)> ReadSolutionFileAsync(string solutionFilePath, PathResolver pathResolver, DiagnosticReportingMode diagnosticReportingMode, CancellationToken cancellationToken)
43private static async Task<ImmutableArray<(string ProjectPath, string ProjectGuid)>?> TryReadSolutionFileAsync(string solutionFilePath, PathResolver pathResolver, ImmutableHashSet<string> projectFilter, DiagnosticReportingMode diagnosticReportingMode, CancellationToken cancellationToken)
Rpc\RpcClient.cs (3)
127public async Task<T?> InvokeNullableAsync<T>(int targetObject, string methodName, List<object?> parameters, CancellationToken cancellationToken) where T : class
133public async Task<T> InvokeAsync<T>(int targetObject, string methodName, List<object?> parameters, CancellationToken cancellationToken) where T : notnull
140private async Task<object?> InvokeCoreAsync(int targetObject, string methodName, List<object?> parameters, Type? expectedReturnType, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (29)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (9)
Microsoft.CodeAnalysis.Workspaces.UnitTests (27)
CodeCleanup\MockCodeCleanupProvider.cs (3)
22public Func<MockCodeCleanupProvider, Document, ImmutableArray<TextSpan>, SyntaxFormattingOptions, CancellationToken, Task<Document>>? CleanupDocumentAsyncImpl { get; set; }
27public Task<Document> CleanupAsync(Document document, ImmutableArray<TextSpan> spans, CodeCleanupOptions options, CancellationToken cancellationToken)
30public Task<SyntaxNode> CleanupAsync(SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SolutionServices services, CancellationToken cancellationToken)
SolutionTests\TextLoaderTests.cs (12)
22public new virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
29public new virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
33public virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId)
37public virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, ref DocumentId? documentId, CancellationToken cancellationToken)
41public virtual Task<TextAndVersion> LoadTextAndVersionAsync<T>(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
47public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
53public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId)
59public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, ref DocumentId? documentId, CancellationToken cancellationToken)
65public override Task<TextAndVersion> LoadTextAndVersionAsync<T>(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
85public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
94public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken)
102public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken)
Microsoft.CommonLanguageServerProtocol.Framework.Package (14)
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (18)
Mocks\TestMethodHandlers.cs (8)
26public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
41public Task<MockResponse> HandleRequestAsync(TestRequestContext context, CancellationToken cancellationToken)
96public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
111public async Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
133public async Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
152public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
169public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
185public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
RequestExecutionQueueTests.cs (4)
77var _ = requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), CancellingHandler.Name, lspServices, cancellingRequestCancellationToken);
78var _1 = requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), CompletingHandler.Name, lspServices, completingRequestCancellationToken);
146var task1 = requestExecutionQueue.ExecuteAsync(request, TestMethodHandler.Name, lspServices, CancellationToken.None);
147var task2 = requestExecutionQueue.ExecuteAsync(request, TestMethodHandler.Name, lspServices, CancellationToken.None);
Microsoft.Data.Analysis (2)
Microsoft.DotNet.Arcade.Sdk (2)
Microsoft.DotNet.Build.Tasks.Feed (36)
src\PublishArtifactsInManifestBase.cs (10)
240public abstract Task<bool> ExecuteAsync();
424private async Task<bool> PublishSymbolsUsingStreamingAsync(
441async Task<bool> PublishSymbolPackageWithDownload(BlobArtifactModel symbolAsset)
499private async Task<bool> PublishSymbolsFromBlobArtifactsAsync(
664Task<SymbolUploadHelper> CreatePublishSymbolHelper(string symbolPublishingExclusionsFile, bool publishSpecialClrFiles, bool dryRun)
727internal async Task<string> PrepLoosePdbsForPublish(string pdbArtifactsBasePath, SemaphoreSlim clientThrottle)
965private async Task<IArtifactUrlHelper> CreateArtifactUrlHelper(HttpClient client, string artifactName)
1372public static async Task<NuGetFeedUploadPackageResult> NuGetFeedUploadPackageAsync(HttpClient httpClient, string feedName, string feedUri, Stream packageContentReadStream)
1439Func<string, string, HttpClient, MsBuildUtils.TaskLoggingHelper, Task<PackageFeedStatus>> CompareLocalPackageToFeedPackageCallBack = null,
1440Func<HttpClient, string, string, Stream, Task<NuGetFeedUploadPackageResult>> AttemptPushPackageCallback = null)
Microsoft.DotNet.Build.Tasks.Feed.Tests (7)
PublishArtifactsInManifestTests.cs (3)
130Func<string, string, HttpClient, MsBuildUtils.TaskLoggingHelper, Task<PackageFeedStatus>> testCompareLocalPackage = async (string localPackageFullPath, string packageContentUrl, HttpClient client, MsBuildUtils.TaskLoggingHelper log) =>
144Func<HttpClient, string, string, Stream, Task<NuGetFeedUploadPackageResult>> testPush = (_, feedName, feedUri, _) =>
221public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Microsoft.DotNet.Deployment.Tasks.Links (4)
Microsoft.DotNet.Git.IssueManager (10)
Microsoft.DotNet.Helix.Client (74)
Microsoft.DotNet.Helix.JobSender (23)
Microsoft.DotNet.Helix.Sdk (20)
Microsoft.DotNet.Helix.Sdk.Tests (2)
Microsoft.DotNet.Internal.SymbolHelper (23)
SymbolPromotionHelper.cs (5)
78public static async Task<bool> RegisterAndPublishRequest(ITracer logger, TokenCredential credential, Environment env,
138async Task<bool> SendPostRequestWithRetries(string url, JsonObject payload)
182public static async Task<SymbolRequestStatus?> CheckRequestRegistration(ITracer logger, TokenCredential credential,
232private async static Task<AuthenticationHeaderValue> GetSymbolRequestAuthHeader(TokenCredential credential, string tokenResource, CancellationToken ct)
238public static async Task<bool> UpdateRequestExpiration(ITracer logger, TokenCredential credential,
SymbolUploadHelper.cs (15)
121public async Task<int> GetClientDiagnosticInfo()
133public async Task<int> CreateRequest(string? name)
151public async Task<int> AddDirectory(string? name, string pathToAdd)
182public async Task<int> AddPackageToRequest(string? name, string packagePath)
198public async Task<int> AddPackagesToRequest(string? name, IEnumerable<string> packagePaths)
224public async Task<int> FinalizeRequest(string? name, uint daysToRetain)
239public async Task<int> DeleteRequest(string? name, bool synchronous = false)
252private async Task<int> AddDirectoryCore(string name, string pathToAdd, string? manifestPath, ScopedTracer logger)
265private async Task<int> AddPackageToRequestCore(string name, string packagePath, ScopedTracer logger)
412private async Task<int> RunSymbolCommand(string arguments, string directory, ScopedTracer logger, CancellationToken ct = default)
455Task<string?> outputAvailable = standardOutput.ReadLineAsync(ct).AsTask();
458Task<string?> errorAvailable = standardError.ReadLineAsync(ct).AsTask();
499async Task<Task<string?>> LogFromStreamReader(Task<string?> outputTask, Func<CancellationToken, ValueTask<string?>> readLine, Action<string> logMethod, CancellationToken ct)
Microsoft.DotNet.Open.Api.Tools.Tests (2)
Microsoft.DotNet.RemoteExecutor (8)
RemoteExecutor.cs (7)
191public static RemoteInvokeHandle Invoke(Func<Task<int>> method, RemoteInvokeOptions options = null)
200public static RemoteInvokeHandle Invoke(Func<string, Task<int>> method, string arg,
211public static RemoteInvokeHandle Invoke(Func<string, string, Task<int>> method, string arg1, string arg2,
223public static RemoteInvokeHandle Invoke(Func<string, string, string, Task<int>> method, string arg1,
236public static RemoteInvokeHandle Invoke(Func<string, string, string, string, Task<int>> method, string arg1,
250public static RemoteInvokeHandle Invoke(Func<string, string, string, string, string, Task<int>> method, string arg1,
423&& method.ReturnType != typeof(Task<int>))
Microsoft.DotNet.SignCheckLibrary (1)
Microsoft.DotNet.SwaggerGenerator.CmdLine (2)
Microsoft.DotNet.SwaggerGenerator.MSBuild (1)
Microsoft.DotNet.XUnitExtensions (5)
Microsoft.Extensions.AI (37)
Embeddings\AnonymousDelegatingEmbeddingGenerator.cs (3)
19private readonly Func<IEnumerable<TInput>, EmbeddingGenerationOptions?, IEmbeddingGenerator<TInput, TEmbedding>, CancellationToken, Task<GeneratedEmbeddings<TEmbedding>>> _generateFunc;
28Func<IEnumerable<TInput>, EmbeddingGenerationOptions?, IEmbeddingGenerator<TInput, TEmbedding>, CancellationToken, Task<GeneratedEmbeddings<TEmbedding>>> generateFunc)
37public override async Task<GeneratedEmbeddings<TEmbedding>> GenerateAsync(
Microsoft.Extensions.AI.Abstractions (23)
Microsoft.Extensions.AI.Abstractions.Tests (9)
Microsoft.Extensions.AI.AzureAIInference (3)
Microsoft.Extensions.AI.Evaluation (7)
Microsoft.Extensions.AI.Evaluation.Console (5)
Microsoft.Extensions.AI.Evaluation.Integration.Tests (2)
Microsoft.Extensions.AI.Evaluation.Quality (1)
Microsoft.Extensions.AI.Evaluation.Reporting (5)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (2)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
Microsoft.Extensions.AI.Evaluation.Safety (2)
Microsoft.Extensions.AI.Integration.Tests (14)
Microsoft.Extensions.AI.Ollama (2)
Microsoft.Extensions.AI.Ollama.Tests (1)
Microsoft.Extensions.AI.OpenAI (5)
Microsoft.Extensions.AI.Templates.Tests (3)
Microsoft.Extensions.AI.Tests (21)
Microsoft.Extensions.ApiDescription.Client.Tests (1)
Microsoft.Extensions.Caching.Abstractions (6)
Microsoft.Extensions.Caching.Hybrid (21)
Microsoft.Extensions.Caching.Hybrid.Tests (31)
SampleUsage.cs (6)
93public async Task<SomeInformation> GetSomeInformationAsync(string name, int id, CancellationToken token = default)
120public async Task<SomeInformation> GetSomeInformationAsync(string name, int id, CancellationToken token = default)
130private static Task<SomeInformation> SomeExpensiveOperationAsync(string name, int id,
139private static Task<SomeInformationReuse> SomeExpensiveOperationReuseAsync(string name, int id,
148public async Task<SomeInformation> GetSomeInformationAsync(string name, int id, CancellationToken token = default)
161public async Task<SomeInformationReuse> GetSomeInformationAsync(string name, int id)
Microsoft.Extensions.Caching.Memory (1)
Microsoft.Extensions.Caching.MicroBenchmarks (10)
Microsoft.Extensions.Caching.SqlServer (6)
Microsoft.Extensions.Caching.SqlServer.Tests (1)
Microsoft.Extensions.Caching.StackExchangeRedis (6)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (1)
Microsoft.Extensions.DependencyInjection (1)
Microsoft.Extensions.Diagnostics.HealthChecks (15)
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (2)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (8)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (9)
Microsoft.Extensions.Diagnostics.Probes.Tests (4)
Microsoft.Extensions.Hosting.Abstractions (1)
Microsoft.Extensions.Http (7)
Microsoft.Extensions.Http.Diagnostics (2)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (51)
Microsoft.Extensions.Http.Diagnostics.Tests (11)
Microsoft.Extensions.Http.Polly (3)
Microsoft.Extensions.Http.Polly.Tests (7)
Microsoft.Extensions.Http.Resilience (2)
Microsoft.Extensions.Http.Resilience.PerformanceTests (13)
Microsoft.Extensions.Http.Resilience.Tests (11)
Microsoft.Extensions.Identity.Core (185)
UserManager.cs (86)
432public virtual Task<TUser?> GetUserAsync(ClaimsPrincipal principal)
447public virtual Task<string> GenerateConcurrencyStampAsync(TUser user)
461public virtual async Task<IdentityResult> CreateAsync(TUser user)
488public virtual Task<IdentityResult> UpdateAsync(TUser user)
504public virtual Task<IdentityResult> DeleteAsync(TUser user)
519public virtual Task<TUser?> FindByIdAsync(string userId)
532public virtual async Task<TUser?> FindByNameAsync(string userName)
571public virtual async Task<IdentityResult> CreateAsync(TUser user, string password)
632public virtual async Task<string?> GetUserNameAsync(TUser user)
645public virtual async Task<IdentityResult> SetUserNameAsync(TUser user, string? userName)
660public virtual async Task<string> GetUserIdAsync(TUser user)
675public virtual async Task<bool> CheckPasswordAsync(TUser user, string password)
707public virtual Task<bool> HasPasswordAsync(TUser user)
726public virtual async Task<IdentityResult> AddPasswordAsync(TUser user, string password)
757public virtual async Task<IdentityResult> ChangePasswordAsync(TUser user, string currentPassword, string newPassword)
784public virtual async Task<IdentityResult> RemovePasswordAsync(TUser user)
804protected virtual async Task<PasswordVerificationResult> VerifyPasswordAsync(IUserPasswordStore<TUser> store, TUser user, string password)
819public virtual async Task<string> GetSecurityStampAsync(TUser user)
844public virtual async Task<IdentityResult> UpdateSecurityStampAsync(TUser user)
861public virtual Task<string> GeneratePasswordResetTokenAsync(TUser user)
878public virtual async Task<IdentityResult> ResetPasswordAsync(TUser user, string token, string newPassword)
904public virtual Task<TUser?> FindByLoginAsync(string loginProvider, string providerKey)
924public virtual async Task<IdentityResult> RemoveLoginAsync(TUser user, string loginProvider, string providerKey)
946public virtual async Task<IdentityResult> AddLoginAsync(TUser user, UserLoginInfo login)
970public virtual async Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user)
987public virtual Task<IdentityResult> AddClaimAsync(TUser user, Claim claim)
1005public virtual async Task<IdentityResult> AddClaimsAsync(TUser user, IEnumerable<Claim> claims)
1026public virtual async Task<IdentityResult> ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim)
1047public virtual Task<IdentityResult> RemoveClaimAsync(TUser user, Claim claim)
1065public virtual async Task<IdentityResult> RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims)
1081/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <see cref="Claim"/>s.
1083public virtual async Task<IList<Claim>> GetClaimsAsync(TUser user)
1100public virtual async Task<IdentityResult> AddToRoleAsync(TUser user, string role)
1124public virtual async Task<IdentityResult> AddToRolesAsync(TUser user, IEnumerable<string> roles)
1152public virtual async Task<IdentityResult> RemoveFromRoleAsync(TUser user, string role)
1194public virtual async Task<IdentityResult> RemoveFromRolesAsync(TUser user, IEnumerable<string> roles)
1218public virtual async Task<IList<string>> GetRolesAsync(TUser user)
1235public virtual async Task<bool> IsInRoleAsync(TUser user, string role)
1248public virtual async Task<string?> GetEmailAsync(TUser user)
1265public virtual async Task<IdentityResult> SetEmailAsync(TUser user, string? email)
1286public virtual async Task<TUser?> FindByEmailAsync(string email)
1338public virtual Task<string> GenerateEmailConfirmationTokenAsync(TUser user)
1353public virtual async Task<IdentityResult> ConfirmEmailAsync(TUser user, string token)
1376public virtual async Task<bool> IsEmailConfirmedAsync(TUser user)
1392public virtual Task<string> GenerateChangeEmailTokenAsync(TUser user, string newEmail)
1408public virtual async Task<IdentityResult> ChangeEmailAsync(TUser user, string newEmail, string token)
1430public virtual async Task<string?> GetPhoneNumberAsync(TUser user)
1447public virtual async Task<IdentityResult> SetPhoneNumberAsync(TUser user, string? phoneNumber)
1470public virtual async Task<IdentityResult> ChangePhoneNumberAsync(TUser user, string phoneNumber, string token)
1495public virtual Task<bool> IsPhoneNumberConfirmedAsync(TUser user)
1511public virtual Task<string> GenerateChangePhoneNumberTokenAsync(TUser user, string phoneNumber)
1528public virtual Task<bool> VerifyChangePhoneNumberTokenAsync(TUser user, string token, string phoneNumber)
1549public virtual async Task<bool> VerifyUserTokenAsync(TUser user, string tokenProvider, string purpose, string token)
1579public virtual Task<string> GenerateUserTokenAsync(TUser user, string tokenProvider, string purpose)
1614public virtual async Task<IList<string>> GetValidTwoFactorProvidersAsync(TUser user)
1639public virtual async Task<bool> VerifyTwoFactorTokenAsync(TUser user, string tokenProvider, string token)
1666public virtual Task<string> GenerateTwoFactorTokenAsync(TUser user, string tokenProvider)
1687public virtual async Task<bool> GetTwoFactorEnabledAsync(TUser user)
1704public virtual async Task<IdentityResult> SetTwoFactorEnabledAsync(TUser user, bool enabled)
1724public virtual async Task<bool> IsLockedOutAsync(TUser user)
1746public virtual async Task<IdentityResult> SetLockoutEnabledAsync(TUser user, bool enabled)
1763public virtual async Task<bool> GetLockoutEnabledAsync(TUser user)
1777/// A <see cref="Task{TResult}"/> that represents the lookup, a <see cref="DateTimeOffset"/> containing the last time a user's lockout expired, if any.
1779public virtual async Task<DateTimeOffset?> GetLockoutEndDateAsync(TUser user)
1793public virtual async Task<IdentityResult> SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd)
1815public virtual async Task<IdentityResult> AccessFailedAsync(TUser user)
1839public virtual async Task<IdentityResult> ResetAccessFailedCountAsync(TUser user)
1859public virtual async Task<int> GetAccessFailedCountAsync(TUser user)
1872/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <typeparamref name="TUser"/>s who
1875public virtual Task<IList<TUser>> GetUsersForClaimAsync(Claim claim)
1888/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <typeparamref name="TUser"/>s who
1891public virtual Task<IList<TUser>> GetUsersInRoleAsync(string roleName)
1907public virtual Task<string?> GetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName)
1926public virtual async Task<IdentityResult> SetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName, string? tokenValue)
1946public virtual async Task<IdentityResult> RemoveAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName)
1963public virtual Task<string?> GetAuthenticatorKeyAsync(TUser user)
1976public virtual async Task<IdentityResult> ResetAuthenticatorKeyAsync(TUser user)
1999public virtual async Task<IEnumerable<string>?> GenerateNewTwoFactorRecoveryCodesAsync(TUser user, int number)
2103public virtual async Task<IdentityResult> RedeemTwoFactorRecoveryCodeAsync(TUser user, string code)
2122public virtual Task<int> CountRecoveryCodesAsync(TUser user)
2193public virtual async Task<byte[]> CreateSecurityTokenAsync(TUser user)
2214protected virtual Task<IdentityResult> UpdatePasswordHash(TUser user, string newPassword, bool validatePassword)
2217private async Task<IdentityResult> UpdatePasswordHash(IUserPasswordStore<TUser> passwordStore,
2299protected async Task<IdentityResult> ValidateUserAsync(TUser user)
2337protected async Task<IdentityResult> ValidatePasswordAsync(TUser user, string? password)
2371protected virtual async Task<IdentityResult> UpdateUserAsync(TUser user)
Microsoft.Extensions.Identity.Stores (63)
UserStoreBase.cs (45)
116public virtual Task<string> GetUserIdAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
130public virtual Task<string?> GetUserNameAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
160public virtual Task<string?> GetNormalizedUserNameAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
190public abstract Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));
198public abstract Task<IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));
206public abstract Task<IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));
216public abstract Task<TUser?> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken));
256public abstract Task<TUser?> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = default(CancellationToken));
287/// <returns>A <see cref="Task{TResult}"/> that contains the password hash for the user.</returns>
288public virtual Task<string?> GetPasswordHashAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
301/// <returns>A <see cref="Task{TResult}"/> containing a flag indicating if the specified user has a password. If the
303public virtual Task<bool> HasPasswordAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
315protected abstract Task<TUser?> FindUserAsync(TKey userId, CancellationToken cancellationToken);
325protected abstract Task<TUserLogin?> FindUserLoginAsync(TKey userId, string loginProvider, string providerKey, CancellationToken cancellationToken);
334protected abstract Task<TUserLogin?> FindUserLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken);
357/// <returns>A <see cref="Task{TResult}"/> that contains the claims granted to a user.</returns>
358public abstract Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));
415public abstract Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));
426public virtual async Task<TUser?> FindByLoginAsync(string loginProvider, string providerKey,
449public virtual Task<bool> GetEmailConfirmedAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
495public virtual Task<string?> GetEmailAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
511public virtual Task<string?> GetNormalizedEmailAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
543public abstract Task<TUser?> FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken));
552/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a <see cref="DateTimeOffset"/> containing the last time
555public virtual Task<DateTimeOffset?> GetLockoutEndDateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
585public virtual Task<int> IncrementAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
616public virtual Task<int> GetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
632public virtual Task<bool> GetLockoutEnabledAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
678public virtual Task<string?> GetPhoneNumberAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
695public virtual Task<bool> GetPhoneNumberConfirmedAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
742public virtual Task<string?> GetSecurityStampAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
777public virtual Task<bool> GetTwoFactorEnabledAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
793public abstract Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken));
803protected abstract Task<TUserToken?> FindTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken);
875public virtual async Task<string?> GetTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken)
905public virtual Task<string?> GetAuthenticatorKeyAsync(TUser user, CancellationToken cancellationToken)
914public virtual async Task<int> CountCodesAsync(TUser user, CancellationToken cancellationToken)
966public virtual async Task<bool> RedeemCodeAsync(TUser user, string code, CancellationToken cancellationToken)
1038public abstract Task<IList<TUser>> GetUsersInRoleAsync(string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken));
1063/// <returns>A <see cref="Task{TResult}"/> that contains the roles the user is a member of.</returns>
1064public abstract Task<IList<string>> GetRolesAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));
1072/// <returns>A <see cref="Task{TResult}"/> containing a flag indicating if the specified user is a member of the given group. If the
1074public abstract Task<bool> IsInRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken));
1082protected abstract Task<TRole?> FindRoleAsync(string normalizedRoleName, CancellationToken cancellationToken);
1091protected abstract Task<TUserRole?> FindUserRoleAsync(TKey userId, TKey roleId, CancellationToken cancellationToken);
Microsoft.Extensions.Logging.AzureAppServices (1)
Microsoft.Extensions.ML (2)
Microsoft.Extensions.ML.Tests (2)
Microsoft.Extensions.Options.Contextual.Tests (2)
Microsoft.Extensions.ServiceDiscovery (2)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (15)
DnsSrvServiceEndpointResolverTests.cs (15)
24public Func<string, QueryType, QueryClass, CancellationToken, Task<IDnsQueryResponse>>? QueryAsyncFunc { get; set; }
29public Task<IDnsQueryResponse> QueryAsync(string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default)
31public Task<IDnsQueryResponse> QueryAsync(DnsQuestion question, CancellationToken cancellationToken = default) => throw new NotImplementedException();
32public Task<IDnsQueryResponse> QueryAsync(DnsQuestion question, DnsQueryAndServerOptions queryOptions, CancellationToken cancellationToken = default) => throw new NotImplementedException();
37public Task<IDnsQueryResponse> QueryReverseAsync(IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
38public Task<IDnsQueryResponse> QueryReverseAsync(IPAddress ipAddress, DnsQueryAndServerOptions queryOptions, CancellationToken cancellationToken = default) => throw new NotImplementedException();
44public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<NameServer> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default) => throw new NotImplementedException();
45public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<NameServer> servers, DnsQuestion question, CancellationToken cancellationToken = default) => throw new NotImplementedException();
46public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<NameServer> servers, DnsQuestion question, DnsQueryOptions queryOptions, CancellationToken cancellationToken = default) => throw new NotImplementedException();
47public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<IPAddress> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default) => throw new NotImplementedException();
48public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<IPEndPoint> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default) => throw new NotImplementedException();
53public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<IPAddress> servers, IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
54public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<IPEndPoint> servers, IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
55public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<NameServer> servers, IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
56public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<NameServer> servers, IPAddress ipAddress, DnsQueryOptions queryOptions, CancellationToken cancellationToken = default) => throw new NotImplementedException();
Microsoft.Extensions.ServiceDiscovery.Yarp (3)
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (15)
YarpServiceDiscoveryTests.cs (15)
318public Func<string, QueryType, QueryClass, CancellationToken, Task<IDnsQueryResponse>>? QueryAsyncFunc { get; set; }
323public Task<IDnsQueryResponse> QueryAsync(string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default)
325public Task<IDnsQueryResponse> QueryAsync(DnsQuestion question, CancellationToken cancellationToken = default) => throw new NotImplementedException();
326public Task<IDnsQueryResponse> QueryAsync(DnsQuestion question, DnsQueryAndServerOptions queryOptions, CancellationToken cancellationToken = default) => throw new NotImplementedException();
331public Task<IDnsQueryResponse> QueryReverseAsync(IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
332public Task<IDnsQueryResponse> QueryReverseAsync(IPAddress ipAddress, DnsQueryAndServerOptions queryOptions, CancellationToken cancellationToken = default) => throw new NotImplementedException();
338public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<NameServer> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default) => throw new NotImplementedException();
339public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<NameServer> servers, DnsQuestion question, CancellationToken cancellationToken = default) => throw new NotImplementedException();
340public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<NameServer> servers, DnsQuestion question, DnsQueryOptions queryOptions, CancellationToken cancellationToken = default) => throw new NotImplementedException();
341public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<IPAddress> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default) => throw new NotImplementedException();
342public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<IPEndPoint> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default) => throw new NotImplementedException();
347public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<IPAddress> servers, IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
348public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<IPEndPoint> servers, IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
349public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<NameServer> servers, IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
350public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<NameServer> servers, IPAddress ipAddress, DnsQueryOptions queryOptions, CancellationToken cancellationToken = default) => throw new NotImplementedException();
Microsoft.Extensions.TimeProvider.Testing.Tests (6)
Microsoft.Extensions.Validation.GeneratorTests (1)
Microsoft.Gen.ComplianceReports.Unit.Tests (11)
Microsoft.Gen.ContextualOptions.Unit.Tests (11)
Microsoft.Gen.Logging.Unit.Tests (11)
Microsoft.Gen.MetadataExtractor.Unit.Tests (11)
Microsoft.Gen.Metrics.Unit.Tests (11)
Microsoft.Gen.MetricsReports.Unit.Tests (11)
Microsoft.Interop.ComInterfaceGenerator (4)
Microsoft.Interop.LibraryImportGenerator (10)
Microsoft.JSInterop (3)
Microsoft.JSInterop.Tests (2)
Microsoft.Maui (31)
Microsoft.Maui.Controls (85)
Page\Page.cs (5)
278 public Task<string> DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons)
293 public Task<string> DisplayActionSheet(string title, string cancel, string destruction, FlowDirection flowDirection, params string[] buttons)
316 public Task<bool> DisplayAlert(string title, string message, string accept, string cancel)
338 public Task<bool> DisplayAlert(string title, string message, string accept, string cancel, FlowDirection flowDirection)
368 public Task<string> DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string placeholder = null, int maxLength = -1, Keyboard keyboard = default(Keyboard), string initialValue = "")
ViewExtensions.cs (12)
38 static Task<bool> AnimateTo(this VisualElement view, double start, double end, string name,
71 public static Task<bool> FadeTo(this VisualElement view, double opacity, uint length = 250, Easing? easing = null)
89 public static Task<bool> LayoutTo(this VisualElement view, Rect bounds, uint length = 250, Easing? easing = null)
117 public static Task<bool> RelRotateTo(this VisualElement view, double drotation, uint length = 250, Easing? easing = null)
135 public static Task<bool> RelScaleTo(this VisualElement view, double dscale, uint length = 250, Easing? easing = null)
153 public static Task<bool> RotateTo(this VisualElement view, double rotation, uint length = 250, Easing? easing = null)
171 public static Task<bool> RotateXTo(this VisualElement view, double rotation, uint length = 250, Easing? easing = null)
189 public static Task<bool> RotateYTo(this VisualElement view, double rotation, uint length = 250, Easing? easing = null)
206 public static Task<bool> ScaleTo(this VisualElement view, double scale, uint length = 250, Easing? easing = null)
224 public static Task<bool> ScaleXTo(this VisualElement view, double scale, uint length = 250, Easing? easing = null)
242 public static Task<bool> ScaleYTo(this VisualElement view, double scale, uint length = 250, Easing? easing = null)
261 public static Task<bool> TranslateTo(this VisualElement view, double x, double y, uint length = 250, Easing? easing = null)
Microsoft.Maui.Controls.Foldable (2)
Microsoft.Maui.Essentials (150)
Browser\Browser.shared.cs (12)
18 Task<bool> OpenAsync(Uri uri, BrowserLaunchOptions options);
31 public static Task<bool> OpenAsync(string uri) => Default.OpenAsync(uri);
39 public static Task<bool> OpenAsync(string uri, BrowserLaunchMode launchMode) => Default.OpenAsync(uri, launchMode);
47 public static Task<bool> OpenAsync(string uri, BrowserLaunchOptions options) => Default.OpenAsync(uri, options);
54 public static Task<bool> OpenAsync(Uri uri) => Default.OpenAsync(uri);
62 public static Task<bool> OpenAsync(Uri uri, BrowserLaunchMode launchMode) => Default.OpenAsync(uri, launchMode);
70 public static Task<bool> OpenAsync(Uri uri, BrowserLaunchOptions options) => Default.OpenAsync(uri, options);
95 public static Task<bool> OpenAsync(this IBrowser browser, string uri) =>
105 public static Task<bool> OpenAsync(this IBrowser browser, string uri, BrowserLaunchMode launchMode) =>
115 public static Task<bool> OpenAsync(this IBrowser browser, string uri, BrowserLaunchOptions options) =>
124 public static Task<bool> OpenAsync(this IBrowser browser, Uri uri) =>
134 public static Task<bool> OpenAsync(this IBrowser browser, Uri uri, BrowserLaunchMode launchMode) =>
Map\Map.shared.cs (12)
38 Task<bool> TryOpenAsync(double latitude, double longitude, MapLaunchOptions options);
47 Task<bool> TryOpenAsync(Placemark placemark, MapLaunchOptions options);
114 public static Task<bool> TryOpenAsync(Location location) =>
124 public static Task<bool> TryOpenAsync(Location location, MapLaunchOptions options) =>
134 public static Task<bool> TryOpenAsync(double latitude, double longitude) =>
145 public static Task<bool> TryOpenAsync(double latitude, double longitude, MapLaunchOptions options) =>
154 public static Task<bool> TryOpenAsync(Placemark placemark) =>
164 public static Task<bool> TryOpenAsync(Placemark placemark, MapLaunchOptions options) =>
222 public static Task<bool> TryOpenAsync(this IMap map, Location location) =>
234 public static Task<bool> TryOpenAsync(this IMap map, Location location, MapLaunchOptions options)
272 public static Task<bool> TryOpenAsync(this IMap map, double latitude, double longitude) =>
282 public static Task<bool> TryOpenAsync(this IMap map, Placemark placemark) =>
Microsoft.Maui.Graphics (4)
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (2)
Microsoft.Maui.Maps (2)
Microsoft.Maui.Resizetizer (1)
Microsoft.ML.AutoML (6)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Core (8)
Utilities\ResourceManagerUtils.cs (7)
108public async Task<ResourceDownloadResults> EnsureResourceAsync(IHostEnvironment env, IChannel ch, string relativeUrl, string fileName, string dir, int timeout)
125private async Task<string> DownloadFromUrlWithRetryAsync(IHostEnvironment env, IChannel ch, string url, string fileName,
155private async Task<string> DownloadFromUrlAsync(IHostEnvironment env, IChannel ch, string url, string fileName, int timeout, string filePath)
160var t = Task.Run(() => DownloadResource(env, ch, client, new Uri(url), filePath, fileName, downloadCancel.Token));
163var timeoutTask = Task.Delay(timeout).ContinueWith(task => default(Exception), TaskScheduler.Default);
165var completedTask = await Task.WhenAny(t, timeoutTask);
249private async Task<Exception> DownloadResource(IHostEnvironment env, IChannel ch, HttpClient httpClient, Uri uri, string path, string fileName, CancellationToken ct)
Microsoft.ML.Core.Tests (1)
Microsoft.ML.Data (2)
Microsoft.ML.Fairlearn (1)
Microsoft.ML.GenAI.Core (1)
Microsoft.ML.GenAI.LLaMA (4)
Microsoft.ML.GenAI.Mistral (1)
Microsoft.ML.GenAI.Phi (4)
Microsoft.ML.GenAI.Samples (2)
Microsoft.ML.InternalCodeAnalyzer (3)
Microsoft.ML.PerformanceTests (1)
Microsoft.ML.Samples (6)
Microsoft.ML.Samples.GPU (6)
Microsoft.ML.SamplesUtils (1)
Microsoft.ML.Sweeper (3)
Microsoft.ML.Sweeper.Tests (11)
Microsoft.ML.TensorFlow (1)
Microsoft.ML.TensorFlow.Tests (1)
Microsoft.ML.TestFramework (1)
Microsoft.ML.Tokenizers (10)
Microsoft.ML.Tokenizers.Tests (1)
Microsoft.ML.TorchSharp (3)
Microsoft.ML.Transforms (1)
Microsoft.Svcutil.NamedPipeMetadataImporter (1)
Microsoft.TestUtilities (1)
Microsoft.VisualBasic.Tests (2)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (2)
214var task = Task.Factory.StartNew(() => SendSecondInstanceArgs(pipeName, timeout: 300, []), cancellationToken: TestContext.Current.CancellationToken, creationOptions: default, scheduler: TaskScheduler.Default);
229var task = Task.Factory.StartNew(() => SendSecondInstanceArgs(pipeName, SendTimeout, ["1", "ABC"]), cancellationToken: TestContext.Current.CancellationToken, creationOptions: default, scheduler: TaskScheduler.Default);
Microsoft.VisualStudio.LanguageServices (210)
CodeLens\RemoteCodeLensReferencesService.cs (6)
41public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults,
66public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
87public async Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
112public async Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
137private async Task<ImmutableArray<ReferenceLocationDescriptor>> FixUpDescriptorsAsync(
252private static async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsWorkerAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
Library\AbstractObjectList.cs (6)
29protected abstract Task<bool> GetExpandableAsync(uint index, uint listTypeExcluded, CancellationToken cancellationToken);
31protected abstract Task<IVsSimpleObjectList2> GetListAsync(
65protected virtual Task<(bool success, object pvar)> TryGetPropertyAsync(uint index, _VSOBJLISTELEMPROPID propertyId, CancellationToken cancellationToken)
76protected virtual Task<object> GetBrowseObjectAsync(uint index, CancellationToken cancellationToken)
84protected virtual Task<IVsNavInfo> GetNavInfoAsync(uint index, CancellationToken cancellationToken)
101protected virtual Task<bool> TryFillDescriptionAsync(uint index, _VSOBJDESCOPTIONS options, IVsObjectBrowserDescription3 description, CancellationToken cancellationToken)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (5)
147private async Task<ImmutableHashSet<DiagnosticData>?> GetDiagnosticsToFixAsync(
171private async Task<bool> ApplySuppressionFixAsync(
386private async Task<UIThreadOperationStatus> InvokeWithWaitDialogAsync(
448private async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken)
541private async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken)
Workspace\VisualStudioDocumentNavigationService.cs (16)
52public async Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken)
68public async Task<bool> CanNavigateToPositionAsync(
100public async Task<INavigableLocation?> GetLocationForSpanAsync(
114public async Task<INavigableLocation?> GetLocationForPositionAsync(
127static async Task<TextSpan> GetTextSpanFromPositionAsync(Document document, int position, int virtualSpace, CancellationToken cancellationToken)
156private async Task<INavigableLocation?> GetNavigableLocationAsync(
159Func<Document, Task<TextSpan>> getTextSpanForMappingAsync,
180private async Task<Func<CancellationToken, Task<bool>>?> GetNavigationCallbackAsync(
183Func<Document, Task<TextSpan>> getTextSpanForMappingAsync,
242private Func<CancellationToken, Task<bool>>? GetNavigationCallback(
294private async Task<Func<CancellationToken, Task<bool>>?> GetNavigableLocationForMappedFileAsync(
317private static async Task<MappedSpanResult?> GetMappedSpanAsync(
374public async Task<bool> NavigateToTextBufferAsync(
412private async Task<bool> CanMapFromSecondaryBufferToPrimaryBufferAsync(
Microsoft.VisualStudio.LanguageServices.CodeLens (4)
Microsoft.VisualStudio.LanguageServices.CSharp (15)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (19)
ProjectSystemShim\CSharpHelpers.cs (5)
49public static Task<CPSProject> CreateCSharpCPSProjectAsync(TestEnvironment environment, string projectName, params string[] commandLineArguments)
54public static Task<CPSProject> CreateCSharpCPSProjectAsync(TestEnvironment environment, string projectName, Guid projectGuid, params string[] commandLineArguments)
62public static Task<CPSProject> CreateCSharpCPSProjectAsync(TestEnvironment environment, string projectName, string binOutputPath, params string[] commandLineArguments)
78public static async Task<CPSProject> CreateCSharpCPSProjectAsync(TestEnvironment environment, string projectName, string projectFilePath, string binOutputPath, Guid projectGuid, params string[] commandLineArguments)
98public static async Task<CPSProject> CreateNonCompilableProjectAsync(TestEnvironment environment, string projectName, string projectFilePath, string targetPath)
Microsoft.VisualStudio.LanguageServices.DevKit (6)
Microsoft.VisualStudio.LanguageServices.LiveShare (11)
Microsoft.VisualStudio.LanguageServices.UnitTests (4)
Microsoft.VisualStudio.LanguageServices.Xaml (46)
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (4)
51public async Task<LSP.Location[]> HandleRequestAsync(TextDocumentPositionParams request, RequestContext context, CancellationToken cancellationToken)
91private async Task<LSP.Location[]> GetLocationsAsync(XamlDefinition definition, Document document, Solution solution, CancellationToken cancellationToken)
111private static async Task<LSP.Location?> GetSourceDefinitionLocationAsync(XamlSourceDefinition sourceDefinition, Solution solution, CancellationToken cancellationToken)
153private static async Task<LSP.Location[]> GetSymbolDefinitionLocationsAsync(XamlSymbolDefinition symbolDefinition, Document document, Solution solution, IMetadataAsSourceFileService metadataAsSourceFileService, IGlobalOptionService globalOptions, CancellationToken cancellationToken)
MSBuild (3)
mscorlib (1)
Mvc.Api.Analyzers.Test (20)
MyFrontend (3)
Negotiate.Client (8)
Controllers\AuthTestController.cs (8)
29public async Task<IActionResult> AnonymousUnrestricted([FromQuery] string server, [FromQuery] string protocol)
49public async Task<IActionResult> AnonymousAuthorized([FromQuery] string server, [FromQuery] string protocol)
76public async Task<IActionResult> DefaultCredentialsAuthorized([FromQuery] string server, [FromQuery] string protocol)
99public async Task<IActionResult> AfterAuthUnrestrictedPersist([FromQuery] string server, [FromQuery] string protocol1, [FromQuery] string protocol2)
132public async Task<IActionResult> AfterAuthUnrestrictedNonPersist([FromQuery] string server, [FromQuery] string protocol1, [FromQuery] string protocol2)
165public async Task<IActionResult> AfterAuthAuthorizedNonPersist([FromQuery] string server, [FromQuery] string protocol1, [FromQuery] string protocol2)
198public async Task<IActionResult> Unauthorized([FromQuery] string server, [FromQuery] string protocol)
224public async Task<IActionResult> AfterAuthUnauthorized([FromQuery] string server, [FromQuery] string protocol)
netstandard (1)
PathSchemeSelection (3)
ProjectCachePlugin (1)
Publishers.Frontend (1)
RazorPagesWebSite (2)
RazorWebSite (1)
Replay (13)
Roslyn.Compilers.Extension (4)
Roslyn.Diagnostics.Analyzers (48)
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (6)
44Func<CancellationToken, Task<Document>> createChangedDocument;
87private static async Task<Document> AddObsoleteAttributeAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
119private static async Task<Document> AddDescriptionAndErrorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
140private static async Task<Document> UpdateDescriptionAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
165private static async Task<Document> AddErrorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
184private static async Task<Document> SetErrorToTrueAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
Roslyn.Diagnostics.CSharp.Analyzers (4)
Roslyn.VisualStudio.DiagnosticsWindow (2)
Roslyn.VisualStudio.Next.UnitTests (16)
RunTests (16)
TestHistoryManager.cs (4)
31public static async Task<ImmutableDictionary<string, TimeSpan>> GetTestHistoryAsync(Options options, CancellationToken cancellationToken)
147private static async Task<Build?> GetLastSuccessfulBuildAsync(int definitionId, string branchName, BuildHttpClient buildClient, CancellationToken cancellationToken)
170private static async Task<TestRun?> GetRunForStageAsync(Build build, string phaseName, TestResultsHttpClient testClient, CancellationToken cancellationToken)
192private static async Task<List<TestCaseResult>> GetTestResultsAsync(TestRun testRun, int skip, int top, TestResultsHttpClient testClient, CancellationToken cancellationToken)
Sandbox (20)
artifacts\obj\Sandbox\Release\net10.0\TranscodingGrpc.cs (16)
186public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> SayHello(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
192public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> ResponseBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
198public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> Custom(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
204public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> AdditionalBindings(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
210public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> NoOption(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
222public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> Body(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
228public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> SubBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
234public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> SubRepeatedBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
240public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> ParameterRoute(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
246public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.ListValue> ReturnListValue(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
252public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Value> ReturnValue(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
258public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Struct> ReturnStruct(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
264public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> ReturnEnum(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
378public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> BadResponseBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
466public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> BadBody(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
554public virtual global::System.Threading.Tasks.Task<global::Transcoding.HelloReply2> BadPattern(global::Transcoding.HelloRequest request, grpc::ServerCallContext context)
ScenarioTests.Common.Tests (17)
SecurityWebSite (5)
ServerComparison.FunctionalTests (1)
ServerComparison.TestSites (1)
Shared.Tests (1)
SignalR.Client.FunctionalTestApp (1)
SignalRSamples (3)
SocialSample (1)
SocialWeather (4)
Sockets.BindTests (5)
Sockets.FunctionalTests (14)
src\Servers\Kestrel\shared\test\StreamExtensions.cs (4)
15public static async Task<int> FillBufferUntilEndAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
34public static async Task<int> FillEntireBufferAsync(this Stream stream, byte[] buffer, CancellationToken cancellationToken = default)
49public static async Task<byte[]> ReadAtLeastLengthAsync(this Stream stream, int length, int bufferLength = 1024, bool allowEmpty = false, CancellationToken cancellationToken = default)
76public static async Task<byte[]> ReadUntilEndAsync(this Stream stream, int bufferLength = 1024, CancellationToken cancellationToken = default)
StaticFilesAuth (2)
Stress.AppHost (2)
Stress.TelemetryService (3)
Swaggatherer (1)
System.Console (5)
System.Data.Common (40)
System.Data.Odbc (9)
System.Formats.Tar (1)
System.IO.Compression (27)
System\IO\Compression\ZipBlocks.Async.cs (6)
58public static async Task<Zip64EndOfCentralDirectoryLocator> TryReadBlockAsync(Stream stream, CancellationToken cancellationToken)
83public static async Task<Zip64EndOfCentralDirectoryRecord> TryReadBlockAsync(Stream stream, CancellationToken cancellationToken)
111public static async Task<(List<ZipGenericExtraField>, byte[] trailingData)> GetExtraFieldsAsync(Stream stream, CancellationToken cancellationToken)
145public static async Task<bool> TrySkipBlockAsync(Stream stream, CancellationToken cancellationToken)
165public static async Task<(bool, int, ZipCentralDirectoryFileHeader?)> TryReadBlockAsync(ReadOnlyMemory<byte> buffer, Stream furtherReads, bool saveExtraFieldsAndComments, CancellationToken cancellationToken)
243public static async Task<ZipEndOfCentralDirectoryBlock> ReadBlockAsync(Stream stream, CancellationToken cancellationToken)
System.IO.Compression.Brotli (1)
System.IO.Compression.ZipFile (6)
System\IO\Compression\ZipFile.Create.Async.cs (3)
35public static Task<ZipArchive> OpenReadAsync(string archiveFileName, CancellationToken cancellationToken = default) => OpenAsync(archiveFileName, ZipArchiveMode.Read, cancellationToken);
74public static Task<ZipArchive> OpenAsync(string archiveFileName, ZipArchiveMode mode, CancellationToken cancellationToken = default) => OpenAsync(archiveFileName, mode, entryNameEncoding: null, cancellationToken);
152public static async Task<ZipArchive> OpenAsync(string archiveFileName, ZipArchiveMode mode, Encoding? entryNameEncoding, CancellationToken cancellationToken = default)
System.IO.IsolatedStorage (1)
System.IO.Pipelines (1)
System.IO.Pipes (1)
System.IO.Ports (3)
System.Linq.Expressions (1)
System.Memory.Data (7)
System.Net.Http (99)
System\Net\Http\HttpClient.cs (44)
159public Task<string> GetStringAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
162public Task<string> GetStringAsync(Uri? requestUri) =>
165public Task<string> GetStringAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
168public Task<string> GetStringAsync(Uri? requestUri, CancellationToken cancellationToken)
178private async Task<string> GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
231public Task<byte[]> GetByteArrayAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
234public Task<byte[]> GetByteArrayAsync(Uri? requestUri) =>
237public Task<byte[]> GetByteArrayAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
240public Task<byte[]> GetByteArrayAsync(Uri? requestUri, CancellationToken cancellationToken)
250private async Task<byte[]> GetByteArrayAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
306public Task<Stream> GetStreamAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
309public Task<Stream> GetStreamAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
312public Task<Stream> GetStreamAsync(Uri? requestUri) =>
315public Task<Stream> GetStreamAsync(Uri? requestUri, CancellationToken cancellationToken)
325private async Task<Stream> GetStreamAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
356public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
359public Task<HttpResponseMessage> GetAsync(Uri? requestUri) =>
362public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpCompletionOption completionOption) =>
365public Task<HttpResponseMessage> GetAsync(Uri? requestUri, HttpCompletionOption completionOption) =>
368public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
371public Task<HttpResponseMessage> GetAsync(Uri? requestUri, CancellationToken cancellationToken) =>
374public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken) =>
377public Task<HttpResponseMessage> GetAsync(Uri? requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken) =>
380public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
383public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content) =>
386public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
389public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
396public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
399public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content) =>
402public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
405public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
412public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
415public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content) =>
418public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
421public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
428public Task<HttpResponseMessage> DeleteAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
431public Task<HttpResponseMessage> DeleteAsync(Uri? requestUri) =>
434public Task<HttpResponseMessage> DeleteAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
437public Task<HttpResponseMessage> DeleteAsync(Uri? requestUri, CancellationToken cancellationToken) =>
496public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request) =>
499public override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) =>
502public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption) =>
505public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
513async Task<HttpResponseMessage> Core(
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (4)
51private static Task<HttpResponseMessage> InnerSendAsync(HttpRequestMessage request, bool async, bool isProxyAuth, HttpConnectionPool pool, HttpConnection connection, CancellationToken cancellationToken)
76private static async Task<HttpResponseMessage> SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, bool async, ICredentials credentials, TokenImpersonationLevel impersonationLevel, bool isProxyAuth, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
235public static Task<HttpResponseMessage> SendWithNtProxyAuthAsync(HttpRequestMessage request, Uri proxyUri, bool async, ICredentials proxyCredentials, TokenImpersonationLevel impersonationLevel, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
240public static Task<HttpResponseMessage> SendWithNtConnectionAuthAsync(HttpRequestMessage request, bool async, ICredentials credentials, TokenImpersonationLevel impersonationLevel, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
System.Net.Http.Json (71)
System\Net\Http\Json\HttpClientJsonExtensions.cs (13)
19private static Task<object?> FromJsonAsyncCore(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
24private static Task<TValue?> FromJsonAsyncCore<TValue>(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
27private static Task<object?> FromJsonAsyncCore(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) =>
30private static Task<TValue?> FromJsonAsyncCore<TValue>(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken) =>
33private static Task<TValue?> FromJsonAsyncCore<TValue, TJsonOptions>(
34Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod,
54Task<HttpResponseMessage> responseTask;
72static async Task<TValue?> Core(
74Task<HttpResponseMessage> responseTask,
System\Net\Http\Json\HttpClientJsonExtensions.Delete.cs (13)
18private static readonly Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> s_deleteAsync =
33public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
48public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
63public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
78public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
91public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) =>
104public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) =>
117public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) =>
130public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) =>
144public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, CancellationToken cancellationToken = default) =>
158public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, CancellationToken cancellationToken = default) =>
172public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken = default) =>
186public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpClientJsonExtensions.Get.cs (13)
18private static readonly Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> s_getAsync =
23public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
28public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
33public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
38public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
41public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) =>
44public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) =>
47public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) =>
50public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) =>
55public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, CancellationToken cancellationToken = default) =>
60public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, CancellationToken cancellationToken = default) =>
65public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken = default) =>
70public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpClientJsonExtensions.Patch.cs (6)
27public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
48public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
68public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
83public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
97public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
116public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System\Net\Http\Json\HttpClientJsonExtensions.Post.cs (6)
16public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
26public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
36public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
41public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
44public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
52public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System\Net\Http\Json\HttpClientJsonExtensions.Put.cs (6)
16public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
26public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
36public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
41public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
44public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
52public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System\Net\Http\Json\HttpContentJsonExtensions.cs (12)
30public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
46public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, CancellationToken cancellationToken = default)
61public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
77public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, CancellationToken cancellationToken = default)
84private static async Task<object?> ReadFromJsonAsyncCore(HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken)
94private static async Task<T?> ReadFromJsonAsyncCore<T>(HttpContent content, JsonSerializerOptions? options, CancellationToken cancellationToken)
102public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default)
109public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, JsonTypeInfo<T> jsonTypeInfo, CancellationToken cancellationToken = default)
116private static async Task<object?> ReadFromJsonAsyncCore(HttpContent content, Type type, JsonSerializerContext context, CancellationToken cancellationToken)
124private static async Task<T?> ReadFromJsonAsyncCore<T>(HttpContent content, JsonTypeInfo<T> jsonTypeInfo, CancellationToken cancellationToken)
134Task<Stream> task = ReadHttpContentStreamAsync(content, cancellationToken);
141private static async ValueTask<Stream> GetTranscodingStreamAsync(Task<Stream> task, Encoding sourceEncoding)
System.Net.Http.WinHttpHandler (1)
System.Net.HttpListener (8)
System.Net.Mail (17)
System\Net\Mail\SmtpClient.cs (4)
410private async Task<(Exception? ex, bool synchronous)> SendAsyncInternal<TIOAdapter>(MailMessage message, bool invokeSendCompleted, object? userToken, bool forceWrapExceptions = false, CancellationToken cancellationToken = default)
593Task<(Exception? ex, bool _)> task = SendAsyncInternal<AsyncReadWriteAdapter>(message, true, userToken, true);
663Task<(Exception?, bool)> task = SendAsyncInternal<AsyncReadWriteAdapter>(message, false, null, true, cancellationToken);
684static async Task WaitAndRethrowIfNeeded(Task<(Exception? ex, bool _)> task)
System\Net\Mail\SmtpCommands.cs (7)
18internal static async Task<LineInfo> SendAsync<TIOAdapter>(SmtpConnection conn, CancellationToken cancellationToken = default)
28internal static async Task<LineInfo[]> SendAsync<TIOAdapter>(SmtpConnection conn, CancellationToken cancellationToken = default)
38internal static async Task<LineInfo> SendAsync<TIOAdapter>(SmtpConnection conn, string type, string message, CancellationToken cancellationToken = default)
46internal static async Task<LineInfo> SendAsync<TIOAdapter>(SmtpConnection conn, string? message, CancellationToken cancellationToken = default)
170internal static async Task<string[]> SendAsync<TIOAdapter>(SmtpConnection conn, string domain, CancellationToken cancellationToken = default)
309static async Task<LineInfo> SendAndCheck(SmtpConnection conn, CancellationToken cancellationToken)
359internal static async Task<(bool success, string response)> SendAsync<TIOAdapter>(SmtpConnection conn, string to, CancellationToken cancellationToken = default)
System.Net.NameResolution (22)
System\Net\Dns.cs (22)
94public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress) =>
103/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns
106public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress, CancellationToken cancellationToken) =>
116/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns
119public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress, AddressFamily family, CancellationToken cancellationToken = default)
123Task<IPHostEntry> t = GetHostEntryCoreAsync(hostNameOrAddress, justReturnParsedIp: false, throwOnIIPAny: true, family, cancellationToken);
152public static Task<IPHostEntry> GetHostEntryAsync(IPAddress address)
224public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress) =>
225(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, AddressFamily.Unspecified, CancellationToken.None);
233/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns an array of
236public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress, CancellationToken cancellationToken) =>
237(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, AddressFamily.Unspecified, cancellationToken);
246/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns an array of
249public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress, AddressFamily family, CancellationToken cancellationToken = default) =>
250(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, family, cancellationToken);
547private static Task<IPHostEntry> GetHostEntryCoreAsync(string hostName, bool justReturnParsedIp, bool throwOnIIPAny, AddressFamily family, CancellationToken cancellationToken) =>
548(Task<IPHostEntry>)GetHostEntryOrAddressesCoreAsync(hostName, justReturnParsedIp, throwOnIIPAny, justAddresses: false, family, cancellationToken);
648private static Task<T>? GetAddrInfoWithTelemetryAsync<T>(string hostName, bool justAddresses, AddressFamily addressFamily, CancellationToken cancellationToken)
663static async Task<T> CompleteAsync(Task task, string hostName, long startingTimeStamp)
670result = await ((Task<T>)task).ConfigureAwait(false);
725private static Task<TResult> RunAsync<TResult>(Func<object, NameResolutionActivity, TResult> func, object key, CancellationToken cancellationToken)
736Task<TResult>? task = null;
System.Net.NetworkInformation (3)
System.Net.Ping (18)
System\Net\NetworkInformation\Ping.cs (15)
522private void TranslateTaskToEap(object? userToken, Task<PingReply> pingTask)
533public Task<PingReply> SendPingAsync(IPAddress address)
538public Task<PingReply> SendPingAsync(string hostNameOrAddress)
543public Task<PingReply> SendPingAsync(IPAddress address, int timeout)
548public Task<PingReply> SendPingAsync(string hostNameOrAddress, int timeout)
553public Task<PingReply> SendPingAsync(IPAddress address, int timeout, byte[] buffer)
558public Task<PingReply> SendPingAsync(string hostNameOrAddress, int timeout, byte[] buffer)
563public Task<PingReply> SendPingAsync(IPAddress address, int timeout, byte[] buffer, PingOptions? options)
583public Task<PingReply> SendPingAsync(IPAddress address, TimeSpan timeout, byte[]? buffer = null, PingOptions? options = null, CancellationToken cancellationToken = default)
588private Task<PingReply> SendPingAsync(IPAddress address, int timeout, byte[] buffer, PingOptions? options, CancellationToken cancellationToken)
603public Task<PingReply> SendPingAsync(string hostNameOrAddress, int timeout, byte[] buffer, PingOptions? options)
626public Task<PingReply> SendPingAsync(string hostNameOrAddress, TimeSpan timeout, byte[]? buffer = null, PingOptions? options = null, CancellationToken cancellationToken = default)
631private Task<PingReply> SendPingAsync(string hostNameOrAddress, int timeout, byte[] buffer, PingOptions? options, CancellationToken cancellationToken)
704private async Task<PingReply> SendPingAsyncInternal<TArg>(
721Task<PingReply> pingTask = SendPingAsyncCore(address, buffer, timeout, options);
System.Net.Quic (3)
System.Net.Requests (21)
System.Net.Security (12)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (6)
19private static readonly Func<string, CancellationToken, bool, Task<byte[]?>>? s_downloadBytes = CreateDownloadBytesFunc();
31Task<byte[]?> task = DownloadAssetCore(uri, downloadTimeout, async: false);
36internal static Task<byte[]?> DownloadAssetAsync(string uri, TimeSpan downloadTimeout)
41private static async Task<byte[]?> DownloadAssetCore(string uri, TimeSpan downloadTimeout, bool async)
66Task<byte[]?> task = s_downloadBytes(uri, cts?.Token ?? default, async);
151private static Func<string, CancellationToken, bool, Task<byte[]?>>? CreateDownloadBytesFunc()
System.Net.Sockets (50)
System\Net\Sockets\Socket.cs (9)
2505Task<int> t = SendAsync(new ReadOnlyMemory<byte>(buffer, offset, size), socketFlags, default).AsTask();
2531Task<int> t = SendAsync(buffers, socketFlags);
2580Task<int> t = SendToAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2601Task<int> t = ReceiveAsync(new ArraySegment<byte>(buffer, offset, size), socketFlags, fromNetworkStream: false, default).AsTask();
2626Task<int> t = ReceiveAsync(buffers, socketFlags);
2647Task<int> ti = TaskToAsyncResult.Unwrap<int>(asyncResult);
2671Task<SocketReceiveMessageFromResult> t = ReceiveMessageFromAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2712Task<SocketReceiveFromResult> t = ReceiveFromAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2750private async Task<(Socket s, byte[] buffer, int bytesReceived)> AcceptAndReceiveHelperAsync(Socket? acceptSocket, int receiveSize)
System\Net\Sockets\Socket.Tasks.cs (21)
23/// <summary>Cached instance for receive operations that return <see cref="Task{Int32}"/>.</summary>
25/// <summary>Cached instance for send operations that return <see cref="Task{Int32}"/>.</summary>
32public Task<Socket> AcceptAsync() => AcceptAsync((Socket?)null, CancellationToken.None).AsTask();
46public Task<Socket> AcceptAsync(Socket? acceptSocket) => AcceptAsync(acceptSocket, CancellationToken.None).AsTask();
276public Task<int> ReceiveAsync(ArraySegment<byte> buffer) =>
285public Task<int> ReceiveAsync(ArraySegment<byte> buffer, SocketFlags socketFlags) => ReceiveAsync(buffer, socketFlags, fromNetworkStream: false);
287internal Task<int> ReceiveAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, bool fromNetworkStream)
335public Task<int> ReceiveAsync(IList<ArraySegment<byte>> buffers) =>
344public Task<int> ReceiveAsync(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
366public Task<SocketReceiveFromResult> ReceiveFromAsync(ArraySegment<byte> buffer, EndPoint remoteEndPoint) =>
376public Task<SocketReceiveFromResult> ReceiveFromAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint)
468public Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(ArraySegment<byte> buffer, EndPoint remoteEndPoint) =>
478public Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint)
527public Task<int> SendAsync(ArraySegment<byte> buffer) =>
536public Task<int> SendAsync(ArraySegment<byte> buffer, SocketFlags socketFlags)
599public Task<int> SendAsync(IList<ArraySegment<byte>> buffers) =>
608public Task<int> SendAsync(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
630public Task<int> SendToAsync(ArraySegment<byte> buffer, EndPoint remoteEP) =>
640public Task<int> SendToAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEP)
853private Task<int> GetTaskForSendReceive(bool pending, TaskSocketAsyncEventArgs<int> saea, bool fromNetworkStream, bool isReceive)
855Task<int> t;
System\Net\Sockets\SocketTaskExtensions.cs (9)
15public static Task<Socket> AcceptAsync(this Socket socket) =>
18public static Task<Socket> AcceptAsync(this Socket socket, Socket? acceptSocket) =>
47public static Task<int> ReceiveAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags) =>
53public static Task<int> ReceiveAsync(this Socket socket, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags) =>
56public static Task<SocketReceiveFromResult> ReceiveFromAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint) =>
59public static Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint) =>
63public static Task<int> SendAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags) =>
69public static Task<int> SendAsync(this Socket socket, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags) =>
73public static Task<int> SendToAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEP) =>
System.Net.WebClient (28)
System\Net\WebClient.cs (27)
268private async Task<WebResponse> GetWebResponseTaskAsync(WebRequest request)
1536public Task<string> DownloadStringTaskAsync(string address) =>
1539public Task<string> DownloadStringTaskAsync(Uri address)
1560public Task<Stream> OpenReadTaskAsync(string address) =>
1563public Task<Stream> OpenReadTaskAsync(Uri address)
1585public Task<Stream> OpenWriteTaskAsync(string address) =>
1588public Task<Stream> OpenWriteTaskAsync(Uri address) =>
1591public Task<Stream> OpenWriteTaskAsync(string address, string? method) =>
1594public Task<Stream> OpenWriteTaskAsync(Uri address, string? method)
1616public Task<string> UploadStringTaskAsync(string address, string data) =>
1619public Task<string> UploadStringTaskAsync(Uri address, string data) =>
1622public Task<string> UploadStringTaskAsync(string address, string? method, string data) =>
1625public Task<string> UploadStringTaskAsync(Uri address, string? method, string data)
1647public Task<byte[]> DownloadDataTaskAsync(string address) =>
1650public Task<byte[]> DownloadDataTaskAsync(Uri address)
1697public Task<byte[]> UploadDataTaskAsync(string address, byte[] data) =>
1700public Task<byte[]> UploadDataTaskAsync(Uri address, byte[] data) =>
1703public Task<byte[]> UploadDataTaskAsync(string address, string? method, byte[] data) =>
1706public Task<byte[]> UploadDataTaskAsync(Uri address, string? method, byte[] data)
1728public Task<byte[]> UploadFileTaskAsync(string address, string fileName) =>
1731public Task<byte[]> UploadFileTaskAsync(Uri address, string fileName) =>
1734public Task<byte[]> UploadFileTaskAsync(string address, string? method, string fileName) =>
1737public Task<byte[]> UploadFileTaskAsync(Uri address, string? method, string fileName)
1759public Task<byte[]> UploadValuesTaskAsync(string address, NameValueCollection data) =>
1762public Task<byte[]> UploadValuesTaskAsync(string address, string? method, NameValueCollection data) =>
1765public Task<byte[]> UploadValuesTaskAsync(Uri address, NameValueCollection data) =>
1768public Task<byte[]> UploadValuesTaskAsync(Uri address, string? method, NameValueCollection data)
System.Net.WebSockets (2)
System.Net.WebSockets.Client (2)
System.Private.CoreLib (962)
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (9)
1084public static Task<string> ReadAllTextAsync(string path, CancellationToken cancellationToken = default)
1087public static Task<string> ReadAllTextAsync(string path, Encoding encoding, CancellationToken cancellationToken = default)
1096private static async Task<string> InternalReadAllTextAsync(string path, Encoding encoding, CancellationToken cancellationToken)
1169public static Task<byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken = default)
1198private static async Task<byte[]> InternalReadAllBytesAsync(SafeFileHandle sfh, int count, CancellationToken cancellationToken)
1219private static async Task<byte[]> InternalReadAllBytesUnknownLengthAsync(SafeFileHandle sfh, CancellationToken cancellationToken)
1292public static Task<string[]> ReadAllLinesAsync(string path, CancellationToken cancellationToken = default)
1295public static Task<string[]> ReadAllLinesAsync(string path, Encoding encoding, CancellationToken cancellationToken = default)
1304private static async Task<string[]> InternalReadAllLinesAsync(string path, Encoding encoding, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (7)
202internal Task<int> BeginReadInternal(
301public Task<int> ReadAsync(byte[] buffer, int offset, int count) => ReadAsync(buffer, offset, count, CancellationToken.None);
303public virtual Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
318static async ValueTask<int> FinishReadAsync(Task<int> readTask, byte[] localBuffer, Memory<byte> localDestination)
450private Task<int> BeginEndReadAsync(byte[] buffer, int offset, int count)
1034TaskToAsyncResult.Begin(Task<int>.s_defaultResultTask, callback, state);
1049public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (17)
854public override Task<string?> ReadLineAsync() =>
898Task<string?> task = ReadLineAsyncInternal(cancellationToken);
904private async Task<string?> ReadLineAsyncInternal(CancellationToken cancellationToken)
987public override Task<string> ReadToEndAsync() => ReadToEndAsync(default);
1012public override Task<string> ReadToEndAsync(CancellationToken cancellationToken)
1026Task<string> task = ReadToEndAsyncInternal(cancellationToken);
1032private async Task<string> ReadToEndAsyncInternal(CancellationToken cancellationToken)
1047public override Task<int> ReadAsync(char[] buffer, int index, int count)
1070Task<int> task = ReadAsyncInternal(new Memory<char>(buffer, index, count), CancellationToken.None).AsTask();
1258public override Task<int> ReadBlockAsync(char[] buffer, int index, int count)
1281Task<int> task = base.ReadBlockAsync(buffer, index, count);
1310Task<int> t = vt.AsTask();
1427public override Task<int> ReadAsync(char[] buffer, int index, int count) => Task.FromResult(0);
1436public override Task<int> ReadBlockAsync(char[] buffer, int index, int count) => Task.FromResult(0);
1443public override Task<string?> ReadLineAsync() => Task.FromResult<string?>(null);
1450public override Task<string> ReadToEndAsync() => Task.FromResult("");
1452public override Task<string> ReadToEndAsync(CancellationToken cancellationToken) =>
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (15)
199public virtual Task<string?> ReadLineAsync() => ReadLineCoreAsync(default);
221private Task<string?> ReadLineCoreAsync(CancellationToken cancellationToken) =>
222Task<string?>.Factory.StartNew(static state => ((TextReader)state!).ReadLine(), this,
225public virtual Task<string> ReadToEndAsync() => ReadToEndAsync(default);
241public virtual async Task<string> ReadToEndAsync(CancellationToken cancellationToken)
260public virtual Task<int> ReadAsync(char[] buffer, int index, int count)
277Task<int>.Factory.StartNew(static state =>
284new ValueTask<int>(Task<int>.Factory.StartNew(static state =>
290public virtual Task<int> ReadBlockAsync(char[] buffer, int index, int count)
307Task<int>.Factory.StartNew(static state =>
376public override Task<string?> ReadLineAsync() => Task.FromResult(ReadLine());
383public override Task<string> ReadToEndAsync() => Task.FromResult(ReadToEnd());
386public override Task<string> ReadToEndAsync(CancellationToken cancellationToken)
390public override Task<int> ReadBlockAsync(char[] buffer, int index, int count)
403public override Task<int> ReadAsync(char[] buffer, int index, int count)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (148)
22/// The type of the result produced by this <see cref="Task{TResult}"/>.
26/// <see cref="Task{TResult}"/> instances may be created in a variety of ways. The most common approach is by
29/// purposes. For example, to create a <see cref="Task{TResult}"/> that runs a function, the factory's StartNew
44/// The <see cref="Task{TResult}"/> class also provides constructors that initialize the task but that do not
52/// All members of <see cref="Task{TResult}"/>, except for
62internal static readonly Task<TResult> s_defaultResultTask = TaskCache.CreateCacheableTask<TResult>(default);
98/// Initializes a new <see cref="Task{TResult}"/> with the specified function.
115/// Initializes a new <see cref="Task{TResult}"/> with the specified function.
135/// Initializes a new <see cref="Task{TResult}"/> with the specified function and creation options.
158/// Initializes a new <see cref="Task{TResult}"/> with the specified function and creation options.
185/// Initializes a new <see cref="Task{TResult}"/> with the specified function and state.
202/// Initializes a new <see cref="Task{TResult}"/> with the specified action, state, and options.
223/// Initializes a new <see cref="Task{TResult}"/> with the specified action, state, and options.
249/// Initializes a new <see cref="Task{TResult}"/> with the specified action, state, and options.
310internal static Task<TResult> StartNew(Task? parent, Func<TResult> function, CancellationToken cancellationToken,
323Task<TResult> f = new Task<TResult>(function, parent, cancellationToken, creationOptions, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler);
330internal static Task<TResult> StartNew(Task? parent, Func<object?, TResult> function, object? state, CancellationToken cancellationToken,
343Task<TResult> f = new Task<TResult>(function, state, parent, cancellationToken, creationOptions, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler);
420/// Gets the result value of this <see cref="Task{TResult}"/>.
434/// Gets the result value of this <see cref="Task{TResult}"/> once the task has completed successfully.
469/// Provides access to factory methods for creating <see cref="Task{TResult}"/> instances.
504/// <summary>Gets an awaiter used to await this <see cref="Task{TResult}"/>.</summary>
511/// <summary>Configures an awaiter used to await this <see cref="Task{TResult}"/>.</summary>
546/// <summary>Gets a <see cref="Task{TResult}"/> that will complete when this <see cref="Task{TResult}"/> completes or when the specified <see cref="CancellationToken"/> has cancellation requested.</summary>
548/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
549public new Task<TResult> WaitAsync(CancellationToken cancellationToken) =>
552/// <summary>Gets a <see cref="Task{TResult}"/> that will complete when this <see cref="Task{TResult}"/> completes or when the specified timeout expires.</summary>
554/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
555public new Task<TResult> WaitAsync(TimeSpan timeout) =>
559/// Gets a <see cref="Task{TResult}"/> that will complete when this <see cref="Task{TResult}"/> completes or when the specified timeout expires.
563/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
564public new Task<TResult> WaitAsync(TimeSpan timeout, TimeProvider timeProvider)
570/// <summary>Gets a <see cref="Task{TResult}"/> that will complete when this <see cref="Task{TResult}"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested.</summary>
573/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
574public new Task<TResult> WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) =>
578/// Gets a <see cref="Task{TResult}"/> that will complete when this <see cref="Task{TResult}"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested.
583/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
584public new Task<TResult> WaitAsync(TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken)
590private Task<TResult> WaitAsync(uint millisecondsTimeout, TimeProvider timeProvider, CancellationToken cancellationToken)
616/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
619/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
631public Task ContinueWith(Action<Task<TResult>> continuationAction)
638/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
641/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
654public Task ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken)
661/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
664/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
682public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler)
688/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
691/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
715public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskContinuationOptions continuationOptions)
721/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
724/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
755public Task ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken,
762internal Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler, CancellationToken cancellationToken,
796/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
799/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
812public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state)
819/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
822/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
836public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, CancellationToken cancellationToken)
843/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
846/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
865public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler)
871/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
874/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
899public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskContinuationOptions continuationOptions)
905/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
908/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
940public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, CancellationToken cancellationToken,
947internal Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler, CancellationToken cancellationToken,
982/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
988/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
991/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
993/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1000public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction)
1007/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1013/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1017/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1019/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1029public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, CancellationToken cancellationToken)
1035/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1041/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1047/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1049/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current task has
1059public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler)
1065/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1071/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1081/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1084/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1090/// cref="Task{TNewResult}"/>. This task's completion state will be transferred to the task returned
1101public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskContinuationOptions continuationOptions)
1107/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1113/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be passed as
1128/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1131/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current task has
1136/// The <paramref name="continuationFunction"/>, when executed, should return a <see cref="Task{TNewResult}"/>.
1154public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, CancellationToken cancellationToken,
1161internal Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler,
1179Task<TNewResult> continuationFuture = new ContinuationResultTaskFromResultTask<TResult, TNewResult>(
1195/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1201/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1205/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1207/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1214public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state)
1221/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1227/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1232/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1234/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1244public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1251/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1257/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1264/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1266/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current task has
1276public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1283/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1289/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1300/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1303/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1309/// cref="Task{TNewResult}"/>. This task's completion state will be transferred to the task returned
1320public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1327/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1333/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1349/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1352/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current task has
1357/// The <paramref name="continuationFunction"/>, when executed, should return a <see cref="Task{TNewResult}"/>.
1375public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1382internal Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1400Task<TNewResult> continuationFuture = new ContinuationResultTaskFromResultTask<TResult, TNewResult>(
1420private readonly Task<TResult> m_task;
1422public SystemThreadingTasks_FutureDebugView(Task<TResult> task)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (204)
10/// <see cref="Task{TResult}">Task{TResult}</see> objects.
13/// the <see cref="Task{TResult}">Task{TResult}</see> objects that are associated with
23/// <see cref="Task{TResult}.Factory">Task{TResult}.Factory</see> property.
241/// Creates and starts a <see cref="Task{TResult}"/>.
244/// the <see cref="Task{TResult}"/>.</param>
245/// <returns>The started <see cref="Task{TResult}"/>.</returns>
250/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
256public Task<TResult> StartNew(Func<TResult> function)
259return Task<TResult>.StartNew(currTask, function, m_defaultCancellationToken,
264/// Creates and starts a <see cref="Task{TResult}"/>.
267/// the <see cref="Task{TResult}"/>.</param>
269/// <returns>The started <see cref="Task{TResult}"/>.</returns>
277/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
283public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken)
286return Task<TResult>.StartNew(currTask, function, cancellationToken,
291/// Creates and starts a <see cref="Task{TResult}"/>.
294/// the <see cref="Task{TResult}"/>.</param>
297/// <see cref="Task{TResult}"/>.</param>
298/// <returns>The started <see cref="Task{TResult}"/>.</returns>
306/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
312public Task<TResult> StartNew(Func<TResult> function, TaskCreationOptions creationOptions)
315return Task<TResult>.StartNew(currTask, function, m_defaultCancellationToken,
320/// Creates and starts a <see cref="Task{TResult}"/>.
323/// the <see cref="Task{TResult}"/>.</param>
326/// <see cref="Task{TResult}"/>.</param>
330/// that is used to schedule the created <see cref="Task{TResult}">
332/// <returns>The started <see cref="Task{TResult}"/>.</returns>
346/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
352public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
354return Task<TResult>.StartNew(
360/// Creates and starts a <see cref="Task{TResult}"/>.
363/// the <see cref="Task{TResult}"/>.</param>
366/// <returns>The started <see cref="Task{TResult}"/>.</returns>
371/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
377public Task<TResult> StartNew(Func<object?, TResult> function, object? state)
380return Task<TResult>.StartNew(currTask, function, state, m_defaultCancellationToken,
385/// Creates and starts a <see cref="Task{TResult}"/>.
388/// the <see cref="Task{TResult}"/>.</param>
392/// <returns>The started <see cref="Task{TResult}"/>.</returns>
400/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
406public Task<TResult> StartNew(Func<object?, TResult> function, object? state, CancellationToken cancellationToken)
409return Task<TResult>.StartNew(currTask, function, state, cancellationToken,
414/// Creates and starts a <see cref="Task{TResult}"/>.
417/// the <see cref="Task{TResult}"/>.</param>
422/// <see cref="Task{TResult}"/>.</param>
423/// <returns>The started <see cref="Task{TResult}"/>.</returns>
431/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
437public Task<TResult> StartNew(Func<object?, TResult> function, object? state, TaskCreationOptions creationOptions)
440return Task<TResult>.StartNew(currTask, function, state, m_defaultCancellationToken,
445/// Creates and starts a <see cref="Task{TResult}"/>.
448/// the <see cref="Task{TResult}"/>.</param>
454/// <see cref="Task{TResult}"/>.</param>
457/// that is used to schedule the created <see cref="Task{TResult}">
459/// <returns>The started <see cref="Task{TResult}"/>.</returns>
473/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
479public Task<TResult> StartNew(Func<object?, TResult> function, object? state, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
481return Task<TResult>.StartNew(Task.InternalCurrentIfAttached(creationOptions), function, state, cancellationToken,
494Task<TResult> promise,
547/// Creates a <see cref="Task{TResult}">Task</see> that executes an end
558/// <returns>A <see cref="Task{TResult}">Task</see> that represents the
560public Task<TResult> FromAsync(IAsyncResult asyncResult, Func<IAsyncResult, TResult> endMethod)
566/// Creates a <see cref="Task{TResult}">Task</see> that executes an end
574/// created <see cref="Task{TResult}">Task</see>.</param>
582/// <returns>A <see cref="Task{TResult}">Task</see> that represents the
584public Task<TResult> FromAsync(
595/// Creates a <see cref="Task{TResult}">Task</see> that executes an end
605/// created <see cref="Task{TResult}">Task</see>.</param>
615/// <returns>A <see cref="Task{TResult}">Task</see> that represents the
617public Task<TResult> FromAsync(
628internal static Task<TResult> FromAsyncImpl(
648Task<TResult> promise = new Task<TResult>((object?)null, creationOptions);
697/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
708/// <returns>The created <see cref="Task{TResult}">Task</see> that
713public Task<TResult> FromAsync(
721/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
727/// created <see cref="Task{TResult}">Task</see>.</param>
737/// <returns>The created <see cref="Task{TResult}">Task</see> that
742public Task<TResult> FromAsync(
751internal static Task<TResult> FromAsyncImpl(Func<AsyncCallback, object?, IAsyncResult> beginMethod,
765Task<TResult> promise = new Task<TResult>(state, creationOptions);
804/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
819/// <returns>The created <see cref="Task{TResult}">Task</see> that
824public Task<TResult> FromAsync<TArg1>(
833/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
843/// created <see cref="Task{TResult}">Task</see>.</param>
853/// <returns>The created <see cref="Task{TResult}">Task</see> that
858public Task<TResult> FromAsync<TArg1>(
868internal static Task<TResult> FromAsyncImpl<TArg1>(Func<TArg1, AsyncCallback, object?, IAsyncResult> beginMethod,
882Task<TResult> promise = new Task<TResult>(state, creationOptions);
921/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
940/// <returns>The created <see cref="Task{TResult}">Task</see> that
945public Task<TResult> FromAsync<TArg1, TArg2>(
954/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
968/// created <see cref="Task{TResult}">Task</see>.</param>
978/// <returns>The created <see cref="Task{TResult}">Task</see> that
983public Task<TResult> FromAsync<TArg1, TArg2>(
993internal static Task<TResult> FromAsyncImpl<TArg1, TArg2>(Func<TArg1, TArg2, AsyncCallback, object?, IAsyncResult> beginMethod,
1007Task<TResult> promise = new Task<TResult>(state, creationOptions);
1046/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1069/// <returns>The created <see cref="Task{TResult}">Task</see> that
1074public Task<TResult> FromAsync<TArg1, TArg2, TArg3>(
1083/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1101/// created <see cref="Task{TResult}">Task</see>.</param>
1111/// <returns>The created <see cref="Task{TResult}">Task</see> that
1116public Task<TResult> FromAsync<TArg1, TArg2, TArg3>(
1126internal static Task<TResult> FromAsyncImpl<TArg1, TArg2, TArg3>(Func<TArg1, TArg2, TArg3, AsyncCallback, object?, IAsyncResult> beginMethod,
1140Task<TResult> promise = new Task<TResult>(state, creationOptions);
1190internal static Task<TResult> FromAsyncTrim<TInstance, TArgs>(
1322private static Task<TResult> CreateCanceledTask(TaskContinuationOptions continuationOptions, CancellationToken ct)
1333/// Creates a continuation <see cref="Task{TResult}">Task</see>
1339/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1348public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction)
1356/// Creates a continuation <see cref="Task{TResult}">Task</see>
1364/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1376public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken)
1384/// Creates a continuation <see cref="Task{TResult}">Task</see>
1392/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1393/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1410public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions)
1418/// Creates a continuation <see cref="Task{TResult}">Task</see>
1428/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1432/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1454public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction,
1463/// Creates a continuation <see cref="Task{TResult}">Task</see>
1470/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1479public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction)
1487/// Creates a continuation <see cref="Task{TResult}">Task</see>
1496/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1508public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1517/// Creates a continuation <see cref="Task{TResult}">Task</see>
1526/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1527/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1544public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1553/// Creates a continuation <see cref="Task{TResult}">Task</see>
1564/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1567/// cref="Task{TResult}"/>.</param>
1568/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1590public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1601internal static Task<TResult> ContinueWhenAllImpl<TAntecedentResult>(Task<TAntecedentResult>[] tasks,
1602Func<Task<TAntecedentResult>[], TResult>? continuationFunction, Action<Task<TAntecedentResult>[]>? continuationAction,
1612Task<TAntecedentResult>[] tasksCopy = TaskFactory.CheckMultiContinuationTasksAndCopy(tasks);
1623Task<Task<TAntecedentResult>[]> starter = TaskFactory.CommonCWAllLogic(tasksCopy);
1629static (starter, continuationFunction) => ((Func<Task<TAntecedentResult>[], TResult>)continuationFunction!)(starter.Result),
1639((Action<Task<TAntecedentResult>[]>)continuationAction!)(starter.Result);
1648internal static Task<TResult> ContinueWhenAllImpl(Task[] tasks,
1670Task<Task[]> starter = TaskFactory.CommonCWAllLogic(tasksCopy);
1703/// Creates a continuation <see cref="Task{TResult}">Task</see>
1709/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1718public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction)
1726/// Creates a continuation <see cref="Task{TResult}">Task</see>
1734/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1746public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
1754/// Creates a continuation <see cref="Task{TResult}">Task</see>
1762/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1763/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1780public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
1788/// Creates a continuation <see cref="Task{TResult}">Task</see>
1798/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1802/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1824public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction,
1833/// Creates a continuation <see cref="Task{TResult}">Task</see>
1840/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1849public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction)
1857/// Creates a continuation <see cref="Task{TResult}">Task</see>
1866/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1878public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1887/// Creates a continuation <see cref="Task{TResult}">Task</see>
1896/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1897/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1914public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1923/// Creates a continuation <see cref="Task{TResult}">Task</see>
1934/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1937/// cref="Task{TResult}"/>.</param>
1938/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1960public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1970internal static Task<TResult> ContinueWhenAnyImpl(Task[] tasks,
1983Task<Task> starter = TaskFactory.CommonCWAnyLogic(tasks);
2021internal static Task<TResult> ContinueWhenAnyImpl<TAntecedentResult>(Task<TAntecedentResult>[] tasks,
2022Func<Task<TAntecedentResult>, TResult>? continuationFunction, Action<Task<TAntecedentResult>>? continuationAction,
2033Task<Task<TAntecedentResult>> starter = TaskFactory.CommonCWAnyLogic(tasks);
2047static (starter, continuationFunction) => ((Func<Task<TAntecedentResult>, TResult>)continuationFunction!)(starter.Result),
2056((Action<Task<TAntecedentResult>>)continuationAction!)(starter.Result);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (128)
96/// For operations that return values, the <see cref="Task{TResult}"/> class
1456/// Provides access to factory methods for creating <see cref="Task"/> and <see cref="Task{TResult}"/> instances.
1466/// <remarks>It's a <see cref="Task{VoidTaskResult}"/> so it can be shared with <see cref="AsyncTaskMethodBuilder"/>.</remarks>
1467internal static readonly Task<VoidTaskResult> s_cachedCompleted = new Task<VoidTaskResult>(false, default, (TaskCreationOptions)InternalTaskOptions.DoNotDispose, default);
2925_ => completingTask is Task<TResult> taskTResult ? TrySetResult(taskTResult.Result) : TrySetResult(),
3995/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
3997/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4004public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction)
4021/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4023/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4033public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
4051/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4053/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4063public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler)
4085/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4087/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4099public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
4126/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4128/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4145public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken,
4152private Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler,
4169Task<TResult> continuationTask = new ContinuationResultTaskFromTask<TResult>(
4195/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4197/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4204public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state)
4222/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4224/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4234public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken)
4253/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4255/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4265public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler)
4288/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4290/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4302public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskContinuationOptions continuationOptions)
4330/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4332/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4349public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken,
4356private Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler,
4373Task<TResult> continuationTask = new ContinuationResultTaskFromTask<TResult>(
5356Task<Task> firstCompleted = TaskFactory.CommonCWAnyLogic(tasks, isSyncBlocking: true);
5381/// <summary>Gets a <see cref="Task{TResult}"/> that's completed successfully with the specified result.</summary>
5386public static unsafe Task<TResult> FromResult<TResult>(TResult result)
5397return Task<TResult>.s_defaultResultTask;
5403Task<bool> task = *(bool*)&result ? TaskCache.s_trueTask : TaskCache.s_falseTask;
5404return *(Task<TResult>*)&task;
5414Task<int> task = TaskCache.s_int32Tasks[value - TaskCache.InclusiveInt32Min];
5415return *(Task<TResult>*)&task;
5430return Task<TResult>.s_defaultResultTask;
5438/// <summary>Creates a <see cref="Task{TResult}"/> that's completed exceptionally with the specified exception.</summary>
5451/// <summary>Creates a <see cref="Task{TResult}"/> that's completed exceptionally with the specified exception.</summary>
5455public static Task<TResult> FromException<TResult>(Exception exception)
5459var task = new Task<TResult>();
5475/// <summary>Creates a <see cref="Task{TResult}"/> that's completed due to cancellation with the specified token.</summary>
5479public static Task<TResult> FromCanceled<TResult>(CancellationToken cancellationToken)
5499/// <summary>Creates a <see cref="Task{TResult}"/> that's completed due to cancellation with the specified exception.</summary>
5503internal static Task<TResult> FromCanceled<TResult>(OperationCanceledException exception)
5507var task = new Task<TResult>();
5557public static Task<TResult> Run<TResult>(Func<TResult> function)
5559return Task<TResult>.StartNew(null, function, default,
5575public static Task<TResult> Run<TResult>(Func<TResult> function, CancellationToken cancellationToken)
5577return Task<TResult>.StartNew(null, function, cancellationToken,
5617Task<Task?> task1 = Task<Task?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
5636public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function)
5652public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function, CancellationToken cancellationToken)
5661Task<Task<TResult>?> task1 = Task<Task<TResult>?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
6235public static Task<TResult[]> WhenAll<TResult>(IEnumerable<Task<TResult>> tasks)
6238if (tasks is Task<TResult>[] taskArray)
6244if (tasks is ICollection<Task<TResult>> taskCollection)
6252taskArray = new Task<TResult>[count];
6254foreach (Task<TResult> task in taskArray)
6271List<Task<TResult>> taskList = new List<Task<TResult>>();
6272foreach (Task<TResult> task in tasks)
6318public static Task<TResult[]> WhenAll<TResult>(params Task<TResult>[] tasks)
6325return WhenAll((ReadOnlySpan<Task<TResult>>)tasks);
6356public static Task<TResult[]> WhenAll<TResult>(params ReadOnlySpan<Task<TResult>> tasks)
6363Task<TResult>[] tasksCopy = tasks.ToArray();
6364foreach (Task<TResult> task in tasksCopy)
6386private readonly Task<T>?[] m_tasks;
6390internal WhenAllPromise(Task<T>[] tasks)
6404foreach (Task<T> task in tasks)
6430Task<T>? task = m_tasks[i];
6508public static Task<Task> WhenAny(params Task[] tasks)
6527public static Task<Task> WhenAny(params ReadOnlySpan<Task> tasks) =>
6542private static Task<TTask> WhenAnyCore<TTask>(ReadOnlySpan<TTask> tasks) where TTask : Task
6580public static Task<Task> WhenAny(Task task1, Task task2) =>
6594private static Task<TTask> WhenAny<TTask>(TTask task1, TTask task2) where TTask : Task
6700public static Task<Task> WhenAny(IEnumerable<Task> tasks) =>
6716private static Task<TTask> WhenAny<TTask>(IEnumerable<TTask> tasks) where TTask : Task
6794public static Task<Task<TResult>> WhenAny<TResult>(params Task<TResult>[] tasks)
6798return WhenAnyCore((ReadOnlySpan<Task<TResult>>)tasks);
6814public static Task<Task<TResult>> WhenAny<TResult>(params ReadOnlySpan<Task<TResult>> tasks) =>
6829public static Task<Task<TResult>> WhenAny<TResult>(Task<TResult> task1, Task<TResult> task2) =>
6830WhenAny<Task<TResult>>(task1, task2);
6848public static Task<Task<TResult>> WhenAny<TResult>(IEnumerable<Task<TResult>> tasks) =>
6849WhenAny<Task<TResult>>(tasks);
6881public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(params Task<TResult>[] tasks)
6884return WhenEach((ReadOnlySpan<Task<TResult>>)tasks);
6890public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(params ReadOnlySpan<Task<TResult>> tasks) => // TODO https://github.com/dotnet/runtime/issues/77873: Add params
6891WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(ReadOnlySpan<Task>.CastUp(tasks)));
6896public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(IEnumerable<Task<TResult>> tasks) =>
6897WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(tasks));
7045internal static Task<TResult> CreateUnwrapPromise<TResult>(Task outerTask, bool lookForOce)
7489ProcessInnerTask(task is Task<Task<TResult>> taskOfTaskOfTResult ? // it's either a Task<Task> or Task<Task<TResult>>
7490taskOfTaskOfTResult.Result : ((Task<Task>)task).Result);
7535result = TrySetResult(task is Task<TResult> taskTResult ? taskTResult.Result : default);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (14)
104private Task<TAntecedentResult>? m_antecedent;
107Task<TAntecedentResult> antecedent, Delegate action, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) :
110Debug.Assert(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object?>,
122Task<TAntecedentResult>? antecedent = m_antecedent;
132if (m_action is Action<Task<TAntecedentResult>> action)
138if (m_action is Action<Task<TAntecedentResult>, object?> actionWithState)
150private Task<TAntecedentResult>? m_antecedent;
153Task<TAntecedentResult> antecedent, Delegate function, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) :
156Debug.Assert(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object?, TResult>,
168Task<TAntecedentResult>? antecedent = m_antecedent;
178if (m_action is Func<Task<TAntecedentResult>, TResult> func)
184if (m_action is Func<Task<TAntecedentResult>, object?, TResult> funcWithState)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (232)
502/// Creates and starts a <see cref="Task{TResult}"/>.
505/// <see cref="Task{TResult}">Task</see>.
508/// the <see cref="Task{TResult}"/>.</param>
509/// <returns>The started <see cref="Task{TResult}"/>.</returns>
514/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
520public Task<TResult> StartNew<TResult>(Func<TResult> function)
523return Task<TResult>.StartNew(currTask, function, m_defaultCancellationToken,
529/// Creates and starts a <see cref="Task{TResult}"/>.
532/// <see cref="Task{TResult}">Task</see>.
535/// the <see cref="Task{TResult}"/>.</param>
537/// <returns>The started <see cref="Task{TResult}"/>.</returns>
545/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
551public Task<TResult> StartNew<TResult>(Func<TResult> function, CancellationToken cancellationToken)
554return Task<TResult>.StartNew(currTask, function, cancellationToken,
559/// Creates and starts a <see cref="Task{TResult}"/>.
562/// <see cref="Task{TResult}">Task</see>.
565/// the <see cref="Task{TResult}"/>.</param>
568/// <see cref="Task{TResult}"/>.</param>
569/// <returns>The started <see cref="Task{TResult}"/>.</returns>
577/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
583public Task<TResult> StartNew<TResult>(Func<TResult> function, TaskCreationOptions creationOptions)
586return Task<TResult>.StartNew(currTask, function, m_defaultCancellationToken,
591/// Creates and starts a <see cref="Task{TResult}"/>.
594/// <see cref="Task{TResult}">Task</see>.
597/// the <see cref="Task{TResult}"/>.</param>
601/// <see cref="Task{TResult}"/>.</param>
604/// that is used to schedule the created <see cref="Task{TResult}">
606/// <returns>The started <see cref="Task{TResult}"/>.</returns>
620/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
626public Task<TResult> StartNew<TResult>(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
628return Task<TResult>.StartNew(
634/// Creates and starts a <see cref="Task{TResult}"/>.
637/// <see cref="Task{TResult}">Task</see>.
640/// the <see cref="Task{TResult}"/>.</param>
643/// <returns>The started <see cref="Task{TResult}"/>.</returns>
648/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
654public Task<TResult> StartNew<TResult>(Func<object?, TResult> function, object? state)
657return Task<TResult>.StartNew(currTask, function, state, m_defaultCancellationToken,
663/// Creates and starts a <see cref="Task{TResult}"/>.
666/// <see cref="Task{TResult}">Task</see>.
669/// the <see cref="Task{TResult}"/>.</param>
673/// <returns>The started <see cref="Task{TResult}"/>.</returns>
681/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
687public Task<TResult> StartNew<TResult>(Func<object?, TResult> function, object? state, CancellationToken cancellationToken)
690return Task<TResult>.StartNew(currTask, function, state, cancellationToken,
695/// Creates and starts a <see cref="Task{TResult}"/>.
698/// <see cref="Task{TResult}">Task</see>.
701/// the <see cref="Task{TResult}"/>.</param>
706/// <see cref="Task{TResult}"/>.</param>
707/// <returns>The started <see cref="Task{TResult}"/>.</returns>
715/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
721public Task<TResult> StartNew<TResult>(Func<object?, TResult> function, object? state, TaskCreationOptions creationOptions)
724return Task<TResult>.StartNew(currTask, function, state, m_defaultCancellationToken,
729/// Creates and starts a <see cref="Task{TResult}"/>.
732/// <see cref="Task{TResult}">Task</see>.
735/// the <see cref="Task{TResult}"/>.</param>
741/// <see cref="Task{TResult}"/>.</param>
744/// that is used to schedule the created <see cref="Task{TResult}">
746/// <returns>The started <see cref="Task{TResult}"/>.</returns>
760/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
766public Task<TResult> StartNew<TResult>(Func<object?, TResult> function, object? state, CancellationToken cancellationToken,
769return Task<TResult>.StartNew(
1137/// Creates a <see cref="Task{TResult}">Task</see> that executes an end
1141/// <see cref="Task{TResult}">Task</see>.
1151/// <returns>A <see cref="Task{TResult}">Task</see> that represents the
1153public Task<TResult> FromAsync<TResult>(
1160/// Creates a <see cref="Task{TResult}">Task</see> that executes an end
1164/// <see cref="Task{TResult}">Task</see>.
1171/// created <see cref="Task{TResult}">Task</see>.</param>
1179/// <returns>A <see cref="Task{TResult}">Task</see> that represents the
1181public Task<TResult> FromAsync<TResult>(
1188/// Creates a <see cref="Task{TResult}">Task</see> that executes an end
1192/// <see cref="Task{TResult}">Task</see>.
1201/// created <see cref="Task{TResult}">Task</see>.</param>
1211/// <returns>A <see cref="Task{TResult}">Task</see> that represents the
1213public Task<TResult> FromAsync<TResult>(
1220/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1224/// <see cref="Task{TResult}">Task</see>.
1234/// <returns>The created <see cref="Task{TResult}">Task</see> that
1239public Task<TResult> FromAsync<TResult>(
1247/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1251/// <see cref="Task{TResult}">Task</see>.
1256/// created <see cref="Task{TResult}">Task</see>.</param>
1266/// <returns>The created <see cref="Task{TResult}">Task</see> that
1271public Task<TResult> FromAsync<TResult>(
1279/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1285/// <see cref="Task{TResult}">Task</see>.
1297/// <returns>The created <see cref="Task{TResult}">Task</see> that
1302public Task<TResult> FromAsync<TArg1, TResult>(
1310/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1316/// <see cref="Task{TResult}">Task</see>.
1323/// created <see cref="Task{TResult}">Task</see>.</param>
1333/// <returns>The created <see cref="Task{TResult}">Task</see> that
1338public Task<TResult> FromAsync<TArg1, TResult>(Func<TArg1, AsyncCallback, object?, IAsyncResult> beginMethod,
1345/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1353/// <see cref="Task{TResult}">Task</see>.
1367/// <returns>The created <see cref="Task{TResult}">Task</see> that
1372public Task<TResult> FromAsync<TArg1, TArg2, TResult>(Func<TArg1, TArg2, AsyncCallback, object?, IAsyncResult> beginMethod,
1379/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1387/// <see cref="Task{TResult}">Task</see>.
1396/// created <see cref="Task{TResult}">Task</see>.</param>
1406/// <returns>The created <see cref="Task{TResult}">Task</see> that
1411public Task<TResult> FromAsync<TArg1, TArg2, TResult>(
1419/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1429/// <see cref="Task{TResult}">Task</see>.
1445/// <returns>The created <see cref="Task{TResult}">Task</see> that
1450public Task<TResult> FromAsync<TArg1, TArg2, TArg3, TResult>(
1458/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1468/// <see cref="Task{TResult}">Task</see>.
1479/// created <see cref="Task{TResult}">Task</see>.</param>
1489/// <returns>The created <see cref="Task{TResult}">Task</see> that
1494public Task<TResult> FromAsync<TArg1, TArg2, TArg3, TResult>(
1596internal static Task<Task[]> CommonCWAllLogic(Task[] tasksCopy)
1617private sealed class CompleteOnCountdownPromise<T> : Task<Task<T>[]>, ITaskCompletionAction
1619private readonly Task<T>[] _tasks;
1622internal CompleteOnCountdownPromise(Task<T>[] tasksCopy)
1666internal static Task<Task<T>[]> CommonCWAllLogic<T>(Task<T>[] tasksCopy)
1829public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction)
1859public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction,
1895public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction,
1941public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction,
1956/// cref="Task{TResult}"/>.</typeparam>
1960/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1969public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction)
1984/// cref="Task{TResult}"/>.</typeparam>
1990/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2002public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken)
2010/// Creates a continuation <see cref="Task{TResult}">Task</see>
2016/// cref="Task{TResult}"/>.</typeparam>
2022/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
2023/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2040public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions)
2048/// Creates a continuation <see cref="Task{TResult}">Task</see>
2054/// cref="Task{TResult}"/>.</typeparam>
2062/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
2065/// cref="Task{TResult}"/>.</param>
2066/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2088public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken,
2098/// Creates a continuation <see cref="Task{TResult}">Task</see>
2105/// cref="Task{TResult}"/>.</typeparam>
2109/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2118public Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction)
2126/// Creates a continuation <see cref="Task{TResult}">Task</see>
2133/// cref="Task{TResult}"/>.</typeparam>
2139/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2151public Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
2160/// Creates a continuation <see cref="Task{TResult}">Task</see>
2167/// cref="Task{TResult}"/>.</typeparam>
2173/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
2174/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2191public Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
2200/// Creates a continuation <see cref="Task{TResult}">Task</see>
2207/// cref="Task{TResult}"/>.</typeparam>
2215/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
2218/// cref="Task{TResult}"/>.</param>
2219/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2241public Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
2336internal static Task<TTask> CommonCWAnyLogic<TTask>(IList<TTask> tasks, bool isSyncBlocking = false) where TTask : Task
2391internal static void CommonCWAnyLogicCleanup(Task<Task> continuation)
2530/// Creates a continuation <see cref="Task{TResult}">Task</see>
2536/// cref="Task{TResult}"/>.</typeparam>
2540/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2549public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction)
2557/// Creates a continuation <see cref="Task{TResult}">Task</see>
2563/// cref="Task{TResult}"/>.</typeparam>
2569/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2581public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
2589/// Creates a continuation <see cref="Task{TResult}">Task</see>
2595/// cref="Task{TResult}"/>.</typeparam>
2601/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
2602/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2619public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
2627/// Creates a continuation <see cref="Task{TResult}">Task</see>
2633/// cref="Task{TResult}"/>.</typeparam>
2641/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
2644/// cref="Task{TResult}"/>.</param>
2645/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2667public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken,
2676/// Creates a continuation <see cref="Task{TResult}">Task</see>
2683/// cref="Task{TResult}"/>.</typeparam>
2687/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2696public Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction)
2704/// Creates a continuation <see cref="Task{TResult}">Task</see>
2711/// cref="Task{TResult}"/>.</typeparam>
2717/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2729public Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
2738/// Creates a continuation <see cref="Task{TResult}">Task</see>
2745/// cref="Task{TResult}"/>.</typeparam>
2751/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
2752/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2769public Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
2778/// Creates a continuation <see cref="Task{TResult}">Task</see>
2785/// cref="Task{TResult}"/>.</typeparam>
2793/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
2796/// cref="Task{TResult}"/>.</param>
2797/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
2819public Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
2845public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction)
2874public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction,
2910public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction,
2933/// cref="Task{TResult}"/>.</param>
2956public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction,
2985internal static Task<TResult>[] CheckMultiContinuationTasksAndCopy<TResult>(Task<TResult>[] tasks)
2992Task<TResult>[] tasksCopy = new Task<TResult>[tasks.Length];
System.Private.DataContractSerialization (2)
System.Private.Xml (264)
System\Xml\AsyncHelper.cs (15)
10public static readonly Task<bool> DoneTaskTrue = Task.FromResult(true);
12public static readonly Task<bool> DoneTaskFalse = Task.FromResult(false);
14public static readonly Task<int> DoneTaskZero = Task.FromResult(0);
40public static Task<bool> ReturnTrueTaskWhenFinishAsync(this Task task)
47private static async Task<bool> ReturnTrueTaskWhenFinishCoreAsync(this Task task)
66public static Task<bool> CallBoolTaskFuncWhenFinishAsync<TArg>(this Task task, Func<TArg, Task<bool>> func, TArg arg)
73private static async Task<bool> CallBoolTaskFuncWhenFinishCoreAsync<TArg>(this Task task, Func<TArg, Task<bool>> func, TArg arg)
79public static Task<bool> ContinueBoolTaskFuncWhenFalseAsync<TArg>(this Task<bool> task, Func<TArg, Task<bool>> func, TArg arg)
91private static async Task<bool> ContinueBoolTaskFuncWhenFalseCoreAsync<TArg>(Task<bool> task, Func<TArg, Task<bool>> func, TArg arg)
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (9)
13internal async Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count) // only ever awaited, so no need to separate out argument handling
57internal async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count) // only ever awaited, so no need to separate out argument handling
101internal async Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count) // only ever awaited, so no need to separate out argument handling
145internal async Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count) // only ever awaited, so no need to separate out argument handling
209private async Task<bool> InitAsync()
222private async Task<bool> InitOnElementAsync()
250private async Task<int> ReadContentAsBinaryAsync(byte[] buffer, int index, int count)
309private async Task<int> ReadElementContentAsBinaryAsync(byte[] buffer, int index, int count)
334private async Task<bool> MoveToNextContentNodeAsync(bool moveIfOnContentNode)
System\Xml\Core\XmlAsyncCheckReader.cs (32)
779public override Task<string> GetValueAsync()
782var task = _coreReader.GetValueAsync();
787public override Task<object> ReadContentAsObjectAsync()
790var task = _coreReader.ReadContentAsObjectAsync();
795public override Task<string> ReadContentAsStringAsync()
798var task = _coreReader.ReadContentAsStringAsync();
803public override Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver? namespaceResolver)
806var task = _coreReader.ReadContentAsAsync(returnType, namespaceResolver);
811public override Task<object> ReadElementContentAsObjectAsync()
814var task = _coreReader.ReadElementContentAsObjectAsync();
819public override Task<string> ReadElementContentAsStringAsync()
822var task = _coreReader.ReadElementContentAsStringAsync();
827public override Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
830var task = _coreReader.ReadElementContentAsAsync(returnType, namespaceResolver);
835public override Task<bool> ReadAsync()
838var task = _coreReader.ReadAsync();
851public override Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
854var task = _coreReader.ReadContentAsBase64Async(buffer, index, count);
859public override Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
862var task = _coreReader.ReadElementContentAsBase64Async(buffer, index, count);
867public override Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
870var task = _coreReader.ReadContentAsBinHexAsync(buffer, index, count);
875public override Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
878var task = _coreReader.ReadElementContentAsBinHexAsync(buffer, index, count);
883public override Task<int> ReadValueChunkAsync(char[] buffer, int index, int count)
886var task = _coreReader.ReadValueChunkAsync(buffer, index, count);
891public override Task<XmlNodeType> MoveToContentAsync()
894var task = _coreReader.MoveToContentAsync();
899public override Task<string> ReadInnerXmlAsync()
902var task = _coreReader.ReadInnerXmlAsync();
907public override Task<string> ReadOuterXmlAsync()
910var task = _coreReader.ReadOuterXmlAsync();
System\Xml\Core\XmlCharCheckingReaderAsync.cs (7)
18public override async Task<bool> ReadAsync()
219public override async Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
262public override async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
305public override Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
320async Task<int> Core(byte[] buffer, int index, int count)
359public override Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
374async Task<int> Core(byte[] buffer, int index, int count)
System\Xml\Core\XmlReaderAsync.cs (20)
17public virtual Task<string> GetValueAsync()
24public virtual async Task<object> ReadContentAsObjectAsync()
35public virtual Task<string> ReadContentAsStringAsync()
46public virtual async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver? namespaceResolver)
74public virtual async Task<object> ReadElementContentAsObjectAsync()
86public virtual async Task<string> ReadElementContentAsStringAsync()
98public virtual async Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
112public virtual Task<bool> ReadAsync()
124public virtual Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
130public virtual Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
136public virtual Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
142public virtual Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
149public virtual Task<int> ReadValueChunkAsync(char[] buffer, int index, int count)
157public virtual async Task<XmlNodeType> MoveToContentAsync()
179public virtual async Task<string> ReadInnerXmlAsync()
262public virtual async Task<string> ReadOuterXmlAsync()
297private async Task<bool> SkipSubtreeAsync()
321internal async Task<string> InternalReadContentAsStringAsync()
367private async Task<bool> SetupReadElementContentAsXxxAsync(string methodName)
398private Task<bool> FinishReadElementContentAsXxxAsync()
System\Xml\Core\XmlSubtreeReaderAsync.cs (13)
16public override Task<string> GetValueAsync()
28public override async Task<bool> ReadAsync()
183public override async Task<object> ReadContentAsObjectAsync()
199public override async Task<string> ReadContentAsStringAsync()
215public override async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver? namespaceResolver)
231public override async Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
312public override async Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
369public override async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
450public override async Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
506public override Task<int> ReadValueChunkAsync(char[] buffer, int index, int count)
557private async Task<bool> InitReadElementContentAsBinaryAsync(State binaryState)
588private async Task<bool> FinishReadElementContentAsBinaryAsync()
622private async Task<bool> FinishReadContentAsBinaryAsync()
System\Xml\Core\XmlTextReaderImplAsync.cs (78)
30public override Task<string> GetValueAsync()
40private async Task<string> _GetValueAsync()
155public override Task<bool> ReadAsync()
270private Task<bool> ReadAsync_SwitchToInteractiveXmlDecl()
274Task<bool> task = ParseXmlDeclarationAsync(false);
285private async Task<bool> _ReadAsync_SwitchToInteractiveXmlDecl(Task<bool> task)
291private Task<bool> ReadAsync_SwitchToInteractiveXmlDecl_Helper(bool finish)
369private async Task<int> ReadContentAsBase64_AsyncHelper(Task<bool> task, byte[] buffer, int index, int count)
387public override Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
421Task<bool> task = InitReadContentAsBinaryAsync();
443public override async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
490private async Task<int> ReadElementContentAsBase64Async_Helper(Task<bool> task, byte[] buffer, int index, int count)
508public override Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
542Task<bool> task = InitReadElementContentAsBinaryAsync();
564public override async Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
611public override async Task<int> ReadValueChunkAsync(char[] buffer, int index, int count)
723internal Task<int> DtdParserProxy_ReadDataAsync()
729internal async Task<int> DtdParserProxy_ParseNumericCharRefAsync(StringBuilder? internalSubsetBuilder)
737internal Task<int> DtdParserProxy_ParseNamedCharRefAsync(bool expand, StringBuilder? internalSubsetBuilder)
797internal async Task<(int, bool)> DtdParserProxy_PushEntityAsync(IDtdEntityInfo entity)
825internal async Task<bool> DtdParserProxy_PushExternalSubsetAsync(string? systemId, string? publicId)
937private Task<int> InitTextReaderInputAsync(string baseUriStr, TextReader input)
942private Task<int> InitTextReaderInputAsync(string baseUriStr, Uri? baseUri, TextReader input)
1019private async Task<int> ReadDataAsync()
1169private async Task<bool> ParseXmlDeclarationAsync(bool isTextDecl)
1469private Task<bool> ParseDocumentContentAsync()
1601private Task<bool> ParseDocumentContentAsync_CData()
1610private async Task<bool> ParseDocumentContentAsync_ParseEntity()
1652private Task<bool> ParseDocumentContentAsync_WhiteSpace()
1654Task<bool> task = ParseTextAsync();
1676private async Task<bool> _ParseDocumentContentAsync_WhiteSpace(Task<bool> task)
1689private async Task<bool> ParseDocumentContentAsync_ReadData(bool needMoreChars)
1729private Task<bool> ParseElementContentAsync()
1828private async Task<bool> ParseElementContent_ReadData()
1919Task<(int, int)> parseQNameTask = ParseQNameAsync();
1926private Task ParseElementAsync_ContinueWithSetElement(Task<(int, int)> task)
1941private async Task _ParseElementAsync_ContinueWithSetElement(Task<(int, int)> task)
2886private Task<bool> ParseTextAsync()
2944private async Task<bool> _ParseTextAsync(Task<(int, int, int, bool)>? parseTask)
3101private Task<bool> ParseTextAsync_IgnoreNode()
3164private readonly Task<(int, int, int, bool)> _parseText_dummyTask = Task.FromResult((0, 0, 0, false));
3169Task<(int, int, int, bool)> task = ParseTextAsync(outOrChars, _ps.chars, _ps.charPos, 0, -1, outOrChars);
3207private async Task<(int, int, int, bool)> ParseTextAsync_AsyncFunc(Task<(int, int, int, bool)> task)
3243private Task<(int, int, int, bool)> ParseTextAsync(int outOrChars, char[] chars, int pos, int rcount, int rpos, int orChars)
3350private async Task<(int, int, int, bool)> ParseTextAsync_ParseEntity(int outOrChars, char[] chars, int pos, int rcount, int rpos, int orChars, char c)
3420private async Task<(int, int, int, bool)> ParseTextAsync_Surrogate(int outOrChars, char[] chars, int pos, int rcount, int rpos, int orChars, char c)
3458private async Task<(int, int, int, bool)> ParseTextAsync_ReadData(int outOrChars, char[] chars, int pos, int rcount, int rpos, int orChars, char c)
3675private async Task<bool> ParseRootLevelWhitespaceAsync()
3725private async Task<(int, EntityType)> HandleEntityReferenceAsync(bool isInAttributeValue, EntityExpandType expandType)
3809private async Task<EntityType> HandleGeneralEntityReferenceAsync(string name, bool isInAttributeValue, bool pushFakeEntityIfNullResolver, int entityStartLinePos)
3894private Task<bool> ParsePIAsync()
3901private async Task<bool> ParsePIAsync(StringBuilder? piInDtdStringBuilder)
4017private async Task<(int, int, bool)> ParsePIValueAsync()
4172private async Task<bool> ParseCommentAsync()
4242private async Task<(int, int, bool)> ParseCDataOrCommentTupleAsync(XmlNodeType type)
4409private async Task<bool> ParseDoctypeDeclAsync()
4803private async Task<int> EatWhitespacesAsync(StringBuilder? sb)
4904private async Task<(EntityType, int)> ParseNumericCharRefAsync(bool expand, StringBuilder? internalSubsetBuilder)
4939private async Task<int> ParseNamedCharRefAsync(bool expand, StringBuilder? internalSubsetBuilder)
4966private async Task<int> ParseNameAsync()
4972private Task<(int, int)> ParseQNameAsync()
4977private async Task<(int, int)> ParseQNameAsync(bool isQName, int startOffset)
5065private async Task<(int, bool)> ReadDataInNameAsync(int pos)
5074private async Task<string> ParseEntityNameAsync()
5159private async Task<bool> OpenAndPushAsync(Uri uri)
5195private async Task<bool> PushExternalEntityAsync(IDtdEntityInfo entity)
5243private async Task<bool> ZeroEndingStreamAsync(int pos)
5268private async Task<bool> InitReadContentAsBinaryAsync()
5294private async Task<bool> InitReadElementContentAsBinaryAsync()
5324private async Task<bool> MoveToNextContentNodeAsync(bool moveIfOnContentNode)
5357private async Task<int> ReadContentAsBinaryAsync(byte[] buffer, int index, int count)
5452private async Task<int> ReadElementContentAsBinaryAsync(byte[] buffer, int index, int count)
System\Xml\Core\XsdValidatingReaderAsync.cs (28)
20public override Task<string> GetValueAsync()
31public override Task<object> ReadContentAsObjectAsync()
41public override async Task<string> ReadContentAsStringAsync()
75public override async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver? namespaceResolver)
122public override async Task<object> ReadElementContentAsObjectAsync()
134public override async Task<string> ReadElementContentAsStringAsync()
174public override async Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
222private Task<bool> ReadAsync_Read(Task<bool> task)
247private async Task<bool> _ReadAsync_Read(Task<bool> task)
266private Task<bool> ReadAsync_ReadAhead(Task task)
279private async Task<bool> _ReadAsync_ReadAhead(Task task)
287public override Task<bool> ReadAsync()
292Task<bool> readTask = _coreReader.ReadAsync();
382public override async Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
409public override async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
436public override async Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
463public override async Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
537static async Task ValidateWhitespace(Task<string> t, XmlSchemaValidator validator) => validator.ValidateWhitespace(await t.ConfigureAwait(false));
539static async Task ValidateText(Task<string> t, XmlSchemaValidator validator) => validator.ValidateText(await t.ConfigureAwait(false));
677private Task<object> InternalReadContentAsObjectAsync()
682private async Task<object> InternalReadContentAsObjectAsync(bool unwrapTypedValue)
688private async Task<(string, object)> InternalReadContentAsObjectTupleAsync(bool unwrapTypedValue)
759private Task<(XmlSchemaType, object)> InternalReadElementContentAsObjectAsync()
764private async Task<(XmlSchemaType, object)> InternalReadElementContentAsObjectAsync(bool unwrapTypedValue)
771private async Task<(XmlSchemaType, string, object)> InternalReadElementContentAsObjectTupleAsync(bool unwrapTypedValue)
853private async Task<object?> ReadTillEndElementAsync()
System\Xml\Schema\DtdParserAsync.cs (31)
23async Task<IDtdInfo> IDtdParser.ParseInternalDtdAsync(IDtdParserAdapter adapter, bool saveInternalSubset)
30async Task<IDtdInfo> IDtdParser.ParseFreeFloatingDtdAsync(string baseUri, string docTypeName, string publicId, string systemId, string internalSubset, IDtdParserAdapter adapter)
1088private async Task<(string?, string?)> ParseExternalIdAsync(Token idTokenType, Token declType)
1171private async Task<Token> GetTokenAsync(bool needWhiteSpace)
1306private async Task<Token> ScanSubsetContentAsync()
1471private async Task<Token> ScanNameExpectedAsync()
1478private async Task<Token> ScanQNameExpectedAsync()
1485private async Task<Token> ScanNmtokenExpectedAsync()
1492private async Task<Token> ScanDoctype1Async()
1526private async Task<Token> ScanElement1Async()
1573private async Task<Token> ScanElement2Async()
1601private async Task<Token> ScanElement3Async()
1619private async Task<Token> ScanAttlist1Async()
1638private async Task<Token> ScanAttlist2Async()
1770private async Task<Token> ScanAttlist6Async()
1837private async Task<Token> ScanLiteralAsync(LiteralType literalType)
2069private async Task<Token> ScanNotation1Async()
2095private async Task<Token> ScanSystemIdAsync()
2108private async Task<Token> ScanEntity1Async()
2125private async Task<Token> ScanEntity2Async()
2157private async Task<Token> ScanEntity3Async()
2182private async Task<Token> ScanPublicId1Async()
2195private async Task<Token> ScanPublicId2Async()
2209private async Task<Token> ScanCondSection1Async()
2263private async Task<Token> ScanCondSection3Async()
2466private async Task<bool> ReadDataInNameAsync()
2520private async Task<bool> EatPublicKeywordAsync()
2539private async Task<bool> EatSystemKeywordAsync()
2561private async Task<int> ReadDataAsync()
2572private Task<bool> HandleEntityReferenceAsync(bool paramEntity, bool inLiteral, bool inAttribute)
2580private async Task<bool> HandleEntityReferenceAsync(XmlQualifiedName entityName, bool paramEntity, bool inLiteral, bool inAttribute)
System.Private.Xml.Linq (11)
System.Runtime (1)
System.Runtime.InteropServices.JavaScript (3)
System.Security.Cryptography (9)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (6)
19private static readonly Func<string, CancellationToken, bool, Task<byte[]?>>? s_downloadBytes = CreateDownloadBytesFunc();
31Task<byte[]?> task = DownloadAssetCore(uri, downloadTimeout, async: false);
36internal static Task<byte[]?> DownloadAssetAsync(string uri, TimeSpan downloadTimeout)
41private static async Task<byte[]?> DownloadAssetCore(string uri, TimeSpan downloadTimeout, bool async)
66Task<byte[]?> task = s_downloadBytes(uri, cts?.Token ?? default, async);
151private static Func<string, CancellationToken, bool, Task<byte[]?>>? CreateDownloadBytesFunc()
System.Security.Cryptography.Cose (18)
System\Security\Cryptography\Cose\CoseSign1Message.cs (9)
189/// <returns>A task that represents the asynchronous operation. The value of its <see cref="Task{T}.Result"/> property contains the encoded message.</returns>
204public static Task<byte[]> SignDetachedAsync(Stream detachedContent, CoseSigner signer, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
221private static async Task<byte[]> SignAsyncCore(int expectedSize, Stream content, CoseSigner signer, ReadOnlyMemory<byte> associatedData, CancellationToken cancellationToken)
332private static async Task<int> CreateCoseSign1MessageAsync(Stream content, byte[] buffer, CoseSigner signer, ReadOnlyMemory<byte> associatedData, CancellationToken cancellationToken)
785/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
816public Task<bool> VerifyDetachedAsync(AsymmetricAlgorithm key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
848/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
878public Task<bool> VerifyDetachedAsync(CoseKey key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
901private async Task<bool> VerifyAsyncCore(CoseKey key, Stream content, ReadOnlyMemory<byte> associatedData, CancellationToken cancellationToken)
System\Security\Cryptography\Cose\CoseSignature.cs (5)
459/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
490public Task<bool> VerifyDetachedAsync(AsymmetricAlgorithm key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
523/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
554public Task<bool> VerifyDetachedAsync(CoseKey key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
577private async Task<bool> VerifyAsyncCore(CoseKey key, Stream content, ReadOnlyMemory<byte> associatedData, CancellationToken cancellationToken)
System.Security.Principal.Windows (2)
System.ServiceModel.Federation (7)
System.ServiceModel.NetFramingBase (28)
System.ServiceModel.Primitives.Tests (10)
System.ServiceModel.UnixDomainSocket (2)
System.Text.Json (6)
System.Text.RegularExpressions.Generator (1)
System.Threading.Channels (3)
System.Threading.Tasks (1)
System.Threading.Tasks.Dataflow (81)
Base\DataflowBlock.cs (64)
249/// A <see cref="System.Threading.Tasks.Task{Boolean}"/> that represents the asynchronous send. If the target
251/// from the call the resulting <see cref="System.Threading.Tasks.Task{Boolean}"/> will be completed and its <see cref="System.Threading.Tasks.Task{Boolean}.Result">Result</see>
252/// property will return true. If the target declines the offered element during the call, upon return from the call the resulting <see cref="System.Threading.Tasks.Task{Boolean}"/> will
253/// be completed and its <see cref="System.Threading.Tasks.Task{Boolean}.Result">Result</see> property will return false. If the target
255/// point the Task will complete, with its <see cref="System.Threading.Tasks.Task{Boolean}.Result"/> indicating whether the message was consumed. If the target
259public static Task<bool> SendAsync<TInput>(this ITargetBlock<TInput> target, TInput item)
271/// A <see cref="System.Threading.Tasks.Task{Boolean}"/> that represents the asynchronous send. If the target
273/// from the call the resulting <see cref="System.Threading.Tasks.Task{Boolean}"/> will be completed and its <see cref="System.Threading.Tasks.Task{Boolean}.Result">Result</see>
274/// property will return true. If the target declines the offered element during the call, upon return from the call the resulting <see cref="System.Threading.Tasks.Task{Boolean}"/> will
275/// be completed and its <see cref="System.Threading.Tasks.Task{Boolean}.Result">Result</see> property will return false. If the target
277/// point the Task will complete, with its <see cref="System.Threading.Tasks.Task{Boolean}.Result"/> indicating whether the message was consumed. If the target
286public static Task<bool> SendAsync<TInput>(this ITargetBlock<TInput> target, TInput item, CancellationToken cancellationToken)
749public Task<bool> Completion { get { return _source.Task; } }
779/// A <see cref="System.Threading.Tasks.Task{TOutput}"/> that represents the asynchronous receive operation. When an item is successfully received from the source,
780/// the returned task will be completed and its <see cref="System.Threading.Tasks.Task{TOutput}.Result">Result</see> will return the received item. If an item cannot be retrieved,
784public static Task<TOutput> ReceiveAsync<TOutput>(
796/// A <see cref="System.Threading.Tasks.Task{TOutput}"/> that represents the asynchronous receive operation. When an item is successfully received from the source,
797/// the returned task will be completed and its <see cref="System.Threading.Tasks.Task{TOutput}.Result">Result</see> will return the received item. If an item cannot be retrieved,
801public static Task<TOutput> ReceiveAsync<TOutput>(
813/// A <see cref="System.Threading.Tasks.Task{TOutput}"/> that represents the asynchronous receive operation. When an item is successfully received from the source,
814/// the returned task will be completed and its <see cref="System.Threading.Tasks.Task{TOutput}.Result">Result</see> will return the received item. If an item cannot be retrieved,
821public static Task<TOutput> ReceiveAsync<TOutput>(
834/// A <see cref="System.Threading.Tasks.Task{TOutput}"/> that represents the asynchronous receive operation. When an item is successfully received from the source,
835/// the returned task will be completed and its <see cref="System.Threading.Tasks.Task{TOutput}.Result">Result</see> will return the received item. If an item cannot be retrieved,
842public static Task<TOutput> ReceiveAsync<TOutput>(
944Task<TOutput> task = ReceiveCore(source, false, timeout, cancellationToken);
971private static Task<TOutput> ReceiveCore<TOutput>(
1037private static Task<TOutput> ReceiveCoreByLinking<TOutput>(ISourceBlock<TOutput> source, int millisecondsTimeout, CancellationToken cancellationToken)
1370/// Provides a <see cref="System.Threading.Tasks.Task{TResult}"/>
1376/// A <see cref="System.Threading.Tasks.Task{Boolean}"/> that informs of whether and when
1377/// more output is available. When the task completes, if its <see cref="System.Threading.Tasks.Task{Boolean}.Result"/> is true, more output
1382public static Task<bool> OutputAvailableAsync<TOutput>(this ISourceBlock<TOutput> source)
1388/// Provides a <see cref="System.Threading.Tasks.Task{TResult}"/>
1395/// A <see cref="System.Threading.Tasks.Task{Boolean}"/> that informs of whether and when
1396/// more output is available. When the task completes, if its <see cref="System.Threading.Tasks.Task{Boolean}.Result"/> is true, more output
1401public static Task<bool> OutputAvailableAsync<TOutput>(
1409static async Task<bool> Impl(ISourceBlock<TOutput> source, CancellationToken cancellationToken)
1645/// A <see cref="System.Threading.Tasks.Task{Int32}"/> that represents the asynchronous choice.
1650/// will end with its <see cref="System.Threading.Tasks.Task{Int32}.Result"/> set to either 0 or 1 to
1661public static Task<int> Choose<T1, T2>(
1679/// A <see cref="System.Threading.Tasks.Task{Int32}"/> that represents the asynchronous choice.
1685/// will end with its <see cref="System.Threading.Tasks.Task{Int32}.Result"/> set to either 0 or 1 to
1699public static Task<int> Choose<T1, T2>(
1728/// A <see cref="System.Threading.Tasks.Task{Int32}"/> that represents the asynchronous choice.
1733/// will end with its <see cref="System.Threading.Tasks.Task{Int32}.Result"/> set to the 0-based index of the source.
1745public static Task<int> Choose<T1, T2, T3>(
1767/// A <see cref="System.Threading.Tasks.Task{Int32}"/> that represents the asynchronous choice.
1773/// will end with its <see cref="System.Threading.Tasks.Task{Int32}.Result"/> set to the 0-based index of the source.
1788public static Task<int> Choose<T1, T2, T3>(
1819private static Task<int> ChooseCore<T1, T2, T3>(
1836Task<int>? resultTask;
1869[NotNullWhen(true)] out Task<int>? task)
1904private static Task<int> ChooseCoreByLinking<T1, T2, T3>(
1927var branchTasks = new Task<int>[hasThirdSource ? 3 : 2];
1950foreach (Task<int> task in tasks)
2001private static Task<int> CreateChooseBranch<T>(
2370private List<Task<bool>>? _tempSendAsyncTaskList;
2423Task<bool> sendAsyncTask = targetObserver.SendAsyncToTarget(item);
2427_tempSendAsyncTaskList ??= new List<Task<bool>>();
2443Task<bool[]> allSendAsyncTasksConsolidated = Task.WhenAll(_tempSendAsyncTaskList);
2548Task<bool> task = SendAsyncToTarget(value);
2570internal Task<bool> SendAsyncToTarget(TInput value)
Blocks\TransformBlock.cs (6)
66public TransformBlock(Func<TInput, Task<TOutput>> transform) :
78public TransformBlock(Func<TInput, Task<TOutput>> transform, ExecutionDataflowBlockOptions dataflowBlockOptions) :
91private TransformBlock(Func<TInput, TOutput>? transformSync, Func<TInput, Task<TOutput>>? transformAsync, ExecutionDataflowBlockOptions dataflowBlockOptions)
223private void ProcessMessageWithTask(Func<TInput, Task<TOutput>> transform, KeyValuePair<TInput, long> messageWithId)
228Task<TOutput>? task = null;
268private void AsyncCompleteProcessMessageWithTask(Task<TOutput> completed, KeyValuePair<TInput, long> messageWithId)
System.Windows.Forms (10)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System.Windows.Forms.Analyzers.CSharp.Tests (1)
System.Windows.Forms.Analyzers.Tests (6)
System.Windows.Forms.Primitives.Tests (1)
System.Windows.Forms.Primitives.TestUtilities (1)
System.Windows.Forms.Tests (4)
System.Windows.Forms.UI.IntegrationTests (1)
TagHelpersWebSite (2)
Templates.Blazor.Tests (7)
Templates.Blazor.WebAssembly.Auth.Tests (7)
Templates.Blazor.WebAssembly.Tests (7)
Templates.Mvc.Tests (11)
Templates.Tests (7)
Test.Utilities (14)
TestProject.IntegrationServiceA (2)
Text.Analyzers (23)
UnitTests.Common (11)
vbc (12)
VBCSCompiler (32)
src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (8)
34internal async Task<CompletionData> ProcessAsync(
35Task<IClientConnection> clientConnectionTask,
49async Task<CompletionData> ProcessCoreAsync()
99private async Task<CompletionData> WriteBuildResponseAsync(IClientConnection clientConnection, string requestId, BuildResponse response, CompletionData completionData, CancellationToken cancellationToken)
111private async Task<CompletionData> ProcessCompilationRequestAsync(IClientConnection clientConnection, BuildRequest request, CancellationToken cancellationToken)
117var compilationTask = ProcessCompilationRequestCoreAsync(CompilerServerHost, request, buildCancellationTokenSource.Token);
163static Task<BuildResponse> ProcessCompilationRequestCoreAsync(ICompilerServerHost compilerServerHost, BuildRequest buildRequest, CancellationToken cancellationToken)
172var task = new Task<BuildResponse>(func, cancellationToken, TaskCreationOptions.LongRunning);
VBCSCompiler.UnitTests (28)
WaitFor.Frontend (1)
Wasm.Performance.ConsoleHost (4)
Wasm.Performance.Driver (1)
WebSocketSample (1)
xunit.assert (14)
Xunit.NetCore.Extensions (3)