17 types derived from Task
Microsoft.AspNetCore.Mvc.Core.Test (1)
Microsoft.AspNetCore.SignalR.Tests (1)
System.Private.CoreLib (15)
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)
321Task<TResult> f = new Task<TResult>(function, parent, cancellationToken, creationOptions, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler);
341Task<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>();
6266return new Task<TResult[]>(false, Array.Empty<TResult>(), TaskCreationOptions.None, default);
6300new Task<TResult[]>(false, Array.Empty<TResult>(), TaskCreationOptions.None, default) :
6377return new Task<TResult[]>(false, Array.Empty<TResult>(), TaskCreationOptions.None, default);
System.Threading.Tasks.Dataflow (1)
VBCSCompiler (1)
14596 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 (160)
Backchannel\ExtensionBackchannel.cs (10)
34Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull;
35Task<bool> ConfirmAsync(string promptText, bool defaultValue, CancellationToken cancellationToken);
36Task<string> PromptForStringAsync(string promptText, string? defaultValue, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken);
39Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken);
40Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken);
397public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
423public async Task<bool> ConfirmAsync(string promptText, bool defaultValue, CancellationToken cancellationToken)
441public async Task<string> PromptForStringAsync(string promptText, string? defaultValue, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken)
498public async Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken)
504public async Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
Commands\AddCommand.cs (9)
66protected override async Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
211private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> GetPackageByInteractiveFlow(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> possiblePackages, string? preferredVersion, CancellationToken cancellationToken)
240private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> GetPackageByInteractiveFlowWithNoMatchesMessage(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> possiblePackages, string? searchTerm, CancellationToken cancellationToken)
262Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken);
263Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken);
268public virtual async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
280async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForChannelPackagesAsync(
312var rootChoices = new List<(string Label, Func<CancellationToken, Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)>> Action)>();
352public virtual async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
Commands\NewCommand.cs (12)
108private async Task<ITemplate> GetProjectTemplateAsync(ParseResult parseResult, CancellationToken cancellationToken)
124protected override async Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
147Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken);
148Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken);
149Task<string> PromptForProjectNameAsync(string defaultName, CancellationToken cancellationToken);
150Task<string> PromptForOutputPath(string v, CancellationToken cancellationToken);
155public virtual async Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken)
170async Task<(NuGetPackage Package, PackageChannel Channel)> PromptForChannelPackagesAsync(
203var rootChoices = new List<(string Label, Func<CancellationToken, Task<(NuGetPackage, PackageChannel)>> Action)>();
246public virtual async Task<string> PromptForOutputPath(string path, CancellationToken cancellationToken)
255public virtual async Task<string> PromptForProjectNameAsync(string defaultName, CancellationToken cancellationToken)
266public virtual async Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken)
Commands\PublishCommandBase.cs (7)
82protected override async Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
151var pendingRun = _runner.RunAsync(
227public static async Task<bool> ProcessPublishingActivitiesAsync(IAsyncEnumerable<PublishingActivity> publishingActivities, CancellationToken cancellationToken)
240public async Task<bool> ProcessAndDisplayPublishingActivitiesAsync(IAsyncEnumerable<PublishingActivity> publishingActivities, IAppHostBackchannel backchannel, CancellationToken cancellationToken)
469private async Task<string?> HandleSingleInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
511private async Task<string?> HandleSelectInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
531private async Task<string?> HandleNumberInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
DotNet\DotNetCliRunner.cs (23)
27Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
28Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
29Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
30Task<int> CheckHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
31Task<int> TrustHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
32Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
33Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
34Task<int> BuildAsync(FileInfo projectFilePath, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
35Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
36Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
37Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
65public async Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
148public async Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
203public async Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
241public async Task<int> CheckHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
256public async Task<int> TrustHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
271public async Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
397public async Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
427public virtual async Task<int> ExecuteAsync(string[] args, IDictionary<string, string>? env, FileInfo? projectFile, DirectoryInfo workingDirectory, TaskCompletionSource<IAppHostBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
658public async Task<int> BuildAsync(FileInfo projectFilePath, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
679public async Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
728public async Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
811public async Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
Interaction\ConsoleInteractionService.cs (5)
30public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
59public async Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
83public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
183public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
Interaction\ExtensionInteractionService.cs (6)
62public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
64var task = action();
83public async Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
110public async Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
138public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
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, bool isSecret = false, bool required = false, 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 (9)
17Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
18Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
19Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
20Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
33public async Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
48public async Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
53public async Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
69private static async Task<string> ComputeNuGetConfigHashSuffixAsync(FileInfo nugetConfigFile, CancellationToken cancellationToken)
77public async Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string query, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
Templating\DotNetTemplateFactory.cs (8)
100private async Task<string[]> PromptForExtraAspireStarterOptionsAsync(ParseResult result, CancellationToken cancellationToken)
110private async Task<string[]> PromptForExtraAspireXUnitOptionsAsync(ParseResult result, CancellationToken cancellationToken)
212private async Task<TemplateResult> ApplyTemplateWithNoExtraArgsAsync(CallbackTemplate template, ParseResult parseResult, CancellationToken cancellationToken)
217private async Task<TemplateResult> ApplyTemplateAsync(CallbackTemplate template, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
333private async Task<string> GetProjectNameAsync(ParseResult parseResult, CancellationToken cancellationToken)
344private async Task<string> GetOutputPathAsync(ParseResult parseResult, Func<string, string> pathDeriver, string projectName, CancellationToken cancellationToken)
354private async Task<(NuGetPackage Package, PackageChannel Channel)> GetProjectTemplatesVersionAsync(ParseResult parseResult, CancellationToken cancellationToken)
Utils\AppHostHelper.cs (3)
17internal static async Task<(bool IsCompatibleAppHost, bool SupportsBackchannel, string? AspireHostingVersion)> CheckAppHostCompatibilityAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, AspireCliTelemetry telemetry, DirectoryInfo workingDirectory, CancellationToken cancellationToken)
53internal static async Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, AspireCliTelemetry telemetry, DirectoryInfo workingDirectory, CancellationToken cancellationToken)
68internal static async Task<int> BuildAppHostAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, DotNetCliRunnerInvocationOptions options, DirectoryInfo workingDirectory, CancellationToken cancellationToken)
Aspire.Azure.AI.OpenAI.Tests (2)
Aspire.Azure.Messaging.WebPubSub (1)
Aspire.Azure.Search.Documents (1)
Aspire.Cli.Tests (91)
Commands\AddCommandTests.cs (2)
547public override Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
556public override Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
Commands\PublishCommandPromptingIntegrationTests.cs (7)
672public Task<DashboardUrlsState> GetDashboardUrlsAsync(CancellationToken cancellationToken) =>
691public Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken) => Task.FromResult(new[] { "baseline.v2" });
735public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
752public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
772public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
790public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action) => action();
Packaging\NuGetConfigMergerTests.cs (5)
20private static async Task<FileInfo> WriteConfigAsync(DirectoryInfo dir, string content)
29public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
33public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
37public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
41public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
TestServices\TestConsoleInteractionService.cs (5)
18public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
29public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
34public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
70public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
TestServices\TestDotNetCliRunner.cs (12)
22public Func<FileInfo, bool, bool, string[], IDictionary<string, string>?, TaskCompletionSource<IAppHostBackchannel>?, DotNetCliRunnerInvocationOptions, CancellationToken, Task<int>>? RunAsyncCallback { get; set; }
26public Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
33public Task<int> BuildAsync(FileInfo projectFilePath, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
40public Task<int> CheckHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
47public Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
56public Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
72public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
79public Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
86public Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
93public Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
100public Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
107public Task<int> TrustHttpCertificateAsync(DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
TestServices\TestExtensionBackchannel.cs (9)
48public Func<string, bool, Task<bool>>? ConfirmAsyncCallback { get; set; }
51public Func<string, string?, Func<string, ValidationResult>?, bool, Task<string>>? PromptForStringAsyncCallback { get; set; }
60public Func<CancellationToken, Task<string[]>>? GetCapabilitiesAsyncCallback { get; set; }
63public Func<string, CancellationToken, Task<bool>>? HasCapabilityAsyncCallback { get; set; }
137public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull
149public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
157public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, CancellationToken cancellationToken = default)
181public Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
189public Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken)
TestServices\TestExtensionInteractionService.cs (5)
23public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action)
33public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
38public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
84public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
Utils\CliUpdateNotificationServiceTests.cs (4)
295public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
300public Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
305public Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
310public Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
Aspire.Components.Common.TestUtilities (1)
Aspire.Confluent.Kafka (2)
Aspire.Dashboard (48)
Aspire.Dashboard.Components.Tests (51)
Shared\TestDialogService.cs (29)
11private readonly Func<object, DialogParameters, Task<IDialogReference>>? _onShowDialog;
13public TestDialogService(Func<object, DialogParameters, Task<IDialogReference>>? onShowDialog = null)
20public event Func<IDialogReference, Type?, DialogParameters, object, Task<IDialogReference>>? OnShowAsync;
22public event Func<string, DialogParameters, Task<IDialogReference?>>? OnUpdateAsync;
46public Task<IDialogReference> ShowConfirmationAsync(object receiver, Func<DialogResult, Task> callback, string message, string primaryText = "Yes", string secondaryText = "No", string? title = null)
51public Task<IDialogReference> ShowConfirmationAsync(string message, string primaryText = "Yes", string secondaryText = "No", string? title = null)
68public async Task<IDialogReference> ShowDialogAsync<TData>(Type dialogComponent, TData data, DialogParameters parameters) where TData : class
73public async Task<IDialogReference> ShowDialogAsync<TDialog>(object data, DialogParameters parameters) where TDialog : IDialogContentComponent
78private async Task<IDialogReference> RunShowDialogCallbackAsync(Type dialogComponent, object data, DialogParameters parameters)
89public Task<IDialogReference> ShowDialogAsync<TDialog>(DialogParameters parameters) where TDialog : IDialogContentComponent
94public Task<IDialogReference> ShowDialogAsync(RenderFragment renderFragment, DialogParameters dialogParameters)
99public Task<IDialogReference> ShowDialogAsync<TDialog, TData>(DialogParameters<TData> parameters)
111public Task<IDialogReference> ShowErrorAsync(string message, string? title = null, string? primaryText = null)
121public Task<IDialogReference> ShowInfoAsync(string message, string? title = null, string? primaryText = null)
131public Task<IDialogReference> ShowMessageBoxAsync(DialogParameters<MessageBoxContent> parameters)
148public Task<IDialogReference> ShowPanelAsync<TData>(Type dialogComponent, TData data, DialogParameters parameters) where TData : class
153public Task<IDialogReference> ShowPanelAsync<TDialog>(object data, DialogParameters parameters) where TDialog : IDialogContentComponent
158public Task<IDialogReference> ShowPanelAsync<TDialog>(DialogParameters parameters) where TDialog : IDialogContentComponent
163public Task<IDialogReference> ShowPanelAsync<TDialog, TData>(DialogParameters<TData> parameters)
170public Task<IDialogReference> ShowPanelAsync<TData>(Type dialogComponent, DialogParameters<TData> parameters) where TData : class
190public Task<IDialogReference> ShowSplashScreenAsync(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters)
195public Task<IDialogReference> ShowSplashScreenAsync(DialogParameters<SplashScreenContent> parameters)
200public Task<IDialogReference> ShowSplashScreenAsync<T>(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent>
205public Task<IDialogReference> ShowSplashScreenAsync<T>(DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent>
210public Task<IDialogReference> ShowSplashScreenAsync(Type component, object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters)
215public Task<IDialogReference> ShowSplashScreenAsync(Type component, DialogParameters<SplashScreenContent> parameters)
225public Task<IDialogReference> ShowSuccessAsync(string message, string? title = null, string? primaryText = null)
235public Task<IDialogReference> ShowWarningAsync(string message, string? title = null, string? primaryText = null)
245public Task<IDialogReference?> UpdateDialogAsync<TData>(string id, DialogParameters<TData> parameters) where TData : class
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 (34)
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 (109)
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)
185public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, CancellationToken cancellationToken = default)
218public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, WaitBehavior waitBehavior, CancellationToken cancellationToken = default)
427/// <returns>A <see cref="Task{ResourceEvent}"/> representing the wait operation and which of the target states the resource reached.</returns>
430public async Task<ResourceEvent> WaitForResourceAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default)
439private async Task<ResourceEvent> WaitForResourceCoreAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default)
Dcp\DcpExecutor.cs (4)
1909private async Task<(List<(string Value, bool IsSensitive)>, bool)> BuildArgsAsync(ILogger resourceLogger, IResource modelResource, CancellationToken cancellationToken)
1937private async Task<List<ContainerCreateFileSystem>> BuildCreateFilesAsync(IResource modelResource, CancellationToken cancellationToken)
1967private async Task<(List<EnvVar>, bool)> BuildEnvVarsAsync(ILogger resourceLogger, IResource modelResource, CancellationToken cancellationToken)
1994private 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,
IInteractionService.cs (6)
35Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default);
47Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default);
61Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
74Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
87Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
99Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default);
InteractionService.cs (8)
35public async Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
45public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
54private async Task<InteractionResult<bool>> PromptMessageBoxCoreAsync(string title, string message, MessageBoxInteractionOptions options, CancellationToken cancellationToken)
75public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
80public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
91public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
114public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
234private async Task<bool> RunValidationAsync(Interaction interactionState, InteractionCompletionState result, CancellationToken cancellationToken)
Aspire.Hosting.Azure (36)
Aspire.Hosting.Azure.AIFoundry (2)
Aspire.Hosting.Azure.AppContainers (1)
Aspire.Hosting.Azure.AppService (1)
Aspire.Hosting.Azure.KeyVault (2)
Aspire.Hosting.Azure.Tests (29)
tests\Shared\TestInteractionService.cs (6)
18public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
23public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
28public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
33public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
48public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
55public Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
Aspire.Hosting.Docker (1)
Aspire.Hosting.Garnet.Tests (1)
Aspire.Hosting.GitHub.Models (2)
Aspire.Hosting.GitHub.Models.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.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 (1)
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.OpenAI (3)
Aspire.Hosting.OpenAI.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 (2)
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)
180public async Task<IDistributedApplicationTestingBuilder> CreateBuilderAsync(CancellationToken cancellationToken)
205public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
245public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
399public Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
488Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken = default);
Aspire.Hosting.Testing.Tests (3)
Aspire.Hosting.Tests (88)
InteractionServiceTests.cs (15)
22var resultTask = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
47var resultTask = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation", cancellationToken: cts.Token);
71var resultTask1 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
72var resultTask2 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
73var resultTask3 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
131var resultTask1 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
135var resultTask2 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
179var resultTask = interactionService.PromptInputAsync(
212var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
231var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
251var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
271var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
301var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
635var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
695var resultTask = interactionService.PromptInputsAsync("Validation Test", "Test validation", inputs, options);
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)
tests\Shared\TestInteractionService.cs (6)
18public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
23public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
28public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
33public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
48public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
55public Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
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)
312public 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 (180)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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\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);
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)
IdentitySample.PasskeyConformance (11)
IdentitySample.PasskeyUI (11)
InMemoryUserStore.cs (11)
19public Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken)
25public Task<IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken)
34public Task<TUser?> FindByIdAsync(string userId, CancellationToken cancellationToken)
37public Task<TUser?> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)
40public Task<TUser?> FindByPasskeyIdAsync(byte[] credentialId, CancellationToken cancellationToken)
43public Task<UserPasskeyInfo?> FindPasskeyAsync(TUser user, byte[] credentialId, CancellationToken cancellationToken)
46public Task<string?> GetNormalizedUserNameAsync(TUser user, CancellationToken cancellationToken)
49public Task<string> GetUserIdAsync(TUser user, CancellationToken cancellationToken)
52public Task<string?> GetUserNameAsync(TUser user, CancellationToken cancellationToken)
67public Task<IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken)
90public Task<IList<UserPasskeyInfo>> GetPasskeysAsync(TUser user, CancellationToken cancellationToken)
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 (4)
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 (47)
Http3\Http3RequestTests.cs (21)
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)
930var responseTask1 = client.SendAsync(request1, cts1.Token);
1004var responseTask1 = client.SendAsync(request1, CancellationToken.None);
1174var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1271var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1417var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1935var responseTask1 = client.SendAsync(CreateHttp3Request(HttpMethod.Get, $"https://127.0.0.1:{port}/1"), CancellationToken.None);
2044var responseTask = client.SendAsync(request1, CancellationToken.None);
2164var readTask = context.Request.Body.ReadUntilEndAsync();
2199var responseTask = client.SendAsync(request, CancellationToken.None);
2299var 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 (101)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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)
Metrics.Legacy (101)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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)
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 (41)
AuthorizationServiceExtensions.cs (8)
24/// A <see cref="Task{TResult}"/> that contains an <see cref="AuthorizationResult"/> indicating whether requirement evaluation has succeeded or failed.
27public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, object? resource, IAuthorizationRequirement requirement)
43/// A <see cref="Task{TResult}"/> that contains an <see cref="AuthorizationResult"/> indicating whether policy evaluation has succeeded or failed.
46public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, object? resource, AuthorizationPolicy policy)
61/// A <see cref="Task{TResult}"/> that contains an <see cref="AuthorizationResult"/> indicating whether policy evaluation has succeeded or failed.
64public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, AuthorizationPolicy policy)
79/// A <see cref="Task{TResult}"/> that contains an <see cref="AuthorizationResult"/> indicating whether policy evaluation has succeeded or failed.
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 (24)
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 (48)
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)
548returnType.GetGenericTypeDefinition() == typeof(Task<>))
578private static ValueTask<object?> TaskOfTToValueTaskOfObject<T>(Task<T> task)
580static async ValueTask<object?> ExecuteAwaited(Task<T> task)
1093else if (returnType == typeof(Task<object>))
1123returnType.GetGenericTypeDefinition() == typeof(Task<>))
1378static async Task<(object? FormValue, bool Successful)> TryReadBodyAsync(
1507static async Task<(object? FormValue, bool Successful)> TryReadFormAsync(
2450private static Task ExecuteTaskOfObject(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo)
2452static async Task ExecuteAwaited(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo)
2470private static Task ExecuteTaskOfTFast<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2474static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2487private static Task ExecuteTaskOfT<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2491static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2504private static Task ExecuteTaskOfString(Task<string?> task, HttpContext httpContext)
2509static async Task ExecuteAwaited(Task<string> task, HttpContext httpContext)
2639private static async Task ExecuteTaskResult<T>(Task<T?> task, HttpContext httpContext) where T : IResult
2843private static void EnsureRequestTaskOfNotNull<T>(Task<T?> task) where T : IResult
Microsoft.AspNetCore.Http.Extensions.Tests (38)
RequestDelegateFactoryTests.cs (31)
1000public static Task<BadBindAsyncStruct> BindAsync(HttpContext context, ParameterInfo parameter) =>
1006public static Task<BadBindAsyncClass> BindAsync(HttpContext context, ParameterInfo parameter) =>
1337Task<JsonTodo> TaskTestAction() => Task.FromResult<JsonTodo>(originalTodo);
1338async Task<JsonTodo> TaskTestActionAwaited()
1354new object[] { (Func<Task<JsonTodo>>)TaskTestAction},
1355new object[] { (Func<Task<JsonTodo>>)TaskTestActionAwaited},
1450Task<CustomResult> TaskTestAction() => Task.FromResult(new CustomResult(resultString));
1455static Task<CustomResult> StaticTaskTestAction() => Task.FromResult(new CustomResult("Still not enough tests!"));
1463static Task<object> StaticTaskOfIResultAsObject() => Task.FromResult<object>(new CustomResult("Still not enough tests!"));
1468Task<StructResult> TaskTestStructAction() => Task.FromResult(new StructResult(resultString));
1475new object[] { (Func<Task<CustomResult>>)TaskTestAction},
1480new object[] { (Func<Task<CustomResult>>)StaticTaskTestAction},
1486new object[] { (Func<Task<object>>)StaticTaskOfIResultAsObject},
1491new object[] { (Func<Task<StructResult>>)TaskTestStructAction },
1521Task<bool?>? TaskBoolAction() => null;
1522Task<IResult?>? TaskNullAction() => null;
1523Task<IResult?> TaskTestAction() => Task.FromResult<IResult?>(null);
1529new object[] { (Func<Task<IResult?>?>)TaskNullAction, "The IResult in Task<IResult> response must not be null." },
1530new object[] { (Func<Task<bool?>?>)TaskBoolAction, "The Task returned by the Delegate must not be null." },
1531new object[] { (Func<Task<IResult?>>)TaskTestAction, "The IResult returned by the Delegate must not be null." },
2272async Task<string> Yield()
2283async Task<object> Yield()
2348Task<FSharp.Core.Unit> TaskOfUnitMethod()
2372async Task<FSharp.Core.Unit> Yield()
2385new object[] { (Func<Task<FSharp.Core.Unit>>)TaskOfUnitMethod },
2474Task<TodoStruct> TaskOfStructMethod()
2479async Task<TodoStruct> TaskOfStructWithYieldMethod()
2494async Task<TodoStruct> Yield()
2505new object[] { (Func<Task<TodoStruct>>)TaskOfStructMethod },
2506new object[] { (Func<Task<TodoStruct>>)TaskOfStructWithYieldMethod },
3881public 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 (74)
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 (42)
123public virtual async Task<ClaimsPrincipal> CreateUserPrincipalAsync(TUser user) => await ClaimsFactory.CreateAsync(user);
145public virtual async Task<bool> CanSignInAsync(TUser user)
187private async Task<(bool success, bool? isPersistent)> RefreshSignInCoreAsync(TUser user)
333public virtual async Task<TUser?> ValidateSecurityStampAsync(ClaimsPrincipal? principal)
356public virtual async Task<TUser?> ValidateTwoFactorSecurityStampAsync(ClaimsPrincipal? principal)
378public virtual async Task<bool> ValidateSecurityStampAsync(TUser? user, string? securityStamp)
393public virtual async Task<SignInResult> PasswordSignInAsync(TUser user, string password,
426public virtual async Task<SignInResult> PasswordSignInAsync(string userName, string password,
448public virtual async Task<SignInResult> CheckPasswordSignInAsync(TUser user, string password, bool lockoutOnFailure)
466private async Task<SignInResult> CheckPasswordSignInCoreAsync(TUser user, string password, bool lockoutOnFailure)
517public virtual async Task<string> MakePasskeyCreationOptionsAsync(PasskeyUserEntity userEntity)
532public virtual async Task<string> MakePasskeyRequestOptionsAsync(TUser? user)
553public virtual async Task<PasskeyAttestationResult> PerformPasskeyAttestationAsync(string credentialJson)
597public virtual async Task<PasskeyAssertionResult<TUser>> PerformPasskeyAssertionAsync(string credentialJson)
640public virtual async Task<SignInResult> PasskeySignInAsync(string credentialJson)
657private async Task<SignInResult> PasskeySignInCoreAsync(string credentialJson)
698private async Task<PasskeyAuthenticationInfo?> RetrievePasskeyAuthenticationInfoAsync()
702async Task<PasskeyAuthenticationInfo?> RetrievePasskeyInfoCoreAsync()
735public virtual async Task<bool> IsTwoFactorClientRememberedAsync(TUser user)
793public virtual async Task<SignInResult> TwoFactorRecoveryCodeSignInAsync(string recoveryCode)
810private async Task<SignInResult> TwoFactorRecoveryCodeSignInCoreAsync(string recoveryCode)
828private async Task<SignInResult> DoTwoFactorSignInAsync(TUser user, TwoFactorAuthenticationInfo twoFactorInfo, bool isPersistent, bool rememberClient)
875public virtual async Task<SignInResult> TwoFactorAuthenticatorSignInAsync(string code, bool isPersistent, bool rememberClient)
892private async Task<SignInResult> TwoFactorAuthenticatorSignInCoreAsync(string code, bool isPersistent, bool rememberClient)
940public virtual async Task<SignInResult> TwoFactorSignInAsync(string provider, string code, bool isPersistent, bool rememberClient)
957private async Task<SignInResult> TwoFactorSignInCoreAsync(string provider, string code, bool isPersistent, bool rememberClient)
999public virtual async Task<TUser?> GetTwoFactorAuthenticationUserAsync()
1018public virtual Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent)
1030public virtual async Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1047private async Task<SignInResult> ExternalLoginSignInCoreAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1067public virtual async Task<IEnumerable<AuthenticationScheme>> GetExternalAuthenticationSchemesAsync()
1079public virtual async Task<ExternalLoginInfo?> GetExternalLoginInfoAsync(string? expectedXsrf = null)
1117public virtual async Task<IdentityResult> UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo externalLogin)
1177internal async Task<ClaimsPrincipal> StoreRememberClient(TUser user)
1197public virtual async Task<bool> IsTwoFactorEnabledAsync(TUser user)
1211protected virtual async Task<SignInResult> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
1251private async Task<TwoFactorAuthenticationInfo?> RetrieveTwoFactorInfoAsync()
1288protected virtual async Task<bool> IsLockedOut(TUser user)
1298protected virtual Task<SignInResult> LockedOut(TUser user)
1309protected virtual async Task<SignInResult?> PreSignInCheck(TUser user)
1341private async Task<IdentityResult> ResetLockoutWithResult(TUser user)
1358if (resetLockoutTask is Task<IdentityResult> resultTask)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (65)
UserOnlyStore.cs (20)
192public override async Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
208public override async Task<IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
234public override async Task<IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
260public override Task<TUser?> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
276public override Task<TUser?> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = default(CancellationToken))
298protected override Task<TUser?> FindUserAsync(TKey userId, CancellationToken cancellationToken)
311protected override Task<TUserLogin?> FindUserLoginAsync(TKey userId, string loginProvider, string providerKey, CancellationToken cancellationToken)
323protected override Task<TUserLogin?> FindUserLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)
333/// <returns>A <see cref="Task{TResult}"/> that contains the claims granted to a user.</returns>
334public override async Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
453public override async Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
472public override async Task<TUser?> FindByLoginAsync(string loginProvider, string providerKey,
493public override Task<TUser?> FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken))
509public override async Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
532protected override Task<TUserToken?> FindTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken)
592private Task<TUserPasskey?> FindUserPasskeyAsync(TKey userId, byte[] credentialId, CancellationToken cancellationToken)
605private Task<TUserPasskey?> FindUserPasskeyByIdAsync(byte[] credentialId, CancellationToken cancellationToken)
649public virtual async Task<IList<UserPasskeyInfo>> GetPasskeysAsync(TUser user, CancellationToken cancellationToken)
686public virtual async Task<TUser?> FindByPasskeyIdAsync(byte[] credentialId, CancellationToken cancellationToken)
706public virtual async Task<UserPasskeyInfo?> FindPasskeyAsync(TUser user, byte[] credentialId, CancellationToken cancellationToken)
UserStore.cs (27)
196public override async Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
212public override async Task<IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
238public override async Task<IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
264public override Task<TUser?> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
280public override Task<TUser?> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = default(CancellationToken))
302protected override Task<TRole?> FindRoleAsync(string normalizedRoleName, CancellationToken cancellationToken)
314protected override Task<TUserRole?> FindUserRoleAsync(TKey userId, TKey roleId, CancellationToken cancellationToken)
325protected override Task<TUser?> FindUserAsync(TKey userId, CancellationToken cancellationToken)
338protected override Task<TUserLogin?> FindUserLoginAsync(TKey userId, string loginProvider, string providerKey, CancellationToken cancellationToken)
350protected override Task<TUserLogin?> FindUserLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)
407/// <returns>A <see cref="Task{TResult}"/> that contains the roles the user is a member of.</returns>
408public override async Task<IList<string>> GetRolesAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
427/// <returns>A <see cref="Task{TResult}"/> containing a flag indicating if the specified user is a member of the given group. If the
429public override async Task<bool> IsInRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken))
450/// <returns>A <see cref="Task{TResult}"/> that contains the claims granted to a user.</returns>
451public override async Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
570public override async Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
589public override async Task<TUser?> FindByLoginAsync(string loginProvider, string providerKey,
610public override Task<TUser?> FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken = default(CancellationToken))
626public override async Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
649public override async Task<IList<TUser>> GetUsersInRoleAsync(string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken))
677protected override Task<TUserToken?> FindTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken)
737private Task<TUserPasskey?> FindUserPasskeyAsync(TKey userId, byte[] credentialId, CancellationToken cancellationToken)
750private Task<TUserPasskey?> FindUserPasskeyByIdAsync(byte[] credentialId, CancellationToken cancellationToken)
793public virtual async Task<IList<UserPasskeyInfo>> GetPasskeysAsync(TUser user, CancellationToken cancellationToken)
830public virtual async Task<TUser?> FindByPasskeyIdAsync(byte[] credentialId, CancellationToken cancellationToken)
850public virtual async Task<UserPasskeyInfo?> FindPasskeyAsync(TUser user, byte[] credentialId, 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 (138)
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 (78)
1103public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<PocoUser> manager, PocoUser user)
1108public Task<string> GenerateAsync(string purpose, UserManager<PocoUser> manager, PocoUser user)
1113public Task<bool> ValidateAsync(string purpose, string token, UserManager<PocoUser> manager, PocoUser user)
1160public Task<IdentityResult> CreateAsync(PocoUser user, CancellationToken cancellationToken)
1165public Task<IdentityResult> DeleteAsync(PocoUser user, CancellationToken cancellationToken)
1175public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken)
1180public Task<PocoUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)
1185public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken)
1190public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken)
1195public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken)
1210public Task<IdentityResult> UpdateAsync(PocoUser user, CancellationToken cancellationToken)
1552public Task<IdentityResult> ValidateAsync(UserManager<TUser> manager, TUser user, string password)
1568public Task<IList<Claim>> GetClaimsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1593public Task<string> GetEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1598public Task<bool> GetEmailConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1608public Task<PocoUser> FindByEmailAsync(string email, CancellationToken cancellationToken = default(CancellationToken))
1613public Task<DateTimeOffset?> GetLockoutEndDateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1623public Task<int> IncrementAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1633public Task<int> GetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1638public Task<bool> GetLockoutEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1658public Task<IList<UserLoginInfo>> GetLoginsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1663public Task<PocoUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken))
1677public Task<IdentityResult> CreateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1682public Task<IdentityResult> UpdateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1687public Task<IdentityResult> DeleteAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1692public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
1697public Task<PocoUser> FindByNameAsync(string userName, CancellationToken cancellationToken = default(CancellationToken))
1707public Task<string> GetPasswordHashAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1712public Task<bool> HasPasswordAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1722public Task<string> GetPhoneNumberAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1727public Task<bool> GetPhoneNumberConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1747public Task<IList<string>> GetRolesAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1752public Task<bool> IsInRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken))
1762public Task<string> GetSecurityStampAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1772public Task<bool> GetTwoFactorEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1777public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1782public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1787public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1797public Task<IList<PocoUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
1802public Task<IList<PocoUser>> GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken = default(CancellationToken))
1807public Task<string> GetNormalizedEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1822public Task<IList<UserPasskeyInfo>> GetPasskeysAsync(PocoUser user, CancellationToken cancellationToken)
1827public Task<PocoUser> FindByPasskeyIdAsync(byte[] credentialId, CancellationToken cancellationToken)
1832public Task<UserPasskeyInfo> FindPasskeyAsync(PocoUser user, byte[] credentialId, CancellationToken cancellationToken)
1847public Task<string> GenerateAsync(string purpose, UserManager<PocoUser> manager, PocoUser user)
1852public Task<bool> ValidateAsync(string purpose, string token, UserManager<PocoUser> manager, PocoUser user)
1857public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<PocoUser> manager, PocoUser user)
1874public Task<IList<Claim>> GetClaimsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1899public Task<string> GetEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1904public Task<bool> GetEmailConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1914public Task<PocoUser> FindByEmailAsync(string email, CancellationToken cancellationToken = default(CancellationToken))
1919public Task<DateTimeOffset?> GetLockoutEndDateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1929public Task<int> IncrementAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1939public Task<int> GetAccessFailedCountAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1944public Task<bool> GetLockoutEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1964public Task<IList<UserLoginInfo>> GetLoginsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1969public Task<PocoUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken))
1979public Task<string> GetUserIdAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1984public Task<string> GetUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1994public Task<PocoUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
1999public Task<PocoUser> FindByNameAsync(string userName, CancellationToken cancellationToken = default(CancellationToken))
2009public Task<string> GetPasswordHashAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
2014public Task<bool> HasPasswordAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
2024public Task<string> GetPhoneNumberAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
2029public Task<bool> GetPhoneNumberConfirmedAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
2044public Task<bool> GetTwoFactorEnabledAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
2059public Task<IList<string>> GetRolesAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
2064public Task<bool> IsInRoleAsync(PocoUser user, string roleName, CancellationToken cancellationToken = default(CancellationToken))
2069public Task<string> GetNormalizedUserNameAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
2079public Task<IList<PocoUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
2084public Task<IList<PocoUser>> GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken = default(CancellationToken))
2089Task<IdentityResult> IUserStore<PocoUser>.CreateAsync(PocoUser user, CancellationToken cancellationToken)
2094Task<IdentityResult> IUserStore<PocoUser>.UpdateAsync(PocoUser user, CancellationToken cancellationToken)
2099Task<IdentityResult> IUserStore<PocoUser>.DeleteAsync(PocoUser user, CancellationToken cancellationToken)
2104public Task<string> GetNormalizedEmailAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
2119public Task<IList<UserPasskeyInfo>> GetPasskeysAsync(PocoUser user, CancellationToken cancellationToken)
2124public Task<PocoUser> FindByPasskeyIdAsync(byte[] credentialId, CancellationToken cancellationToken)
2129public Task<UserPasskeyInfo> FindPasskeyAsync(PocoUser user, byte[] credentialId, CancellationToken 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 (25)
Services\Schemas\OpenApiSchemaService.cs (2)
230internal async Task<OpenApiSchema> GetOrCreateUnresolvedSchemaAsync(OpenApiDocument? document, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
249internal async Task<IOpenApiSchema> GetOrCreateSchemaAsync(OpenApiDocument document, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.OpenApi.Tests (4)
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.Tasks.CodeAnalysis (10)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (10)
Microsoft.CodeAnalysis (82)
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 (211)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (5)
65private async Task<Document> ConvertToEqualsAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
80private async Task<Document> CallOverloadWithEqualityComparerAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
116private static async Task<Document> CallOverloadWithEqualityComparerAsync(Document document, SyntaxNode nodeToReplace, IMethodSymbol? methodSymbol,
187private async Task<Document> EnsureEqualsCorrectAsync(Document document, SemanticModel semanticModel, IInvocationOperation invocationOperation, CancellationToken cancellationToken)
257private static async Task<Document> ConvertToEqualsAsync(Document document, SemanticModel semanticModel, IBinaryOperation binaryOperation, CancellationToken cancellationToken)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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\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.AnalyzerUtilities (99)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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)
Microsoft.CodeAnalysis.BannedApiAnalyzers (185)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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\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.CodeStyle (88)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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)
Microsoft.CodeAnalysis.CodeStyle.Fixes (225)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (4)
346? new Func<CancellationToken, Task<Solution>>(cancellationToken => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, cancellationToken))
374private async Task<Solution> FixAsync(
402private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken)
411private static async Task<(string argumentNameSuggestion, bool isNamed)> GetNameSuggestionForArgumentAsync(
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (6)
301static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey)
314private static async Task<Document> AddEditsAsync(
380private static Task<Document> TakeTopAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
383private static Task<Document> TakeBottomAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
386private static Task<Document> TakeBothAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
392private 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(
889async Task<bool> TryRemoveUnusedLocalAsync(TLocalDeclarationStatementSyntax newDecl, TLocalDeclarationStatementSyntax originalDecl)
913private 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 (58)
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 (271)
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)
274private readonly Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution = createChangedSolution;
276protected 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)
571protected override Task<Workspace> CreateWorkspaceImplAsync()
611public Task<bool> IsRefineOptionEnabledAsync()
614public Task<bool> IsCodeAnalysisOptionEnabledAsync()
617public Task<bool> IsOnTheFlyDocsOptionEnabledAsync()
620public Task<bool> IsGenerateDocumentationCommentOptionEnabledAsync()
623public Task<bool> IsImplementNotImplementedExceptionEnabledAsync()
643public Task<ImmutableArray<string>> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken)
646public Task<ImmutableArray<Diagnostic>> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray<string> promptTitles, CancellationToken cancellationToken)
649public Task<(string responseString, bool isQuotaExceeded)> GetOnTheFlyDocsAsync(string symbolSignature, ImmutableArray<string> declarationCode, string language, CancellationToken cancellationToken)
652public Task<bool> IsAvailableAsync(CancellationToken cancellationToken)
655public Task<bool> IsFileExcludedAsync(string filePath, CancellationToken cancellationToken)
661Task<(Dictionary<string, string>? responseDictionary, bool isQuotaExceeded)> ICopilotCodeAnalysisService.GetDocumentationCommentAsync(DocumentationCommentProposal proposal, CancellationToken cancellationToken)
664public Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsAsync(
695public Task<bool> IsImplementNotImplementedExceptionsAvailableAsync(CancellationToken cancellationToken)
700public Task<string> GetOnTheFlyDocsPromptAsync(OnTheFlyDocsInfo onTheFlyDocsInfo, CancellationToken cancellationToken)
705public 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 (275)
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)
96Func<ITextSnapshot, IUIThreadOperationContext, Task<Document?>> getCurrentDocumentAsync,
97Func<Document, CancellationToken, Task<Document>> getChangedDocumentAsync)
112Func<ITextSnapshot, IUIThreadOperationContext, Task<Document?>> getCurrentDocumentAsync,
113Func<Document, CancellationToken, Task<Document>> getChangedDocumentAsync)
Preview\AbstractPreviewFactoryService.cs (16)
249public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedDocumentPreviewViewAsync(Document document, CancellationToken cancellationToken)
272private async Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedTextDocumentPreviewViewAsync<TDocument>(
292public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedDocumentPreviewViewAsync(Document document, double zoomLevel, CancellationToken cancellationToken)
300public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedAdditionalDocumentPreviewViewAsync(TextDocument document, double zoomLevel, CancellationToken cancellationToken)
308public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedAnalyzerConfigDocumentPreviewViewAsync(TextDocument document, double zoomLevel, CancellationToken cancellationToken)
316public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedDocumentPreviewViewAsync(Document document, CancellationToken cancellationToken)
339private async Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedTextDocumentPreviewViewAsync<TDocument>(
369public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedDocumentPreviewViewAsync(Document document, double zoomLevel, CancellationToken cancellationToken)
377public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedAdditionalDocumentPreviewViewAsync(TextDocument document, double zoomLevel, CancellationToken cancellationToken)
385public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedAnalyzerConfigDocumentPreviewViewAsync(TextDocument document, double zoomLevel, CancellationToken cancellationToken)
393public Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedDocumentPreviewViewAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken)
396public async Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedDocumentPreviewViewAsync(Document oldDocument, Document newDocument, double zoomLevel, CancellationToken cancellationToken)
479private async Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedAdditionalOrAnalyzerConfigDocumentPreviewViewAsync(
529public Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedAdditionalDocumentPreviewViewAsync(TextDocument oldDocument, TextDocument newDocument, double zoomLevel, CancellationToken cancellationToken)
535public Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedAnalyzerConfigDocumentPreviewViewAsync(TextDocument oldDocument, TextDocument newDocument, double zoomLevel, CancellationToken cancellationToken)
628protected abstract Task<TDifferenceViewer> CreateDifferenceViewAsync(IDifferenceBuffer diffBuffer, ITextViewRoleSet previewRoleSet, DifferenceViewMode mode, double zoomLevel, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (34)
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 (46)
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 (60)
Cohost\Handlers\InlayHints.cs (6)
23public static Task<LSP.InlayHint[]?> GetInlayHintsAsync(Document document, LSP.TextDocumentIdentifier textDocumentIdentifier, LSP.Range range, bool displayAllOverride, CancellationToken cancellationToken)
29public static Task<LSP.InlayHint[]?> GetInlayHintsAsync(Document document, LSP.TextDocumentIdentifier textDocumentIdentifier, LSP.Range range, bool displayAllOverride, InlayHintCacheWrapper cacheWrapper, CancellationToken cancellationToken)
34private static Task<LSP.InlayHint[]?> GetInlayHintsAsync(Document document, LSP.TextDocumentIdentifier textDocumentIdentifier, LSP.Range range, bool displayAllOverride, InlayHintCache cache, CancellationToken cancellationToken)
46public static Task<LSP.InlayHint> ResolveInlayHintAsync(Document document, LSP.InlayHint request, CancellationToken cancellationToken)
52public static Task<LSP.InlayHint> ResolveInlayHintAsync(Document document, LSP.InlayHint request, InlayHintCacheWrapper cacheWrapper, CancellationToken cancellationToken)
57private static Task<LSP.InlayHint> ResolveInlayHintAsync(Document document, LSP.InlayHint request, InlayHintCache cache, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.Xaml (12)
Microsoft.CodeAnalysis.Features (1266)
AddImport\SymbolReferenceFinder.cs (17)
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);
142foreach (var task in 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)
24Task<CodeFixCollection?> GetMostSevereFixAsync(TextDocument document, TextSpan range, ICodeActionRequestPriorityProvider priorityProvider, CancellationToken cancellationToken);
26Task<CodeFixCollection?> GetDocumentFixAllForIdInSpanAsync(TextDocument document, TextSpan textSpan, string diagnosticId, DiagnosticSeverity severity, CancellationToken cancellationToken);
27Task<TDocument> ApplyCodeFixesForSpecificDiagnosticIdAsync<TDocument>(TDocument document, string diagnosticId, DiagnosticSeverity severity, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
37public static Task<ImmutableArray<CodeFixCollection>> GetFixesAsync(this ICodeFixService service, TextDocument document, TextSpan range, CancellationToken cancellationToken)
40public 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 (10)
44private static async Task<T?> FindAsync<T>(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
45Func<CodeLensFindReferencesProgress, Task<T>> onResults, Func<CodeLensFindReferencesProgress, Task<T>> onCapped,
91public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults, CancellationToken cancellationToken)
103private static async Task<ReferenceLocationDescriptorAndDocument> GetDescriptorOfEnclosingSymbolAsync(Solution solution, Location location, CancellationToken cancellationToken)
199public async Task<ImmutableArray<ReferenceLocationDescriptorAndDocument>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
214public async Task<ImmutableArray<ReferenceLocationDescriptor>> MapReferenceLocationsAsync(Solution solution, ImmutableArray<ReferenceLocationDescriptorAndDocument> referenceLocations, ClassificationOptions classificationOptions, CancellationToken cancellationToken)
373private static async Task<ReferenceMethodDescriptor> TryGetMethodDescriptorAsync(Location commonLocation, Solution solution, CancellationToken cancellationToken)
387public Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
403public async Task<string> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CodeLens\ICodeLensReferencesService.cs (5)
24Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, CancellationToken cancellationToken);
29Task<ImmutableArray<ReferenceLocationDescriptorAndDocument>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
34Task<ImmutableArray<ReferenceLocationDescriptor>> MapReferenceLocationsAsync(Solution solution, ImmutableArray<ReferenceLocationDescriptorAndDocument> referenceLocations, ClassificationOptions classificationOptions, CancellationToken cancellationToken);
39Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
44Task<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)
40public abstract Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken);
42public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken);
44public abstract Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
94protected abstract Task<SyntaxNode?> TryGetApplicableContainerFromSpanAsync(Document document, TextSpan span, CancellationToken cancellationToken);
107protected abstract Task<ImmutableArray<(DocumentId id, SyntaxNode container)>> GetValidContainersFromAllLinkedDocumentsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken);
115public override async Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken)
126public override async Task<Solution?> TryChangeTopLevelNamespacesAsync(
171static async Task<ImmutableArray<SyntaxNode>> GetTopLevelNamespacesAsync(Document document, CancellationToken cancellationToken)
182public override async Task<Solution> ChangeNamespaceAsync(
269protected async Task<ImmutableArray<(DocumentId, SyntaxNode)>> TryGetApplicableContainersFromAllDocumentsAsync(
312protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken)
324protected async Task<bool> ContainsPartialTypeWithMultipleDeclarationsAsync(
367private async Task<ImmutableArray<ISymbol>> GetDeclaredSymbolsInContainerAsync(
428private 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)
77public 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)
31protected abstract Task<ImmutableArray<SymbolAndSelectionInfo>> GetSymbolsAsync(
299internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
339private async Task<ImmutableArray<CompletionItem>> GetItemsAsync(
382protected virtual Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken)
410private async Task<ImmutableArray<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)>> GetPerContextSymbolsAsync(
438protected async Task<ImmutableArray<SymbolAndSelectionInfo>> TryGetSymbolsForContextAsync(
469public 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(
EncapsulateField\AbstractEncapsulateFieldService.cs (10)
41protected abstract Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken);
42protected abstract Task<ImmutableArray<IFieldSymbol>> GetFieldsAsync(Document document, TextSpan span, CancellationToken cancellationToken);
45public async Task<EncapsulateFieldResult?> EncapsulateFieldsInSpanAsync(Document document, TextSpan span, bool useDefaultBehavior, CancellationToken cancellationToken)
58public async Task<ImmutableArray<CodeAction>> GetEncapsulateFieldCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken)
110public async Task<Solution> EncapsulateFieldsAsync(
141private async Task<Solution> EncapsulateFieldsInCurrentProcessAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken)
167private async Task<Solution?> EncapsulateFieldAsync(
230private async Task<Solution> UpdateReferencesAsync(
275private static async Task<Solution> RenameAsync(
316protected 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\ISymbolDisplayService.cs (4)
15Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default);
16Task<IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>> ToDescriptionGroupsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken = default);
23public Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default)
26public async Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, 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)
20public static async Task<Document> ReplaceNodeAsync<TNode>(this Document document, TNode oldNode, TNode newNode, CancellationToken cancellationToken)
42public static async Task<Document> ReplaceNodesAsync(this Document document,
52public static async Task<ImmutableArray<T>> GetUnionItemsFromDocumentAndLinkedDocumentsAsync<T>(
55Func<Document, Task<ImmutableArray<T>>> getItemsWorker)
71public static async Task<bool> IsValidContextForDocumentOrLinkedDocumentsAsync(
73Func<Document, CancellationToken, Task<bool>> contextChecker,
94public static async Task<NamingRule> GetApplicableNamingRuleAsync(this Document document, ISymbol symbol, CancellationToken cancellationToken)
106public 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)
33public abstract Task<string?> GetContainingClassNameAsync(Document document, int position, CancellationToken cancellationToken);
39public static async Task<string?> GetSimplifiedTypeNameAsync(Document document, TextSpan fieldSpan, string fullyQualifiedTypeName, SimplifierOptions simplifierOptions, CancellationToken cancellationToken)
57public async Task<string?> GetSwitchExpansionAsync(Document document, TextSpan caseGenerationLocation, TextSpan switchExpressionLocation, SimplifierOptions simplifierOptions, CancellationToken cancellationToken)
121protected abstract Task<ITypeSymbol?> GetEnumSymbolAsync(Document document, TextSpan switchExpressionSpan, CancellationToken cancellationToken);
123protected abstract Task<(Document, TextSpan)> GetDocumentWithEnumCaseAsync(Document document, string fullyQualifiedTypeName, string firstEnumMemberName, TextSpan caseGenerationLocation, CancellationToken cancellationToken);
125private async Task<string?> GetSimplifiedEnumNameAsync(
141private 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)
346? new Func<CancellationToken, Task<Solution>>(cancellationToken => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, cancellationToken))
374private async Task<Solution> FixAsync(
402private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken)
411private static async Task<(string argumentNameSuggestion, bool isNamed)> GetNameSuggestionForArgumentAsync(
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (6)
301static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey)
314private static async Task<Document> AddEditsAsync(
380private static Task<Document> TakeTopAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
383private static Task<Document> TakeBottomAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
386private static Task<Document> TakeBothAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken)
392private 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(
889async Task<bool> TryRemoveUnusedLocalAsync(TLocalDeclarationStatementSyntax newDecl, TLocalDeclarationStatementSyntax originalDecl)
913private 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 (2)
Microsoft.CodeAnalysis.Features.UnitTests (2)
Microsoft.CodeAnalysis.InteractiveHost (77)
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 (40)
Microsoft.CodeAnalysis.LanguageServer.Protocol (196)
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)
226public async Task<(Workspace?, Solution?)> GetLspSolutionInfoAsync(CancellationToken cancellationToken)
244public async Task<(Workspace?, Solution?, TextDocument?)> GetLspDocumentInfoAsync(TextDocumentIdentifier textDocumentIdentifier, CancellationToken cancellationToken)
321private async Task<ImmutableArray<(Workspace workspace, Solution Solution, bool IsForked)>> GetLspSolutionsAsync(CancellationToken cancellationToken)
346async Task<(Solution Solution, bool IsForked)> GetLspSolutionForWorkspaceAsync(Workspace workspace, CancellationToken cancellationToken)
509private async Task<bool> DoesAllTextMatchWorkspaceSolutionAsync(ImmutableDictionary<DocumentUri, ImmutableArray<TextDocument>> documentsInWorkspace, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (106)
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)
2071var resultTask = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, triggerConnectionClose: false);
2099var resultTask = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, triggerConnectionClose: false);
2128var resultTask = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, triggerConnectionClose: false);
2155var resultTaskOne = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, category: PullDiagnosticCategories.WorkspaceDocumentsAndProject, triggerConnectionClose: false);
2156var resultTaskTwo = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, category: PullDiagnosticCategories.EditAndContinue, triggerConnectionClose: false);
HandlerTests.cs (11)
156var response = Task.FromException<TestConfigurableResponse>(new InvalidOperationException(nameof(HandlerTests)));
184var response = Task.FromException<TestConfigurableResponse>(new StreamJsonRpc.LocalRpcException(nameof(HandlerTests)) { ErrorCode = LspErrorCodes.ContentModified });
212var response = Task.FromException<TestConfigurableResponse>(new InvalidOperationException(nameof(HandlerTests)));
242var response = Task.FromException<TestConfigurableResponse>(new OperationCanceledException(nameof(HandlerTests)));
270var response = Task.FromException<TestConfigurableResponse>(new OperationCanceledException(nameof(HandlerTests)));
319public Task<string> HandleRequestAsync(TestRequestTypeOne request, RequestContext context, CancellationToken cancellationToken)
341public Task<string> HandleRequestAsync(TestRequestTypeOne request, RequestContext context, CancellationToken cancellationToken)
358public Task<string> HandleRequestAsync(RequestContext context, CancellationToken cancellationToken)
441public Task<string> HandleRequestAsync(TestRequestTypeOne request, RequestContext context, CancellationToken cancellationToken)
465public Task<string> HandleRequestAsync(TestRequestTypeTwo request, RequestContext context, CancellationToken cancellationToken)
484public Task<string> HandleRequestAsync(RequestContext context, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (14)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (185)
Microsoft.CodeAnalysis.PublicApiAnalyzers (98)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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)
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 (98)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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)
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Microsoft.CodeAnalysis.Scripting (34)
Script.cs (19)
164internal Task<object> EvaluateAsync(object globals = null, CancellationToken cancellationToken = default(CancellationToken))
167internal abstract Task<object> CommonEvaluateAsync(object globals, CancellationToken cancellationToken);
178public Task<ScriptState> RunAsync(object globals, CancellationToken cancellationToken)
194public Task<ScriptState> RunAsync(object globals = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
197internal abstract Task<ScriptState> CommonRunAsync(object globals, Func<Exception, bool> catchException, CancellationToken cancellationToken);
207public Task<ScriptState> RunFromAsync(ScriptState previousState, CancellationToken cancellationToken)
222public Task<ScriptState> RunFromAsync(ScriptState previousState, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
225internal abstract Task<ScriptState> CommonRunFromAsync(ScriptState previousState, Func<Exception, bool> catchException, CancellationToken cancellationToken);
342private Func<object[], Task<T>> _lazyExecutor;
377internal override Task<object> CommonEvaluateAsync(object globals, CancellationToken cancellationToken)
380internal override Task<ScriptState> CommonRunAsync(object globals, Func<Exception, bool> catchException, CancellationToken cancellationToken)
383internal override Task<ScriptState> CommonRunFromAsync(ScriptState previousState, Func<Exception, bool> catchException, CancellationToken cancellationToken)
387private Func<object[], Task<T>> GetExecutor(CancellationToken cancellationToken)
454internal new Task<T> EvaluateAsync(object globals = null, CancellationToken cancellationToken = default(CancellationToken))
468public new Task<ScriptState<T>> RunAsync(object globals, CancellationToken cancellationToken)
486public new Task<ScriptState<T>> RunAsync(object globals = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
529public new Task<ScriptState<T>> RunFromAsync(ScriptState previousState, CancellationToken cancellationToken)
546public new Task<ScriptState<T>> RunFromAsync(ScriptState previousState, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
574private 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 (25)
ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
Microsoft.CodeAnalysis.UnitTests (10)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (874)
CodeActions\CodeAction.cs (46)
123static codeAction => new Func<CancellationToken, Task<IEnumerable<CodeActionOperation>>>(codeAction.ComputeOperationsAsync).Method.DeclaringType != typeof(CodeAction));
131static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction));
232public Task<ImmutableArray<CodeActionOperation>> GetOperationsAsync(CancellationToken cancellationToken)
238public Task<ImmutableArray<CodeActionOperation>> GetOperationsAsync(
244private protected virtual async Task<ImmutableArray<CodeActionOperation>> GetOperationsCoreAsync(
260public Task<ImmutableArray<CodeActionOperation>> GetPreviewOperationsAsync(CancellationToken cancellationToken)
263internal async Task<ImmutableArray<CodeActionOperation>> GetPreviewOperationsAsync(
282protected virtual async Task<IEnumerable<CodeActionOperation>> ComputeOperationsAsync(CancellationToken cancellationToken)
298protected virtual async Task<ImmutableArray<CodeActionOperation>> ComputeOperationsAsync(
323protected virtual async Task<IEnumerable<CodeActionOperation>> ComputePreviewOperationsAsync(CancellationToken cancellationToken)
332protected virtual async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken)
344protected virtual async Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
361internal async Task<Solution> GetRequiredChangedSolutionAsync(IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
380protected virtual Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
396protected virtual Task<Document> GetChangedDocumentAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
402internal async Task<Solution?> GetChangedSolutionInternalAsync(
412internal Task<Document> GetChangedDocumentInternalAsync(CancellationToken cancellation)
422protected Task<ImmutableArray<CodeActionOperation>> PostProcessAsync(IEnumerable<CodeActionOperation> operations, CancellationToken cancellationToken)
426internal async Task<ImmutableArray<CodeActionOperation>> PostProcessAsync(
453protected Task<Solution> PostProcessChangesAsync(Solution changedSolution, CancellationToken cancellationToken)
465protected virtual async Task<Document> PostProcessChangesAsync(Document document, CancellationToken cancellationToken)
486public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey)
490internal static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey)
493/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?)"/>
496public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
499/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?, CodeActionPriority)"/>
501public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
520public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey)
531public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
534/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Solution}}, string?, CodeActionPriority)"/>
536public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
540string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey, CodeActionPriority priority, CodeActionCleanup cleanup)
652private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> _createChangedDocument;
653private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>>? _createChangedDocumentPreview;
657Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument,
658Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>>? createChangedDocumentPreview,
670Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument,
679Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument,
684protected override async Task<IEnumerable<CodeActionOperation>> ComputePreviewOperationsAsync(CancellationToken cancellationToken)
693protected sealed override Task<Document> GetChangedDocumentAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
699private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution;
705Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
718Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
728Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
734protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
755protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
CodeActions\CodeAction_Cleanup.cs (12)
44private static readonly Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>> s_cleanupSyntaxPass =
47private static readonly ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> s_cleanupSyntaxPasses = [s_cleanupSyntaxPass];
53private static readonly ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> s_allCleanupPasses =
71internal static Task<Document> CleanupSyntaxAsync(Document document, CodeCleanupOptions options, CancellationToken cancellationToken)
88internal static async Task<Solution> PostProcessChangesAsync(
110private static async Task<Solution> CleanSyntaxAndSemanticsAsync(
114ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> passes,
126async Task<ImmutableArray<(DocumentId documentId, CodeCleanupOptions codeCleanupOptions)>> GetDocumentIdsAndOptionsToCleanAsync()
163private static async Task<Solution> RunCleanupPassesInOrderAsync(
167ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> passes,
179async Task<Solution> RunParallelCleanupPassAsync(
180Solution 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 (7)
42public abstract Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext);
55public static FixAllProvider Create(Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync)
75Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync,
82Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync,
99Task<CodeAction?> IFixAllProvider.GetFixAsync(IFixAllContext fixAllContext)
104Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync,
110protected override Task<Document?> FixAllAsync(FixAllContext context, Document document, ImmutableArray<Diagnostic> diagnostics)
CodeRefactorings\FixAllOccurences\FixAllProvider.cs (7)
35public abstract Task<CodeAction?> GetFixAsync(FixAllContext fixAllContext);
38Task<CodeAction?> IFixAllProvider.GetFixAsync(IFixAllContext fixAllContext)
53public static FixAllProvider Create(Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync)
73Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync,
80Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync,
97Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync,
103protected override Task<Document?> FixAllAsync(FixAllContext context, Document document, Optional<ImmutableArray<TextSpan>> fixAllSpans)
Diagnostics\CompilationWithAnalyzersPair.cs (5)
50public Task<AnalyzerTelemetryInfo> GetAnalyzerTelemetryInfoAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
63public async Task<AnalysisResultPair?> GetAnalysisResultAsync(CancellationToken cancellationToken)
75public async Task<AnalysisResultPair?> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken)
87public async Task<AnalysisResultPair?> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken)
99public 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)
47public static Task<Document> FormatAsync(Document document, OptionSet? options = null, CancellationToken cancellationToken = default)
52internal static Task<Document> FormatAsync(Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken)
63public static Task<Document> FormatAsync(Document document, TextSpan span, OptionSet? options = null, CancellationToken cancellationToken = default)
68internal static Task<Document> FormatAsync(Document document, TextSpan span, SyntaxFormattingOptions options, CancellationToken cancellationToken)
79public static async Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, OptionSet? options = null, CancellationToken cancellationToken = default)
91internal static async Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, SyntaxFormattingOptions? options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
107public static Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, OptionSet? options = null, CancellationToken cancellationToken = default)
116internal static Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, CancellationToken cancellationToken)
119internal static Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
122internal static async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, OptionSet? optionSet, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
353public 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\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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\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 (38)
MSBuild\BuildHostProcessManager.cs (5)
50public async Task<RemoteBuildHost> GetBuildHostWithFallbackAsync(string projectFilePath, CancellationToken cancellationToken)
60public async Task<(RemoteBuildHost buildHost, BuildHostProcessKind actualKind)> GetBuildHostWithFallbackAsync(BuildHostProcessKind buildHostKind, string projectOrSolutionFilePath, CancellationToken cancellationToken)
86public Task<RemoteBuildHost> GetBuildHostAsync(BuildHostProcessKind buildHostKind, CancellationToken cancellationToken)
91public async Task<RemoteBuildHost> GetBuildHostAsync(BuildHostProcessKind buildHostKind, string? projectOrSolutionFilePath, string? dotnetPath, CancellationToken cancellationToken)
105async Task<BuildHostProcess> NoLock_GetBuildHostAsync(BuildHostProcessKind buildHostKind, string? projectOrSolutionFilePath, string? dotnetPath, CancellationToken cancellationToken)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (4)
187private async Task<ResolvedReferences> ResolveReferencesAsync(ProjectId id, ProjectFileInfo projectFileInfo, CommandLineArguments commandLineArgs, CancellationToken cancellationToken)
268private async Task<bool> TryLoadAndAddReferenceAsync(ProjectId id, string projectReferencePath, ImmutableArray<string> aliases, ResolvedReferencesBuilder builder, CancellationToken cancellationToken)
341private async Task<bool> VerifyUnloadableProjectOutputExistsAsync(string projectPath, ResolvedReferencesBuilder builder, CancellationToken cancellationToken)
350private 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 (31)
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.Example (3)
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.Baselines.Tasks (16)
Microsoft.DotNet.Build.Tasks.Feed (45)
src\ProductionChannelValidator.cs (7)
40public async Task<TargetChannelValidationResult> ValidateAsync(ProductConstructionService.Client.Models.Build build, TargetChannelConfig targetChannel)
149private async Task<AzureDevOpsBuildInfo> GetAzureDevOpsBuildInfoAsync(ProductConstructionService.Client.Models.Build build)
201private async Task<TargetChannelValidationResult> ValidateBranchIsProductionAsync(ProductConstructionService.Client.Models.Build build, AzureDevOpsBuildInfo buildInfo)
328Task<AzureDevOpsBuildInfo> GetBuildInfoAsync(string account, string project, int buildId);
333Task<BranchClassificationResponse> GetBranchClassificationsAsync(string organizationName, string projectId, string repositoryId);
391public async Task<AzureDevOpsBuildInfo> GetBuildInfoAsync(string account, string project, int buildId)
442public async Task<BranchClassificationResponse> GetBranchClassificationsAsync(string organizationName, string projectId, string repositoryId)
src\PublishArtifactsInManifestBase.cs (11)
252public abstract Task<bool> ExecuteAsync();
261protected async Task<bool> ValidateTargetChannelAsync(ProductConstructionService.Client.Models.Build build, TargetChannelConfig targetChannel)
478private async Task<bool> PublishSymbolsUsingStreamingAsync(
495async Task<bool> PublishSymbolPackageWithDownload(BlobArtifactModel symbolAsset)
553private async Task<bool> PublishSymbolsFromBlobArtifactsAsync(
718Task<SymbolUploadHelper> CreatePublishSymbolHelper(string symbolPublishingExclusionsFile, bool publishSpecialClrFiles, bool dryRun)
781internal async Task<string> PrepLoosePdbsForPublish(string pdbArtifactsBasePath, SemaphoreSlim clientThrottle)
1019private async Task<IArtifactUrlHelper> CreateArtifactUrlHelper(HttpClient client, string artifactName)
1426public static async Task<NuGetFeedUploadPackageResult> NuGetFeedUploadPackageAsync(HttpClient httpClient, string feedName, string feedUri, Stream packageContentReadStream)
1493Func<string, string, HttpClient, MsBuildUtils.TaskLoggingHelper, Task<PackageFeedStatus>> CompareLocalPackageToFeedPackageCallBack = null,
1494Func<HttpClient, string, string, Stream, Task<NuGetFeedUploadPackageResult>> AttemptPushPackageCallback = null)
Microsoft.DotNet.Build.Tasks.Feed.Tests (10)
PublishArtifactsInManifestTests.cs (6)
53public Task<TargetChannelValidationResult> ValidateAsync(ProductConstructionService.Client.Models.Build build, TargetChannelConfig targetChannel)
75public override Task<bool> ExecuteAsync()
80public new async Task<bool> ValidateTargetChannelAsync(
294Func<string, string, HttpClient, MsBuildUtils.TaskLoggingHelper, Task<PackageFeedStatus>> testCompareLocalPackage = async (string localPackageFullPath, string packageContentUrl, HttpClient client, MsBuildUtils.TaskLoggingHelper log) =>
308Func<HttpClient, string, string, Stream, Task<NuGetFeedUploadPackageResult>> testPush = (_, feedName, feedUri, _) =>
385public 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 (43)
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 (30)
Microsoft.Extensions.AI.Abstractions.Tests (12)
Microsoft.Extensions.AI.AzureAIInference (3)
Microsoft.Extensions.AI.Evaluation (6)
Microsoft.Extensions.AI.Evaluation.Console (6)
Microsoft.Extensions.AI.Evaluation.Integration.Tests (2)
Microsoft.Extensions.AI.Evaluation.NLP (1)
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 (15)
Microsoft.Extensions.AI.OllamaSharp.Integration.Tests (1)
Microsoft.Extensions.AI.OpenAI (6)
Microsoft.Extensions.AI.Templates.Tests (3)
Microsoft.Extensions.AI.Tests (24)
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 (9)
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 (8)
Microsoft.Extensions.Identity.Core (210)
UserManager.cs (108)
454public virtual Task<TUser?> GetUserAsync(ClaimsPrincipal principal)
469public virtual Task<string> GenerateConcurrencyStampAsync(TUser user)
483public virtual async Task<IdentityResult> CreateAsync(TUser user)
500private async Task<IdentityResult> CreateCoreAsync(TUser user)
527public virtual async Task<IdentityResult> UpdateAsync(TUser user)
553public virtual async Task<IdentityResult> DeleteAsync(TUser user)
581public virtual Task<TUser?> FindByIdAsync(string userId)
594public virtual async Task<TUser?> FindByNameAsync(string userName)
633public virtual async Task<IdentityResult> CreateAsync(TUser user, string password)
707public virtual async Task<string?> GetUserNameAsync(TUser user)
720public virtual async Task<IdentityResult> SetUserNameAsync(TUser user, string? userName)
744public virtual async Task<string> GetUserIdAsync(TUser user)
759public virtual async Task<bool> CheckPasswordAsync(TUser user, string password)
781private async Task<(PasswordVerificationResult? result, bool userMissing)> CheckPasswordCoreAsync(TUser user, string password)
810public virtual Task<bool> HasPasswordAsync(TUser user)
829public virtual async Task<IdentityResult> AddPasswordAsync(TUser user, string password)
845private async Task<IdentityResult> AddPasswordCoreAsync(TUser user, string password)
876public virtual async Task<IdentityResult> ChangePasswordAsync(TUser user, string currentPassword, string newPassword)
892private async Task<IdentityResult> ChangePasswordCoreAsync(TUser user, string currentPassword, string newPassword)
919public virtual async Task<IdentityResult> RemovePasswordAsync(TUser user)
948protected virtual async Task<PasswordVerificationResult> VerifyPasswordAsync(IUserPasswordStore<TUser> store, TUser user, string password)
965public virtual async Task<string> GetSecurityStampAsync(TUser user)
990public virtual async Task<IdentityResult> UpdateSecurityStampAsync(TUser user)
1016public virtual Task<string> GeneratePasswordResetTokenAsync(TUser user)
1033public virtual async Task<IdentityResult> ResetPasswordAsync(TUser user, string token, string newPassword)
1065public virtual Task<TUser?> FindByLoginAsync(string loginProvider, string providerKey)
1085public virtual async Task<IdentityResult> RemoveLoginAsync(TUser user, string loginProvider, string providerKey)
1116public virtual async Task<IdentityResult> AddLoginAsync(TUser user, UserLoginInfo login)
1132private async Task<IdentityResult> AddLoginCoreAsync(TUser user, UserLoginInfo login)
1156public virtual async Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user)
1173public virtual Task<IdentityResult> AddClaimAsync(TUser user, Claim claim)
1187public virtual async Task<IdentityResult> AddClaimsAsync(TUser user, IEnumerable<Claim> claims)
1217public virtual async Task<IdentityResult> ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim)
1247public virtual Task<IdentityResult> RemoveClaimAsync(TUser user, Claim claim)
1261public virtual async Task<IdentityResult> RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims)
1286/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <see cref="Claim"/>s.
1288public virtual async Task<IList<Claim>> GetClaimsAsync(TUser user)
1305public virtual async Task<IdentityResult> AddToRoleAsync(TUser user, string role)
1321private async Task<IdentityResult> AddToRoleCoreAsync(TUser user, string role)
1345public virtual async Task<IdentityResult> AddToRolesAsync(TUser user, IEnumerable<string> roles)
1361private async Task<IdentityResult> AddToRolesCoreAsync(TUser user, IEnumerable<string> roles)
1389public virtual async Task<IdentityResult> RemoveFromRoleAsync(TUser user, string role)
1436public virtual async Task<IdentityResult> RemoveFromRolesAsync(TUser user, IEnumerable<string> roles)
1452private async Task<IdentityResult> RemoveFromRolesCoreAsync(TUser user, IEnumerable<string> roles)
1476public virtual async Task<IList<string>> GetRolesAsync(TUser user)
1493public virtual async Task<bool> IsInRoleAsync(TUser user, string role)
1506public virtual async Task<string?> GetEmailAsync(TUser user)
1523public virtual async Task<IdentityResult> SetEmailAsync(TUser user, string? email)
1553public virtual async Task<TUser?> FindByEmailAsync(string email)
1605public virtual Task<string> GenerateEmailConfirmationTokenAsync(TUser user)
1620public virtual async Task<IdentityResult> ConfirmEmailAsync(TUser user, string token)
1636private async Task<IdentityResult> ConfirmEmailCoreAsync(TUser user, string token)
1659public virtual async Task<bool> IsEmailConfirmedAsync(TUser user)
1675public virtual Task<string> GenerateChangeEmailTokenAsync(TUser user, string newEmail)
1691public virtual async Task<IdentityResult> ChangeEmailAsync(TUser user, string newEmail, string token)
1705private async Task<IdentityResult> ChangeEmailCoreAsync(TUser user, string newEmail, string token, long startTimestamp)
1727public virtual async Task<string?> GetPhoneNumberAsync(TUser user)
1744public virtual async Task<IdentityResult> SetPhoneNumberAsync(TUser user, string? phoneNumber)
1776public virtual async Task<IdentityResult> ChangePhoneNumberAsync(TUser user, string phoneNumber, string token)
1792private async Task<IdentityResult> ChangePhoneNumberCoreAsync(TUser user, string phoneNumber, string token)
1817public virtual Task<bool> IsPhoneNumberConfirmedAsync(TUser user)
1833public virtual Task<string> GenerateChangePhoneNumberTokenAsync(TUser user, string phoneNumber)
1849public virtual Task<bool> VerifyChangePhoneNumberTokenAsync(TUser user, string token, string phoneNumber)
1870public virtual async Task<bool> VerifyUserTokenAsync(TUser user, string tokenProvider, string purpose, string token)
1909public virtual Task<string> GenerateUserTokenAsync(TUser user, string tokenProvider, string purpose)
1953public virtual async Task<IList<string>> GetValidTwoFactorProvidersAsync(TUser user)
1978public virtual async Task<bool> VerifyTwoFactorTokenAsync(TUser user, string tokenProvider, string token)
2015public virtual Task<string> GenerateTwoFactorTokenAsync(TUser user, string tokenProvider)
2045public virtual async Task<bool> GetTwoFactorEnabledAsync(TUser user)
2062public virtual async Task<IdentityResult> SetTwoFactorEnabledAsync(TUser user, bool enabled)
2091public virtual async Task<bool> IsLockedOutAsync(TUser user)
2113public virtual async Task<IdentityResult> SetLockoutEnabledAsync(TUser user, bool enabled)
2139public virtual async Task<bool> GetLockoutEnabledAsync(TUser user)
2153/// A <see cref="Task{TResult}"/> that represents the lookup, a <see cref="DateTimeOffset"/> containing the last time a user's lockout expired, if any.
2155public virtual async Task<DateTimeOffset?> GetLockoutEndDateAsync(TUser user)
2169public virtual async Task<IdentityResult> SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd)
2185private async Task<IdentityResult> SetLockoutEndDateCoreAsync(TUser user, DateTimeOffset? lockoutEnd)
2207public virtual async Task<IdentityResult> AccessFailedAsync(TUser user)
2240public virtual async Task<IdentityResult> ResetAccessFailedCountAsync(TUser user)
2256private async Task<IdentityResult> ResetAccessFailedCountCoreAsync(TUser user)
2276public virtual async Task<int> GetAccessFailedCountAsync(TUser user)
2289/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <typeparamref name="TUser"/>s who
2292public virtual Task<IList<TUser>> GetUsersForClaimAsync(Claim claim)
2305/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <typeparamref name="TUser"/>s who
2308public virtual Task<IList<TUser>> GetUsersInRoleAsync(string roleName)
2324public virtual Task<string?> GetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName)
2343public virtual async Task<IdentityResult> SetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName, string? tokenValue)
2372public virtual async Task<IdentityResult> RemoveAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName)
2398public virtual Task<string?> GetAuthenticatorKeyAsync(TUser user)
2411public virtual async Task<IdentityResult> ResetAuthenticatorKeyAsync(TUser user)
2443public virtual async Task<IEnumerable<string>?> GenerateNewTwoFactorRecoveryCodesAsync(TUser user, int number)
2556public virtual async Task<IdentityResult> RedeemTwoFactorRecoveryCodeAsync(TUser user, string code)
2572private async Task<IdentityResult> RedeemTwoFactorRecoveryCodeCoreAsync(TUser user, string code)
2591public virtual Task<int> CountRecoveryCodesAsync(TUser user)
2606public virtual async Task<IdentityResult> AddOrUpdatePasskeyAsync(TUser user, UserPasskeyInfo passkey)
2622private async Task<IdentityResult> AddOrUpdatePasskeyCoreAsync(TUser user, UserPasskeyInfo passkey)
2640public virtual Task<IList<UserPasskeyInfo>> GetPasskeysAsync(TUser user)
2657public virtual Task<UserPasskeyInfo?> GetPasskeyAsync(TUser user, byte[] credentialId)
2674public virtual Task<TUser?> FindByPasskeyIdAsync(byte[] credentialId)
2692public virtual async Task<IdentityResult> RemovePasskeyAsync(TUser user, byte[] credentialId)
2708private async Task<IdentityResult> RemovePasskeyCoreAsync(TUser user, byte[] credentialId)
2781public virtual async Task<byte[]> CreateSecurityTokenAsync(TUser user)
2802protected virtual Task<IdentityResult> UpdatePasswordHash(TUser user, string newPassword, bool validatePassword)
2805private async Task<IdentityResult> UpdatePasswordHash(IUserPasswordStore<TUser> passwordStore,
2887protected async Task<IdentityResult> ValidateUserAsync(TUser user)
2927protected async Task<IdentityResult> ValidatePasswordAsync(TUser user, string? password)
2961protected virtual async Task<IdentityResult> UpdateUserAsync(TUser user)
2975private async Task<IdentityResult> UpdateUserAndRecordMetricAsync(TUser user, UserUpdateType updateType, long startTimestamp)
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 (3)
Microsoft.Extensions.ServiceDiscovery.Yarp (3)
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.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.Samples (6)
Microsoft.ML.Samples.GPU (6)
Microsoft.ML.SamplesUtils (1)
Microsoft.ML.Sweeper (3)
Microsoft.ML.Sweeper.Tests (11)
Microsoft.ML.TestFramework (1)
Microsoft.ML.Tokenizers (10)
Microsoft.ML.Tokenizers.Tests (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\VisualStudioCodeLensReferencesService.cs (5)
32public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults,
57public async Task<ImmutableArray<ReferenceLocationDescriptorAndDocument>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
83public Task<ImmutableArray<ReferenceLocationDescriptor>> MapReferenceLocationsAsync(Solution solution, ImmutableArray<ReferenceLocationDescriptorAndDocument> referenceLocations, ClassificationOptions classificationOptions, CancellationToken cancellationToken)
89public async Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
114public async Task<string?> GetFullyQualifiedNameAsync(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)
51public async Task<bool> CanNavigateToSpanAsync(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool allowInvalidSpan, CancellationToken cancellationToken)
67public async Task<bool> CanNavigateToPositionAsync(
99public async Task<INavigableLocation?> GetLocationForSpanAsync(
113public async Task<INavigableLocation?> GetLocationForPositionAsync(
126static async Task<TextSpan> GetTextSpanFromPositionAsync(Document document, int position, int virtualSpace, CancellationToken cancellationToken)
155private async Task<INavigableLocation?> GetNavigableLocationAsync(
158Func<Document, Task<TextSpan>> getTextSpanForMappingAsync,
179private async Task<Func<CancellationToken, Task<bool>>?> GetNavigationCallbackAsync(
182Func<Document, Task<TextSpan>> getTextSpanForMappingAsync,
240private Func<CancellationToken, Task<bool>>? GetNavigationCallback(
292private async Task<Func<CancellationToken, Task<bool>>?> GetNavigableLocationForMappedFileAsync(
315private static async Task<MappedSpanResult?> GetMappedSpanAsync(Document generatedDocument, TextSpan textSpan, CancellationToken cancellationToken)
377public async Task<bool> NavigateToTextBufferAsync(
415private async Task<bool> CanMapFromSecondaryBufferToPrimaryBufferAsync(
Microsoft.VisualStudio.LanguageServices.CodeLens (4)
Microsoft.VisualStudio.LanguageServices.CSharp (16)
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.Implementation (11)
Microsoft.VisualStudio.LanguageServices.LiveShare (11)
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)
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 (206)
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (6)
42Func<CancellationToken, Task<Document>> createChangedDocument;
85private async Task<Document> AddObsoleteAttributeAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
117private static async Task<Document> AddDescriptionAndErrorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
138private static async Task<Document> UpdateDescriptionAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
163private static async Task<Document> AddErrorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
182private static async Task<Document> SetErrorToTrueAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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\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);
Roslyn.Diagnostics.CSharp.Analyzers (15)
Roslyn.VisualStudio.DiagnosticsWindow (2)
Roslyn.VisualStudio.Next.UnitTests (16)
RunTests (16)
TestHistoryManager.cs (4)
30public static async Task<ImmutableDictionary<string, TimeSpan>> GetTestHistoryAsync(Options options, CancellationToken cancellationToken)
146private static async Task<Build?> GetLastSuccessfulBuildAsync(int definitionId, string branchName, BuildHttpClient buildClient, CancellationToken cancellationToken)
169private static async Task<TestRun?> GetRunForStageAsync(Build build, string phaseName, TestResultsHttpClient testClient, CancellationToken cancellationToken)
191private 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 (38)
System.Data.Odbc (7)
System.Formats.Tar (1)
System.IO.Compression (26)
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();
250public Task<int> ReceiveAsync(ArraySegment<byte> buffer) =>
259public Task<int> ReceiveAsync(ArraySegment<byte> buffer, SocketFlags socketFlags) => ReceiveAsync(buffer, socketFlags, fromNetworkStream: false);
261internal Task<int> ReceiveAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, bool fromNetworkStream)
309public Task<int> ReceiveAsync(IList<ArraySegment<byte>> buffers) =>
318public Task<int> ReceiveAsync(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
340public Task<SocketReceiveFromResult> ReceiveFromAsync(ArraySegment<byte> buffer, EndPoint remoteEndPoint) =>
350public Task<SocketReceiveFromResult> ReceiveFromAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint)
442public Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(ArraySegment<byte> buffer, EndPoint remoteEndPoint) =>
452public Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint)
501public Task<int> SendAsync(ArraySegment<byte> buffer) =>
510public Task<int> SendAsync(ArraySegment<byte> buffer, SocketFlags socketFlags)
573public Task<int> SendAsync(IList<ArraySegment<byte>> buffers) =>
582public Task<int> SendAsync(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
604public Task<int> SendToAsync(ArraySegment<byte> buffer, EndPoint remoteEP) =>
614public Task<int> SendToAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEP)
827private Task<int> GetTaskForSendReceive(bool pending, TaskSocketAsyncEventArgs<int> saea, bool fromNetworkStream, bool isReceive)
829Task<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 (3)
System.Net.WebSockets.Client (2)
System.Private.CoreLib (963)
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (9)
1083public static Task<string> ReadAllTextAsync(string path, CancellationToken cancellationToken = default)
1086public static Task<string> ReadAllTextAsync(string path, Encoding encoding, CancellationToken cancellationToken = default)
1095private static async Task<string> InternalReadAllTextAsync(string path, Encoding encoding, CancellationToken cancellationToken)
1168public static Task<byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken = default)
1197private static async Task<byte[]> InternalReadAllBytesAsync(SafeFileHandle sfh, int count, CancellationToken cancellationToken)
1218private static async Task<byte[]> InternalReadAllBytesUnknownLengthAsync(SafeFileHandle sfh, CancellationToken cancellationToken)
1291public static Task<string[]> ReadAllLinesAsync(string path, CancellationToken cancellationToken = default)
1294public static Task<string[]> ReadAllLinesAsync(string path, Encoding encoding, CancellationToken cancellationToken = default)
1303private 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);
96/// Initializes a new <see cref="Task{TResult}"/> with the specified function.
113/// Initializes a new <see cref="Task{TResult}"/> with the specified function.
133/// Initializes a new <see cref="Task{TResult}"/> with the specified function and creation options.
156/// Initializes a new <see cref="Task{TResult}"/> with the specified function and creation options.
183/// Initializes a new <see cref="Task{TResult}"/> with the specified function and state.
200/// Initializes a new <see cref="Task{TResult}"/> with the specified action, state, and options.
221/// Initializes a new <see cref="Task{TResult}"/> with the specified action, state, and options.
247/// Initializes a new <see cref="Task{TResult}"/> with the specified action, state, and options.
308internal static Task<TResult> StartNew(Task? parent, Func<TResult> function, CancellationToken cancellationToken,
321Task<TResult> f = new Task<TResult>(function, parent, cancellationToken, creationOptions, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler);
328internal static Task<TResult> StartNew(Task? parent, Func<object?, TResult> function, object? state, CancellationToken cancellationToken,
341Task<TResult> f = new Task<TResult>(function, state, parent, cancellationToken, creationOptions, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler);
418/// Gets the result value of this <see cref="Task{TResult}"/>.
432/// Gets the result value of this <see cref="Task{TResult}"/> once the task has completed successfully.
467/// Provides access to factory methods for creating <see cref="Task{TResult}"/> instances.
500/// <summary>Gets an awaiter used to await this <see cref="Task{TResult}"/>.</summary>
507/// <summary>Configures an awaiter used to await this <see cref="Task{TResult}"/>.</summary>
542/// <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>
544/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
545public new Task<TResult> WaitAsync(CancellationToken cancellationToken) =>
548/// <summary>Gets a <see cref="Task{TResult}"/> that will complete when this <see cref="Task{TResult}"/> completes or when the specified timeout expires.</summary>
550/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
551public new Task<TResult> WaitAsync(TimeSpan timeout) =>
555/// Gets a <see cref="Task{TResult}"/> that will complete when this <see cref="Task{TResult}"/> completes or when the specified timeout expires.
559/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
560public new Task<TResult> WaitAsync(TimeSpan timeout, TimeProvider timeProvider)
566/// <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>
569/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
570public new Task<TResult> WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) =>
574/// 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.
579/// <returns>The <see cref="Task{TResult}"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
580public new Task<TResult> WaitAsync(TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken)
586private Task<TResult> WaitAsync(uint millisecondsTimeout, TimeProvider timeProvider, CancellationToken cancellationToken)
612/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
615/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
627public Task ContinueWith(Action<Task<TResult>> continuationAction)
634/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
637/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
650public Task ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken)
657/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
660/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
678public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler)
684/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
687/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
711public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskContinuationOptions continuationOptions)
717/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
720/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
751public Task ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken,
758internal Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler, CancellationToken cancellationToken,
792/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
795/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
808public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state)
815/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
818/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
832public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, CancellationToken cancellationToken)
839/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
842/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
861public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler)
867/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
870/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
895public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskContinuationOptions continuationOptions)
901/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
904/// An action to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
936public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, CancellationToken cancellationToken,
943internal Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler, CancellationToken cancellationToken,
978/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
984/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
987/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
989/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
996public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction)
1003/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1009/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1013/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1015/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1025public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, CancellationToken cancellationToken)
1031/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1037/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1043/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1045/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current task has
1055public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler)
1061/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1067/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1077/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1080/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1086/// cref="Task{TNewResult}"/>. This task's completion state will be transferred to the task returned
1097public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskContinuationOptions continuationOptions)
1103/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1109/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be passed as
1124/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1127/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current task has
1132/// The <paramref name="continuationFunction"/>, when executed, should return a <see cref="Task{TNewResult}"/>.
1150public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, CancellationToken cancellationToken,
1157internal Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, TNewResult> continuationFunction, TaskScheduler scheduler,
1175Task<TNewResult> continuationFuture = new ContinuationResultTaskFromResultTask<TResult, TNewResult>(
1191/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1197/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1201/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1203/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1210public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state)
1217/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1223/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1228/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1230/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1240public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1247/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1253/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1260/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1262/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current task has
1272public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1279/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1285/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1296/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1299/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current
1305/// cref="Task{TNewResult}"/>. This task's completion state will be transferred to the task returned
1316public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1323/// Creates a continuation that executes when the target <see cref="Task{TResult}"/> completes.
1329/// A function to run when the <see cref="Task{TResult}"/> completes. When run, the delegate will be
1345/// <returns>A new continuation <see cref="Task{TNewResult}"/>.</returns>
1348/// The returned <see cref="Task{TNewResult}"/> will not be scheduled for execution until the current task has
1353/// The <paramref name="continuationFunction"/>, when executed, should return a <see cref="Task{TNewResult}"/>.
1371public Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1378internal Task<TNewResult> ContinueWith<TNewResult>(Func<Task<TResult>, object?, TNewResult> continuationFunction, object? state,
1396Task<TNewResult> continuationFuture = new ContinuationResultTaskFromResultTask<TResult, TNewResult>(
1416private readonly Task<TResult> m_task;
1418public 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);
6252public static Task<TResult[]> WhenAll<TResult>(IEnumerable<Task<TResult>> tasks)
6255if (tasks is Task<TResult>[] taskArray)
6261if (tasks is ICollection<Task<TResult>> taskCollection)
6269taskArray = new Task<TResult>[count];
6271foreach (Task<TResult> task in taskArray)
6288List<Task<TResult>> taskList = new List<Task<TResult>>();
6289foreach (Task<TResult> task in tasks)
6335public static Task<TResult[]> WhenAll<TResult>(params Task<TResult>[] tasks)
6342return WhenAll((ReadOnlySpan<Task<TResult>>)tasks);
6373public static Task<TResult[]> WhenAll<TResult>(params ReadOnlySpan<Task<TResult>> tasks)
6380Task<TResult>[] tasksCopy = tasks.ToArray();
6381foreach (Task<TResult> task in tasksCopy)
6403private readonly Task<T>?[] m_tasks;
6407internal WhenAllPromise(Task<T>[] tasks)
6421foreach (Task<T> task in tasks)
6447Task<T>? task = m_tasks[i];
6525public static Task<Task> WhenAny(params Task[] tasks)
6544public static Task<Task> WhenAny(params ReadOnlySpan<Task> tasks) =>
6559private static Task<TTask> WhenAnyCore<TTask>(ReadOnlySpan<TTask> tasks) where TTask : Task
6597public static Task<Task> WhenAny(Task task1, Task task2) =>
6611private static Task<TTask> WhenAny<TTask>(TTask task1, TTask task2) where TTask : Task
6717public static Task<Task> WhenAny(IEnumerable<Task> tasks) =>
6733private static Task<TTask> WhenAny<TTask>(IEnumerable<TTask> tasks) where TTask : Task
6811public static Task<Task<TResult>> WhenAny<TResult>(params Task<TResult>[] tasks)
6815return WhenAnyCore((ReadOnlySpan<Task<TResult>>)tasks);
6831public static Task<Task<TResult>> WhenAny<TResult>(params ReadOnlySpan<Task<TResult>> tasks) =>
6846public static Task<Task<TResult>> WhenAny<TResult>(Task<TResult> task1, Task<TResult> task2) =>
6847WhenAny<Task<TResult>>(task1, task2);
6865public static Task<Task<TResult>> WhenAny<TResult>(IEnumerable<Task<TResult>> tasks) =>
6866WhenAny<Task<TResult>>(tasks);
6898public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(params Task<TResult>[] tasks)
6901return WhenEach((ReadOnlySpan<Task<TResult>>)tasks);
6907public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(params ReadOnlySpan<Task<TResult>> tasks) =>
6908WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(ReadOnlySpan<Task>.CastUp(tasks)));
6913public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(IEnumerable<Task<TResult>> tasks) =>
6914WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(tasks));
7062internal static Task<TResult> CreateUnwrapPromise<TResult>(Task outerTask, bool lookForOce)
7506ProcessInnerTask(task is Task<Task<TResult>> taskOfTaskOfTResult ? // it's either a Task<Task> or Task<Task<TResult>>
7507taskOfTaskOfTResult.Result : ((Task<Task>)task).Result);
7552result = 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)
822/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
853public Task<bool> VerifyDetachedAsync(AsymmetricAlgorithm key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
885/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
915public Task<bool> VerifyDetachedAsync(CoseKey key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
938private async Task<bool> VerifyAsyncCore(CoseKey key, Stream content, ReadOnlyMemory<byte> associatedData, CancellationToken cancellationToken)
System\Security\Cryptography\Cose\CoseSignature.cs (5)
496/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
527public Task<bool> VerifyDetachedAsync(AsymmetricAlgorithm key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
560/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
591public Task<bool> VerifyDetachedAsync(CoseKey key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
614private async Task<bool> VerifyAsyncCore(CoseKey key, Stream content, ReadOnlyMemory<byte> associatedData, CancellationToken cancellationToken)
System.Security.Principal.Windows (2)
System.ServiceModel.Federation (7)
System.ServiceModel.Http (42)
System\ServiceModel\Channels\HttpChannelFactory.cs (8)
245internal async Task<HttpClient> GetHttpClientAsync(EndpointAddress to, Uri via,
444private async Task<SecurityTokenProviderContainer> CreateAndOpenTokenProviderAsync(TimeSpan timeout, AuthenticationSchemes authenticationScheme,
742private async Task<(SecurityTokenProviderContainer tokenProvider, SecurityTokenProviderContainer proxyTokenProvider)> CreateAndOpenTokenProvidersCoreAsync(EndpointAddress to, Uri via, ChannelParameterCollection channelParameters, TimeSpan timeout)
759internal Task<(SecurityTokenProviderContainer tokenProvider, SecurityTokenProviderContainer proxyTokenProvider)> CreateAndOpenTokenProvidersAsync(EndpointAddress to, Uri via, ChannelParameterCollection channelParameters, TimeSpan timeout)
913internal virtual Task<HttpClient> GetHttpClientAsync(EndpointAddress to, Uri via, TimeoutHelper timeoutHelper)
918protected async Task<HttpClient> GetHttpClientAsync(EndpointAddress to, Uri via, SecurityTokenContainer clientCertificateToken, TimeoutHelper timeoutHelper)
1129public async Task<Message> ReceiveReplyAsync(TimeoutHelper timeoutHelper)
1383public async Task<IWebProxy> CreateWebProxyAsync(AuthenticationLevel requestAuthenticationLevel, TokenImpersonationLevel requestImpersonationLevel, SecurityTokenProviderContainer tokenProvider, TimeSpan timeout)
System.ServiceModel.NetFramingBase (28)
System.ServiceModel.NetTcp (4)
System.ServiceModel.Primitives (158)
Internals\System\Runtime\TaskHelpers.cs (8)
34public static Task<TResult> ToApm<TResult>(this Task<TResult> task, AsyncCallback callback, object state)
145Task<TResult> task = iar as Task<TResult>;
161public static Task<(TOut1, TOut2)> FromAsync<TIn, TOut1, TOut2>(Func<TIn, AsyncCallback, object, IAsyncResult> beginDelegate, EndWithOutDelegate<TOut2, TOut1> endDelegate, TIn arg1, object state)
219public static async Task<bool> AwaitWithTimeout(this Task task, TimeSpan timeout)
276public static TResult WaitForCompletion<TResult>(this Task<TResult> task)
284public static TResult WaitForCompletionNoSpin<TResult>(this Task<TResult> task)
System\IdentityModel\Selectors\SecurityTokenProvider.cs (8)
60public async Task<SecurityToken> GetTokenAsync(TimeSpan timeout)
84protected virtual Task<SecurityToken> GetTokenCoreAsync(TimeSpan timeout)
86return Task<SecurityToken>.Factory.FromAsync(BeginGetTokenCore, EndGetTokenCore, timeout, null);
91internal virtual Task<SecurityToken> GetTokenCoreInternalAsync(TimeSpan timeout)
140public async Task<SecurityToken> RenewTokenAsync(TimeSpan timeout, SecurityToken tokenToBeRenewed)
171protected virtual Task<SecurityToken> RenewTokenCoreAsync(TimeSpan timeout, SecurityToken tokenToBeRenewed)
173return Task<SecurityToken>.Factory.FromAsync(BeginRenewTokenCore, EndRenewTokenCore, timeout, tokenToBeRenewed, null);
176internal virtual Task<SecurityToken> RenewTokenCoreInternalAsync(TimeSpan timeout, SecurityToken tokenToBeRenewed)
System\ServiceModel\Channels\ClientReliableChannelBinder.cs (8)
111public Task<bool> EnsureChannelForRequestAsync()
130protected virtual Task<Message> OnRequestAsync(TChannel channel, Message message, TimeSpan timeout,
136public Task<Message> RequestAsync(Message message, TimeSpan timeout)
141public async Task<Message> RequestAsync(Message message, TimeSpan timeout, MaskingMode maskingMode)
200protected override Task<bool> TryGetChannelAsync(TimeSpan timeout)
285protected override async Task<(bool, RequestContext)> OnTryReceiveAsync(TDuplexChannel channel, TimeSpan timeout)
449protected override Task<Message> OnRequestAsync(TRequestChannel channel, Message message,
477public override async Task<(bool, RequestContext)> TryReceiveAsync(TimeSpan timeout)
System\ServiceModel\Channels\ReliableChannelBinder.cs (11)
549protected virtual Task<(bool success, RequestContext requestContext)> OnTryReceiveAsync(TChannel channel, TimeSpan timeout)
728protected abstract Task<bool> TryGetChannelAsync(TimeSpan timeout);
730public virtual Task<(bool, RequestContext)> TryReceiveAsync(TimeSpan timeout)
735public virtual async Task<(bool, RequestContext)> TryReceiveAsync(TimeSpan timeout, MaskingMode maskingMode)
998public async Task<bool> EnsureChannelAsync()
1535public Task<(bool success, TChannel channel)> TryGetChannelForInputAsync(bool canGetChannel, TimeSpan timeout)
1540public Task<(bool success, TChannel channel)> TryGetChannelForOutputAsync(TimeSpan timeout, MaskingMode maskingMode)
1545private async Task<(bool success, TChannel channel)> TryGetChannelAsync(bool canGetChannel, bool canCauseFault, TimeSpan timeout,
1777private async Task<bool> TryGetChannelAsync()
1831public async Task<(bool success, TChannel channel)> TryWaitAsync()
1855private async Task<bool> WaitAsync()
System\ServiceModel\Security\SecurityProtocol.cs (4)
492internal async Task<IList<SupportingTokenSpecification>> TryGetSupportingTokensAsync(SecurityProtocolFactory factory, EndpointAddress target, Uri via, Message message, TimeSpan timeout)
587internal static async Task<SecurityToken> GetTokenAsync(SecurityTokenProvider provider, EndpointAddress target, TimeSpan timeout)
612public abstract Task<Message> SecureOutgoingMessageAsync(Message message, TimeSpan timeout);
615public virtual async Task<(SecurityProtocolCorrelationState, Message)> SecureOutgoingMessageAsync(Message message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
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 (12)
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 (89)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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)
TestProject.IntegrationServiceA (2)
Text.Analyzers (185)
src\Dependencies\Threading\ProducerConsumer.cs (13)
23private static async Task<VoidResult> BatchReaderIntoArraysAsync<TArgs>(
157public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
160Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
171public static Task<TResult> RunParallelAsync<TSource, TArgs, TResult>(
174Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
191public static Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
204public static async Task<ImmutableArray<TItem>> RunParallelAsync<TSource, TArgs>(
223private static Task<TResult> RunParallelChannelAsync<TSource, TArgs, TResult>(
226Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
319private static async Task<TResult> RunChannelAsync<TArgs, TResult>(
322Func<ChannelReader<TItem>, TArgs, CancellationToken, Task<TResult>> consumeItems,
343var readTask = ReadFromChannelAndConsumeItemsAsync();
348async Task<TResult> ReadFromChannelAndConsumeItemsAsync()
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\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);
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 (32)
WaitFor.Frontend (1)
Wasm.Performance.ConsoleHost (4)
Wasm.Performance.Driver (1)
WebSocketSample (1)
xunit.assert (14)
Xunit.NetCore.Extensions (3)