16 types derived from Task
System.Private.CoreLib (16)
34 instantiations of Task
Microsoft.ML.Data (1)
Microsoft.ML.TestFramework (2)
rzc (1)
System.Private.CoreLib (28)
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (1)
1350Task<T?> task = new();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task_T.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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (8)
1615internal static readonly Task<VoidTaskResult> s_cachedCompleted = new Task<VoidTaskResult>(false, default, (TaskCreationOptions)InternalTaskOptions.DoNotDispose, default);
5602return new Task<TResult>(result);
5626var task = new Task<TResult>();
5650return new Task<TResult>(true, default, TaskCreationOptions.None, cancellationToken);
5674var task = new Task<TResult>();
6433return new Task<TResult[]>(false, [], TaskCreationOptions.None, default);
6467new Task<TResult[]>(false, [], TaskCreationOptions.None, default) :
6544return new Task<TResult[]>(false, [], TaskCreationOptions.None, default);
System.Threading.Tasks.Dataflow (1)
VBCSCompiler (1)
13459 references to Task
aspire (574)
Backchannel\ExtensionBackchannel.cs (16)
34Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull;
35Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull;
36Task<bool> ConfirmAsync(string promptText, bool defaultValue, CancellationToken cancellationToken);
37Task<string> PromptForStringAsync(string promptText, string? defaultValue, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken);
38Task<string> PromptForSecretStringAsync(string promptText, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken);
39Task<string?> PromptForFilePathAsync(string promptText, string? defaultValue, bool directory, CancellationToken cancellationToken);
42Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken);
43Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken);
411public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
441public async Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
471public async Task<bool> ConfirmAsync(string promptText, bool defaultValue, CancellationToken cancellationToken)
495public async Task<string> PromptForStringAsync(string promptText, string? defaultValue, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken)
521public async Task<string> PromptForSecretStringAsync(string promptText, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken)
547public async Task<string?> PromptForFilePathAsync(string promptText, string? defaultValue, bool directory, CancellationToken cancellationToken)
632public async Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken)
638public async Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
Commands\AddCommand.cs (9)
63protected override async Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
283private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> GetPackageByInteractiveFlow(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> possiblePackages, string? preferredVersion, CancellationToken cancellationToken)
324private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> GetPackageByInteractiveFlowWithNoMatchesMessage(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> possiblePackages, string? searchTerm, CancellationToken cancellationToken)
346Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken);
347Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken);
352public virtual async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
362async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForChannelPackagesAsync(
412var rootChoices = new List<(string Label, Func<CancellationToken, Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)>> Action)>();
456public virtual async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
Commands\ConfigCommand.cs (16)
47protected override async Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
84protected override Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
96public override async Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
102private async Task<int> ExecuteAsync(string key, CancellationToken cancellationToken)
144protected override Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
165public override async Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
178private async Task<int> ExecuteAsync(string key, string value, bool isGlobal, CancellationToken cancellationToken)
216protected override Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
222public override Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
227private async Task<int> ExecuteAsync(bool showAll, CancellationToken cancellationToken)
364protected override Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
378public override async Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
398private async Task<int> ExecuteAsync(string key, bool isGlobal, CancellationToken cancellationToken)
450protected override Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
456public override Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
461private Task<int> ExecuteAsync(bool useJson)
Commands\NewCommand.cs (13)
140private async Task<ITemplate?> GetProjectTemplateAsync(ITemplate[] availableTemplates, ParseResult parseResult, CancellationToken cancellationToken)
188private async Task<ResolveTemplateVersionResult> ResolveCliTemplateVersionAsync(ParseResult parseResult, CancellationToken cancellationToken)
234protected override async Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
295Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken);
296Task<string> PromptForProjectNameAsync(string defaultName, CancellationToken cancellationToken);
297Task<string> PromptForOutputPath(string v, CancellationToken cancellationToken);
308Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken);
313public virtual async Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken)
344async Task<(NuGetPackage Package, PackageChannel Channel)> PromptForChannelPackagesAsync(
367var rootChoices = new List<(string Label, Func<CancellationToken, Task<(NuGetPackage, PackageChannel)>> Action)>();
410public virtual async Task<string> PromptForOutputPath(string path, CancellationToken cancellationToken)
422public virtual async Task<string> PromptForProjectNameAsync(string defaultName, CancellationToken cancellationToken)
435public virtual async Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken)
Commands\PipelineCommandBase.cs (8)
114protected abstract Task<string[]> GetRunArgumentsAsync(string? fullyQualifiedOutputPath, string[] unmatchedTokens, ParseResult parseResult, CancellationToken cancellationToken);
125protected override async Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
158Task<int>? pendingRun = null;
375public async Task<bool> ProcessPublishingActivitiesDebugAsync(IAsyncEnumerable<PublishingActivity> publishingActivities, IAppHostCliBackchannel backchannel, CancellationToken cancellationToken)
482public async Task<bool> ProcessAndDisplayPublishingActivitiesAsync(IAsyncEnumerable<PublishingActivity> publishingActivities, IAppHostCliBackchannel backchannel, bool isDebugOrTraceLoggingEnabled, CancellationToken cancellationToken)
798private async Task<string?> HandleSingleInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
840private async Task<string?> HandleSelectInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
874private async Task<string?> HandleNumberInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
Commands\TemplateCommand.cs (3)
15private readonly Func<ParseResult, CancellationToken, Task<int>> _executeCallback;
17public TemplateCommand(ITemplate template, Func<ParseResult, CancellationToken, Task<int>> executeCallback, IFeatures features, ICliUpdateNotifier updateNotifier, CliExecutionContext executionContext, IInteractionService interactionService, AspireCliTelemetry telemetry)
27protected override Task<int> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
DotNet\DotNetCliRunner.cs (30)
29Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
30Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
31Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, bool noRestore, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, 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> RestoreAsync(FileInfo projectFilePath, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
35Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
36Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, bool noRestore, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
37Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
38Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, bool useCache, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
39Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
40Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
41Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProject, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
42Task<int> InitUserSecretsAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
99private async Task<int> ExecuteAsync(
231public async Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
314public async Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
415public async Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, bool noRestore, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
490public async Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
619public async Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
634public async Task<int> RestoreAsync(FileInfo projectFilePath, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
650public async Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
673public async Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, bool noRestore, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
737public async Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
766public async Task<string> ComputeNuGetConfigHierarchySha256Async(DirectoryInfo workingDirectory, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
829public async Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, bool useCache, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
998public async Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
1038public async Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
1104public async Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProject, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
1133public Task<int> InitUserSecretsAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
Interaction\ConsoleInteractionService.cs (7)
45public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
129public async Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
159public Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default)
164public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
200public async Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, CancellationToken cancellationToken = default) where T : notnull
389public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
Interaction\ExtensionInteractionService.cs (7)
67public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
101public async Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
149public async Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default)
201public async Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
232public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
264public async Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
Interaction\IInteractionService.cs (7)
13Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false);
15Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default);
16Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default);
17public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default);
18Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull;
19Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, CancellationToken cancellationToken = default) where T : notnull;
Npm\NpmRunner.cs (7)
16public async Task<NpmPackageInfo?> ResolvePackageAsync(string packageName, string versionRange, CancellationToken cancellationToken)
75public async Task<string?> PackAsync(string packageName, string version, string outputDirectory, CancellationToken cancellationToken)
113public async Task<bool> AuditSignaturesAsync(string packageName, string version, CancellationToken cancellationToken)
165public async Task<bool> InstallGlobalAsync(string tarballPath, CancellationToken cancellationToken)
226private async Task<string?> RunNpmCommandInDirectoryAsync(string npmPath, string[] args, string workingDirectory, CancellationToken cancellationToken)
250var outputTask = process.StandardOutput.ReadToEndAsync(cancellationToken);
251var errorTask = process.StandardError.ReadToEndAsync(cancellationToken);
NuGet\NuGetPackageCache.cs (9)
16Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
17Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
18Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
19Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken);
32public async Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
47public async Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
52public async Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
68private static async Task<string> ComputeNuGetConfigHashSuffixAsync(FileInfo nugetConfigFile, CancellationToken cancellationToken)
76public async Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string query, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
Packaging\NuGetConfigMerger.cs (4)
33public static async Task CreateOrUpdateAsync(DirectoryInfo targetDirectory, PackageChannel channel, Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback = null, CancellationToken cancellationToken = default)
60private static async Task CreateNewNuGetConfigAsync(DirectoryInfo targetDirectory, PackageChannel channel, Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback, CancellationToken cancellationToken)
95private static async Task UpdateExistingNuGetConfigAsync(FileInfo nugetConfigFile, PackageChannel channel, Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback, CancellationToken cancellationToken)
147private static async Task<NuGetConfigContext> LoadAndValidateConfigAsync(FileInfo nugetConfigFile, PackageMapping[] mappings)
Projects\DotNetAppHostProject.cs (10)
83public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default)
157public async Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
200public async Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
371public async Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
472public async Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
495public async Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
502public async Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
522public async Task<string?> GetUserSecretsIdAsync(FileInfo projectFile, bool autoInit, CancellationToken cancellationToken)
550private async Task<string?> QueryUserSecretsIdAsync(FileInfo projectFile, CancellationToken cancellationToken)
590private async Task<string?> ConfigureIsolatedModeAsync(
Projects\GuestAppHostProject.cs (15)
122public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default)
152private async Task<List<IntegrationReference>> GetIntegrationReferencesAsync(
226private static async Task<(bool Success, OutputCollector? Output, string? ChannelName, bool NeedsCodeGen)> PrepareAppHostServerAsync(
240internal async Task<bool> BuildAndGenerateSdkAsync(DirectoryInfo directory, CancellationToken cancellationToken)
298Task<bool> IGuestAppHostSdkGenerator.BuildAndGenerateSdkAsync(DirectoryInfo directory, CancellationToken cancellationToken)
308public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
338public async Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
748public async Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
1002public async Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
1022public async Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
1158public async Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
1298private async Task<int> InstallDependenciesAsync(
1331private async Task<(int ExitCode, OutputCollector? Output)> ExecuteGuestAppHostAsync(
1354private async Task<(int ExitCode, OutputCollector? Output)> ExecuteGuestAppHostForPublishAsync(
1376public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
Projects\ProjectLocator.cs (10)
20Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default);
21Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken);
28Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default);
42public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(string searchDirectory, CancellationToken cancellationToken)
48private async Task<(List<FileInfo> BuildableAppHost, List<FileInfo> UnbuildableSuspectedAppHostProjects, bool HasUnsupportedProjects)> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, CancellationToken cancellationToken)
163public async Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default)
168private async Task<FileInfo?> GetAppHostProjectFileFromSettingsAsync(CancellationToken cancellationToken)
173private async Task<FileInfo?> GetAppHostProjectFileFromSettingsAsync(bool silent, CancellationToken cancellationToken)
254public async Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default)
401public async Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken = default)
Projects\ProjectUpdater.cs (11)
23Task<ProjectUpdateResult> UpdateProjectAsync(FileInfo projectFile, PackageChannel channel, CancellationToken cancellationToken = default);
28public async Task<ProjectUpdateResult> UpdateProjectAsync(FileInfo projectFile, PackageChannel channel, CancellationToken cancellationToken = default)
155private async Task<(IEnumerable<UpdateStep> UpdateSteps, bool FallbackUsed)> GetUpdateStepsAsync(FileInfo projectFile, PackageChannel channel, CancellationToken cancellationToken)
172private async Task<JsonDocument> GetItemsAndPropertiesAsync(FileInfo projectFile, CancellationToken cancellationToken)
177private async Task<JsonDocument> GetItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, CancellationToken cancellationToken)
197private async Task<JsonDocument> GetItemsAndPropertiesWithFallbackAsync(FileInfo projectFile, UpdateContext context, CancellationToken cancellationToken)
202private async Task<JsonDocument> GetItemsAndPropertiesWithFallbackAsync(FileInfo projectFile, string[] items, string[] properties, UpdateContext context, CancellationToken cancellationToken)
240private async Task<NuGetPackageCli> GetLatestVersionOfPackageAsync(UpdateContext context, string packageId, CancellationToken cancellationToken)
761private async Task<string?> GetPackageVersionFromDirectoryPackagesPropsAsync(string packageId, FileInfo directoryPackagesPropsFile, FileInfo projectFile, CancellationToken cancellationToken)
831private async Task<string?> ResolveMSBuildPropertyAsync(string propertyName, FileInfo projectFile, CancellationToken cancellationToken)
895private async Task<bool> AnalyzeAndConfirmNuGetConfigChanges(FileInfo targetFile, XmlDocument? originalDocument, XmlDocument proposedDocument, CancellationToken cancellationToken)
Templating\DotNetTemplateFactory.cs (19)
71public async Task<IEnumerable<ITemplate>> GetTemplatesAsync(CancellationToken cancellationToken = default)
83public async Task<IEnumerable<ITemplate>> GetInitTemplatesAsync(CancellationToken cancellationToken = default)
93private async Task<bool> IsDotNetSdkAvailableAsync(CancellationToken cancellationToken)
273private async Task<string[]> PromptForExtraAspireStarterOptionsAsync(ParseResult result, CancellationToken cancellationToken)
284private async Task<string[]> PromptForExtraAspireSingleFileOptionsAsync(ParseResult result, CancellationToken cancellationToken)
293private async Task<string[]> PromptForExtraAspirePythonStarterOptionsAsync(ParseResult result, CancellationToken cancellationToken)
303private async Task<string[]> PromptForExtraAspireJsFrontendStarterOptionsAsync(ParseResult result, CancellationToken cancellationToken)
313private async Task<string[]> PromptForExtraAspireXUnitOptionsAsync(ParseResult result, CancellationToken cancellationToken)
448private async Task<TemplateResult> ApplyTemplateWithNoExtraArgsAsync(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, CancellationToken cancellationToken)
453private async Task<TemplateResult> ApplySingleFileTemplate(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
480private Task<TemplateResult> ApplySingleFileTemplateWithNoExtraArgsAsync(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, CancellationToken cancellationToken)
490private async Task<TemplateResult> ApplyTemplateAsync(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
503private async Task<TemplateResult> ApplyTemplateAsync(CallbackTemplate template, TemplateInputs inputs, string name, string outputPath, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
622private async Task<string> GetProjectNameAsync(TemplateInputs inputs, CancellationToken cancellationToken)
633private async Task<string> GetOutputPathAsync(TemplateInputs inputs, Func<string, string> pathDeriver, string projectName, CancellationToken cancellationToken)
643private async Task<(NuGetPackage Package, PackageChannel Channel)> GetProjectTemplatesVersionAsync(TemplateInputs inputs, 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, string logFilePath, 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)
69internal static async Task<int> BuildAppHostAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, bool noRestore, DotNetCliRunnerInvocationOptions options, DirectoryInfo workingDirectory, CancellationToken cancellationToken)
aspire-managed (5)
Aspire.Azure.AI.OpenAI.Tests (2)
Aspire.Azure.Messaging.WebPubSub (1)
Aspire.Azure.Search.Documents (1)
Aspire.Azure.Storage.Files.DataLake (2)
Aspire.Cli.EndToEnd.Tests (57)
Aspire.Cli.Tests (382)
Agents\PlaywrightCliInstallerTests.cs (7)
552public Task<NpmPackageInfo?> ResolvePackageAsync(string packageName, string versionRange, CancellationToken cancellationToken)
558public Task<string?> PackAsync(string packageName, string version, string outputDirectory, CancellationToken cancellationToken)
564public Task<bool> AuditSignaturesAsync(string packageName, string version, CancellationToken cancellationToken)
567public Task<bool> InstallGlobalAsync(string tarballPath, CancellationToken cancellationToken)
579public Task<ProvenanceVerificationResult> VerifyProvenanceAsync(string packageName, string version, string expectedSourceRepository, string expectedWorkflowPath, string expectedBuildType, Func<WorkflowRefInfo, bool>? validateWorkflowRef, CancellationToken cancellationToken, string? sriIntegrity = null)
599public Task<SemVersion?> GetVersionAsync(CancellationToken cancellationToken)
602public Task<bool> InstallSkillsAsync(string workingDirectory, CancellationToken cancellationToken)
Commands\AddCommandTests.cs (2)
822public override Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
831public override Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
Commands\ExecCommandTests.cs (9)
171public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
176public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
181public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
186public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
191public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
196public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
201public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
206public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
211public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
Commands\InitCommandTests.cs (13)
397public override Task<(Aspire.Shared.NuGetPackageCli Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(Aspire.Shared.NuGetPackageCli Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken)
406public override Task<string> PromptForProjectNameAsync(string defaultName, CancellationToken cancellationToken)
415public override Task<string> PromptForOutputPath(string defaultPath, CancellationToken cancellationToken)
428public Task<IEnumerable<PackageChannel>> GetChannelsAsync(CancellationToken cancellationToken = default)
438public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
449public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
454public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
459public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
548public Task<IEnumerable<PackageChannel>> GetChannelsAsync(CancellationToken cancellationToken = default)
562public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
574public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
579public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
584public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
Commands\NewCommandTests.cs (33)
686public Task<EnsureCertificatesTrustedResult> EnsureCertificatesTrustedAsync(CancellationToken cancellationToken)
1483public override Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken)
1492public override Task<string> PromptForProjectNameAsync(string defaultName, CancellationToken cancellationToken)
1501public override Task<string> PromptForOutputPath(string path, CancellationToken cancellationToken)
1510public override Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken)
1524public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
1534public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
1539public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
1558public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, CancellationToken cancellationToken = default) where T : notnull
1579public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default) => Task.FromResult(true);
1580public Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default)
1596public Func<CancellationToken, Task<IEnumerable<PackageChannel>>>? GetChannelsAsyncCallback { get; set; }
1598public Task<IEnumerable<PackageChannel>> GetChannelsAsync(CancellationToken cancellationToken = default)
1613public Func<DirectoryInfo, bool, FileInfo?, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetTemplatePackagesAsyncCallback { get; set; }
1615public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
1631public Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
1636public Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
1641public Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
1649public Func<ScaffoldContext, CancellationToken, Task<bool>>? ScaffoldAsyncCallback { get; set; }
1651public Task<bool> ScaffoldAsync(ScaffoldContext context, CancellationToken cancellationToken)
1674internal sealed class TestTypeScriptStarterProjectFactory(Func<DirectoryInfo, CancellationToken, Task<bool>> buildAndGenerateSdkAsync) : IAppHostProjectFactory
1701internal sealed class TestTypeScriptStarterProject(Func<DirectoryInfo, CancellationToken, Task<bool>> buildAndGenerateSdkAsync) : IAppHostProject, IGuestAppHostSdkGenerator
1711public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default)
1726public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
1731public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
1736public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
1741public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
1746public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
1751public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
1756public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
1761public Task<IReadOnlyList<(string PackageId, string Version)>> GetPackageReferencesAsync(FileInfo appHostFile, CancellationToken cancellationToken)
1766public Task<bool> BuildAndGenerateSdkAsync(DirectoryInfo directory, CancellationToken cancellationToken)
Commands\PublishCommandPromptingIntegrationTests.cs (9)
813public Task<DashboardUrlsState> GetDashboardUrlsAsync(CancellationToken cancellationToken) =>
833public Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken) => Task.FromResult(new[] { "baseline.v2" });
873public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
890public Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default)
893public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
913public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, CancellationToken cancellationToken = default) where T : notnull
931public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
949public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => action();
Commands\RunCommandTests.cs (19)
167public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
172public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
177public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
214public Task<Aspire.Cli.Certificates.EnsureCertificatesTrustedResult> EnsureCertificatesTrustedAsync(CancellationToken cancellationToken)
222public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
227public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
232public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
237public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
242public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
247public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
329var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
384var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
548var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
618var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
688var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
1266public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
1271public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
1277public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
1404var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
Commands\SecretCommandTests.cs (11)
85public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default)
88public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
91public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default)
111public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
113public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken) => throw new NotSupportedException();
114public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default) => Task.FromResult<string[]>([]);
115public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken) => Task.FromResult<string?>(userSecretsId);
117public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
118public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
119public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
120public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken) => throw new NotSupportedException();
Commands\UpdateCommandTests.cs (11)
1044public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => _innerService.ShowStatusAsync(statusText, action, emoji, allowMarkup);
1046public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
1048public Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default)
1050public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
1052public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
1054public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, CancellationToken cancellationToken = default) where T : notnull
1084public Func<FileInfo, PackageChannel, CancellationToken, Task<ProjectUpdateResult>>? UpdateProjectAsyncCallback { get; set; }
1086public Task<ProjectUpdateResult> UpdateProjectAsync(FileInfo projectFile, PackageChannel channel, CancellationToken cancellationToken = default)
1101public Func<CancellationToken, Task<IEnumerable<PackageChannel>>>? GetChannelsAsyncCallback { get; set; }
1103public Task<IEnumerable<PackageChannel>> GetChannelsAsync(CancellationToken cancellationToken = default)
Mcp\MockPackagingService.cs (5)
20public Task<IEnumerable<PackageChannel>> GetChannelsAsync(CancellationToken cancellationToken = default)
37public Task<IEnumerable<NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
40public Task<IEnumerable<NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
43public Task<IEnumerable<NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
46public Task<IEnumerable<NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
Packaging\NuGetConfigMergerSnapshotTests.cs (5)
27public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
28public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
29public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
30public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
45private static async Task<FileInfo> WriteConfigAsync(DirectoryInfo dir, string content)
Packaging\NuGetConfigMergerTests.cs (5)
22private static async Task<FileInfo> WriteConfigAsync(DirectoryInfo dir, string content)
31public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
35public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
39public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
43public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
Packaging\PackageChannelTests.cs (4)
14public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
15public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
16public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
17public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
Packaging\PackagingServiceTests.cs (8)
19public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
20public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
21public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
22public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
897public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
906public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
909public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
912public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
Projects\AppHostServerProjectTests.cs (5)
321public Task<IEnumerable<PackageChannel>> GetChannelsAsync(CancellationToken cancellationToken = default)
346public Task<IEnumerable<NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
349public Task<IEnumerable<NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
352public Task<IEnumerable<NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
355public Task<IEnumerable<NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
Projects\ExtensionGuestLauncherTests.cs (7)
159public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => throw new NotImplementedException();
161public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, Spectre.Console.ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default) => throw new NotImplementedException();
162public Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, Spectre.Console.ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default) => throw new NotImplementedException();
163public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull => throw new NotImplementedException();
164public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, CancellationToken cancellationToken = default) where T : notnull => throw new NotImplementedException();
171public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default) => throw new NotImplementedException();
Templating\DotNetTemplateFactoryTests.cs (36)
36public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
40public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
44public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
48public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
403public Task<bool> DeleteConfigurationAsync(string key, bool isGlobal = false, CancellationToken cancellationToken = default)
408public Task<Dictionary<string, string>> GetAllConfigurationAsync(CancellationToken cancellationToken = default)
413public Task<Dictionary<string, string>> GetLocalConfigurationAsync(CancellationToken cancellationToken = default)
418public Task<Dictionary<string, string>> GetGlobalConfigurationAsync(CancellationToken cancellationToken = default)
423public Task<string?> GetConfigurationAsync(string key, CancellationToken cancellationToken = default)
457public Task<T> PromptForSelectionAsync<T>(string prompt, IEnumerable<T> choices, Func<T, string> displaySelector, CancellationToken cancellationToken) where T : notnull
460public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, CancellationToken cancellationToken = default) where T : notnull
463public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
466public Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default)
469public Task<bool> ConfirmAsync(string prompt, bool defaultAnswer, CancellationToken cancellationToken)
472public Task<TResult> ShowStatusAsync<TResult>(string message, Func<Task<TResult>> work, KnownEmoji? emoji = null, bool allowMarkup = false)
501public Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
504public Task<int> NewProjectAsync(string templateName, string projectName, string outputPath, string[] extraArgs, DotNetCliRunnerInvocationOptions? options, CancellationToken cancellationToken)
507public Task<int> RestoreAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
510public Task<int> BuildAsync(FileInfo projectFile, bool noRestore, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
513public Task<int> AddPackageAsync(FileInfo projectFile, string packageName, string version, string? packageSourceUrl, bool noRestore, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
516public Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
519public Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
522public Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProjectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
525public Task<(int ExitCode, NuGetPackageCli[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, bool useCache, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
528public Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
531public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
534public Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, bool noRestore, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
537public Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
540public Task<int> InitUserSecretsAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
546public Task<EnsureCertificatesTrustedResult> EnsureCertificatesTrustedAsync(CancellationToken cancellationToken)
552public Task<IEnumerable<PackageChannel>> GetChannelsAsync(CancellationToken cancellationToken)
558public Task<string> PromptForProjectNameAsync(string defaultName, CancellationToken cancellationToken)
561public Task<string> PromptForOutputPath(string defaultPath, CancellationToken cancellationToken)
564public Task<(Aspire.Shared.NuGetPackageCli Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(Aspire.Shared.NuGetPackageCli Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
567public Task<ITemplate> PromptForTemplateAsync(ITemplate[] templates, CancellationToken cancellationToken)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
TestServices\FakeNuGetPackageCache.cs (4)
11public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
14public Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
17public Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
20public Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
TestServices\FakePlaywrightServices.cs (7)
15public Task<NpmPackageInfo?> ResolvePackageAsync(string packageName, string versionRange, CancellationToken cancellationToken)
18public Task<string?> PackAsync(string packageName, string version, string outputDirectory, CancellationToken cancellationToken)
21public Task<bool> AuditSignaturesAsync(string packageName, string version, CancellationToken cancellationToken)
24public Task<bool> InstallGlobalAsync(string tarballPath, CancellationToken cancellationToken)
33public Task<ProvenanceVerificationResult> VerifyProvenanceAsync(string packageName, string version, string expectedSourceRepository, string expectedWorkflowPath, string expectedBuildType, Func<WorkflowRefInfo, bool>? validateWorkflowRef, CancellationToken cancellationToken, string? sriIntegrity = null)
46public Task<SemVersion?> GetVersionAsync(CancellationToken cancellationToken)
49public Task<bool> InstallSkillsAsync(string workingDirectory, CancellationToken cancellationToken)
TestServices\TestAppHostProjectFactory.cs (9)
126public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken)
146public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
149public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
152public Task<IReadOnlyList<(string PackageId, string Version)>> GetPackageReferencesAsync(FileInfo appHostFile, CancellationToken cancellationToken)
155public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
176public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
179public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
182public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
185public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
TestServices\TestDotNetCliRunner.cs (15)
23public Func<FileInfo, bool, bool, bool, string[], IDictionary<string, string>?, TaskCompletionSource<IAppHostCliBackchannel>?, DotNetCliRunnerInvocationOptions, CancellationToken, Task<int>>? RunAsyncCallback { get; set; }
28public Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, bool noRestore, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
35public Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
42public Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
49public Task<int> RestoreAsync(FileInfo projectFilePath, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
56public Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
65public Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
81public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
88public Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
95public Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
102public Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, bool noRestore, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
109public Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, bool useCache, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
116public Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
123public Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProject, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
130public Task<int> InitUserSecretsAsync(FileInfo projectFile, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
TestServices\TestExtensionBackchannel.cs (14)
51public Func<string, bool, Task<bool>>? ConfirmAsyncCallback { get; set; }
54public Func<string, string?, Func<string, ValidationResult>?, bool, Task<string>>? PromptForStringAsyncCallback { get; set; }
57public Func<string, Func<string, ValidationResult>?, bool, Task<string>>? PromptForSecretStringAsyncCallback { get; set; }
60public Func<string, string?, bool, Task<string?>>? PromptForFilePathAsyncCallback { get; set; }
69public Func<CancellationToken, Task<string[]>>? GetCapabilitiesAsyncCallback { get; set; }
72public Func<string, CancellationToken, Task<bool>>? HasCapabilityAsyncCallback { get; set; }
155public Task<string?> PromptForFilePathAsync(string promptText, string? defaultValue, bool directory, CancellationToken cancellationToken)
163public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull
175public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull
187public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
195public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool required = false, CancellationToken cancellationToken = default)
203public Task<string> PromptForSecretStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool required = false, CancellationToken cancellationToken = default)
227public Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
235public async Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken)
TestServices\TestExtensionInteractionService.cs (7)
28public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
38public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
43public Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default)
48public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
58public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, CancellationToken cancellationToken = default) where T : notnull
124public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
TestServices\TestInteractionService.cs (7)
53public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
64public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, CancellationToken cancellationToken = default)
81public Task<string> PromptForFilePathAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, CancellationToken cancellationToken = default)
86public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken = default) where T : notnull
116public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, CancellationToken cancellationToken = default) where T : notnull
165public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
TestServices\TestProjectLocator.cs (6)
11public Func<FileInfo?, bool, CancellationToken, Task<FileInfo?>>? UseOrFindAppHostProjectFileAsyncCallback { get; set; }
13public Func<FileInfo?, MultipleAppHostProjectsFoundBehavior, bool, CancellationToken, Task<AppHostProjectSearchResult>>? UseOrFindAppHostProjectFileWithBehaviorAsyncCallback { get; set; }
15public Func<CancellationToken, Task<FileInfo?>>? GetAppHostFromSettingsAsyncCallback { get; set; }
17public async Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
34public async Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default)
51public async Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default)
Utils\CliUpdateNotificationServiceTests.cs (4)
296public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
301public Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
306public Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
311public Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
Aspire.Components.Common.TestUtilities (1)
Aspire.Confluent.Kafka (2)
Aspire.Dashboard (76)
ServiceClient\DashboardClient.cs (6)
298private async Task WatchWithRecoveryAsync(Func<RetryContext, CancellationToken, Task<RetryResult>> action, string actionName, CancellationToken cancellationToken)
357private async Task<RetryResult> WatchResourcesAsync(RetryContext retryContext, CancellationToken cancellationToken)
450private async Task<RetryResult> WatchInteractionsAsync(RetryContext retryContext, CancellationToken cancellationToken)
528private static async Task<bool> IsUnimplemented(AsyncDuplexStreamingCall<WatchInteractionsRequestUpdate, WatchInteractionsResponseUpdate> call)
595public async Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
754public async Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, CancellationToken cancellationToken)
Aspire.Dashboard.Components.Tests (53)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\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;
30public Task<IDialogReference> ShowConfirmationAsync(object receiver, Func<DialogResult, Task> callback, string message, string primaryText = "Yes", string secondaryText = "No", string? title = null) => throw new NotImplementedException();
31public Task<IDialogReference> ShowConfirmationAsync(string message, string primaryText = "Yes", string secondaryText = "No", string? title = null) => throw new NotImplementedException();
35public async Task<IDialogReference> ShowDialogAsync<TData>(Type dialogComponent, TData data, DialogParameters parameters) where TData : class
40public async Task<IDialogReference> ShowDialogAsync<TDialog>(object data, DialogParameters parameters) where TDialog : IDialogContentComponent
45private async Task<IDialogReference> RunShowDialogCallbackAsync(Type dialogComponent, object data, DialogParameters parameters)
56public Task<IDialogReference> ShowDialogAsync<TDialog>(DialogParameters parameters) where TDialog : IDialogContentComponent => throw new NotImplementedException();
57public Task<IDialogReference> ShowDialogAsync(RenderFragment renderFragment, DialogParameters dialogParameters) => throw new NotImplementedException();
58public Task<IDialogReference> ShowDialogAsync<TDialog, TData>(DialogParameters<TData> parameters) where TDialog : IDialogContentComponent<TData> where TData : class => throw new NotImplementedException();
60public Task<IDialogReference> ShowErrorAsync(string message, string? title = null, string? primaryText = null) => throw new NotImplementedException();
62public Task<IDialogReference> ShowInfoAsync(string message, string? title = null, string? primaryText = null) => throw new NotImplementedException();
64public async Task<IDialogReference> ShowMessageBoxAsync(DialogParameters<MessageBoxContent> parameters)
77public Task<IDialogReference> ShowPanelAsync<TData>(Type dialogComponent, TData data, DialogParameters parameters) where TData : class => throw new NotImplementedException();
78public Task<IDialogReference> ShowPanelAsync<TDialog>(object data, DialogParameters parameters) where TDialog : IDialogContentComponent => throw new NotImplementedException();
79public Task<IDialogReference> ShowPanelAsync<TDialog>(DialogParameters parameters) where TDialog : IDialogContentComponent => throw new NotImplementedException();
80public Task<IDialogReference> ShowPanelAsync<TDialog, TData>(DialogParameters<TData> parameters) where TDialog : IDialogContentComponent<TData> where TData : class => throw new NotImplementedException();
81public Task<IDialogReference> ShowPanelAsync<TData>(Type dialogComponent, DialogParameters<TData> parameters) where TData : class => throw new NotImplementedException();
85public Task<IDialogReference> ShowSplashScreenAsync(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
86public Task<IDialogReference> ShowSplashScreenAsync(DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
87public Task<IDialogReference> ShowSplashScreenAsync<T>(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent> => throw new NotImplementedException();
88public Task<IDialogReference> ShowSplashScreenAsync<T>(DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent> => throw new NotImplementedException();
89public Task<IDialogReference> ShowSplashScreenAsync(Type component, object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
90public Task<IDialogReference> ShowSplashScreenAsync(Type component, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
92public Task<IDialogReference> ShowSuccessAsync(string message, string? title = null, string? primaryText = null) => throw new NotImplementedException();
94public Task<IDialogReference> ShowWarningAsync(string message, string? title = null, string? primaryText = null) => throw new NotImplementedException();
96public Task<IDialogReference?> UpdateDialogAsync<TData>(string id, DialogParameters<TData> parameters) where TData : class => throw new NotImplementedException();
Aspire.Dashboard.Tests (72)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\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;
30public Task<IDialogReference> ShowConfirmationAsync(object receiver, Func<DialogResult, Task> callback, string message, string primaryText = "Yes", string secondaryText = "No", string? title = null) => throw new NotImplementedException();
31public Task<IDialogReference> ShowConfirmationAsync(string message, string primaryText = "Yes", string secondaryText = "No", string? title = null) => throw new NotImplementedException();
35public async Task<IDialogReference> ShowDialogAsync<TData>(Type dialogComponent, TData data, DialogParameters parameters) where TData : class
40public async Task<IDialogReference> ShowDialogAsync<TDialog>(object data, DialogParameters parameters) where TDialog : IDialogContentComponent
45private async Task<IDialogReference> RunShowDialogCallbackAsync(Type dialogComponent, object data, DialogParameters parameters)
56public Task<IDialogReference> ShowDialogAsync<TDialog>(DialogParameters parameters) where TDialog : IDialogContentComponent => throw new NotImplementedException();
57public Task<IDialogReference> ShowDialogAsync(RenderFragment renderFragment, DialogParameters dialogParameters) => throw new NotImplementedException();
58public Task<IDialogReference> ShowDialogAsync<TDialog, TData>(DialogParameters<TData> parameters) where TDialog : IDialogContentComponent<TData> where TData : class => throw new NotImplementedException();
60public Task<IDialogReference> ShowErrorAsync(string message, string? title = null, string? primaryText = null) => throw new NotImplementedException();
62public Task<IDialogReference> ShowInfoAsync(string message, string? title = null, string? primaryText = null) => throw new NotImplementedException();
64public async Task<IDialogReference> ShowMessageBoxAsync(DialogParameters<MessageBoxContent> parameters)
77public Task<IDialogReference> ShowPanelAsync<TData>(Type dialogComponent, TData data, DialogParameters parameters) where TData : class => throw new NotImplementedException();
78public Task<IDialogReference> ShowPanelAsync<TDialog>(object data, DialogParameters parameters) where TDialog : IDialogContentComponent => throw new NotImplementedException();
79public Task<IDialogReference> ShowPanelAsync<TDialog>(DialogParameters parameters) where TDialog : IDialogContentComponent => throw new NotImplementedException();
80public Task<IDialogReference> ShowPanelAsync<TDialog, TData>(DialogParameters<TData> parameters) where TDialog : IDialogContentComponent<TData> where TData : class => throw new NotImplementedException();
81public Task<IDialogReference> ShowPanelAsync<TData>(Type dialogComponent, DialogParameters<TData> parameters) where TData : class => throw new NotImplementedException();
85public Task<IDialogReference> ShowSplashScreenAsync(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
86public Task<IDialogReference> ShowSplashScreenAsync(DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
87public Task<IDialogReference> ShowSplashScreenAsync<T>(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent> => throw new NotImplementedException();
88public Task<IDialogReference> ShowSplashScreenAsync<T>(DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent> => throw new NotImplementedException();
89public Task<IDialogReference> ShowSplashScreenAsync(Type component, object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
90public Task<IDialogReference> ShowSplashScreenAsync(Type component, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
92public Task<IDialogReference> ShowSuccessAsync(string message, string? title = null, string? primaryText = null) => throw new NotImplementedException();
94public Task<IDialogReference> ShowWarningAsync(string message, string? title = null, string? primaryText = null) => throw new NotImplementedException();
96public Task<IDialogReference?> UpdateDialogAsync<TData>(string id, DialogParameters<TData> parameters) where TData : class => throw new NotImplementedException();
Aspire.Deployment.EndToEnd.Tests (27)
Aspire.EndToEnd.Tests (12)
Aspire.Hosting (187)
ApplicationModel\ResourceNotificationService.cs (7)
118/// <returns>A <see cref="Task{String}"/> representing the wait operation and which of the target states the resource reached.</returns>
121public async Task<string> WaitForResourceAsync(string resourceName, IEnumerable<string> targetStates, CancellationToken cancellationToken = default)
189public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, CancellationToken cancellationToken = default)
222public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, WaitBehavior waitBehavior, CancellationToken cancellationToken = default)
473/// <returns>A <see cref="Task{ResourceEvent}"/> representing the wait operation and which of the target states the resource reached.</returns>
476public async Task<ResourceEvent> WaitForResourceAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default)
489private async Task<ResourceEvent> WaitForResourceCoreAsync(string resourceName, Func<ResourceEvent, bool> predicate, string cancellationMessage, CancellationToken cancellationToken = default)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (18)
39public Task<GetCapabilitiesResponse> GetCapabilitiesAsync(GetCapabilitiesRequest? request = null, CancellationToken cancellationToken = default)
57public async Task<GetAppHostInfoResponse> GetAppHostInfoAsync(GetAppHostInfoRequest? request = null, CancellationToken cancellationToken = default)
79public async Task<GetDashboardInfoResponse> GetDashboardInfoAsync(GetDashboardInfoRequest? request = null, CancellationToken cancellationToken = default)
112public async Task<GetResourcesResponse> GetResourcesAsync(GetResourcesRequest? request = null, CancellationToken cancellationToken = default)
169public async Task<CallMcpToolResponse> CallMcpToolAsync(CallMcpToolRequest request, CancellationToken cancellationToken = default)
202public async Task<StopAppHostResponse> StopAsync(StopAppHostRequest? request = null, CancellationToken cancellationToken = default)
215public async Task<ExecuteResourceCommandResponse> ExecuteResourceCommandAsync(ExecuteResourceCommandRequest request, CancellationToken cancellationToken = default)
233public async Task<WaitForResourceResponse> WaitForResourceAsync(WaitForResourceRequest request, CancellationToken cancellationToken = default)
273private static async Task<WaitForResourceResponse> WaitForHealthyAsync(ResourceNotificationService notificationService, string resourceName, CancellationToken cancellationToken)
285private static async Task<WaitForResourceResponse> WaitForRunningAsync(ResourceNotificationService notificationService, string resourceName, CancellationToken cancellationToken)
304private static async Task<WaitForResourceResponse> WaitForTerminalAsync(ResourceNotificationService notificationService, string resourceName, CancellationToken cancellationToken)
329public Task<AppHostInformation> GetAppHostInformationAsync(CancellationToken cancellationToken = default)
371public async Task<DashboardMcpConnectionInfo?> GetDashboardMcpConnectionInfoAsync(CancellationToken cancellationToken = default)
423public async Task<DashboardUrlsState> GetDashboardUrlsAsync(CancellationToken cancellationToken = default)
434public async Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(CancellationToken cancellationToken = default)
502private async Task<ResourceSnapshot?> CreateResourceSnapshotFromEventAsync(
752public async Task<CallToolResult> CallResourceMcpToolAsync(
868private async Task<Tool[]?> TryListToolsAsync(Uri endpointUri, CancellationToken cancellationToken)
ContainerResourceBuilderExtensions.cs (4)
727public static IResourceBuilder<T> WithDockerfileFactory<T>(this IResourceBuilder<T> builder, string contextPath, Func<DockerfileFactoryContext, Task<string>> dockerfileFactory, string? stage = null) where T : ContainerResource
881public static IResourceBuilder<ContainerResource> AddDockerfileFactory(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, Func<DockerfileFactoryContext, Task<string>> dockerfileFactory, string? stage = null)
1303public static IResourceBuilder<T> WithContainerFiles<T>(this IResourceBuilder<T> builder, string destinationPath, Func<ContainerFileSystemCallbackContext, CancellationToken, Task<IEnumerable<ContainerFileSystemItem>>> callback, int? defaultOwner = null, int? defaultGroup = null, UnixFileMode? umask = null) where T : ContainerResource
1460Func<DockerfileFactoryContext, Task<string>> dockerfileFactory = async factoryContext =>
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)
304public Task<Stream> GetLogStreamAsync<T>(
450private Task<TResult> ExecuteWithRetry<TResult>(
465private async Task<TResult> ExecuteWithRetry<TResult>(
468Func<DcpKubernetesClient, Task<TResult>> operation,
IInteractionService.cs (6)
36Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default);
48Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default);
62Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
75Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
88Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
100Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default);
InteractionService.cs (8)
58public async Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
68public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
77private async Task<InteractionResult<bool>> PromptMessageBoxCoreAsync(string title, string message, MessageBoxInteractionOptions options, CancellationToken cancellationToken)
106public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
111public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
122public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
219public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
362private async Task<bool> RunValidationAsync(Interaction interactionState, InteractionCompletionState result, CancellationToken cancellationToken)
Publishing\DockerContainerRuntime.cs (6)
21private async Task<int> RunDockerBuildAsync(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options, Dictionary<string, string?> buildArguments, Dictionary<string, BuildImageSecretValue> buildSecrets, string? stage, CancellationToken cancellationToken)
169public override async Task<bool> CheckIfRunningAsync(CancellationToken cancellationToken)
181private async Task<bool> CheckDockerDaemonAsync(CancellationToken cancellationToken)
200private async Task<bool> CheckDockerBuildxAsync(CancellationToken cancellationToken)
219private async Task<int> CreateBuildkitInstanceAsync(string builderName, CancellationToken cancellationToken)
231private async Task<int> RemoveBuildkitInstanceAsync(string builderName, CancellationToken cancellationToken)
Aspire.Hosting.Azure (43)
Provisioning\Internal\BaseProvisioningContextProvider.cs (6)
78public virtual async Task<ProvisioningContext> CreateProvisioningContextAsync(CancellationToken cancellationToken = default)
201protected async Task<(List<KeyValuePair<string, string>>? tenantOptions, bool fetchSucceeded)> TryGetTenantsAsync(CancellationToken cancellationToken)
250protected async Task<(List<KeyValuePair<string, string>>? subscriptionOptions, bool fetchSucceeded)> TryGetSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken)
278protected async Task<(List<KeyValuePair<string, string>>? subscriptionOptions, bool fetchSucceeded)> TryGetSubscriptionsAsync(CancellationToken cancellationToken)
283protected async Task<(List<(string Name, string Location)>? resourceGroupOptions, bool fetchSucceeded)> TryGetResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken)
316protected async Task<(List<KeyValuePair<string, string>> locationOptions, bool fetchSucceeded)> TryGetLocationsAsync(string subscriptionId, CancellationToken cancellationToken)
Provisioning\Internal\IProvisioningServices.cs (12)
48Task<string> CompileBicepToArmAsync(string bicepFilePath, CancellationToken cancellationToken = default);
61Task<ProvisioningContext> CreateProvisioningContextAsync(CancellationToken cancellationToken = default);
72Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default);
77Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default);
82Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default);
87Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default);
92Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default);
97Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default);
139Task<Response<IResourceGroupResource>> GetAsync(string resourceGroupName, CancellationToken cancellationToken = default);
144Task<ArmOperation<IResourceGroupResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceGroupName, ResourceGroupData data, CancellationToken cancellationToken = default);
176Task<ArmOperation<ArmDeploymentResource>> CreateOrUpdateAsync(
212Task<UserPrincipal> GetUserPrincipalAsync(CancellationToken cancellationToken = default);
Aspire.Hosting.Azure.AppContainers (1)
Aspire.Hosting.Azure.AppService (2)
Aspire.Hosting.Azure.KeyVault (2)
Aspire.Hosting.Azure.Kusto (5)
Aspire.Hosting.Azure.Kusto.Tests (13)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Azure.Tests (39)
ProvisioningTestHelpers.cs (14)
199public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
214public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
223public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
232public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
244public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
255public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
334public Task<Response<IResourceGroupResource>> GetAsync(string resourceGroupName, CancellationToken cancellationToken = default)
348public Task<ArmOperation<IResourceGroupResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceGroupName, ResourceGroupData data, CancellationToken cancellationToken = default)
424public Task<ArmOperation<ArmDeploymentResource>> CreateOrUpdateAsync(
597public Task<string> CompileBicepToArmAsync(string bicepFilePath, CancellationToken cancellationToken = default)
614public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
636public Task<UserPrincipal> GetUserPrincipalAsync(CancellationToken cancellationToken = default)
674public (Task<ProcessResult>, IAsyncDisposable) Run(ProcessSpec processSpec)
685var resultTask = Task.FromResult(result);
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 async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
36public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
51public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
58public Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
Aspire.Hosting.CodeGeneration.Go.Tests (7)
Aspire.Hosting.CodeGeneration.Java.Tests (7)
Aspire.Hosting.CodeGeneration.Python.Tests (7)
Aspire.Hosting.CodeGeneration.Rust.Tests (7)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (7)
Aspire.Hosting.DevTunnels (44)
DevTunnelCli.cs (19)
35public Task<int> GetVersionAsync(TextWriter? outputWriter = null, TextWriter? errorWriter = null, ILogger? logger = default, CancellationToken cancellationToken = default)
38public Task<int> UserLoginMicrosoftAsync(ILogger? logger = default, CancellationToken cancellationToken = default)
41public Task<int> UserLoginGitHubAsync(ILogger? logger = default, CancellationToken cancellationToken = default)
44public Task<int> UserLogoutAsync(TextWriter? outputWriter = null, TextWriter? errorWriter = null, ILogger? logger = default, CancellationToken cancellationToken = default)
48public Task<int> UserStatusAsync(TextWriter? outputWriter = null, TextWriter? errorWriter = null, ILogger? logger = default, CancellationToken cancellationToken = default)
51public Task<int> CreateTunnelAsync(
70public Task<int> UpdateTunnelAsync(
87public Task<int> ListPortsAsync(
100public Task<int> ListAccessAsync(
115public Task<int> ResetAccessAsync(
130public Task<int> CreateAccessAsync(
154public Task<int> DeleteTunnelAsync(
162public Task<int> ShowTunnelAsync(
170public Task<int> CreatePortAsync(
189public Task<int> UpdatePortAsync(
208public Task<int> DeletePortAsync(
217private Task<int> RunAsync(string[] args, TextWriter? outputWriter = null, TextWriter? errorWriter = null, ILogger? logger = default, CancellationToken cancellationToken = default)
220private Task<int> RunAsync(string[] args, TextWriter? outputWriter = null, TextWriter? errorWriter = null, bool useShellExecute = false, ILogger? logger = default, CancellationToken cancellationToken = default)
235private async Task<int> RunAsync(Action<bool, string> onOutput, string[] args, bool useShellExecute = false, ILogger? logger = default, CancellationToken cancellationToken = default)
DevTunnelCliClient.cs (13)
18public async Task<Version> GetVersionAsync(ILogger? logger = default, CancellationToken cancellationToken = default)
52public async Task<DevTunnelStatus> CreateTunnelAsync(string tunnelId, DevTunnelOptions options, ILogger? logger = default, CancellationToken cancellationToken = default)
127public async Task<DevTunnelStatus> GetTunnelAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default)
137public async Task<DevTunnelPortList> GetPortListAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default)
146public async Task<DevTunnelPortStatus> CreatePortAsync(string tunnelId, int portNumber, DevTunnelPortOptions options, ILogger? logger = default, CancellationToken cancellationToken = default)
215public async Task<DevTunnelPortDeleteResult> DeletePortAsync(string tunnelId, int portNumber, ILogger? logger = default, CancellationToken cancellationToken = default)
224public async Task<DevTunnelAccessStatus> GetAccessAsync(string tunnelId, int? portNumber = null, ILogger? logger = default, CancellationToken cancellationToken = default)
233public async Task<UserLoginStatus> GetUserLoginStatusAsync(ILogger? logger = default, CancellationToken cancellationToken = default)
242public async Task<UserLoginStatus> UserLoginAsync(LoginProvider provider, ILogger? logger = default, CancellationToken cancellationToken = default)
261private async Task<(T? Result, int ExitCode, string? Error)> CallCliAsJsonAsync<T>(Func<TextWriter, TextWriter, ILogger?, CancellationToken, Task<int>> cliCall, ILogger? logger = default, CancellationToken cancellationToken = default)
266private async Task<(T? Result, int ExitCode, string? Error)> CallCliAsJsonAsync<T>(Func<TextWriter, TextWriter, ILogger?, CancellationToken, Task<int>> cliCall, string? propertyName, ILogger? logger = default, CancellationToken cancellationToken = default)
IDevTunnelClient.cs (9)
10Task<Version> GetVersionAsync(ILogger? logger = default, CancellationToken cancellationToken = default);
12Task<UserLoginStatus> GetUserLoginStatusAsync(ILogger? logger = default, CancellationToken cancellationToken = default);
14Task<UserLoginStatus> UserLoginAsync(LoginProvider provider, ILogger? logger = default, CancellationToken cancellationToken = default);
16Task<DevTunnelStatus> CreateTunnelAsync(string tunnelId, DevTunnelOptions options, ILogger? logger = default, CancellationToken cancellationToken = default);
18Task<DevTunnelPortList> GetPortListAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default);
20Task<DevTunnelPortStatus> CreatePortAsync(string tunnelId, int portNumber, DevTunnelPortOptions options, ILogger? logger = default, CancellationToken cancellationToken = default);
22Task<DevTunnelPortDeleteResult> DeletePortAsync(string tunnelId, int portNumber, ILogger? logger = default, CancellationToken cancellationToken = default);
24Task<DevTunnelStatus> GetTunnelAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default);
26Task<DevTunnelAccessStatus> GetAccessAsync(string tunnelId, int? portNumber = null, ILogger? logger = default, CancellationToken cancellationToken = default);
Aspire.Hosting.DevTunnels.Tests (18)
DevTunnelCliVersionValidationTests.cs (9)
51public Task<Version> GetVersionAsync(ILogger? logger = null, CancellationToken cancellationToken = default) => Task.FromResult(cliVersion);
53public Task<DevTunnelPortStatus> CreatePortAsync(string tunnelId, int portNumber, DevTunnelPortOptions options, ILogger? logger = null, CancellationToken cancellationToken = default)
58public Task<DevTunnelStatus> CreateTunnelAsync(string tunnelId, DevTunnelOptions options, ILogger? logger = null, CancellationToken cancellationToken = default)
63public Task<DevTunnelAccessStatus> GetAccessAsync(string tunnelId, int? portNumber = null, ILogger? logger = null, CancellationToken cancellationToken = default)
68public Task<DevTunnelStatus> GetTunnelAsync(string tunnelId, ILogger? logger = null, CancellationToken cancellationToken = default)
73public Task<UserLoginStatus> GetUserLoginStatusAsync(ILogger? logger = null, CancellationToken cancellationToken = default)
78public Task<UserLoginStatus> UserLoginAsync(LoginProvider provider, ILogger? logger = null, CancellationToken cancellationToken = default)
83public Task<DevTunnelPortList> GetPortListAsync(string tunnelId, ILogger? logger = null, CancellationToken cancellationToken = default)
88public Task<DevTunnelPortDeleteResult> DeletePortAsync(string tunnelId, int portNumber, ILogger? logger = null, CancellationToken cancellationToken = default)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Docker (5)
Aspire.Hosting.Docker.Tests (3)
Aspire.Hosting.DotnetTool.Tests (9)
Aspire.Hosting.Foundry (6)
Aspire.Hosting.Foundry.Tests (9)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Garnet.Tests (1)
Aspire.Hosting.GitHub.Models (2)
Aspire.Hosting.GitHub.Models.Tests (9)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.JavaScript.Tests (9)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public 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)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Kubernetes (3)
Aspire.Hosting.Maui (2)
Aspire.Hosting.MySql (1)
Aspire.Hosting.MySql.Tests (11)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Nats (2)
Aspire.Hosting.OpenAI (4)
Aspire.Hosting.OpenAI.Tests (9)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public 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)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public 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)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Redis.Tests (1)
Aspire.Hosting.RemoteHost (13)
Aspire.Hosting.RemoteHost.Tests (9)
Aspire.Hosting.Testing (17)
DistributedApplicationTestingBuilder.cs (11)
36public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(CancellationToken cancellationToken = default)
49public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, CancellationToken cancellationToken = default)
64public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(string[] args, CancellationToken cancellationToken = default)
78public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, CancellationToken cancellationToken = default)
94public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder, CancellationToken cancellationToken = default)
108public static async Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder, CancellationToken cancellationToken = default)
186public async Task<IDistributedApplicationTestingBuilder> CreateBuilderAsync(CancellationToken cancellationToken)
211public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
255public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
413public Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
511Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken = default);
Aspire.Hosting.Testing.Tests (3)
Aspire.Hosting.Tests (131)
Dcp\TestKubernetesService.cs (6)
38public Task<T> GetAsync<T>(string name, string? namespaceParameter = null, CancellationToken _ = default) where T : CustomResource, IKubernetesStaticMetadata
59public Task<T> CreateAsync<T>(T obj, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
104public async Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
124public Task<List<T>> ListAsync<T>(string? namespaceParameter = null, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
165public Task<Stream> GetLogStreamAsync<T>(
180public Task<T> PatchAsync<T>(T obj, V1Patch patch, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
Helpers\KubernetesHelper.cs (2)
13public static async Task<T> GetResourceByNameAsync<T>(IKubernetesService kubernetes, string resourceName, string resourceNameSuffix, Func<T, bool> ready, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
28public static async Task<T> GetResourceByNameMatchAsync<T>(IKubernetesService kubernetes, string resourceNamePattern, Func<T, bool> ready, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
InteractionServiceTests.cs (18)
26var resultTask = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
51var resultTask = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation", cancellationToken: cts.Token);
75var resultTask1 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
76var resultTask2 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
77var resultTask3 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
135var resultTask1 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
139var resultTask2 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
280var resultTask = interactionService.PromptInputAsync(
317var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
340var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
363var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
384var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
407var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
440var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
778var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
843var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
898var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
961var resultTask = interactionService.PromptInputsAsync("Validation Test", "Test validation", inputs, options);
Publishing\PipelineActivityReporterTests.cs (4)
521var promptTask = _interactionService.PromptInputAsync("Test Prompt", "test-description", "text-label", "test-placeholder");
546var promptTask = _interactionService.PromptInputAsync("Test Prompt", "test-description", "text-label", "test-placeholder");
575var promptTask = _interactionService.PromptInputAsync("Test Prompt", "test-description", "text-label", "test-placeholder");
610var notificationTask = _interactionService.PromptNotificationAsync("Test Notification", "This is a test notification message", notificationOptions);
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public 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 async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
36public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
51public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
58public Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
Aspire.Hosting.Valkey.Tests (10)
tests\Shared\AsyncTestHelpers.cs (9)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public 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)
113public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
128public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
220public 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.v6.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)
AzureFunctionsEndToEnd.Functions (1)
BasketService (14)
Binding.Http.IntegrationTests (3)
Binding.ReliableSession.IntegrationTests (10)
blazor-gateway (1)
CatalogDb (3)
CatalogModel (2)
cdac-build-tool (3)
CdkSample.ApiService (9)
Client.ClientBase.IntegrationTests (1)
Client.ExpectedExceptions.IntegrationTests (7)
Client.TypedClient.IntegrationTests (3)
Contract.Service.IntegrationTests (6)
Contract.XmlSerializer.IntegrationTests (1)
CosmosEndToEnd.ApiService (1)
csc (12)
dotnet (71)
NugetPackageDownloader\NuGetPackageDownloader.cs (22)
159public async Task<string> DownloadPackageAsync(PackageId packageId,
301public async Task<string> GetPackageUrl(PackageId packageId,
324public async Task<IEnumerable<string>> ExtractPackageAsync(string packagePath, DirectoryPath targetFolder)
365public async Task<IEnumerable<IPackageSearchMetadata>> GetLatestVersionsOfPackage(string packageId, bool includePreview, int numberOfResults)
371private async Task<(PackageSource, NuGetVersion)> GetPackageSourceAndVersion(PackageId packageId,
632private async Task<(PackageSource, IPackageSearchMetadata)> GetMatchingVersionInternalAsync(
713private async Task<(PackageSource, IPackageSearchMetadata)> GetLatestVersionInternalAsync(
720private async Task<IEnumerable<(PackageSource, IPackageSearchMetadata)>> GetLatestVersionsInternalAsync(
784public async Task<NuGetVersion> GetBestPackageVersionAsync(PackageId packageId,
798public async Task<(NuGetVersion version, PackageSource source)> GetBestPackageVersionAndSourceAsync(PackageId packageId,
812private async Task<(PackageSource, IPackageSearchMetadata)> GetPackageMetadataAsync(string packageIdentifier,
827List<Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)>> tasks = [.. sources
859foreach (Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)> task in tasks)
872Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)> finishedTask =
895private async Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)>
937public async Task<NuGetVersion> GetLatestPackageVersion(PackageId packageId,
944public async Task<IEnumerable<NuGetVersion>> GetLatestPackageVersions(PackageId packageId, int numberOfResults, PackageSourceLocation packageSourceLocation = null, bool includePreview = false)
954public async Task<IEnumerable<string>> GetPackageIdsAsync(string idStem, bool allowPrerelease, PackageSourceLocation packageSourceLocation = null, CancellationToken cancellationToken = default)
969public async Task<IEnumerable<NuGetVersion>> GetPackageVersionsAsync(PackageId packageId, string versionPrefix = null, bool allowPrerelease = false, PackageSourceLocation packageSourceLocation = null, CancellationToken cancellationToken = default)
983private async Task<IEnumerable<AutoCompleteResource>> GetAutocompleteAsync(PackageSource source, CancellationToken cancellationToken)
996private async Task<IEnumerable<NuGetVersion>> GetPackageVersionsForSource(AutoCompleteResource autocomplete, PackageId packageId, string versionPrefix, bool allowPrerelease, CancellationToken cancellationToken)
1015private static async Task<IEnumerable<string>> GetPackageIdsForSource(AutoCompleteResource autocomplete, PackageId packageId, bool allowPrerelease, CancellationToken cancellationToken)
dotnet-aot (38)
src\sdk\src\Cli\dotnet\NugetPackageDownloader\NuGetPackageDownloader.cs (22)
159public async Task<string> DownloadPackageAsync(PackageId packageId,
301public async Task<string> GetPackageUrl(PackageId packageId,
324public async Task<IEnumerable<string>> ExtractPackageAsync(string packagePath, DirectoryPath targetFolder)
365public async Task<IEnumerable<IPackageSearchMetadata>> GetLatestVersionsOfPackage(string packageId, bool includePreview, int numberOfResults)
371private async Task<(PackageSource, NuGetVersion)> GetPackageSourceAndVersion(PackageId packageId,
632private async Task<(PackageSource, IPackageSearchMetadata)> GetMatchingVersionInternalAsync(
713private async Task<(PackageSource, IPackageSearchMetadata)> GetLatestVersionInternalAsync(
720private async Task<IEnumerable<(PackageSource, IPackageSearchMetadata)>> GetLatestVersionsInternalAsync(
784public async Task<NuGetVersion> GetBestPackageVersionAsync(PackageId packageId,
798public async Task<(NuGetVersion version, PackageSource source)> GetBestPackageVersionAndSourceAsync(PackageId packageId,
812private async Task<(PackageSource, IPackageSearchMetadata)> GetPackageMetadataAsync(string packageIdentifier,
827List<Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)>> tasks = [.. sources
859foreach (Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)> task in tasks)
872Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)> finishedTask =
895private async Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)>
937public async Task<NuGetVersion> GetLatestPackageVersion(PackageId packageId,
944public async Task<IEnumerable<NuGetVersion>> GetLatestPackageVersions(PackageId packageId, int numberOfResults, PackageSourceLocation packageSourceLocation = null, bool includePreview = false)
954public async Task<IEnumerable<string>> GetPackageIdsAsync(string idStem, bool allowPrerelease, PackageSourceLocation packageSourceLocation = null, CancellationToken cancellationToken = default)
969public async Task<IEnumerable<NuGetVersion>> GetPackageVersionsAsync(PackageId packageId, string versionPrefix = null, bool allowPrerelease = false, PackageSourceLocation packageSourceLocation = null, CancellationToken cancellationToken = default)
983private async Task<IEnumerable<AutoCompleteResource>> GetAutocompleteAsync(PackageSource source, CancellationToken cancellationToken)
996private async Task<IEnumerable<NuGetVersion>> GetPackageVersionsForSource(AutoCompleteResource autocomplete, PackageId packageId, string versionPrefix, bool allowPrerelease, CancellationToken cancellationToken)
1015private static async Task<IEnumerable<string>> GetPackageIdsForSource(AutoCompleteResource autocomplete, PackageId packageId, bool allowPrerelease, CancellationToken cancellationToken)
dotnet-dev-certs (1)
dotnet-format (47)
dotnet-getdocument (1)
dotnet-openapi (18)
dotnet-sourcelink (7)
dotnet-sql-cache (1)
dotnet-suggest (4)
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 = "")
716public async Task<ProcessRunner.ProcessResult> RestoreAsync(ILogger logger, CancellationToken cancellationToken)
736public async Task<ProcessRunner.ProcessResult> BuildAsync(bool restore, ILogger logger, CancellationToken cancellationToken)
745public async Task<ProcessRunner.ProcessResult> BuildAsync(ILogger logger, CancellationToken cancellationToken)
755public async Task<IEnumerable<ProjectDependency>> ResolveProjectReferencesAsync(IEnumerable<ProjectDependency> excludeDependencies, ILogger logger, CancellationToken cancellationToken)
788private async Task<List<ProjectDependency>> ResolvePackageReferencesAsync(ILogger logger, CancellationToken cancellationToken)
866private async Task<List<ProjectDependency>> ResolveAssemblyReferencesAsync(ILogger logger, CancellationToken cancellationToken)
954public async Task<IEnumerable<KeyValuePair<string, string>>> ResolveProperyValuesAsync(IEnumerable<string> propertyNames, ILogger logger, CancellationToken cancellationToken)
993private 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-svcutil.xmlserializer.IntegrationTests (1)
dotnet-user-jwts (1)
dotnet-user-secrets (1)
dotnet-watch (8)
GenerateDocumentationAndConfigFiles (182)
src\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (9)
30public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
37public static Task<Document> AddFieldDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken)
44public static Task<Document> AddMethodDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
51public static Task<Document> AddPropertyDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken)
58public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
65public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
72public static Task<Document> AddNamespaceDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken)
79public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\roslyn\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)
GetDocument.Insider (1)
ILCompiler.ReadyToRun (16)
ILLink.CodeFixProvider (15)
ILLink.RoslynAnalyzer (1)
Infrastructure.Common (3)
Infrastructure.Tests (14)
Keycloak.Web (2)
Microsoft.Agents.AI.ProjectTemplates.Tests (3)
Microsoft.Analyzers.Extra (10)
Microsoft.Analyzers.Extra.Tests (10)
Microsoft.Analyzers.Local.Tests (11)
Microsoft.Arcade.Common (14)
Microsoft.AspNetCore.Analyzers (1)
Microsoft.AspNetCore.Antiforgery (5)
Microsoft.AspNetCore.App.Analyzers (4)
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.DeviceBoundSessions (3)
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.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()
109protected virtual async Task<bool> HandleRemoteSignOutAsync()
317protected virtual async Task<bool> HandleSignOutCallbackAsync()
609private async Task<string> GetPushedAuthorizationRequestUri(HttpResponseMessage parResponseMessage)
634protected override async Task<HandleRequestResult> HandleRemoteAuthenticateAsync()
989protected virtual async Task<OpenIdConnectMessage> RedeemAuthorizationCodeAsync(OpenIdConnectMessage tokenEndpointRequest)
1042protected virtual async Task<HandleRequestResult> GetUserInformationAsync(
1211private async Task<MessageReceivedContext> RunMessageReceivedEventAsync(OpenIdConnectMessage message, AuthenticationProperties? properties)
1235private async Task<TokenValidatedContext> RunTokenValidatedEventAsync(OpenIdConnectMessage authorizationResponse, OpenIdConnectMessage? tokenEndpointResponse, ClaimsPrincipal user, AuthenticationProperties properties, JwtSecurityToken jwt, string? nonce)
1261private async Task<AuthorizationCodeReceivedContext> RunAuthorizationCodeReceivedEventAsync(OpenIdConnectMessage authorizationResponse, ClaimsPrincipal? user, AuthenticationProperties properties, JwtSecurityToken? jwt)
1307private async Task<TokenResponseReceivedContext> RunTokenResponseReceivedEventAsync(
1336private async Task<UserInformationReceivedContext> RunUserInformationReceivedEventAsync(ClaimsPrincipal principal, AuthenticationProperties properties, OpenIdConnectMessage message, JsonDocument user)
1362private async Task<AuthenticationFailedContext> RunAuthenticationFailedEventAsync(OpenIdConnectMessage message, Exception exception)
1444private async Task<TokenValidationResult> ValidateTokenUsingHandlerAsync(string idToken, AuthenticationProperties properties, TokenValidationParameters validationParameters)
Microsoft.AspNetCore.Authentication.Twitter (7)
Microsoft.AspNetCore.Authentication.WsFederation (5)
Microsoft.AspNetCore.Authorization (43)
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.Components (22)
Microsoft.AspNetCore.Components.Analyzers (4)
Microsoft.AspNetCore.Components.Authorization (17)
Microsoft.AspNetCore.Components.Endpoints (23)
CacheView\CacheViewService.cs (9)
79public async Task<CacheViewRenderState?> PrepareAsync(CacheView cacheView, HttpContext httpContext)
160var pending = state.PendingStoreTask;
191var pending = state.PendingStoreTask;
250private async Task ApplyDuplicateResolutionAsync(CacheViewRenderState state, string key, Task<SerializedRenderFragment?> resolution)
289var inflight = _store.GetOrCreateAsync(
344private async Task ObserveCacheStorePersistAsync(string key, Task<SerializedRenderFragment> pending)
360private static Dictionary<string, (CacheView Owner, Task<SerializedRenderFragment?> Task)> GetInFlightResolutions(HttpContext httpContext)
362if (httpContext.Items[_inFlightResolutionsItemKey] is not Dictionary<string, (CacheView Owner, Task<SerializedRenderFragment?> Task)> resolutions)
364resolutions = new Dictionary<string, (CacheView, Task<SerializedRenderFragment?>)>(StringComparer.Ordinal);
Microsoft.AspNetCore.Components.Forms (1)
Microsoft.AspNetCore.Components.QuickGrid (2)
Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter (2)
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
Microsoft.AspNetCore.Components.Server (28)
Microsoft.AspNetCore.Components.Testing (8)
Microsoft.AspNetCore.Components.Web (7)
Microsoft.AspNetCore.Components.WebAssembly (23)
Microsoft.AspNetCore.Components.WebAssembly.Authentication (22)
Microsoft.AspNetCore.Components.WebAssembly.Server (7)
Microsoft.AspNetCore.Components.WebView (4)
Microsoft.AspNetCore.Components.WebView.Maui (7)
Microsoft.AspNetCore.Components.WebView.WindowsForms (7)
Microsoft.AspNetCore.Components.WebView.Wpf (6)
Microsoft.AspNetCore.Connections.Abstractions (1)
Microsoft.AspNetCore.Cors (7)
Microsoft.AspNetCore.DataProtection (3)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Microsoft.AspNetCore.Grpc.JsonTranscoding (14)
Microsoft.AspNetCore.HeaderPropagation (1)
Microsoft.AspNetCore.Http (11)
Microsoft.AspNetCore.Http.Abstractions (5)
Microsoft.AspNetCore.Http.Connections (13)
Microsoft.AspNetCore.Http.Connections.Client (15)
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(
1529static async Task<(object? FormValue, bool Successful)> TryReadFormAsync(
2487private static Task ExecuteTaskOfObject(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo)
2489static async Task ExecuteAwaited(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo)
2507private static Task ExecuteTaskOfTFast<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2511static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2524private static Task ExecuteTaskOfT<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2528static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo)
2541private static Task ExecuteTaskOfString(Task<string?> task, HttpContext httpContext)
2546static async Task ExecuteAwaited(Task<string> task, HttpContext httpContext)
2676private static async Task ExecuteTaskResult<T>(Task<T?> task, HttpContext httpContext) where T : IResult
2880private static void EnsureRequestTaskOfNotNull<T>(Task<T?> task) where T : IResult
Microsoft.AspNetCore.Http.Features (4)
Microsoft.AspNetCore.HttpLogging (3)
Microsoft.AspNetCore.HttpOverrides (2)
Microsoft.AspNetCore.Identity (114)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (40)
87var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.RegisterRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!);
105var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.RegisterRequest>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!);
132var task = handler(registration_local!, context_local, sp_local);
170var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.RegisterRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!);
207var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse>, global::Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.ProblemHttpResult>> (global::Microsoft.AspNetCore.Identity.Data.LoginRequest arg0, global::System.Boolean? arg1, global::System.Boolean? arg2, global::System.IServiceProvider arg3) => throw null!);
225var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.LoginRequest>(0)!, ic.GetArgument<global::System.Boolean?>(1)!, ic.GetArgument<global::System.Boolean?>(2)!, ic.GetArgument<global::System.IServiceProvider>(3)!);
285var task = handler(login_local!, useCookies_local, useSessionCookies_local, sp_local);
356var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse>, global::Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.ProblemHttpResult>> (global::Microsoft.AspNetCore.Identity.Data.LoginRequest arg0, global::System.Boolean? arg1, global::System.Boolean? arg2, global::System.IServiceProvider arg3) => throw null!);
391var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse>, global::Microsoft.AspNetCore.Http.HttpResults.UnauthorizedHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.SignInHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.ChallengeHttpResult>> (global::Microsoft.AspNetCore.Identity.Data.RefreshRequest arg0, global::System.IServiceProvider arg1) => throw null!);
409var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.RefreshRequest>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
435var task = handler(refreshRequest_local!, sp_local);
472var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse>, global::Microsoft.AspNetCore.Http.HttpResults.UnauthorizedHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.SignInHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.ChallengeHttpResult>> (global::Microsoft.AspNetCore.Identity.Data.RefreshRequest arg0, global::System.IServiceProvider arg1) => throw null!);
508var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.ContentHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.UnauthorizedHttpResult>> (global::System.String arg0, global::System.String arg1, global::System.String? arg2, global::System.IServiceProvider arg3) => throw null!);
525var task = handler(ic.GetArgument<global::System.String>(0)!, ic.GetArgument<global::System.String>(1)!, ic.GetArgument<global::System.String?>(2)!, ic.GetArgument<global::System.IServiceProvider>(3)!);
566var task = handler(userId_local, code_local, changedEmail_local, sp_local);
618var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.ContentHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.UnauthorizedHttpResult>> (global::System.String arg0, global::System.String arg1, global::System.String? arg2, global::System.IServiceProvider arg3) => throw null!);
654var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Ok> (global::Microsoft.AspNetCore.Identity.Data.ResendConfirmationEmailRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!);
672var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.ResendConfirmationEmailRequest>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!);
699var task = handler(resendRequest_local!, context_local, sp_local);
737var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Ok> (global::Microsoft.AspNetCore.Identity.Data.ResendConfirmationEmailRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!);
772var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.ForgotPasswordRequest arg0, global::System.IServiceProvider arg1) => throw null!);
790var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.ForgotPasswordRequest>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
816var task = handler(resetRequest_local!, sp_local);
853var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.ForgotPasswordRequest arg0, global::System.IServiceProvider arg1) => throw null!);
888var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.ResetPasswordRequest arg0, global::System.IServiceProvider arg1) => throw null!);
906var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.ResetPasswordRequest>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
932var task = handler(resetRequest_local!, sp_local);
969var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.ResetPasswordRequest arg0, global::System.IServiceProvider arg1) => throw null!);
1005var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.TwoFactorResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest arg1, global::System.IServiceProvider arg2) => throw null!);
1023var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!);
1050var task = handler(claimsPrincipal_local, tfaRequest_local!, sp_local);
1088var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.TwoFactorResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest arg1, global::System.IServiceProvider arg2) => throw null!);
1122var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!);
1139var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
1159var task = handler(claimsPrincipal_local, sp_local);
1190var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!);
1227var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.InfoRequest arg1, global::Microsoft.AspNetCore.Http.HttpContext arg2, global::System.IServiceProvider arg3) => throw null!);
1245var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.InfoRequest>(1)!, ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(2)!, ic.GetArgument<global::System.IServiceProvider>(3)!);
1273var task = handler(claimsPrincipal_local, infoRequest_local!, context_local, sp_local);
1312var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.InfoRequest arg1, global::Microsoft.AspNetCore.Http.HttpContext arg2, global::System.IServiceProvider arg3) => throw null!);
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)
128public virtual async Task<ClaimsPrincipal> CreateUserPrincipalAsync(TUser user) => await ClaimsFactory.CreateAsync(user);
150public virtual async Task<bool> CanSignInAsync(TUser user)
192private async Task<(bool success, bool? isPersistent)> RefreshSignInCoreAsync(TUser user)
338public virtual async Task<TUser?> ValidateSecurityStampAsync(ClaimsPrincipal? principal)
361public virtual async Task<TUser?> ValidateTwoFactorSecurityStampAsync(ClaimsPrincipal? principal)
383public virtual async Task<bool> ValidateSecurityStampAsync(TUser? user, string? securityStamp)
398public virtual async Task<SignInResult> PasswordSignInAsync(TUser user, string password,
431public virtual async Task<SignInResult> PasswordSignInAsync(string userName, string password,
453public virtual async Task<SignInResult> CheckPasswordSignInAsync(TUser user, string password, bool lockoutOnFailure)
471private async Task<SignInResult> CheckPasswordSignInCoreAsync(TUser user, string password, bool lockoutOnFailure)
522public virtual async Task<string> MakePasskeyCreationOptionsAsync(PasskeyUserEntity userEntity)
537public virtual async Task<string> MakePasskeyRequestOptionsAsync(TUser? user)
558public virtual async Task<PasskeyAttestationResult> PerformPasskeyAttestationAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
602public virtual async Task<PasskeyAssertionResult<TUser>> PerformPasskeyAssertionAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
645public virtual async Task<SignInResult> PasskeySignInAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
662private async Task<SignInResult> PasskeySignInCoreAsync(string credentialJson)
709private async Task<PasskeyAuthenticationInfo?> RetrievePasskeyAuthenticationInfoAsync()
713async Task<PasskeyAuthenticationInfo?> RetrievePasskeyInfoCoreAsync()
746public virtual async Task<bool> IsTwoFactorClientRememberedAsync(TUser user)
804public virtual async Task<SignInResult> TwoFactorRecoveryCodeSignInAsync(string recoveryCode)
821private async Task<SignInResult> TwoFactorRecoveryCodeSignInCoreAsync(string recoveryCode)
839private async Task<SignInResult> DoTwoFactorSignInAsync(TUser user, TwoFactorAuthenticationInfo twoFactorInfo, bool isPersistent, bool rememberClient)
886public virtual async Task<SignInResult> TwoFactorAuthenticatorSignInAsync(string code, bool isPersistent, bool rememberClient)
903private async Task<SignInResult> TwoFactorAuthenticatorSignInCoreAsync(string code, bool isPersistent, bool rememberClient)
951public virtual async Task<SignInResult> TwoFactorSignInAsync(string provider, string code, bool isPersistent, bool rememberClient)
968private async Task<SignInResult> TwoFactorSignInCoreAsync(string provider, string code, bool isPersistent, bool rememberClient)
1010public virtual async Task<TUser?> GetTwoFactorAuthenticationUserAsync()
1029public virtual Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent)
1041public virtual async Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1058private async Task<SignInResult> ExternalLoginSignInCoreAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1078public virtual async Task<IEnumerable<AuthenticationScheme>> GetExternalAuthenticationSchemesAsync()
1090public virtual async Task<ExternalLoginInfo?> GetExternalLoginInfoAsync(string? expectedXsrf = null)
1128public virtual async Task<IdentityResult> UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo externalLogin)
1188internal async Task<ClaimsPrincipal> StoreRememberClient(TUser user)
1208public virtual async Task<bool> IsTwoFactorEnabledAsync(TUser user)
1222protected virtual async Task<SignInResult> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
1262private async Task<TwoFactorAuthenticationInfo?> RetrieveTwoFactorInfoAsync()
1299protected virtual async Task<bool> IsLockedOut(TUser user)
1309protected virtual Task<SignInResult> LockedOut(TUser user)
1320protected virtual async Task<SignInResult?> PreSignInCheck(TUser user)
1352private async Task<IdentityResult> ResetLockoutWithResult(TUser user)
1369if (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)
646public virtual async Task<IList<UserPasskeyInfo>> GetPasskeysAsync(TUser user, CancellationToken cancellationToken)
670public virtual async Task<TUser?> FindByPasskeyIdAsync(byte[] credentialId, CancellationToken cancellationToken)
690public 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)
791public virtual async Task<IList<UserPasskeyInfo>> GetPasskeysAsync(TUser user, CancellationToken cancellationToken)
815public virtual async Task<TUser?> FindByPasskeyIdAsync(byte[] credentialId, CancellationToken cancellationToken)
835public virtual async Task<UserPasskeyInfo?> FindPasskeyAsync(TUser user, byte[] credentialId, CancellationToken cancellationToken)
Microsoft.AspNetCore.Identity.UI (168)
Microsoft.AspNetCore.InternalTesting (31)
src\aspnetcore\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.Localization (9)
Microsoft.AspNetCore.Localization.Routing (1)
Microsoft.AspNetCore.Mvc.Abstractions (9)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
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.Formatters.Xml (2)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (7)
src\aspnetcore\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.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.TagHelpers (15)
Microsoft.AspNetCore.Mvc.Testing (4)
Microsoft.AspNetCore.Mvc.ViewFeatures (29)
Microsoft.AspNetCore.OpenApi (25)
Services\Schemas\OpenApiSchemaService.cs (2)
249internal async Task<OpenApiSchema> GetOrCreateUnresolvedSchemaAsync(OpenApiDocument? document, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
265internal async Task<IOpenApiSchema> GetOrCreateSchemaAsync(OpenApiDocument document, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.OutputCaching (10)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
Microsoft.AspNetCore.Owin (11)
Microsoft.AspNetCore.Razor (6)
Microsoft.AspNetCore.Razor.Runtime (1)
Microsoft.AspNetCore.Razor.Utilities.Shared (18)
Microsoft.AspNetCore.RequestDecompression (1)
Microsoft.AspNetCore.ResponseCaching (2)
Microsoft.AspNetCore.Routing (7)
Microsoft.AspNetCore.Server.HttpSys (10)
Microsoft.AspNetCore.Server.IIS (12)
Microsoft.AspNetCore.Server.IISIntegration (2)
Microsoft.AspNetCore.Server.IntegrationTesting (10)
Microsoft.AspNetCore.Server.Kestrel.Core (16)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Microsoft.AspNetCore.SignalR.Client.Core (114)
HubConnection.cs (17)
363public virtual IDisposable On(string methodName, Type[] parameterTypes, Func<object?[], object, Task<object?>> handler, object state)
436/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
437/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
442public virtual async Task<ChannelReader<object?>> StreamAsChannelCoreAsync(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken = default)
458/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
459/// The <see cref="Task{TResult}.Result"/> property returns an <see cref="object"/> for the hub method return value.
464public virtual async Task<object?> InvokeCoreAsync(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken = default)
578public async Task<TimeSpan?> RefreshAuthenticationAsync(CancellationToken cancellationToken = default)
853private async Task<ChannelReader<object?>> StreamAsChannelCoreAsyncCore(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken)
1148private async Task<(ConnectionState, Activity?)> WaitForActiveConnectionWithActivityAsync(string sendingMethodName, string invokedMethodName, CancellationToken token)
1157var connectionStateTask = _state.WaitForActiveConnectionAsync(sendingMethodName, token);
1206private async Task<object?> InvokeCoreAsyncCore(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken)
1214Task<object?> invocationTask;
1461private async Task<CloseMessage?> ProcessMessagesAsync(HubMessage message, ConnectionState connectionState, ChannelWriter<InvocationMessage> invocationMessageWriter)
1583if (handler.HasResult && task is Task<object?> resultTask)
2279public bool HasResult => _callback.Method.ReturnType == typeof(Task<object>);
2695public 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.Core (38)
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)
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\aspnetcore\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\aspnetcore\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.SpaProxy (2)
Microsoft.AspNetCore.SpaServices.Extensions (14)
Microsoft.AspNetCore.TestHost (14)
Microsoft.AspNetCore.Testing.Tests (2)
Microsoft.AspNetCore.Watch.BrowserRefresh (2)
Microsoft.AspNetCore.WebSockets (2)
Microsoft.AspNetCore.WebUtilities (19)
Microsoft.Bcl.TimeProvider (2)
Microsoft.Build (41)
BackEnd\Components\RequestBuilder\TargetBuilder.cs (5)
108public async Task<BuildResult> BuildTargets(ProjectLoggingContext loggingContext, BuildRequestEntry entry, IRequestBuilderCallback callback, (string name, TargetBuiltReason reason)[] targetNames, Lookup baseLookup, CancellationToken cancellationToken)
250async Task<ITargetResult[]> ITargetBuilderCallback.LegacyCallTarget(string[] targets, bool continueOnError, ElementLocation taskLocation)
329async Task<BuildResult[]> IRequestBuilderCallback.BuildProjects(string[] projectFiles, Microsoft.Build.Collections.PropertyDictionary<ProjectPropertyInstance>[] properties, string[] toolsVersions, string[] targets, bool waitForResults, bool skipNonexistentTargets)
666private async Task<bool> PushTargets(IList<TargetSpecification> targets, TargetEntry parentTargetEntry, Lookup baseLookup, bool addAsErrorTarget, bool stopProcessingOnCompletion, TargetBuiltReason buildReason)
769private async Task<bool> CompleteOutstandingActiveRequests(string targetName)
BackEnd\Components\RequestBuilder\TaskBuilder.cs (2)
149public async Task<WorkUnitResult> ExecuteTask(TargetLoggingContext loggingContext, BuildRequestEntry requestEntry, ITargetBuilderCallback targetBuilderCallback, ProjectTargetInstanceChild taskInstance, TaskExecutionMode mode, Lookup inferLookup, Lookup executeLookup, CancellationToken cancellationToken)
673private async Task<WorkUnitResult> InitializeAndExecuteTask(TaskLoggingContext taskLoggingContext, ItemBucket bucket, TaskHostParameters taskIdentityParameters, TaskHost taskHost, TaskExecutionMode howToExecuteTask)
BackEnd\Components\RequestBuilder\TaskHost.cs (2)
969public async Task<BuildEngineResult> InternalBuildProjects(string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IList<String>[] undefineProperties, string[] toolsVersion, bool returnTargetOutputs, bool skipNonexistentTargets = false)
1142private async Task<BuildEngineResult> BuildProjectFilesInParallelAsync(string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IList<String>[] undefineProperties, string[] toolsVersion, bool returnTargetOutputs, bool skipNonexistentTargets = false)
Microsoft.Build.Framework (2)
Microsoft.Build.NuGetSdkResolver (2)
Microsoft.Build.Tasks.CodeAnalysis (10)
Microsoft.Build.Tasks.Core (4)
Microsoft.CodeAnalysis (82)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (37)
228public Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync()
237public async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync(CancellationToken cancellationToken = default)
248public async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
258public async Task<AnalysisResult> GetAnalysisResultAsync(CancellationToken cancellationToken)
268public async Task<AnalysisResult> GetAnalysisResultAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
279public Task<ImmutableArray<Diagnostic>> GetAllDiagnosticsAsync()
287public async Task<ImmutableArray<Diagnostic>> GetAllDiagnosticsAsync(CancellationToken cancellationToken = default)
297async Task<ImmutableArray<Diagnostic>> getAllDiagnosticsWithoutStateTrackingAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
319public async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsAsync(CancellationToken cancellationToken)
330public async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
337private async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
344private async Task<AnalysisResult> GetAnalysisResultCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
351private async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
358private static async Task<AnalyzerDriver> CreateAndInitializeDriverAsync(
390public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, CancellationToken cancellationToken)
406public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken)
422public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
440public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
454public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, CancellationToken cancellationToken)
469public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken)
483public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
500public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
515public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, CancellationToken cancellationToken)
530public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
547public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, CancellationToken cancellationToken)
564public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
572private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SourceOrAdditionalFile file, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken)
579private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsCoreAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken)
593public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, CancellationToken cancellationToken)
608public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
623public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, CancellationToken cancellationToken)
638public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
646private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
653private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
832static async Task<(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts, bool hasAnyActionsRequiringCompilationEvents)> getAnalyzerActionCountsAsync(
1278public async Task<AnalyzerTelemetryInfo> GetAnalyzerTelemetryInfoAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
1298private async Task<AnalyzerActionCounts> GetAnalyzerActionCountsAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Analyzers (213)
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\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (9)
30public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
37public static Task<Document> AddFieldDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken)
44public static Task<Document> AddMethodDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
51public static Task<Document> AddPropertyDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken)
58public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
65public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
72public static Task<Document> AddNamespaceDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken)
79public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\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 (88)
src\roslyn\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\roslyn\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\roslyn\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\roslyn\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 (227)
src\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (9)
30public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
37public static Task<Document> AddFieldDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken)
44public static Task<Document> AddMethodDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
51public static Task<Document> AddPropertyDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken)
58public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
65public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
72public static Task<Document> AddNamespaceDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken)
79public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\roslyn\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.CSharp (3)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (60)
Microsoft.CodeAnalysis.CSharp.Features (278)
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.NetAnalyzers (3)
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.Workspaces (15)
Microsoft.CodeAnalysis.Extensions.Package (7)
Microsoft.CodeAnalysis.ExternalAccess.Extensions (5)
Microsoft.CodeAnalysis.ExternalAccess.HotReload (3)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (13)
Microsoft.CodeAnalysis.Features (1286)
AddImport\SymbolReferenceFinder.cs (17)
94internal Task<ImmutableArray<SymbolReference>> FindInAllSymbolsInStartingProjectAsync(bool exact, CancellationToken cancellationToken)
97internal Task<ImmutableArray<SymbolReference>> FindInSourceSymbolsInProjectAsync(ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>> projectToAssembly, Project project, bool exact, CancellationToken cancellationToken)
100internal Task<ImmutableArray<SymbolReference>> FindInMetadataSymbolsAsync(IAssemblySymbol assembly, Project assemblyProject, PortableExecutableReference metadataReference, bool exact, CancellationToken cancellationToken)
103private async Task<ImmutableArray<SymbolReference>> DoAsync(SearchScope searchScope, CancellationToken cancellationToken)
114using var _1 = ArrayBuilder<Task<ImmutableArray<SymbolReference>>>.GetInstance(out var tasks);
140foreach (var task in tasks)
175private async Task<ImmutableArray<SymbolReference>> GetReferencesForMatchingTypesAsync(
260private async Task<ImmutableArray<SymbolReference>> GetReferencesForMatchingNamespacesAsync(
287private async Task<ImmutableArray<SymbolReference>> GetReferencesForMatchingFieldsAndPropertiesAsync(
351private async Task<ImmutableArray<SymbolReference>> GetReferencesForMatchingExtensionMembersAsync(
421private async Task<ImmutableArray<SymbolReference>> GetReferencesForCollectionInitializerMethodsAsync(
442private async Task<ImmutableArray<SymbolReference>> GetReferencesForQueryPatternsAsync(
466private async Task<ImmutableArray<SymbolReference>> GetReferencesForGetAwaiterAsync(
488private async Task<ImmutableArray<SymbolReference>> GetReferencesForGetEnumeratorAsync(
510private async Task<ImmutableArray<SymbolReference>> GetReferencesForGetAsyncEnumeratorAsync(
532private async Task<ImmutableArray<SymbolReference>> GetReferencesForDeconstructAsync(
554private 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, CodeActionRequestPriority? priority, CancellationToken cancellationToken);
26Task<CodeFixCollection?> GetDocumentFixAllForIdInSpanAsync(Document document, TextSpan? textSpan, string diagnosticId, DiagnosticSeverity severity, CancellationToken cancellationToken);
27Task<Document> ApplyCodeFixesForSpecificDiagnosticIdAsync(Document document, TextSpan? textSpan, 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, CodeActionRequestPriority? priority, 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)
43private static async Task<T?> FindAsync<T>(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
44Func<CodeLensFindReferencesProgress, Task<T>> onResults, Func<CodeLensFindReferencesProgress, Task<T>> onCapped,
90public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults, CancellationToken cancellationToken)
102private static async Task<ReferenceLocationDescriptorAndDocument> GetDescriptorOfEnclosingSymbolAsync(Solution solution, Location location, CancellationToken cancellationToken)
198public async Task<ImmutableArray<ReferenceLocationDescriptorAndDocument>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
213public async Task<ImmutableArray<ReferenceLocationDescriptor>> MapReferenceLocationsAsync(Solution solution, ImmutableArray<ReferenceLocationDescriptorAndDocument> referenceLocations, ClassificationOptions classificationOptions, CancellationToken cancellationToken)
356private static async Task<ReferenceMethodDescriptor> TryGetMethodDescriptorAsync(Location commonLocation, Solution solution, CancellationToken cancellationToken)
370public Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
386public 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)
23protected abstract Task<bool> ShouldPreselectInferredTypesAsync(CompletionContext? completionContext, int position, CompletionOptions options, CancellationToken cancellationToken);
24protected abstract Task<bool> ShouldProvideAvailableSymbolsInCurrentContextAsync(CompletionContext? completionContext, TSyntaxContext context, int position, CompletionOptions options, CancellationToken cancellationToken);
33protected sealed override async Task<ImmutableArray<SymbolAndSelectionInfo>> GetSymbolsAsync(
223internal sealed override async Task<CompletionDescription> GetDescriptionWorkerAsync(
251async Task<CompletionDescription?> TryGetDescriptionAsync(DocumentId documentId)
287protected sealed override async Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken)
293protected async Task<bool?> IsTriggerOnDotAsync(Document document, int characterPosition, CancellationToken cancellationToken)
Completion\Providers\AbstractSymbolCompletionProvider.cs (7)
31protected abstract Task<ImmutableArray<SymbolAndSelectionInfo>> GetSymbolsAsync(
328internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
368private async Task<ImmutableArray<CompletionItem>> GetItemsAsync(
411protected virtual Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken)
439private async Task<ImmutableArray<(DocumentId documentId, TSyntaxContext syntaxContext, ImmutableArray<SymbolAndSelectionInfo> symbols)>> GetPerContextSymbolsAsync(
467protected async Task<ImmutableArray<SymbolAndSelectionInfo>> TryGetSymbolsForContextAsync(
498public 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)
85private async Task<string> GetNewParameterNameAsync(CancellationToken cancellationToken)
227private async Task<SyntaxNode> ModifyDocumentInvocationsTrampolineOverloadAndIntroduceParameterAsync(Compilation compilation, Document currentDocument,
352private async Task<ITypeSymbol> GetTypeOfExpressionAsync(CancellationToken cancellationToken)
396private async Task<SyntaxNode> ExtractMethodAsync(ImmutableArray<IParameterSymbol> validParameters, string newMethodIdentifier, SyntaxGenerator generator, CancellationToken cancellationToken)
428private async Task<SyntaxNode> GenerateNewMethodOverloadAsync(int insertionIndex, SyntaxGenerator generator, CancellationToken cancellationToken)
449private async Task<SyntaxNode> CreateMethodDeclarationAsync(SyntaxNode newStatement, ImmutableArray<IParameterSymbol>? validParameters,
489private async Task<SyntaxNode> ModifyDocumentInvocationsAndIntroduceParameterAsync(Compilation compilation, Document document, int insertionIndex,
674private 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)
32public async Task<SourceFileInfo?> LoadSourceDocumentAsync(string tempFilePath, SourceDocument sourceDocument, Encoding encoding, TelemetryMessage telemetry, bool useExtendedTimeout, ISourceLinkService? sourceLinkService, CancellationToken cancellationToken)
119private async Task<SourceFileInfo?> TryGetSourceLinkFileAsync(SourceDocument sourceDocument, Encoding encoding, TelemetryMessage telemetry, bool useExtendedTimeout, ISourceLinkService? sourceLinkService, CancellationToken cancellationToken)
130var sourceFileTask = sourceLinkService.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);
72public async Task<SnippetChange> GetSnippetChangeAsync(Document document, int position, CancellationToken cancellationToken)
142private static async Task<Document> CleanupDocumentAsync(
170private async Task<Document> GetDocumentWithSnippetAndTriviaAsync(Document snippetDocument, int position, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken)
191private static async Task<Document> GetDocumentWithSnippetAsync(Document document, ImmutableArray<TextChange> snippets, CancellationToken cancellationToken)
201private async Task<Document> AddFormatAnnotationAsync(Document document, int position, CancellationToken cancellationToken)
211private async Task<SyntaxNode> AnnotateNodesToReformatAsync(
236private async Task<Document> AddIndentationToDocumentAsync(Document document, CancellationToken cancellationToken)
247protected virtual Task<Document> AddIndentationToDocumentAsync(Document document, TSnippetSyntax snippet, CancellationToken cancellationToken)
src\roslyn\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\roslyn\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\roslyn\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(
Microsoft.CodeAnalysis.Features.ExternalAccess (49)
Copilot\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(
Copilot\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.NetAnalyzers (52)
Microsoft.NetCore.Analyzers\Performance\RecommendCaseInsensitiveStringComparison.Fixer.cs (4)
111Task<Document> createChangedDocument(CancellationToken _) => FixInvocationAsync(generator, doc, root,
128Task<Document> createChangedDocument(CancellationToken _) => FixBinaryAsync(generator, doc, root, binaryOperation, stringComparisonType, caseChangingApproachValue!);
141private Task<Document> FixInvocationAsync(SyntaxGenerator generator, Document doc, SyntaxNode root, IInvocationOperation mainInvocation,
185private Task<Document> FixBinaryAsync(SyntaxGenerator generator, Document doc, SyntaxNode root, IBinaryOperation binaryOperation,
Microsoft.CodeAnalysis.ResxSourceGenerator (98)
src\roslyn\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\roslyn\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\roslyn\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\roslyn\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.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)
455internal new Task<T> EvaluateAsync(object globals = null, CancellationToken cancellationToken = default(CancellationToken))
469public new Task<ScriptState<T>> RunAsync(object globals, CancellationToken cancellationToken)
487public new Task<ScriptState<T>> RunAsync(object globals = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
530public new Task<ScriptState<T>> RunFromAsync(ScriptState previousState, CancellationToken cancellationToken)
547public new Task<ScriptState<T>> RunFromAsync(ScriptState previousState, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
575private async Task<ScriptState<T>> RunSubmissionsAsync(
ScriptState.cs (4)
142public Task<ScriptState<object>> ContinueWithAsync(string code, ScriptOptions options, CancellationToken cancellationToken)
156public Task<ScriptState<object>> ContinueWithAsync(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
166public Task<ScriptState<TResult>> ContinueWithAsync<TResult>(string code, ScriptOptions options, CancellationToken cancellationToken)
180public Task<ScriptState<TResult>> ContinueWithAsync<TResult>(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (866)
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)
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 async Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
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?> IRefactorOrFixAllProvider.GetCodeActionAsync(IRefactorOrFixAllContext fixAllContext)
104Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync,
110protected override Task<Document?> FixAllAsync(FixAllContext context, Document document, ImmutableArray<Diagnostic> diagnostics)
CodeRefactorings\FixAllOccurences\RefactorAllProvider.cs (7)
38public abstract Task<CodeAction?> GetRefactoringAsync(RefactorAllContext refactorAllContext);
41Task<CodeAction?> IRefactorOrFixAllProvider.GetCodeActionAsync(IRefactorOrFixAllContext fixAllContext)
55public static RefactorAllProvider Create(Func<RefactorAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> refactorAllAsync)
74Func<RefactorAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> refactorAllAsync,
81Func<RefactorAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> refactorAllAsync,
98Func<RefactorAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> refactorAllAsync,
104protected override Task<Document?> RefactorAllAsync(RefactorAllContext context, Document document, Optional<ImmutableArray<TextSpan>> refactorAllSpans)
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\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (9)
30public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
37public static Task<Document> AddFieldDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken)
44public static Task<Document> AddMethodDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
51public static Task<Document> AddPropertyDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken)
58public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
65public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
72public static Task<Document> AddNamespaceDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken)
79public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\roslyn\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);
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 async Task<bool> ChecksumMatchesAsync(string name, Checksum checksum, CancellationToken cancellationToken)
26public async Task<bool> ChecksumMatchesAsync(Project project, string name, Checksum checksum, CancellationToken cancellationToken)
29public async Task<bool> ChecksumMatchesAsync(Document document, string name, Checksum checksum, CancellationToken cancellationToken)
32public async Task<bool> ChecksumMatchesAsync(ProjectKey project, string name, Checksum checksum, CancellationToken cancellationToken)
35public async Task<bool> ChecksumMatchesAsync(DocumentKey document, string name, Checksum checksum, CancellationToken cancellationToken)
38public async Task<Stream?> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken)
41public async Task<Stream?> ReadStreamAsync(Project project, string name, CancellationToken cancellationToken)
44public async Task<Stream?> ReadStreamAsync(string name, CancellationToken cancellationToken)
47public async Task<Stream?> ReadStreamAsync(string name, Checksum? checksum, CancellationToken cancellationToken)
50public async Task<Stream?> ReadStreamAsync(Project project, string name, Checksum? checksum, CancellationToken cancellationToken)
53public async Task<Stream?> ReadStreamAsync(Document document, string name, Checksum? checksum, CancellationToken cancellationToken)
56public async Task<Stream?> ReadStreamAsync(ProjectKey project, string name, Checksum? checksum, CancellationToken cancellationToken)
59public async Task<Stream?> ReadStreamAsync(DocumentKey document, string name, Checksum? checksum, CancellationToken cancellationToken)
62public async Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken)
65public async Task<bool> WriteStreamAsync(Project project, string name, Stream stream, CancellationToken cancellationToken)
68public async Task<bool> WriteStreamAsync(string name, Stream stream, CancellationToken cancellationToken)
71public async Task<bool> WriteStreamAsync(string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
74public async Task<bool> WriteStreamAsync(Project project, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
77public async Task<bool> WriteStreamAsync(Document document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
80public async Task<bool> WriteStreamAsync(ProjectKey projectKey, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
83public async Task<bool> WriteStreamAsync(DocumentKey documentKey, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (11)
31public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
85public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
120public override async 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 async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
265public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
288public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
319public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
339public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.MSBuild (45)
MSBuild\BuildHostProcessManager.cs (5)
60public async Task<RemoteBuildHost> GetBuildHostWithFallbackAsync(string projectFilePath, CancellationToken cancellationToken)
70public async Task<(RemoteBuildHost buildHost, BuildHostProcessKind actualKind)> GetBuildHostWithFallbackAsync(BuildHostProcessKind buildHostKind, string projectOrSolutionFilePath, CancellationToken cancellationToken)
96public Task<RemoteBuildHost> GetBuildHostAsync(BuildHostProcessKind buildHostKind, CancellationToken cancellationToken)
101public async Task<RemoteBuildHost> GetBuildHostAsync(BuildHostProcessKind buildHostKind, string? projectOrSolutionFilePath, string? dotnetPath, CancellationToken cancellationToken)
116async 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, IEnumerable<MetadataReference> resolvedMetadataReferences, CancellationToken cancellationToken)
267private async Task<bool> TryLoadAndAddReferenceAsync(ProjectId id, string projectReferencePath, ImmutableArray<string> aliases, ResolvedReferencesBuilder builder, CancellationToken cancellationToken)
340private async Task<bool> VerifyUnloadableProjectOutputExistsAsync(string projectPath, ResolvedReferencesBuilder builder, CancellationToken cancellationToken)
346private 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\RemoteBuildHost.cs (6)
32public Task<MSBuildLocation?> FindBestMSBuildAsync(string projectOrSolutionFilePath, CancellationToken cancellationToken)
41public Task<bool> HasUsableMSBuildAsync(string projectOrSolutionFilePath, CancellationToken cancellationToken)
48public async Task<RemoteProjectFile> LoadProjectFileAsync(string projectFilePath, string languageName, CancellationToken cancellationToken)
61public async Task<RemoteProjectFile> LoadProjectAsync(string projectFilePath, string? physicalFilePath, string projectContent, string languageName, IDictionary<string, string>? globalProperties, CancellationToken cancellationToken)
68public async Task<RemoteProjectInstance> LoadProjectInstanceAsync(string projectFilePath, string projectContent, IDictionary<string, string>? additionalGlobalProperties, CancellationToken cancellationToken)
75public Task<string?> TryGetProjectOutputPathAsync(string projectFilePath, CancellationToken cancellationToken)
Rpc\RpcClient.cs (3)
128public async Task<T?> InvokeNullableAsync<T>(int targetObject, string methodName, List<object?> parameters, CancellationToken cancellationToken) where T : class
134public async Task<T> InvokeAsync<T>(int targetObject, string methodName, List<object?> parameters, CancellationToken cancellationToken) where T : notnull
141private async Task<object?> InvokeCoreAsync(int targetObject, string methodName, List<object?> parameters, Type? expectedReturnType, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (16)
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (4)
Microsoft.Data.Analysis (2)
Microsoft.Deployment.DotNet.Releases (11)
Microsoft.Diagnostics.NETCore.Client (59)
DiagnosticsServerRouter\DiagnosticsServerRouterRunner.cs (6)
24public static async Task<int> runIpcClientTcpServerRouter(CancellationToken token, string ipcClient, string tcpServer, int runtimeTimeoutMs, NetServerRouterFactory.CreateInstanceDelegate tcpServerRouterFactory, ILogger logger, ICallbacks callbacks)
29public static async Task<int> runIpcServerTcpServerRouter(CancellationToken token, string ipcServer, string tcpServer, int runtimeTimeoutMs, NetServerRouterFactory.CreateInstanceDelegate tcpServerRouterFactory, ILogger logger, ICallbacks callbacks)
34public static async Task<int> runIpcServerTcpClientRouter(CancellationToken token, string ipcServer, string tcpClient, int runtimeTimeoutMs, TcpClientRouterFactory.CreateInstanceDelegate tcpClientRouterFactory, ILogger logger, ICallbacks callbacks)
39public static async Task<int> runIpcClientTcpClientRouter(CancellationToken token, string ipcClient, string tcpClient, int runtimeTimeoutMs, TcpClientRouterFactory.CreateInstanceDelegate tcpClientRouterFactory, ILogger logger, ICallbacks callbacks)
58private static async Task<int> runRouter(CancellationToken token, DiagnosticsServerRouterFactory routerFactory, ICallbacks callbacks)
73Task<Router> routerTask = null;
Microsoft.DotNet.Arcade.Sdk (2)
Microsoft.DotNet.Cli.Telemetry (2)
Microsoft.DotNet.Cli.Utils (9)
Microsoft.DotNet.HotReload.Utils.Generator (8)
Microsoft.DotNet.HotReload.Utils.Generator.Frontend (1)
Microsoft.DotNet.HotReload.Utils.Generator.Tasks (1)
Microsoft.DotNet.HotReload.Watch (49)
Microsoft.Extensions.AI (51)
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 (31)
Microsoft.Extensions.AI.Abstractions.Tests (12)
Microsoft.Extensions.AI.Evaluation (7)
Microsoft.Extensions.AI.Evaluation.Console (8)
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 (24)
Microsoft.Extensions.AI.OllamaSharp.Integration.Tests (1)
Microsoft.Extensions.AI.OpenAI (16)
OpenAIChatClient.cs (5)
33private static readonly Func<ChatClient, IEnumerable<OpenAI.Chat.ChatMessage>, ChatCompletionOptions, RequestOptions, Task<ClientResult<ChatCompletion>>>?
35(Func<ChatClient, IEnumerable<OpenAI.Chat.ChatMessage>, ChatCompletionOptions, RequestOptions, Task<ClientResult<ChatCompletion>>>?)
41typeof(Func<ChatClient, IEnumerable<OpenAI.Chat.ChatMessage>, ChatCompletionOptions, RequestOptions, Task<ClientResult<ChatCompletion>>>));
85public async Task<ChatResponse> GetResponseAsync(
96var task = _completeChatAsync is not null ?
OpenAIEmbeddingGenerator.cs (5)
24private static readonly Func<EmbeddingClient, IEnumerable<string>, OpenAI.Embeddings.EmbeddingGenerationOptions, RequestOptions, Task<ClientResult<OpenAIEmbeddingCollection>>>?
26(Func<EmbeddingClient, IEnumerable<string>, OpenAI.Embeddings.EmbeddingGenerationOptions, RequestOptions, Task<ClientResult<OpenAIEmbeddingCollection>>>?)
32typeof(Func<EmbeddingClient, IEnumerable<string>, OpenAI.Embeddings.EmbeddingGenerationOptions, RequestOptions, Task<ClientResult<OpenAIEmbeddingCollection>>>));
64public async Task<GeneratedEmbeddings<Embedding<float>>> GenerateAsync(IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
68var t = _generateEmbeddingsAsync is not null ?
Microsoft.Extensions.AI.OpenAI.Tests (1)
Microsoft.Extensions.AI.Templates.Tests (3)
Microsoft.Extensions.AI.Tests (31)
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.SqlServer (6)
Microsoft.Extensions.Caching.StackExchangeRedis (6)
Microsoft.Extensions.DataIngestion (4)
Microsoft.Extensions.DataIngestion.Abstractions (4)
Microsoft.Extensions.DataIngestion.Markdig (3)
Microsoft.Extensions.DataIngestion.MarkItDown (6)
Microsoft.Extensions.DataIngestion.Tests (11)
Utils\TestReader.cs (3)
13public TestReader(Func<Stream, string, string, CancellationToken, Task<IngestionDocument>> readAsyncCallback)
18public Func<Stream, string, string, CancellationToken, Task<IngestionDocument>> ReadAsyncCallback { get; }
20public override Task<IngestionDocument> ReadAsync(Stream source, string identifier, string mediaType, CancellationToken cancellationToken = default)
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.EntityFrameworkCore (4)
Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization (5)
Microsoft.Extensions.Diagnostics.Probes.Tests (4)
Microsoft.Extensions.Diagnostics.Testing.Tests (11)
Microsoft.Extensions.Hosting.Abstractions (1)
Microsoft.Extensions.Http (7)
Microsoft.Extensions.Http.Diagnostics (1)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (51)
Microsoft.Extensions.Http.Diagnostics.Tests (13)
Microsoft.Extensions.Http.Polly (3)
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)
456public virtual Task<TUser?> GetUserAsync(ClaimsPrincipal principal)
471public virtual Task<string> GenerateConcurrencyStampAsync(TUser user)
485public virtual async Task<IdentityResult> CreateAsync(TUser user)
502private async Task<IdentityResult> CreateCoreAsync(TUser user)
529public virtual async Task<IdentityResult> UpdateAsync(TUser user)
555public virtual async Task<IdentityResult> DeleteAsync(TUser user)
583public virtual Task<TUser?> FindByIdAsync(string userId)
596public virtual async Task<TUser?> FindByNameAsync(string userName)
635public virtual async Task<IdentityResult> CreateAsync(TUser user, string password)
709public virtual async Task<string?> GetUserNameAsync(TUser user)
722public virtual async Task<IdentityResult> SetUserNameAsync(TUser user, string? userName)
746public virtual async Task<string> GetUserIdAsync(TUser user)
761public virtual async Task<bool> CheckPasswordAsync(TUser user, string password)
783private async Task<(PasswordVerificationResult? result, bool userMissing)> CheckPasswordCoreAsync(TUser user, string password)
812public virtual Task<bool> HasPasswordAsync(TUser user)
831public virtual async Task<IdentityResult> AddPasswordAsync(TUser user, string password)
847private async Task<IdentityResult> AddPasswordCoreAsync(TUser user, string password)
878public virtual async Task<IdentityResult> ChangePasswordAsync(TUser user, string currentPassword, string newPassword)
894private async Task<IdentityResult> ChangePasswordCoreAsync(TUser user, string currentPassword, string newPassword)
921public virtual async Task<IdentityResult> RemovePasswordAsync(TUser user)
950protected virtual async Task<PasswordVerificationResult> VerifyPasswordAsync(IUserPasswordStore<TUser> store, TUser user, string password)
967public virtual async Task<string> GetSecurityStampAsync(TUser user)
992public virtual async Task<IdentityResult> UpdateSecurityStampAsync(TUser user)
1018public virtual Task<string> GeneratePasswordResetTokenAsync(TUser user)
1035public virtual async Task<IdentityResult> ResetPasswordAsync(TUser user, string token, string newPassword)
1067public virtual Task<TUser?> FindByLoginAsync(string loginProvider, string providerKey)
1087public virtual async Task<IdentityResult> RemoveLoginAsync(TUser user, string loginProvider, string providerKey)
1118public virtual async Task<IdentityResult> AddLoginAsync(TUser user, UserLoginInfo login)
1134private async Task<IdentityResult> AddLoginCoreAsync(TUser user, UserLoginInfo login)
1158public virtual async Task<IList<UserLoginInfo>> GetLoginsAsync(TUser user)
1175public virtual Task<IdentityResult> AddClaimAsync(TUser user, Claim claim)
1189public virtual async Task<IdentityResult> AddClaimsAsync(TUser user, IEnumerable<Claim> claims)
1219public virtual async Task<IdentityResult> ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim)
1249public virtual Task<IdentityResult> RemoveClaimAsync(TUser user, Claim claim)
1263public virtual async Task<IdentityResult> RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims)
1288/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <see cref="Claim"/>s.
1290public virtual async Task<IList<Claim>> GetClaimsAsync(TUser user)
1307public virtual async Task<IdentityResult> AddToRoleAsync(TUser user, string role)
1323private async Task<IdentityResult> AddToRoleCoreAsync(TUser user, string role)
1347public virtual async Task<IdentityResult> AddToRolesAsync(TUser user, IEnumerable<string> roles)
1363private async Task<IdentityResult> AddToRolesCoreAsync(TUser user, IEnumerable<string> roles)
1391public virtual async Task<IdentityResult> RemoveFromRoleAsync(TUser user, string role)
1438public virtual async Task<IdentityResult> RemoveFromRolesAsync(TUser user, IEnumerable<string> roles)
1454private async Task<IdentityResult> RemoveFromRolesCoreAsync(TUser user, IEnumerable<string> roles)
1478public virtual async Task<IList<string>> GetRolesAsync(TUser user)
1495public virtual async Task<bool> IsInRoleAsync(TUser user, string role)
1508public virtual async Task<string?> GetEmailAsync(TUser user)
1525public virtual async Task<IdentityResult> SetEmailAsync(TUser user, string? email)
1555public virtual async Task<TUser?> FindByEmailAsync(string email)
1607public virtual Task<string> GenerateEmailConfirmationTokenAsync(TUser user)
1622public virtual async Task<IdentityResult> ConfirmEmailAsync(TUser user, string token)
1638private async Task<IdentityResult> ConfirmEmailCoreAsync(TUser user, string token)
1661public virtual async Task<bool> IsEmailConfirmedAsync(TUser user)
1677public virtual Task<string> GenerateChangeEmailTokenAsync(TUser user, string newEmail)
1693public virtual async Task<IdentityResult> ChangeEmailAsync(TUser user, string newEmail, string token)
1707private async Task<IdentityResult> ChangeEmailCoreAsync(TUser user, string newEmail, string token, long startTimestamp)
1729public virtual async Task<string?> GetPhoneNumberAsync(TUser user)
1746public virtual async Task<IdentityResult> SetPhoneNumberAsync(TUser user, string? phoneNumber)
1778public virtual async Task<IdentityResult> ChangePhoneNumberAsync(TUser user, string phoneNumber, string token)
1794private async Task<IdentityResult> ChangePhoneNumberCoreAsync(TUser user, string phoneNumber, string token)
1819public virtual Task<bool> IsPhoneNumberConfirmedAsync(TUser user)
1835public virtual Task<string> GenerateChangePhoneNumberTokenAsync(TUser user, string phoneNumber)
1851public virtual Task<bool> VerifyChangePhoneNumberTokenAsync(TUser user, string token, string phoneNumber)
1872public virtual async Task<bool> VerifyUserTokenAsync(TUser user, string tokenProvider, string purpose, string token)
1911public virtual Task<string> GenerateUserTokenAsync(TUser user, string tokenProvider, string purpose)
1955public virtual async Task<IList<string>> GetValidTwoFactorProvidersAsync(TUser user)
1980public virtual async Task<bool> VerifyTwoFactorTokenAsync(TUser user, string tokenProvider, string token)
2017public virtual Task<string> GenerateTwoFactorTokenAsync(TUser user, string tokenProvider)
2047public virtual async Task<bool> GetTwoFactorEnabledAsync(TUser user)
2064public virtual async Task<IdentityResult> SetTwoFactorEnabledAsync(TUser user, bool enabled)
2093public virtual async Task<bool> IsLockedOutAsync(TUser user)
2115public virtual async Task<IdentityResult> SetLockoutEnabledAsync(TUser user, bool enabled)
2141public virtual async Task<bool> GetLockoutEnabledAsync(TUser user)
2155/// A <see cref="Task{TResult}"/> that represents the lookup, a <see cref="DateTimeOffset"/> containing the last time a user's lockout expired, if any.
2157public virtual async Task<DateTimeOffset?> GetLockoutEndDateAsync(TUser user)
2171public virtual async Task<IdentityResult> SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd)
2187private async Task<IdentityResult> SetLockoutEndDateCoreAsync(TUser user, DateTimeOffset? lockoutEnd)
2209public virtual async Task<IdentityResult> AccessFailedAsync(TUser user)
2242public virtual async Task<IdentityResult> ResetAccessFailedCountAsync(TUser user)
2258private async Task<IdentityResult> ResetAccessFailedCountCoreAsync(TUser user)
2278public virtual async Task<int> GetAccessFailedCountAsync(TUser user)
2291/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <typeparamref name="TUser"/>s who
2294public virtual Task<IList<TUser>> GetUsersForClaimAsync(Claim claim)
2307/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <typeparamref name="TUser"/>s who
2310public virtual Task<IList<TUser>> GetUsersInRoleAsync(string roleName)
2326public virtual Task<string?> GetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName)
2345public virtual async Task<IdentityResult> SetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName, string? tokenValue)
2374public virtual async Task<IdentityResult> RemoveAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName)
2400public virtual Task<string?> GetAuthenticatorKeyAsync(TUser user)
2413public virtual async Task<IdentityResult> ResetAuthenticatorKeyAsync(TUser user)
2445public virtual async Task<IEnumerable<string>?> GenerateNewTwoFactorRecoveryCodesAsync(TUser user, int number)
2574public virtual async Task<IdentityResult> RedeemTwoFactorRecoveryCodeAsync(TUser user, string code)
2590private async Task<IdentityResult> RedeemTwoFactorRecoveryCodeCoreAsync(TUser user, string code)
2609public virtual Task<int> CountRecoveryCodesAsync(TUser user)
2624public virtual async Task<IdentityResult> AddOrUpdatePasskeyAsync(TUser user, UserPasskeyInfo passkey)
2640private async Task<IdentityResult> AddOrUpdatePasskeyCoreAsync(TUser user, UserPasskeyInfo passkey)
2658public virtual Task<IList<UserPasskeyInfo>> GetPasskeysAsync(TUser user)
2675public virtual Task<UserPasskeyInfo?> GetPasskeyAsync(TUser user, byte[] credentialId)
2692public virtual Task<TUser?> FindByPasskeyIdAsync(byte[] credentialId)
2710public virtual async Task<IdentityResult> RemovePasskeyAsync(TUser user, byte[] credentialId)
2726private async Task<IdentityResult> RemovePasskeyCoreAsync(TUser user, byte[] credentialId)
2812public virtual async Task<byte[]> CreateSecurityTokenAsync(TUser user)
2833protected virtual Task<IdentityResult> UpdatePasswordHash(TUser user, string newPassword, bool validatePassword)
2836private async Task<IdentityResult> UpdatePasswordHash(IUserPasswordStore<TUser> passwordStore,
2918protected async Task<IdentityResult> ValidateUserAsync(TUser user)
2958protected async Task<IdentityResult> ValidatePasswordAsync(TUser user, string? password)
2992protected virtual async Task<IdentityResult> UpdateUserAsync(TUser user)
3006private 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 (31)
AsyncValidateOptions.cs (18)
22public AsyncValidateOptions(string? name, Func<TOptions, CancellationToken, Task<bool>> validation, string failureMessage)
39public Func<TOptions, CancellationToken, Task<bool>> Validation { get; }
53public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
85public AsyncValidateOptions(string? name, TDep dependency, Func<TOptions, TDep, CancellationToken, Task<bool>> validation, string failureMessage)
108public Func<TOptions, TDep, CancellationToken, Task<bool>> Validation { get; }
116public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
148public AsyncValidateOptions(string? name, TDep1 dependency1, TDep2 dependency2, Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> validation, string failureMessage)
177public Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> Validation { get; }
185public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
219public AsyncValidateOptions(string? name, TDep1 dependency1, TDep2 dependency2, TDep3 dependency3, Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> validation, string failureMessage)
254public Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> Validation { get; }
262public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
298public AsyncValidateOptions(string? name, TDep1 dependency1, TDep2 dependency2, TDep3 dependency3, TDep4 dependency4, Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> validation, string failureMessage)
339public Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> Validation { get; }
347public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
385public AsyncValidateOptions(string? name, TDep1 dependency1, TDep2 dependency2, TDep3 dependency3, TDep4 dependency4, TDep5 dependency5, Func<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, CancellationToken, Task<bool>> validation, string failureMessage)
432public Func<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, CancellationToken, Task<bool>> Validation { get; }
440public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
OptionsBuilder.cs (12)
581public virtual OptionsBuilder<TOptions> Validate(Func<TOptions, CancellationToken, Task<bool>> validation)
590public virtual OptionsBuilder<TOptions> Validate(Func<TOptions, CancellationToken, Task<bool>> validation, string failureMessage)
604public virtual OptionsBuilder<TOptions> Validate<TDep>(Func<TOptions, TDep, CancellationToken, Task<bool>> validation) where TDep : notnull
614public virtual OptionsBuilder<TOptions> Validate<TDep>(Func<TOptions, TDep, CancellationToken, Task<bool>> validation, string failureMessage) where TDep : notnull
630public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2>(Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> validation)
643public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2>(Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> validation, string failureMessage)
666public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3>(Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> validation)
681public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3>(Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> validation, string failureMessage)
707public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> validation)
724public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> validation, string failureMessage)
753public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4, TDep5>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, CancellationToken, Task<bool>> validation)
772public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4, TDep5>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, CancellationToken, Task<bool>> validation, string failureMessage)
Microsoft.Extensions.Options.Contextual.Tests (2)
Microsoft.Extensions.Options.DataAnnotations (2)
Microsoft.Extensions.ServiceDiscovery (2)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
Microsoft.Extensions.ServiceDiscovery.Yarp (3)
Microsoft.Extensions.TimeProvider.Testing.Tests (6)
Microsoft.Gen.BuildMetadata.Unit.Tests (11)
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.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.McpServer.ProjectTemplates.Tests (3)
Microsoft.ML.AutoML (6)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Core (8)
Utilities\ResourceManagerUtils.cs (7)
108public async Task<ResourceDownloadResults> EnsureResourceAsync(IHostEnvironment env, IChannel ch, string relativeUrl, string fileName, string dir, int timeout)
125private async Task<string> DownloadFromUrlWithRetryAsync(IHostEnvironment env, IChannel ch, string url, string fileName,
155private async Task<string> DownloadFromUrlAsync(IHostEnvironment env, IChannel ch, string url, string fileName, int timeout, string filePath)
160var t = Task.Run(() => DownloadResource(env, ch, client, new Uri(url), filePath, fileName, downloadCancel.Token));
163var timeoutTask = Task.Delay(timeout).ContinueWith(task => default(Exception), TaskScheduler.Default);
165var completedTask = await Task.WhenAny(t, timeoutTask);
249private async Task<Exception> DownloadResource(IHostEnvironment env, IChannel ch, HttpClient httpClient, Uri uri, string path, string fileName, CancellationToken ct)
Microsoft.ML.Core.Tests (1)
Microsoft.ML.Data (2)
Microsoft.ML.Fairlearn (1)
Microsoft.ML.GenAI.Core (1)
Microsoft.ML.GenAI.LLaMA (4)
Microsoft.ML.GenAI.Mistral (1)
Microsoft.ML.GenAI.Phi (4)
Microsoft.ML.GenAI.Samples (4)
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.TensorFlow (1)
Microsoft.ML.TestFramework (1)
Microsoft.ML.Tokenizers (10)
Microsoft.ML.Tokenizers.Tests (1)
Microsoft.ML.TorchSharp (3)
Microsoft.ML.Transforms (1)
Microsoft.NET.Build.Containers (66)
AuthHandshakeMessageHandler.cs (5)
171private async Task<(AuthenticationHeaderValue, DateTimeOffset)?> GetAuthenticationAsync(string registry, string scheme, AuthInfo? bearerAuthInfo, CancellationToken cancellationToken)
455private async Task<(AuthenticationHeaderValue, DateTimeOffset)?> TryOAuthPostAsync(DockerCredentials privateRepoCreds, AuthInfo bearerAuthInfo, Uri realmUri, CancellationToken cancellationToken)
511private async Task<(AuthenticationHeaderValue, DateTimeOffset)?> TryTokenGetAsync(DockerCredentials privateRepoCreds, AuthInfo bearerAuthInfo, Uri realmUri, CancellationToken cancellationToken)
547private static async Task<DockerCredentials> GetLoginCredentials(string registry)
572protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
LocalDaemons\ContainerRuntimeOperations.cs (8)
19private readonly Func<string, string, CancellationToken, Task<bool>> _tryRunCommand;
24Func<string, string, CancellationToken, Task<bool>> tryRunCommand)
30public Task<bool> ProbeCommandAsync(string command, string arguments, CancellationToken cancellationToken)
61Task<ProcessTextOutput> loadTask = Process.RunAndCaptureTextAsync(loadInfo, processCancellation.Token);
137internal static async Task<bool> TryRunCommandAsync(string command, string arguments, CancellationToken cancellationToken)
172internal static async Task<(int ExitCode, string StandardError)> RunProcessAsync(
185private static async Task<(int ExitCode, string StandardError)> RunProcessAsync(
202private static async Task<(int ExitCode, string StandardError)> RunProcessAsync(
Registry\DefaultBlobUploadOperations.cs (6)
43public async Task<HttpResponseMessage> GetStatusAsync(Uri uploadUri, CancellationToken cancellationToken)
48public async Task<StartUploadInformation> StartAsync(string repositoryName, CancellationToken cancellationToken)
66public async Task<bool> TryMountAsync(string destinationRepository, string sourceRepository, string digest, CancellationToken cancellationToken)
73public async Task<FinalizeUploadInformation> UploadAtomicallyAsync(Uri uploadUri, Stream content, CancellationToken cancellationToken)
85public async Task<NextChunkUploadInformation> UploadChunkAsync(Uri uploadUri, HttpContent content, CancellationToken cancellationToken)
105private async Task<Uri> PatchAsync(Uri uploadUri, HttpContent content, CancellationToken cancellationToken)
Registry\Registry.cs (10)
191public async Task<ImageBuilder> GetImageManifestAsync(string repositoryName, string reference, string runtimeIdentifier, IManifestPicker manifestPicker, CancellationToken cancellationToken)
226async Task<ManifestV2> ReadManifest()
239internal async Task<ManifestListV2?> GetManifestListAsync(string repositoryName, string reference, CancellationToken cancellationToken)
251private async Task<ImageBuilder> ReadSingleImageAsync(string repositoryName, ManifestV2 manifest, string manifestMediaType, CancellationToken cancellationToken)
327private async Task<ImageBuilder> PickBestImageFromManifestListAsync(
354private async Task<ImageBuilder> PickBestImageFromImageIndexAsync(
381private async Task<ImageBuilder> ReadImageFromManifest(
410public async Task<string> DownloadBlobAsync(string repository, Descriptor descriptor, CancellationToken cancellationToken)
492internal async Task<FinalizeUploadInformation> UploadBlobChunkedAsync(Stream contents, StartUploadInformation startUploadInformation, CancellationToken cancellationToken)
531private Task<FinalizeUploadInformation> UploadBlobContentsAsync(Stream contents, StartUploadInformation startUploadInformation, CancellationToken cancellationToken)
Microsoft.NET.Sdk.Publish.Tasks (36)
Tasks\ZipDeploy\ZipDeploy.cs (2)
47Task<bool> t = ZipDeployAsync(ZipToPublishPath, user, password, PublishUrl, SiteName, UserAgentVersion, client, true);
53public async Task<bool> ZipDeployAsync(string? zipToPublishPath, string? userName, string? password, string? publishUrl, string? siteName, string? userAgentVersion, IHttpClient client, bool logMessages)
Microsoft.NET.Sdk.Razor.Tasks (9)
Microsoft.Svcutil.NamedPipeMetadataImporter (1)
Microsoft.TemplateEngine.Abstractions (21)
Microsoft.TemplateEngine.Cli (68)
Commands\create\TemplateCommand.cs (6)
145internal static async Task<IReadOnlyList<TemplateConstraintResult>> ValidateConstraintsAsync(TemplateConstraintManager constraintManager, ITemplateInfo template, CancellationToken cancellationToken)
162internal async Task<NewCommandStatus> InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
174Task<IReadOnlyList<TemplateConstraintResult>> constraintsEvaluation = ValidateConstraintsAsync(constraintManager, args.Template, args.IsForceFlagSpecified ? cancellationTokenSource.Token : cancellationToken);
189Task<NewCommandStatus> instantiateTask = invoker.InvokeTemplateAsync(args, cancellationToken);
190Task<(string Id, string Version, string Provider)> builtInPackageCheck = packageCoordinator.ValidateBuiltInPackageAvailabilityAsync(args.Template, cancellationToken);
191Task<CheckUpdateResult?> checkForUpdateTask = packageCoordinator.CheckUpdateForTemplate(args, cancellationToken);
TemplatePackageCoordinator.cs (11)
53internal async Task<CheckUpdateResult?> CheckUpdateForTemplate(TemplateCommandArgs args, CancellationToken cancellationToken = default)
83internal async Task<(string Id, string Version, string Provider)> ValidateBuiltInPackageAvailabilityAsync(
178internal async Task<NewCommandStatus> EnterInstallFlowAsync(InstallCommandArgs args, CancellationToken cancellationToken)
282internal async Task<NewCommandStatus> EnterUpdateFlowAsync(UpdateCommandArgs commandArgs, CancellationToken cancellationToken)
356internal async Task<NewCommandStatus> EnterUninstallFlowAsync(UninstallCommandArgs args, CancellationToken cancellationToken)
396internal async Task<NewCommandStatus> DisplayTemplatePackageMetadata(
609private async Task<bool> ValidateInstallationRequestsAsync(InstallCommandArgs args, List<InstallRequest> installRequests, CancellationToken cancellationToken)
655private async Task<(NewCommandStatus, Dictionary<IManagedTemplatePackageProvider, List<IManagedTemplatePackage>>)> DetermineSourcesToUninstallAsync(UninstallCommandArgs commandArgs, CancellationToken cancellationToken)
782private async Task<IEnumerable<ITemplatePackage>> GetTemplatePackagesByShortNameAsync(string sourceIdentifier, CancellationToken cancellationToken)
804private async Task<bool> IsTemplateShortNameAsync(string sourceIdentifier, CancellationToken cancellationToken)
914private async Task<NugetPackageMetadata?> GetPackageMetadataFromMultipleFeedsAsync(
Microsoft.TemplateEngine.Edge (73)
BuiltInManagedProvider\GlobalSettingsTemplatePackageProvider.cs (10)
54public async Task<IReadOnlyList<ITemplatePackage>> GetAllTemplatePackagesAsync(CancellationToken cancellationToken)
80public async Task<IReadOnlyList<CheckUpdateResult>> GetLatestVersionsAsync(IEnumerable<IManagedTemplatePackage> packages, CancellationToken cancellationToken)
84var tasks = new List<Task<IReadOnlyList<CheckUpdateResult>>>();
92foreach (var task in tasks)
104public async Task<IReadOnlyList<InstallResult>> InstallAsync(IEnumerable<InstallRequest> installRequests, CancellationToken cancellationToken)
159public async Task<IReadOnlyList<UninstallResult>> UninstallAsync(IEnumerable<IManagedTemplatePackage> packages, CancellationToken cancellationToken)
186public async Task<IReadOnlyList<UpdateResult>> UpdateAsync(IEnumerable<UpdateRequest> updateRequests, CancellationToken cancellationToken)
232private async Task<UpdateResult> UpdateAsync(List<TemplatePackageData> packages, UpdateRequest updateRequest, CancellationToken cancellationToken)
258private async Task<(InstallerErrorCode, string)> EnsureInstallPrerequisites(List<TemplatePackageData> packagesInSettings, string identifier, string? version, IInstaller installer, CancellationToken cancellationToken, bool update = false, bool forceUpdate = false)
305private async Task<InstallResult> InstallAsync(List<TemplatePackageData> packages, InstallRequest installRequest, IInstaller installer, CancellationToken cancellationToken)
Installers\NuGet\NugetApiPackageManager.cs (8)
49public async Task<NuGetPackageInfo> DownloadPackageAsync(string downloadPath, string identifier, string? version = null, IEnumerable<string>? additionalSources = null, bool force = false, bool includePrerelease = false, CancellationToken cancellationToken = default)
197public async Task<(string LatestVersion, bool IsLatestVersion, NugetPackageMetadata PackageMetadata)> GetLatestVersionAsync(string identifier, string? version = null, string? additionalSource = null, CancellationToken cancellationToken = default)
247private async Task<(PackageSource, NugetPackageMetadata)> GetLatestVersionInternalAsync(
311private async Task<(PackageSource, NugetPackageMetadata)> GetPackageMetadataAsync(
327List<Task<(PackageSource Source, IEnumerable<NugetPackageMetadata>? FoundPackages)>> tasks =
331Task<(PackageSource Source, IEnumerable<NugetPackageMetadata>? FoundPackages)> finishedTask =
364private async Task<(PackageSource Source, IEnumerable<NugetPackageMetadata>? FoundPackages)> GetPackageMetadataAsync(
423private async Task<(string Owners, bool Verified)> GetPackageAdditionalMetadata(
Settings\TemplatePackageManager.cs (12)
24private Dictionary<ITemplatePackageProvider, Task<IReadOnlyList<ITemplatePackage>>>? _cachedSources;
74public async Task<IReadOnlyList<IManagedTemplatePackage>> GetManagedTemplatePackagesAsync(bool force, CancellationToken cancellationToken)
89public async Task<IReadOnlyList<ITemplatePackage>> GetTemplatePackagesAsync(bool force, CancellationToken cancellationToken)
102foreach (KeyValuePair<ITemplatePackageProvider, Task<IReadOnlyList<ITemplatePackage>>> source in _cachedSources.OrderBy((p) => (p.Key.Factory as IPrioritizedComponent)?.Priority ?? 0))
154public async Task<IReadOnlyList<ITemplateInfo>> GetTemplatesAsync(CancellationToken cancellationToken)
172public async Task<IReadOnlyList<ITemplateMatchInfo>> GetTemplatesAsync(Func<ITemplateMatchInfo, bool> matchFilter, IEnumerable<Func<ITemplateInfo, MatchInfo?>> filters, CancellationToken cancellationToken)
195public async Task<ITemplatePackage> GetTemplatePackageAsync(ITemplateInfo template, CancellationToken cancellationToken)
208public async Task<IEnumerable<ITemplateInfo>> GetTemplatesAsync(ITemplatePackage templatePackage, CancellationToken cancellationToken)
223public async Task<(IManagedTemplatePackage? Package, IEnumerable<ITemplateInfo>? Templates)> GetManagedTemplatePackageAsync(string packageIdentifier, string? packageVersion = null, CancellationToken cancellationToken = default)
254_cachedSources = new Dictionary<ITemplatePackageProvider, Task<IReadOnlyList<ITemplatePackage>>>();
273private async Task<TemplateCache> UpdateTemplateCacheAsync(bool needsRebuild, CancellationToken cancellationToken)
277Task<IReadOnlyList<ITemplatePackage>> getTemplatePackagesTask = GetTemplatePackagesAsync(needsRebuild, cancellationToken);
TemplateConstraintManager.cs (9)
17private readonly Dictionary<string, Task<ITemplateConstraint>> _templateConstrains = new Dictionary<string, Task<ITemplateConstraint>>();
40public async Task<IReadOnlyList<ITemplateConstraint>> GetConstraintsAsync(IEnumerable<ITemplateInfo>? templates = null, CancellationToken cancellationToken = default)
43IEnumerable<(string Type, Task<ITemplateConstraint> Task)> constraintsToInitialize;
91public async Task<TemplateConstraintResult> EvaluateConstraintAsync(string type, string? args, CancellationToken cancellationToken)
94if (!_templateConstrains.TryGetValue(type, out Task<ITemplateConstraint> task))
146public async Task<IReadOnlyList<(ITemplateInfo Template, IReadOnlyList<TemplateConstraintResult> Result)>> EvaluateConstraintsAsync(IEnumerable<ITemplateInfo> templates, CancellationToken cancellationToken)
154if (!_templateConstrains.TryGetValue(constraintType, out Task<ITemplateConstraint> task))
188if (!_templateConstrains.TryGetValue(constraint.Type, out Task<ITemplateConstraint> task))
Microsoft.TemplateEngine.IDE (17)
Bootstrapper.cs (17)
102public Task<IReadOnlyList<ITemplateInfo>> GetTemplatesAsync(CancellationToken cancellationToken)
116public Task<IReadOnlyList<ITemplateMatchInfo>> GetTemplatesAsync(IEnumerable<Func<ITemplateInfo, MatchInfo?>> filters, bool exactMatchesOnly = true, CancellationToken cancellationToken = default)
144public Task<ITemplateCreationResult> CreateAsync(
177public Task<ITemplateCreationResult> CreateAsync(
209public Task<ITemplateCreationResult> GetCreationEffectsAsync(
236public Task<IReadOnlyList<ITemplatePackage>> GetTemplatePackagesAsync(CancellationToken cancellationToken = default)
247public Task<IReadOnlyList<IManagedTemplatePackage>> GetManagedTemplatePackagesAsync(CancellationToken cancellationToken = default)
264public Task<IReadOnlyList<InstallResult>> InstallTemplatePackagesAsync(IEnumerable<InstallRequest> installRequests, InstallationScope scope = InstallationScope.Global, CancellationToken cancellationToken = default)
294public async Task<IReadOnlyList<CheckUpdateResult>> GetLatestVersionsAsync(IEnumerable<IManagedTemplatePackage> managedPackages, CancellationToken cancellationToken = default)
316public async Task<IReadOnlyList<UpdateResult>> UpdateTemplatePackagesAsync(IEnumerable<UpdateRequest> updateRequests, CancellationToken cancellationToken = default)
338public async Task<IReadOnlyList<UninstallResult>> UninstallTemplatePackagesAsync(IEnumerable<IManagedTemplatePackage> managedPackages, CancellationToken cancellationToken = default)
365public async Task<IReadOnlyCollection<Edge.Template.IFilteredTemplateInfo>> ListTemplates(bool exactMatchesOnly, params Func<ITemplateInfo, Edge.Template.MatchInfo?>[] filters)
408Task<IReadOnlyList<InstallResult>> t = InstallTemplatePackagesAsync(installRequests);
434var task = GetManagedTemplatePackagesAsync();
444Task<IReadOnlyList<UninstallResult>> uninstallTask = UninstallTemplatePackagesAsync(packagesToUninstall);
452public async Task<ICreationResult?> CreateAsync(ITemplateInfo info, string name, string outputPath, IReadOnlyDictionary<string, string?> parameters, bool skipUpdateCheck, string baselineName)
459public async Task<ICreationEffects?> GetCreationEffectsAsync(ITemplateInfo info, string name, string outputPath, IReadOnlyDictionary<string, string?> parameters, string baselineName)
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (19)
Microsoft.TemplateEngine.Utils (3)
Microsoft.TemplateSearch.Common (4)
Microsoft.TestPlatform.CommunicationUtilities (4)
Microsoft.TestPlatform.CrossPlatEngine (12)
Microsoft.TestPlatform.Extensions.BlameDataCollector (1)
Microsoft.TestPlatform.TestHostRuntimeProvider (3)
Microsoft.TestPlatform.Utilities (3)
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (4)
Microsoft.TestUtilities (2)
Microsoft.VisualStudio.TestPlatform.Common (1)
Microsoft.VisualStudio.TestPlatform.ObjectModel (2)
MSBuild (1)
MSBuild.Coordinator (1)
mscorlib (1)
MyFrontend (3)
netstandard (1)
NuGet.Build.Tasks (2)
NuGet.Build.Tasks.Console (3)
NuGet.CommandLine.XPlat (86)
Commands\Package\Update\PackageUpdateCommandRunner.cs (8)
29internal static Task<int> Run(PackageUpdateArgs args, IVirtualProjectBuilder? virtualProjectBuilder, CancellationToken cancellationToken)
49internal static async Task<int> Run(PackageUpdateArgs args, ILoggerWithColor logger, IPackageUpdateIO packageUpdateIO, CancellationToken cancellationToken)
127private static async Task<(List<PackageUpdateResult> vulnerablePackages, HashSet<string> packagesScanned)> SelectVulnerablePackagesToUpdateAsync(
245private static async Task<(int? exitCode, Dictionary<string, List<PackageUpdateResult>> projectPackageUpdates, int totalPackagesScanned)>
350private static async Task<(int? exitCode, int totalPackagesScanned)> ProcessProjectsInParallelAsync(
353Func<string, CancellationToken, Task<(List<PackageUpdateResult>? packagesToUpdate, HashSet<string> scannedPackages, int? errorExitCode)>> processProject,
391internal static async Task<(List<PackageUpdateResult>?, HashSet<string> scannedPackages)> SelectSpecificPackagesToUpdateAsync(
550internal static async Task<(List<PackageUpdateResult>? packagesToUpdate, HashSet<string> scannedPackages)> SelectAllPackagesWithUpdatesAsync(
NuGet.Commands (134)
RestoreCommand\ProjectRestoreCommand.cs (15)
45public async Task<Tuple<bool, List<RestoreTargetGraph>, RuntimeGraph>> TryRestoreAsync(LibraryRange projectRange,
58var frameworkTasks = new List<Task<RestoreTargetGraph>>();
112var runtimeTasks = new List<Task<RestoreTargetGraph[]>>();
217internal static async Task<DownloadDependencyResolutionResult[]> DownloadDependenciesAsync(PackageSpec packageSpec, RemoteWalkContext context, TelemetryActivity telemetryActivity, string telemetryPrefix, CancellationToken cancellationToken)
221List<Task<DownloadDependencyResolutionResult>> downloadDependencyResolutionTasks = new(capacity: packageSpec.TargetFrameworks.Count);
225Task<DownloadDependencyResolutionResult> task = ResolveDownloadDependenciesAsync(context, targetFrameworkInformation, cancellationToken);
236async Task<DownloadDependencyResolutionResult> ResolveDownloadDependenciesAsync(RemoteWalkContext context, TargetFrameworkInformation targetFrameworkInformation, CancellationToken token)
243List<Task<Tuple<LibraryRange, RemoteMatch>>> packageDownloadTasks = new(capacity: targetFrameworkInformation.DownloadDependencies.Length);
256private Task<RestoreTargetGraph> WalkDependenciesAsync(LibraryRange projectRange,
273private async Task<RestoreTargetGraph> WalkDependenciesAsync(LibraryRange projectRange,
302internal async Task<bool> ResolutionSucceeded(IEnumerable<RestoreTargetGraph> graphs, IList<DownloadDependencyResolutionResult> downloadDependencyResults, RemoteWalkContext context, CancellationToken token)
346public async Task<bool> InstallPackagesAsync(
396private async Task<bool> InstallPackageAsync(RemoteMatch installItem, NuGetv3LocalRepository userPackageFolder, PackageExtractionContext packageExtractionContext, CancellationToken token)
457private Task<RestoreTargetGraph[]> WalkRuntimeDependenciesAsync(LibraryRange projectRange,
465var resultGraphs = new List<Task<RestoreTargetGraph>>();
RestoreCommand\RestoreCommand.cs (14)
205public Task<RestoreResult> ExecuteAsync()
210public async Task<RestoreResult> ExecuteAsync(CancellationToken token)
591private async Task<(RestoreResult, bool, CacheFile)> EvaluateNoOpAsync(TelemetryActivity telemetry, CacheFile cacheFile, Stopwatch restoreTime)
727private async Task<EvaluateLockFileResult>
749private async Task<(bool, List<RestoreTargetGraph>)> GenerateRestoreGraphsAsync(TelemetryActivity telemetry, RemoteWalkContext contextForProject, bool success, CancellationToken token)
796private async Task<(bool, IEnumerable<MSBuildOutputFile>, string, string, LockFile, List<RestoreTargetGraph>, PackagesLockFile, string, CacheFile)> ProcessRestoreResultAsync(TelemetryActivity telemetry,
952private async Task<bool> PerformAuditAsync(List<RestoreTargetGraph> graphs, TelemetryActivity telemetry, CancellationToken token)
1573private async Task<(bool success, bool isLockFileValid, PackagesLockFile packagesLockFile)> EvaluatePackagesLockFileAsync(
1827private async Task<bool> ValidateRestoreGraphsAsync(IEnumerable<RestoreTargetGraph> graphs, ILogger logger)
1850private static async Task<bool> ValidateCyclesAsync(IEnumerable<RestoreTargetGraph> graphs, ILogger logger)
1868private async Task<bool> ValidateConflictsAsync(IEnumerable<RestoreTargetGraph> graphs, ILogger logger)
1969private static async Task<IList<CompatibilityCheckResult>> VerifyCompatibilityAsync(
2017private async Task<(bool, List<RestoreTargetGraph>)> ExecuteLegacyRestoreAsync(
2202private async Task<(bool, List<RestoreTargetGraph>)> ExecuteRestoreAsync(
RestoreCommand\RestoreRunner.cs (22)
26public static async Task<IReadOnlyList<RestoreSummary>> RunAsync(RestoreArgs restoreContext, CancellationToken token)
38public static async Task<IReadOnlyList<RestoreSummary>> RunAsync(RestoreArgs restoreContext)
47private static async Task<IReadOnlyList<RestoreSummary>> RunAsync(
70var restoreTasks = new List<Task<RestoreSummary>>(maxTasks);
85var task = Task.Run(() => ExecuteAndCommitAsync(request, restoreArgs.ProgressReporter, token), token);
103public static Task<IReadOnlyList<RestoreResultPair>> RunWithoutCommit(
113public static async Task<IReadOnlyList<RestoreResultPair>> RunWithoutCommitAsync(
136var restoreTasks = new List<Task<RestoreResultPair>>(maxTasks);
151var task = Task.Run(() => ExecuteAsync(request, CancellationToken.None));
169public static async Task<IReadOnlyList<RestoreSummaryRequest>> GetRequests(RestoreArgs restoreContext)
241private static async Task<RestoreSummary> ExecuteAndCommitAsync(RestoreSummaryRequest summaryRequest, IRestoreProgressReporter progressReporter, CancellationToken token)
248private static async Task<RestoreResultPair> ExecuteAsync(RestoreSummaryRequest summaryRequest, CancellationToken token)
268public static Task<RestoreSummary> CommitAsync(RestoreResultPair restoreResult, CancellationToken token) => CommitAsync(restoreResult, progressReporter: null, token);
270private static async Task<RestoreSummary> CommitAsync(RestoreResultPair restoreResult, IRestoreProgressReporter progressReporter, CancellationToken token)
339private static async Task<RestoreSummary> CompleteTaskAsync(List<Task<RestoreSummary>> restoreTasks)
341var doneTask = await Task.WhenAny(restoreTasks);
346private static async Task<RestoreResultPair>
347CompleteTaskAsync(List<Task<RestoreResultPair>> restoreTasks)
349var doneTask = await Task.WhenAny(restoreTasks);
354private static async Task<IReadOnlyList<RestoreSummaryRequest>> CreatePreLoadedRequests(
368private static async Task<IReadOnlyList<RestoreSummaryRequest>> CreateRequests(
src\nuget-client\build\Shared\TaskResultCache.cs (13)
23private readonly ConcurrentDictionary<TKey, Task<TValue>> _cache;
65/// Gets the cached async operation associated with the specified key, or runs the operation asynchronously and returns <see cref="Task{TValue}" /> that the caller can await.
71/// <returns>A <see cref="Task{TResult}" /> for the specified asynchronous operation from the cache if found, otherwise the scheduled asynchronous operation to await.</returns>
72public Task<TValue> GetOrAddAsync<TState>(TKey key, Func<TState, Task<TValue>> valueFactory, TState state, CancellationToken cancellationToken)
78/// Gets the cached async operation associated with the specified key, or runs the operation asynchronously and returns <see cref="Task{TValue}" /> that the caller can await, and optionally refreshes the cache.
85/// <returns>A <see cref="Task{TResult}" /> for the specified asynchronous operation from the cache if found, otherwise the scheduled asynchronous operation to await.</returns>
86public Task<TValue> GetOrAddAsync<TState>(TKey key, bool refresh, Func<TState, Task<TValue>> valueFactory, TState state, CancellationToken cancellationToken)
88if (!refresh && _cache.TryGetValue(key, out Task<TValue>? value))
125public Task<TValue> GetValueAsync(TKey key)
127if (TryGetValue(key, out Task<TValue>? value))
136public bool TryGetValue(TKey key, [NotNullWhen(true)] out Task<TValue>? value)
NuGet.Common (37)
NuGet.Configuration (2)
NuGet.Credentials (7)
NuGet.DependencyResolver.Core (71)
ResolverUtility.cs (15)
20public static Task<GraphItem<RemoteResolveResult>> FindLibraryCachedAsync(
36public static async Task<GraphItem<RemoteResolveResult>> FindLibraryEntryAsync(
111private static async Task<GraphItem<RemoteResolveResult>> CreateGraphItemAsync(
156internal static Task<RemoteMatch?> FindLibraryMatchAsync(
182internal static async Task<RemoteMatch?> FindLibraryMatchAsync(
273public static Task<Tuple<LibraryRange, RemoteMatch>> FindPackageLibraryMatchCachedAsync(
284private static async Task<Tuple<LibraryRange, RemoteMatch>> ResolvePackageLibraryMatchAsync(LibraryRange libraryRange, RemoteWalkContext remoteWalkContext, CancellationToken cancellationToken)
301private static async Task<RemoteMatch?> FindPackageLibraryMatchAsync(LibraryRange libraryRange, NuGetFramework framework, IEnumerable<IRemoteDependencyProvider> remoteProviders, IEnumerable<IRemoteDependencyProvider> localProviders, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
379public static Task<RemoteMatch?> FindProjectMatchAsync(
388internal static Task<RemoteMatch?> FindProjectMatchAsync(
431public static async Task<RemoteMatch?> FindLibraryByVersionAsync(
493private static async Task<RemoteMatch?> FindLibraryFromSourcesAsync(
501var tasks = new List<Task<RemoteMatch?>>();
512var task = await Task.WhenAny(tasks);
535static async Task<RemoteMatch?> FindLibraryFromProviderAsync(IRemoteDependencyProvider provider, LibraryRange libraryRange,
src\nuget-client\build\Shared\TaskResultCache.cs (13)
23private readonly ConcurrentDictionary<TKey, Task<TValue>> _cache;
65/// Gets the cached async operation associated with the specified key, or runs the operation asynchronously and returns <see cref="Task{TValue}" /> that the caller can await.
71/// <returns>A <see cref="Task{TResult}" /> for the specified asynchronous operation from the cache if found, otherwise the scheduled asynchronous operation to await.</returns>
72public Task<TValue> GetOrAddAsync<TState>(TKey key, Func<TState, Task<TValue>> valueFactory, TState state, CancellationToken cancellationToken)
78/// Gets the cached async operation associated with the specified key, or runs the operation asynchronously and returns <see cref="Task{TValue}" /> that the caller can await, and optionally refreshes the cache.
85/// <returns>A <see cref="Task{TResult}" /> for the specified asynchronous operation from the cache if found, otherwise the scheduled asynchronous operation to await.</returns>
86public Task<TValue> GetOrAddAsync<TState>(TKey key, bool refresh, Func<TState, Task<TValue>> valueFactory, TState state, CancellationToken cancellationToken)
88if (!refresh && _cache.TryGetValue(key, out Task<TValue>? value))
125public Task<TValue> GetValueAsync(TKey key)
127if (TryGetValue(key, out Task<TValue>? value))
136public bool TryGetValue(TKey key, [NotNullWhen(true)] out Task<TValue>? value)
NuGet.PackageManagement (201)
NuGetPackageManager.cs (46)
485public Task<IEnumerable<NuGetProjectAction>> PreviewInstallPackageAsync(
502public async Task<IEnumerable<NuGetProjectAction>> PreviewInstallPackageAsync(
560public Task<IEnumerable<NuGetProjectAction>> PreviewUpdatePackagesAsync(
579public Task<IEnumerable<NuGetProjectAction>> PreviewUpdatePackagesAsync(
599public Task<IEnumerable<NuGetProjectAction>> PreviewUpdatePackagesAsync(
619public Task<IEnumerable<NuGetProjectAction>> PreviewUpdatePackagesAsync(
639private async Task<IEnumerable<NuGetProjectAction>> PreviewUpdatePackagesAsync(
680var tasks = new List<Task<IEnumerable<NuGetProjectAction>>>(maxTasks);
793private async Task<List<PackageIdentity>> GetPackagesToUpdateInProjectAsync(
812private async Task<IEnumerable<T>> CompleteTaskAsync<T>(
813List<Task<IEnumerable<T>>> updateTasks)
815var doneTask = await Task.WhenAny(updateTasks);
823private async Task<IEnumerable<NuGetProjectAction>> PreviewUpdatePackagesForBuildIntegratedAsync(
998private async Task<IEnumerable<NuGetProjectAction>> PreviewUpdatePackagesForClassicAsync(
1345public async Task<IEnumerable<PackageDependencyInfo>> GetInstalledPackagesDependencyInfo(NuGetProject nuGetProject, CancellationToken token, bool includeUnresolved = false)
1363public async Task<IEnumerable<PackageIdentity>> GetInstalledPackagesInDependencyOrder(NuGetProject nuGetProject,
1550public async Task<IEnumerable<NuGetProjectAction>> PreviewInstallPackageAsync(NuGetProject nuGetProject, PackageIdentity packageIdentity,
1576public async Task<IEnumerable<ResolvedAction>> PreviewProjectsInstallPackageAsync(
1587public async Task<IEnumerable<ResolvedAction>> PreviewProjectsInstallPackageAsync(
1609public async Task<IEnumerable<ResolvedAction>> PreviewProjectsInstallPackageAsync(
1714public async Task<IEnumerable<NuGetProjectAction>> PreviewInstallPackageAsync(
1726public async Task<IEnumerable<NuGetProjectAction>> PreviewInstallPackageAsync(
2047private static async Task<SourceRepository> GetSourceRepository(PackageIdentity packageIdentity,
2060var results = new Queue<KeyValuePair<SourceRepository, Task<bool>>>();
2068var task = Task.Run(() => metadataResource.Exists(packageIdentity, sourceCacheContext, logger, tokenSource.Token), tokenSource.Token);
2069results.Enqueue(new KeyValuePair<SourceRepository, Task<bool>>(sourceRepository, task));
2124public async Task<IEnumerable<NuGetProjectAction>> PreviewProjectsUninstallPackageAsync(
2217private async Task<IEnumerable<NuGetProjectAction>> PreviewBuildIntegratedNuGetProjectsUninstallPackageInternalAsync(
2267public async Task<IEnumerable<NuGetProjectAction>> PreviewUninstallPackageAsync(NuGetProject nuGetProject, string packageId,
2308public async Task<IEnumerable<NuGetProjectAction>> PreviewUninstallPackageAsync(NuGetProject nuGetProject, PackageIdentity packageIdentity,
2343private async Task<IEnumerable<NuGetProjectAction>> PreviewUninstallPackageInternalAsync(NuGetProject nuGetProject, Packaging.PackageReference packageReference,
2393private async Task<IEnumerable<PackageDependencyInfo>> GetDependencyInfoFromPackagesFolderAsync(IEnumerable<PackageIdentity> packageIdentities,
2827public async Task<BuildIntegratedProjectAction> PreviewBuildIntegratedProjectActionsAsync(
2874internal async Task<IEnumerable<ResolvedAction>> PreviewBuildIntegratedProjectsActionsAsync(
3611public async Task<bool> RestorePackageAsync(
3646public Task<bool> CopySatelliteFilesAsync(PackageIdentity packageIdentity, INuGetProjectContext nuGetProjectContext, CancellationToken token)
3699public static async Task<bool> PackageExistsInAnotherNuGetProject(NuGetProject nuGetProject, PackageIdentity packageIdentity, ISolutionManager solutionManager, CancellationToken token, bool excludeIntegrated = false)
3740private async Task<bool> DeletePackageAsync(PackageIdentity packageIdentity, INuGetProjectContext nuGetProjectContext, CancellationToken token)
3767public static Task<ResolvedPackage> GetLatestVersionAsync(
3784public static Task<ResolvedPackage> GetLatestVersionAsync(
3808public static async Task<ResolvedPackage> GetLatestVersionAsync(
3826public static async Task<ResolvedPackage> GetLatestVersionAsync(
3834var tasks = new List<Task<ResolvedPackage>>();
3848public static async Task<ResolvedPackage> GetLatestVersionAsync(
3856var tasks = new List<Task<ResolvedPackage>>();
3872private static async Task<ResolvedPackage> GetLatestVersionCoreAsync(
NuGet.Packaging (131)
Signing\Authoring\X509SignatureProvider.cs (4)
32public Task<PrimarySignature> CreatePrimarySignatureAsync(SignPackageRequest request, SignatureContent signatureContent, ILogger logger, CancellationToken token)
64public Task<PrimarySignature> CreateRepositoryCountersignatureAsync(RepositorySignPackageRequest request, PrimarySignature primarySignature, ILogger logger, CancellationToken token)
188private Task<PrimarySignature> TimestampPrimarySignatureAsync(SignPackageRequest request, ILogger logger, PrimarySignature signature, CancellationToken token)
203private Task<PrimarySignature> TimestampRepositoryCountersignatureAsync(SignPackageRequest request, ILogger logger, PrimarySignature primarySignature, CancellationToken token)
NuGet.Protocol (502)
HttpSource\HttpSource.cs (21)
21private readonly Func<Task<HttpHandlerResource>> _messageHandlerFactory;
40Func<Task<HttpHandlerResource>> messageHandlerFactory,
67public virtual async Task<T> GetAsync<T>(
69Func<HttpSourceResult, Task<T>> processAsync,
130Func<Task<ThrottledResponse>> throttledResponseFactory = () => GetThrottledResponse(
209public Task<T> ProcessStreamAsync<T>(
211Func<Stream?, Task<T>> processAsync,
218internal async Task<T> ProcessHttpStreamAsync<T>(
220Func<HttpResponseMessage?, Task<T>> processAsync,
246public async Task<T> ProcessStreamAsync<T>(
248Func<Stream?, Task<T>> processAsync,
273public Task<T> ProcessResponseAsync<T>(
275Func<HttpResponseMessage, Task<T>> processAsync,
282public async Task<T> ProcessResponseAsync<T>(
284Func<HttpResponseMessage, Task<T>> processAsync,
292Task<ThrottledResponse> throttledResponseFactory() => GetThrottledResponse(
309public async Task<JObject?> GetJObjectAsync(HttpSourceRequest request, ILogger log, CancellationToken token)
326private async Task<ThrottledResponse> GetThrottledResponse(
371private async Task<HttpClient> GetHttpClientAsync()
394private async Task<HttpClient> CreateHttpClientAsync()
453Func<Task<HttpHandlerResource>> factory = async () =>
HttpSource\ProxyAuthenticationHandler.cs (3)
57protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
148private async Task<bool> AcquireCredentialsAsync(Uri requestUri, Guid cacheVersion, IWebProxy proxy, ICredentialService credentialService, ILogger log, CancellationToken cancellationToken)
199private static async Task<NetworkCredential?> PromptForProxyCredentialsAsync(Uri proxyAddress, IWebProxy proxy, ICredentialService credentialService, ILogger log, CancellationToken cancellationToken)
LegacyFeed\MetadataResourceV2Feed.cs (6)
33public override async Task<IEnumerable<KeyValuePair<string, NuGetVersion?>>> GetLatestVersions(IEnumerable<string> packageIds, bool includePrerelease, bool includeUnlisted,
38var tasks = new Stack<KeyValuePair<string, Task<IEnumerable<NuGetVersion>>>>();
43var task = new KeyValuePair<string, Task<IEnumerable<NuGetVersion>>>(id, GetVersions(id, includePrerelease, includeUnlisted, sourceCacheContext, log, token));
68public override async Task<IEnumerable<NuGetVersion>> GetVersions(string packageId, bool includePrerelease, bool includeUnlisted, SourceCacheContext sourceCacheContext, ILogger log, CancellationToken token)
84public override async Task<bool> Exists(PackageIdentity identity, bool includeUnlisted, SourceCacheContext sourceCacheContext, ILogger log, CancellationToken token)
100public override async Task<bool> Exists(string packageId, bool includePrerelease, bool includeUnlisted, SourceCacheContext sourceCacheContext, ILogger log, CancellationToken token)
Providers\ServiceIndexResourceV3Provider.cs (5)
52public override async Task<Tuple<bool, INuGetResource?>> TryCreate(SourceRepository source, CancellationToken token)
117private async Task<ServiceIndexResourceV3?> GetServiceIndexResourceV3(
195private async Task<ServiceIndexResourceV3> ConsumeServiceIndexStreamAsync(Stream stream, DateTime utcNow, PackageSource source, CancellationToken token)
211private static async Task<ServiceIndexResourceV3> ConsumeServiceIndexStreamStjAsync(Stream stream, DateTime utcNow, PackageSource source, CancellationToken token)
246private static async Task<ServiceIndexResourceV3> ConsumeServiceIndexStreamNsjAsync(Stream stream, DateTime utcNow, PackageSource source, CancellationToken token)
Resources\DependencyInfoResourceV3.cs (3)
70public override async Task<SourcePackageDependencyInfo?> ResolvePackage(PackageIdentity package, NuGetFramework projectFramework, SourceCacheContext cacheContext, Common.ILogger log, CancellationToken token)
108public override async Task<IEnumerable<SourcePackageDependencyInfo>> ResolvePackages(string packageId, NuGetFramework projectFramework, SourceCacheContext cacheContext, Common.ILogger log, CancellationToken token)
145public override Task<IEnumerable<RemoteSourceDependencyInfo>> ResolvePackages(string packageId, SourceCacheContext cacheContext, Common.ILogger log, CancellationToken token)
Resources\DownloadResourceV3.cs (4)
80private async Task<Uri?> GetDownloadUrl(PackageIdentity identity, ILogger log, CancellationToken token)
123private static async Task<Uri?> GetDownloadUrlFromItemAsync(RegistrationResourceV3 regResource, PackageIdentity identity, SourceCacheContext sourceCacheContext, ILogger log, CancellationToken token)
131private static async Task<Uri?> GetDownloadUrlFromJObjectAsync(RegistrationResourceV3 regResource, PackageIdentity identity, SourceCacheContext sourceCacheContext, ILogger log, CancellationToken token)
145public override async Task<DownloadResourceResult> GetDownloadResourceResultAsync(
Resources\MetadataResource.cs (8)
21public async Task<IEnumerable<NuGetVersion>> GetVersions(string packageId, SourceCacheContext sourceCacheContext, Common.ILogger log, CancellationToken token)
29public abstract Task<IEnumerable<NuGetVersion>> GetVersions(string packageId, bool includePrerelease, bool includeUnlisted, SourceCacheContext sourceCacheContext, Common.ILogger log, CancellationToken token);
35public async Task<bool> Exists(PackageIdentity identity, SourceCacheContext sourceCacheContext, Common.ILogger log, CancellationToken token)
43public abstract Task<bool> Exists(PackageIdentity identity, bool includeUnlisted, SourceCacheContext sourceCacheContext, Common.ILogger log, CancellationToken token);
45public async Task<bool> Exists(string packageId, SourceCacheContext sourceCacheContext, Common.ILogger log, CancellationToken token)
50public abstract Task<bool> Exists(string packageId, bool includePrerelease, bool includeUnlisted, SourceCacheContext sourceCacheContext, Common.ILogger log, CancellationToken token);
52public abstract Task<IEnumerable<KeyValuePair<string, NuGetVersion?>>> GetLatestVersions(IEnumerable<string> packageIds, bool includePrerelease, bool includeUnlisted, SourceCacheContext sourceCacheContext, Common.ILogger log, CancellationToken token);
54public async Task<NuGetVersion?> GetLatestVersion(string packageId, bool includePrerelease, bool includeUnlisted, SourceCacheContext sourceCacheContext, Common.ILogger log, CancellationToken token)
Resources\PackageSearchResourceV3.cs (8)
54public override async Task<IEnumerable<IPackageSearchMetadata>> SearchAsync(string searchTerm, SearchFilter filter, int skip, int take, Common.ILogger log, CancellationToken cancellationToken)
96private async Task<T> SearchPage<T>(
97Func<Uri, Task<T>> getResultAsync,
202internal async Task<IReadOnlyList<PackageSearchMetadata>> Search(
224internal async Task<IReadOnlyList<PackageSearchMetadata>> ProcessHttpStreamTakeCountedItemAsync(HttpResponseMessage? httpInitialResponse, int take, CancellationToken token)
235private async Task<V3SearchResults?> ProcessHttpStreamWithoutBufferingAsync(HttpResponseMessage? httpInitialResponse, uint take, CancellationToken token)
256private static async Task<V3SearchResults?> ProcessHttpStreamWithStjAsync(HttpResponseMessage httpInitialResponse, uint take, CancellationToken token)
273private static async Task<V3SearchResults?> ProcessHttpStreamWithNsjAsync(HttpResponseMessage httpInitialResponse, uint take, CancellationToken token)
Resources\RawSearchResourceV3.cs (2)
41public virtual async Task<JObject> SearchPage(string searchTerm, SearchFilter filters, int skip, int take, Common.ILogger log, CancellationToken cancellationToken)
115public virtual async Task<IEnumerable<JObject>> Search(string searchTerm, SearchFilter filters, int skip, int take, Common.ILogger log, CancellationToken cancellationToken)
Resources\RegistrationResourceV3.cs (6)
103public virtual async Task<JObject?> GetPackageMetadata(PackageIdentity identity, SourceCacheContext cacheContext, Common.ILogger log, CancellationToken token)
112public virtual async Task<IEnumerable<JObject>> GetPackageMetadata(string packageId, bool includePrerelease, bool includeUnlisted, SourceCacheContext cacheContext, Common.ILogger log, CancellationToken token)
121public virtual async Task<IEnumerable<JObject>> GetPackageMetadata(
170public virtual Task<IEnumerable<JObject>> GetPackageEntries(string packageId, bool includeUnlisted, SourceCacheContext cacheContext, Common.ILogger log, CancellationToken token)
181internal virtual async Task<IReadOnlyList<RegistrationLeafItem>> GetPackageMetadataItemsAsync(
229internal virtual async Task<RegistrationLeafItem?> GetPackageMetadataItemAsync(PackageIdentity identity, SourceCacheContext cacheContext, Common.ILogger log, CancellationToken token)
src\nuget-client\build\Shared\TaskResultCache.cs (13)
23private readonly ConcurrentDictionary<TKey, Task<TValue>> _cache;
65/// Gets the cached async operation associated with the specified key, or runs the operation asynchronously and returns <see cref="Task{TValue}" /> that the caller can await.
71/// <returns>A <see cref="Task{TResult}" /> for the specified asynchronous operation from the cache if found, otherwise the scheduled asynchronous operation to await.</returns>
72public Task<TValue> GetOrAddAsync<TState>(TKey key, Func<TState, Task<TValue>> valueFactory, TState state, CancellationToken cancellationToken)
78/// Gets the cached async operation associated with the specified key, or runs the operation asynchronously and returns <see cref="Task{TValue}" /> that the caller can await, and optionally refreshes the cache.
85/// <returns>A <see cref="Task{TResult}" /> for the specified asynchronous operation from the cache if found, otherwise the scheduled asynchronous operation to await.</returns>
86public Task<TValue> GetOrAddAsync<TState>(TKey key, bool refresh, Func<TState, Task<TValue>> valueFactory, TState state, CancellationToken cancellationToken)
88if (!refresh && _cache.TryGetValue(key, out Task<TValue>? value))
125public Task<TValue> GetValueAsync(TKey key)
127if (TryGetValue(key, out Task<TValue>? value))
136public bool TryGetValue(TKey key, [NotNullWhen(true)] out Task<TValue>? value)
Publishers.Frontend (1)
Roslyn.Diagnostics.Analyzers (208)
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\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (9)
30public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
37public static Task<Document> AddFieldDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken)
44public static Task<Document> AddMethodDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken)
51public static Task<Document> AddPropertyDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken)
58public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
65public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken)
72public static Task<Document> AddNamespaceDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken)
79public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\roslyn\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)
rzc (27)
ScenarioTests.Common.Tests (17)
Shared.Tests (1)
Stress.AppHost (2)
Stress.TelemetryService (3)
SuperFileCheck (5)
System.CommandLine (14)
System.ComponentModel.Annotations (23)
System.Console (5)
System.Data.Common (38)
System.Data.Odbc (7)
System.Data.OleDb (5)
System.Diagnostics.Process (13)
System.Formats.Tar (2)
System.IO.Compression (47)
System\IO\Compression\ZipArchiveEntry.Async.cs (22)
22public Task<Stream> OpenAsync(CancellationToken cancellationToken = default)
34/// <returns>A <see cref="Task{Stream}"/> that represents the asynchronous open operation.</returns>
48public Task<Stream> OpenAsync(FileAccess access, CancellationToken cancellationToken = default)
62/// <returns>A <see cref="Task{Stream}"/> that represents the asynchronous open operation.</returns>
75public Task<Stream> OpenAsync(FileAccess access, ReadOnlySpan<char> password, CancellationToken cancellationToken = default)
103public Task<Stream> OpenAsync(ReadOnlySpan<char> password, CancellationToken cancellationToken = default)
116private Task<Stream> OpenAsyncCore(FileAccess access, ReadOnlySpan<char> password, CancellationToken cancellationToken)
153internal async Task<long> GetOffsetOfCompressedDataAsync(CancellationToken cancellationToken)
218private Task<Stream> OpenInReadModeAsync(bool checkOpenable, ReadOnlySpan<char> password, CancellationToken cancellationToken)
267async Task<Stream> OpenInReadModeAsyncCore(bool checkOpenable, WinZipAesKeyMaterial? aesKeys, ZipCryptoKeys? zipCryptoKeys, byte zipCryptoCheckByte, CancellationToken cancellationToken)
302private async Task<WrappedStream> OpenInUpdateModeAsync(bool loadExistingContent, CancellationToken cancellationToken)
345private async Task<Stream> OpenInUpdateModeForReadAsync(CancellationToken cancellationToken)
356private async Task<MemoryStream> GetUncompressedDataAsync(CancellationToken cancellationToken)
490private async Task<bool> GetIsOpenableAsync(bool needToUncompress, bool needToLoadIntoMemory, CancellationToken cancellationToken)
511private Task<Stream> OpenInUpdateModeWithPasswordAsync(bool loadExistingContent, ReadOnlySpan<char> password, CancellationToken cancellationToken)
568private static async Task<Stream> CastToStreamAsync(Task<WrappedStream> task) => await task.ConfigureAwait(false);
570private async Task<Stream> DecryptAndStoreForUpdateWithZipCryptoAsync(ZipCryptoKeys keys, byte checkByte, CancellationToken cancellationToken)
582private async Task<Stream> DecryptAndStoreForUpdateWithAesAsync(WinZipAesKeyMaterial aesKeys, CancellationToken cancellationToken)
607private async Task<Stream> StoreDecryptedDataForUpdateAsync(Stream decryptedStream, CancellationToken cancellationToken)
645private async Task<(bool, string?)> IsOpenableAsync(bool needToUncompress, bool needToLoadIntoMemory, CancellationToken cancellationToken)
689private async Task<bool> WriteLocalFileHeaderAsync(bool isEmptyFile, bool forceWrite, bool preserveDataDescriptor, CancellationToken cancellationToken)
System\IO\Compression\ZipBlocks.Async.cs (6)
79public static async Task<Zip64EndOfCentralDirectoryLocator> TryReadBlockAsync(Stream stream, CancellationToken cancellationToken)
104public static async Task<Zip64EndOfCentralDirectoryRecord> TryReadBlockAsync(Stream stream, CancellationToken cancellationToken)
132public static async Task<(List<ZipGenericExtraField>, byte[] trailingData)> GetExtraFieldsAsync(Stream stream, CancellationToken cancellationToken)
166public static async Task<bool> TrySkipBlockAsync(Stream stream, CancellationToken cancellationToken)
185public static async Task<(bool, int, ZipCentralDirectoryFileHeader?)> TryReadBlockAsync(ReadOnlyMemory<byte> buffer, Stream furtherReads, bool saveExtraFieldsAndComments, CancellationToken cancellationToken)
260public static async Task<ZipEndOfCentralDirectoryBlock> ReadBlockAsync(Stream stream, CancellationToken cancellationToken)
System\IO\Compression\ZipCryptoStream.cs (3)
76internal static async Task<ZipCryptoStream> CreateAsync(Stream baseStream, ZipCryptoKeys keys, byte expectedCheckByte, bool encrypting, CancellationToken cancellationToken = default, bool leaveOpen = false)
204private static async Task<(uint key0, uint key1, uint key2)> ReadAndValidateHeaderCore(bool isAsync, Stream baseStream, ZipCryptoKeys keys, byte expectedCheckByte, CancellationToken cancellationToken)
389public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System.IO.Compression.Brotli (1)
System.IO.Compression.ZipFile (8)
System\IO\Compression\ZipFile.Create.Async.cs (3)
36public static Task<ZipArchive> OpenReadAsync(string archiveFileName, CancellationToken cancellationToken = default) => OpenAsync(archiveFileName, ZipArchiveMode.Read, cancellationToken);
76public static Task<ZipArchive> OpenAsync(string archiveFileName, ZipArchiveMode mode, CancellationToken cancellationToken = default) => OpenAsync(archiveFileName, mode, entryNameEncoding: null, cancellationToken);
155public 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 (6)
System.Memory.Data (6)
System.Net.Http (100)
System\Net\Http\HttpClient.cs (44)
164public Task<string> GetStringAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
167public Task<string> GetStringAsync(Uri? requestUri) =>
170public Task<string> GetStringAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
173public Task<string> GetStringAsync(Uri? requestUri, CancellationToken cancellationToken)
183private async Task<string> GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
238public Task<byte[]> GetByteArrayAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
241public Task<byte[]> GetByteArrayAsync(Uri? requestUri) =>
244public Task<byte[]> GetByteArrayAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
247public Task<byte[]> GetByteArrayAsync(Uri? requestUri, CancellationToken cancellationToken)
257private async Task<byte[]> GetByteArrayAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
315public Task<Stream> GetStreamAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
318public Task<Stream> GetStreamAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
321public Task<Stream> GetStreamAsync(Uri? requestUri) =>
324public Task<Stream> GetStreamAsync(Uri? requestUri, CancellationToken cancellationToken)
334private async Task<Stream> GetStreamAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
365public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
368public Task<HttpResponseMessage> GetAsync(Uri? requestUri) =>
371public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpCompletionOption completionOption) =>
374public Task<HttpResponseMessage> GetAsync(Uri? requestUri, HttpCompletionOption completionOption) =>
377public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
380public Task<HttpResponseMessage> GetAsync(Uri? requestUri, CancellationToken cancellationToken) =>
383public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken) =>
386public Task<HttpResponseMessage> GetAsync(Uri? requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken) =>
389public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
392public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content) =>
395public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
398public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
405public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
408public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content) =>
411public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
414public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
421public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
424public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content) =>
427public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
430public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
437public Task<HttpResponseMessage> DeleteAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
440public Task<HttpResponseMessage> DeleteAsync(Uri? requestUri) =>
443public Task<HttpResponseMessage> DeleteAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
446public Task<HttpResponseMessage> DeleteAsync(Uri? requestUri, CancellationToken cancellationToken) =>
517public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request) =>
520public override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) =>
523public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption) =>
526public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
534async Task<HttpResponseMessage> Core(
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (4)
21private static Task<HttpResponseMessage> InnerSendAsync(HttpRequestMessage request, bool async, bool isProxyAuth, HttpConnectionPool pool, HttpConnection connection, CancellationToken cancellationToken)
46private static async Task<HttpResponseMessage> SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, bool async, ICredentials credentials, TokenImpersonationLevel impersonationLevel, bool isProxyAuth, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
205public static Task<HttpResponseMessage> SendWithNtProxyAuthAsync(HttpRequestMessage request, Uri proxyUri, bool async, ICredentials proxyCredentials, TokenImpersonationLevel impersonationLevel, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
210public 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 (6)
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 (77)
System\Net\Dns.cs (28)
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);
666private static Task<IPHostEntry> GetHostEntryCoreAsync(string hostName, bool justReturnParsedIp, bool throwOnIIPAny, AddressFamily family, CancellationToken cancellationToken) =>
667(Task<IPHostEntry>)GetHostEntryOrAddressesCoreAsync(hostName, justReturnParsedIp, throwOnIIPAny, justAddresses: false, family, cancellationToken);
785private static Task<T>? GetAddrInfoWithTelemetryAsync<T>(string hostName, bool justAddresses, AddressFamily addressFamily, CancellationToken cancellationToken)
801static async Task<T> CompleteAsync(Task task, string hostName, bool justAddresses, AddressFamily addressFamily, bool shouldFallbackToLocalhost, long startingTimeStamp, CancellationToken cancellationToken)
809result = await ((Task<T>)task).ConfigureAwait(false);
859static async Task<T> GetLocalhostAddressesAsync(AddressFamily family, CancellationToken cancellationToken)
863return await ((Task<T>)(Task)Dns.GetHostAddressesAsync(Localhost, family, cancellationToken)).ConfigureAwait(false);
868return await ((Task<T>)(Task)Dns.GetHostAddressesAsync(IPv6Localhost, family, cancellationToken)).ConfigureAwait(false);
872static async Task<T> GetLocalhostEntryAsync(AddressFamily family, CancellationToken cancellationToken)
876return await ((Task<T>)(Task)Dns.GetHostEntryAsync(Localhost, family, cancellationToken)).ConfigureAwait(false);
881return await ((Task<T>)(Task)Dns.GetHostEntryAsync(IPv6Localhost, family, cancellationToken)).ConfigureAwait(false);
934private static Task<TResult> RunAsync<TResult>(Func<object, NameResolutionActivity, TResult> func, object key, CancellationToken cancellationToken)
945Task<TResult>? task = null;
System\Net\Dns.Resolve.cs (9)
51public static Task<DnsResult<AddressRecord>> ResolveAddressesAsync(string name, CancellationToken cancellationToken = default)
67public static Task<DnsResult<AddressRecord>> ResolveAddressesAsync(string name, AddressFamily addressFamily, CancellationToken cancellationToken = default)
88public static Task<DnsResult<SrvRecord>> ResolveSrvAsync(string name, CancellationToken cancellationToken = default)
109public static Task<DnsResult<MxRecord>> ResolveMxAsync(string name, CancellationToken cancellationToken = default)
130public static Task<DnsResult<TxtRecord>> ResolveTxtAsync(string name, CancellationToken cancellationToken = default)
151public static Task<DnsResult<CNameRecord>> ResolveCNameAsync(string name, CancellationToken cancellationToken = default)
181public static Task<DnsResult<PtrRecord>> ResolvePtrAsync(string name, CancellationToken cancellationToken = default)
191public static Task<DnsResult<PtrRecord>> ResolvePtrAsync(IPAddress address, CancellationToken cancellationToken = default)
212public static Task<DnsResult<NsRecord>> ResolveNsAsync(string name, CancellationToken cancellationToken = default)
System\Net\DnsResolver.cs (29)
90Task<DnsResult<AddressRecord>> task = ResolveAddressesCore(async: false, name, addressFamily, default);
107Task<DnsResult<SrvRecord>> task = ResolveSrvCore(async: false, name, default);
124Task<DnsResult<MxRecord>> task = ResolveMxCore(async: false, name, default);
141Task<DnsResult<TxtRecord>> task = ResolveTxtCore(async: false, name, default);
158Task<DnsResult<CNameRecord>> task = ResolveCNameCore(async: false, name, default);
175Task<DnsResult<PtrRecord>> task = ResolvePtrCore(async: false, name, default);
191Task<DnsResult<PtrRecord>> task = ResolvePtrCore(async: false, BuildArpaName(address), default);
208Task<DnsResult<NsRecord>> task = ResolveNsCore(async: false, name, default);
222public Task<DnsResult<AddressRecord>> ResolveAddressesAsync(string name, CancellationToken cancellationToken = default)
239public Task<DnsResult<AddressRecord>> ResolveAddressesAsync(string name, AddressFamily addressFamily, CancellationToken cancellationToken = default)
255public Task<DnsResult<SrvRecord>> ResolveSrvAsync(string name, CancellationToken cancellationToken = default)
271public Task<DnsResult<MxRecord>> ResolveMxAsync(string name, CancellationToken cancellationToken = default)
287public Task<DnsResult<TxtRecord>> ResolveTxtAsync(string name, CancellationToken cancellationToken = default)
303public Task<DnsResult<CNameRecord>> ResolveCNameAsync(string name, CancellationToken cancellationToken = default)
319public Task<DnsResult<PtrRecord>> ResolvePtrAsync(string name, CancellationToken cancellationToken = default)
334public Task<DnsResult<PtrRecord>> ResolvePtrAsync(IPAddress address, CancellationToken cancellationToken = default)
350public Task<DnsResult<NsRecord>> ResolveNsAsync(string name, CancellationToken cancellationToken = default)
379private async Task<DnsResult<AddressRecord>> ResolveAddressesCore(bool async, string name, AddressFamily addressFamily, CancellationToken cancellationToken)
384Task<DnsResult<AddressRecord>> aTask = DoResolve(async, name, AddressFamily.InterNetwork, cancellationToken);
385Task<DnsResult<AddressRecord>> aaaaTask = DoResolve(async, name, AddressFamily.InterNetworkV6, cancellationToken);
395Task<DnsResult<AddressRecord>> DoResolve(bool async, string name, AddressFamily addressFamily, CancellationToken cancellationToken)
403private Task<DnsResult<SrvRecord>> ResolveSrvCore(bool async, string name, CancellationToken cancellationToken)
410private Task<DnsResult<MxRecord>> ResolveMxCore(bool async, string name, CancellationToken cancellationToken)
417private Task<DnsResult<TxtRecord>> ResolveTxtCore(bool async, string name, CancellationToken cancellationToken)
432private Task<DnsResult<CNameRecord>> ResolveCNameCore(bool async, string name, CancellationToken cancellationToken)
439private Task<DnsResult<PtrRecord>> ResolvePtrCore(bool async, string name, CancellationToken cancellationToken)
446private Task<DnsResult<NsRecord>> ResolveNsCore(bool async, string name, CancellationToken cancellationToken)
453private static async Task<DnsResult<T>> ResolveWithTelemetry<T, TState>(string name, TState state, Func<TState, Task<DnsResult<T>>> resolve, Func<DnsResult<T>, string[]> getAnswers)
System\Net\DnsResolverPal.Managed.cs (11)
63public static async Task<DnsResult<AddressRecord>> ResolveAddresses(IList<IPEndPoint> servers, bool async, string name, AddressFamily addressFamily, CancellationToken cancellationToken)
76public static async Task<DnsResult<SrvRecord>> ResolveSrv(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
82public static async Task<DnsResult<MxRecord>> ResolveMx(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
88public static async Task<DnsResult<TxtRecord>> ResolveTxt(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
94public static async Task<DnsResult<CNameRecord>> ResolveCName(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
100public static async Task<DnsResult<PtrRecord>> ResolvePtr(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
106public static async Task<DnsResult<NsRecord>> ResolveNs(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
382private static async Task<DnsResponse> SendQuery(IList<IPEndPoint> servers, bool async, string name, DnsRecordType qtype, CancellationToken cancellationToken)
622private static async Task<int> SendUdpQueryAsync(
646private static async Task<(byte[]? Buffer, int Length, Exception? Error)> TryTcpFallbackAsync(
682private static async Task<(byte[] Buffer, int Length)> SendTcpQueryAsync(
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\runtime\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 (51)
System\Net\Sockets\Socket.cs (9)
2514Task<int> t = SendAsync(new ReadOnlyMemory<byte>(buffer, offset, size), socketFlags, default).AsTask();
2540Task<int> t = SendAsync(buffers, socketFlags);
2589Task<int> t = SendToAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2610Task<int> t = ReceiveAsync(new ArraySegment<byte>(buffer, offset, size), socketFlags, fromNetworkStream: false, default).AsTask();
2635Task<int> t = ReceiveAsync(buffers, socketFlags);
2656Task<int> ti = TaskToAsyncResult.Unwrap<int>(asyncResult);
2680Task<SocketReceiveMessageFromResult> t = ReceiveMessageFromAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2721Task<SocketReceiveFromResult> t = ReceiveFromAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2759private 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();
254public Task<int> ReceiveAsync(ArraySegment<byte> buffer) =>
263public Task<int> ReceiveAsync(ArraySegment<byte> buffer, SocketFlags socketFlags) => ReceiveAsync(buffer, socketFlags, fromNetworkStream: false);
265internal Task<int> ReceiveAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, bool fromNetworkStream)
313public Task<int> ReceiveAsync(IList<ArraySegment<byte>> buffers) =>
322public Task<int> ReceiveAsync(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
344public Task<SocketReceiveFromResult> ReceiveFromAsync(ArraySegment<byte> buffer, EndPoint remoteEndPoint) =>
354public Task<SocketReceiveFromResult> ReceiveFromAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint)
446public Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(ArraySegment<byte> buffer, EndPoint remoteEndPoint) =>
456public Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint)
505public Task<int> SendAsync(ArraySegment<byte> buffer) =>
514public Task<int> SendAsync(ArraySegment<byte> buffer, SocketFlags socketFlags)
577public Task<int> SendAsync(IList<ArraySegment<byte>> buffers) =>
586public Task<int> SendAsync(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
608public Task<int> SendToAsync(ArraySegment<byte> buffer, EndPoint remoteEP) =>
618public Task<int> SendToAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEP)
831private Task<int> GetTaskForSendReceive(bool pending, TaskSocketAsyncEventArgs<int> saea, bool fromNetworkStream, bool isReceive)
833Task<int> t;
System\Net\Sockets\SocketAsyncEventArgs.cs (3)
707Task<IPAddress[]> addressesTask = Dns.GetHostAddressesAsync(endPoint.Host, parallelConnect ? AddressFamily.InterNetwork : endPoint.AddressFamily, cancellationToken);
725Task<IPAddress[]> addressesTask6 = Dns.GetHostAddressesAsync(endPoint.Host, AddressFamily.InterNetworkV6, cancellationToken);
740async Task Core(MultiConnectSocketAsyncEventArgs internalArgs, Task<IPAddress[]> addressesTask, int port, SocketType socketType, ProtocolType protocolType, ParallelMultiConnectSocketState? parallelState, CancellationToken cancellationToken)
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 (3)
System.Private.CoreLib (977)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (9)
1109public static Task<string> ReadAllTextAsync(string path, CancellationToken cancellationToken = default)
1112public static Task<string> ReadAllTextAsync(string path, Encoding encoding, CancellationToken cancellationToken = default)
1121private static async Task<string> InternalReadAllTextAsync(string path, Encoding encoding, CancellationToken cancellationToken)
1194public static Task<byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken = default)
1223private static async Task<byte[]> InternalReadAllBytesAsync(SafeFileHandle sfh, int count, CancellationToken cancellationToken)
1244private static async Task<byte[]> InternalReadAllBytesUnknownLengthAsync(SafeFileHandle sfh, CancellationToken cancellationToken)
1317public static Task<string[]> ReadAllLinesAsync(string path, CancellationToken cancellationToken = default)
1320public static Task<string[]> ReadAllLinesAsync(string path, Encoding encoding, CancellationToken cancellationToken = default)
1329private static async Task<string[]> InternalReadAllLinesAsync(string path, Encoding encoding, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (7)
202internal Task<int> BeginReadInternal(
302public Task<int> ReadAsync(byte[] buffer, int offset, int count) => ReadAsync(buffer, offset, count, CancellationToken.None);
304public virtual Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
319static async ValueTask<int> FinishReadAsync(Task<int> readTask, byte[] localBuffer, Memory<byte> localDestination)
452private Task<int> BeginEndReadAsync(byte[] buffer, int offset, int count)
1037TaskToAsyncResult.Begin(Task<int>.s_defaultResultTask, callback, state);
1052public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (17)
884public override Task<string?> ReadLineAsync() =>
931private async Task<string?> ReadLineAsyncInternal(CancellationToken cancellationToken)
1016public override Task<string> ReadToEndAsync() => ReadToEndAsync(default);
1041public override Task<string> ReadToEndAsync(CancellationToken cancellationToken)
1058private async Task<string> ReadToEndAsyncInternal(CancellationToken cancellationToken)
1075public override Task<int> ReadAsync(char[] buffer, int index, int count)
1103Task<int> task = ReadAsyncInternal(new Memory<char>(buffer, index, count), CancellationToken.None).AsTask();
1107async Task<int> ReadAsyncInternalWithGuard(Memory<char> buffer, CancellationToken cancellationToken)
1296public override Task<int> ReadBlockAsync(char[] buffer, int index, int count)
1324Task<int> task = base.ReadBlockAsync(buffer, index, count);
1328async Task<int> ReadBlockAsyncWithGuard(char[] buffer, int index, int count)
1363Task<int> t = vt.AsTask();
1486public override Task<int> ReadAsync(char[] buffer, int index, int count) => Task.FromResult(0);
1495public override Task<int> ReadBlockAsync(char[] buffer, int index, int count) => Task.FromResult(0);
1502public override Task<string?> ReadLineAsync() => Task.FromResult<string?>(null);
1509public override Task<string> ReadToEndAsync() => Task.FromResult("");
1511public override Task<string> ReadToEndAsync(CancellationToken cancellationToken) =>
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task_T.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> continuationTask = 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> continuationTask = new ContinuationResultTaskFromResultTask<TResult, TNewResult>(
1416private readonly Task<TResult> m_task;
1418public SystemThreadingTasks_TaskOfTResultDebugView(Task<TResult> task)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (128)
96/// For operations that return values, the <see cref="Task{TResult}"/> class
1604/// Provides access to factory methods for creating <see cref="Task"/> and <see cref="Task{TResult}"/> instances.
1614/// <remarks>It's a <see cref="Task{VoidTaskResult}"/> so it can be shared with <see cref="AsyncTaskMethodBuilder"/>.</remarks>
1615internal static readonly Task<VoidTaskResult> s_cachedCompleted = new Task<VoidTaskResult>(false, default, (TaskCreationOptions)InternalTaskOptions.DoNotDispose, default);
3079_ => completingTask is Task<TResult> taskTResult ? TrySetResult(taskTResult.Result) : TrySetResult(),
4179/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4181/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4188public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction)
4205/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4207/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4217public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
4235/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4237/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4247public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler)
4269/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4271/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4283public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
4310/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4312/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4329public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken,
4336private Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler,
4353Task<TResult> continuationTask = new ContinuationResultTaskFromTask<TResult>(
4379/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4381/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4388public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state)
4406/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4408/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4418public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken)
4437/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4439/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4449public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler)
4472/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4474/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4486public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskContinuationOptions continuationOptions)
4514/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4516/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4533public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken,
4540private Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler,
4557Task<TResult> continuationTask = new ContinuationResultTaskFromTask<TResult>(
5522Task<Task> firstCompleted = TaskFactory.CommonCWAnyLogic(tasks, isSyncBlocking: true);
5547/// <summary>Gets a <see cref="Task{TResult}"/> that's completed successfully with the specified result.</summary>
5553public static unsafe Task<TResult> FromResult<TResult>(TResult result)
5564return Task<TResult>.s_defaultResultTask;
5570Task<bool> task = *(bool*)&result ? TaskCache.s_trueTask : TaskCache.s_falseTask;
5571return *(Task<TResult>*)&task;
5581Task<int> task = TaskCache.s_int32Tasks[value - TaskCache.InclusiveInt32Min];
5582return *(Task<TResult>*)&task;
5597return Task<TResult>.s_defaultResultTask;
5605/// <summary>Creates a <see cref="Task{TResult}"/> that's completed exceptionally with the specified exception.</summary>
5618/// <summary>Creates a <see cref="Task{TResult}"/> that's completed exceptionally with the specified exception.</summary>
5622public static Task<TResult> FromException<TResult>(Exception exception)
5626var task = new Task<TResult>();
5642/// <summary>Creates a <see cref="Task{TResult}"/> that's completed due to cancellation with the specified token.</summary>
5646public static Task<TResult> FromCanceled<TResult>(CancellationToken cancellationToken)
5666/// <summary>Creates a <see cref="Task{TResult}"/> that's completed due to cancellation with the specified exception.</summary>
5670internal static Task<TResult> FromCanceled<TResult>(OperationCanceledException exception)
5674var task = new Task<TResult>();
5724public static Task<TResult> Run<TResult>(Func<TResult> function)
5726return Task<TResult>.StartNew(null, function, default,
5742public static Task<TResult> Run<TResult>(Func<TResult> function, CancellationToken cancellationToken)
5744return Task<TResult>.StartNew(null, function, cancellationToken,
5784Task<Task?> task1 = Task<Task?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
5803public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function)
5819public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function, CancellationToken cancellationToken)
5828Task<Task<TResult>?> task1 = Task<Task<TResult>?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
6419public static Task<TResult[]> WhenAll<TResult>(IEnumerable<Task<TResult>> tasks)
6422if (tasks is Task<TResult>[] taskArray)
6428if (tasks is ICollection<Task<TResult>> taskCollection)
6436taskArray = new Task<TResult>[count];
6438foreach (Task<TResult> task in taskArray)
6455List<Task<TResult>> taskList = new List<Task<TResult>>();
6456foreach (Task<TResult> task in tasks)
6502public static Task<TResult[]> WhenAll<TResult>(params Task<TResult>[] tasks)
6509return WhenAll((ReadOnlySpan<Task<TResult>>)tasks);
6540public static Task<TResult[]> WhenAll<TResult>(params ReadOnlySpan<Task<TResult>> tasks)
6547Task<TResult>[] tasksCopy = tasks.ToArray();
6548foreach (Task<TResult> task in tasksCopy)
6570private readonly Task<T>?[] m_tasks;
6574internal WhenAllPromise(Task<T>[] tasks)
6588foreach (Task<T> task in tasks)
6614Task<T>? task = m_tasks[i];
6692public static Task<Task> WhenAny(params Task[] tasks)
6711public static Task<Task> WhenAny(params ReadOnlySpan<Task> tasks) =>
6726private static Task<TTask> WhenAnyCore<TTask>(ReadOnlySpan<TTask> tasks) where TTask : Task
6764public static Task<Task> WhenAny(Task task1, Task task2) =>
6778private static Task<TTask> WhenAny<TTask>(TTask task1, TTask task2) where TTask : Task
6884public static Task<Task> WhenAny(IEnumerable<Task> tasks) =>
6900private static Task<TTask> WhenAny<TTask>(IEnumerable<TTask> tasks) where TTask : Task
6978public static Task<Task<TResult>> WhenAny<TResult>(params Task<TResult>[] tasks)
6982return WhenAnyCore((ReadOnlySpan<Task<TResult>>)tasks);
6998public static Task<Task<TResult>> WhenAny<TResult>(params ReadOnlySpan<Task<TResult>> tasks) =>
7013public static Task<Task<TResult>> WhenAny<TResult>(Task<TResult> task1, Task<TResult> task2) =>
7014WhenAny<Task<TResult>>(task1, task2);
7032public static Task<Task<TResult>> WhenAny<TResult>(IEnumerable<Task<TResult>> tasks) =>
7033WhenAny<Task<TResult>>(tasks);
7065public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(params Task<TResult>[] tasks)
7068return WhenEach((ReadOnlySpan<Task<TResult>>)tasks);
7074public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(params ReadOnlySpan<Task<TResult>> tasks) =>
7075WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(ReadOnlySpan<Task>.CastUp(tasks)));
7080public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(IEnumerable<Task<TResult>> tasks) =>
7081WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(tasks));
7229internal static Task<TResult> CreateUnwrapPromise<TResult>(Task outerTask, bool lookForOce)
7675ProcessInnerTask(task is Task<Task<TResult>> taskOfTaskOfTResult ? // it's either a Task<Task> or Task<Task<TResult>>
7676taskOfTaskOfTResult.Result : ((Task<Task>)task).Result);
7721result = TrySetResult(task is Task<TResult> taskTResult ? taskTResult.Result : default);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory_T.cs (204)
11/// <see cref="Task{TResult}">Task{TResult}</see> objects.
14/// the <see cref="Task{TResult}">Task{TResult}</see> objects that are associated with
24/// <see cref="Task{TResult}.Factory">Task{TResult}.Factory</see> property.
242/// Creates and starts a <see cref="Task{TResult}"/>.
245/// the <see cref="Task{TResult}"/>.</param>
246/// <returns>The started <see cref="Task{TResult}"/>.</returns>
251/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
257public Task<TResult> StartNew(Func<TResult> function)
260return Task<TResult>.StartNew(currTask, function, m_defaultCancellationToken,
265/// Creates and starts a <see cref="Task{TResult}"/>.
268/// the <see cref="Task{TResult}"/>.</param>
270/// <returns>The started <see cref="Task{TResult}"/>.</returns>
278/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
284public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken)
287return Task<TResult>.StartNew(currTask, function, cancellationToken,
292/// Creates and starts a <see cref="Task{TResult}"/>.
295/// the <see cref="Task{TResult}"/>.</param>
298/// <see cref="Task{TResult}"/>.</param>
299/// <returns>The started <see cref="Task{TResult}"/>.</returns>
307/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
313public Task<TResult> StartNew(Func<TResult> function, TaskCreationOptions creationOptions)
316return Task<TResult>.StartNew(currTask, function, m_defaultCancellationToken,
321/// Creates and starts a <see cref="Task{TResult}"/>.
324/// the <see cref="Task{TResult}"/>.</param>
327/// <see cref="Task{TResult}"/>.</param>
331/// that is used to schedule the created <see cref="Task{TResult}">
333/// <returns>The started <see cref="Task{TResult}"/>.</returns>
347/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
353public Task<TResult> StartNew(Func<TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
355return Task<TResult>.StartNew(
361/// Creates and starts a <see cref="Task{TResult}"/>.
364/// the <see cref="Task{TResult}"/>.</param>
367/// <returns>The started <see cref="Task{TResult}"/>.</returns>
372/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
378public Task<TResult> StartNew(Func<object?, TResult> function, object? state)
381return Task<TResult>.StartNew(currTask, function, state, m_defaultCancellationToken,
386/// Creates and starts a <see cref="Task{TResult}"/>.
389/// the <see cref="Task{TResult}"/>.</param>
393/// <returns>The started <see cref="Task{TResult}"/>.</returns>
401/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
407public Task<TResult> StartNew(Func<object?, TResult> function, object? state, CancellationToken cancellationToken)
410return Task<TResult>.StartNew(currTask, function, state, cancellationToken,
415/// Creates and starts a <see cref="Task{TResult}"/>.
418/// the <see cref="Task{TResult}"/>.</param>
423/// <see cref="Task{TResult}"/>.</param>
424/// <returns>The started <see cref="Task{TResult}"/>.</returns>
432/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
438public Task<TResult> StartNew(Func<object?, TResult> function, object? state, TaskCreationOptions creationOptions)
441return Task<TResult>.StartNew(currTask, function, state, m_defaultCancellationToken,
446/// Creates and starts a <see cref="Task{TResult}"/>.
449/// the <see cref="Task{TResult}"/>.</param>
455/// <see cref="Task{TResult}"/>.</param>
458/// that is used to schedule the created <see cref="Task{TResult}">
460/// <returns>The started <see cref="Task{TResult}"/>.</returns>
474/// Calling StartNew is functionally equivalent to creating a <see cref="Task{TResult}"/> using one
480public Task<TResult> StartNew(Func<object?, TResult> function, object? state, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler)
482return Task<TResult>.StartNew(Task.InternalCurrentIfAttached(creationOptions), function, state, cancellationToken,
495Task<TResult> promise,
548/// Creates a <see cref="Task{TResult}">Task</see> that executes an end
559/// <returns>A <see cref="Task{TResult}">Task</see> that represents the
561public Task<TResult> FromAsync(IAsyncResult asyncResult, Func<IAsyncResult, TResult> endMethod)
567/// Creates a <see cref="Task{TResult}">Task</see> that executes an end
575/// created <see cref="Task{TResult}">Task</see>.</param>
583/// <returns>A <see cref="Task{TResult}">Task</see> that represents the
585public Task<TResult> FromAsync(
596/// Creates a <see cref="Task{TResult}">Task</see> that executes an end
606/// created <see cref="Task{TResult}">Task</see>.</param>
616/// <returns>A <see cref="Task{TResult}">Task</see> that represents the
618public Task<TResult> FromAsync(
629internal static Task<TResult> FromAsyncImpl(
649Task<TResult> promise = new Task<TResult>((object?)null, creationOptions);
700/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
711/// <returns>The created <see cref="Task{TResult}">Task</see> that
716public Task<TResult> FromAsync(
724/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
730/// created <see cref="Task{TResult}">Task</see>.</param>
740/// <returns>The created <see cref="Task{TResult}">Task</see> that
745public Task<TResult> FromAsync(
754internal static Task<TResult> FromAsyncImpl(Func<AsyncCallback, object?, IAsyncResult> beginMethod,
768Task<TResult> promise = new Task<TResult>(state, creationOptions);
807/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
822/// <returns>The created <see cref="Task{TResult}">Task</see> that
827public Task<TResult> FromAsync<TArg1>(
836/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
846/// created <see cref="Task{TResult}">Task</see>.</param>
856/// <returns>The created <see cref="Task{TResult}">Task</see> that
861public Task<TResult> FromAsync<TArg1>(
871internal static Task<TResult> FromAsyncImpl<TArg1>(Func<TArg1, AsyncCallback, object?, IAsyncResult> beginMethod,
885Task<TResult> promise = new Task<TResult>(state, creationOptions);
924/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
943/// <returns>The created <see cref="Task{TResult}">Task</see> that
948public Task<TResult> FromAsync<TArg1, TArg2>(
957/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
971/// created <see cref="Task{TResult}">Task</see>.</param>
981/// <returns>The created <see cref="Task{TResult}">Task</see> that
986public Task<TResult> FromAsync<TArg1, TArg2>(
996internal static Task<TResult> FromAsyncImpl<TArg1, TArg2>(Func<TArg1, TArg2, AsyncCallback, object?, IAsyncResult> beginMethod,
1010Task<TResult> promise = new Task<TResult>(state, creationOptions);
1049/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1072/// <returns>The created <see cref="Task{TResult}">Task</see> that
1077public Task<TResult> FromAsync<TArg1, TArg2, TArg3>(
1086/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1104/// created <see cref="Task{TResult}">Task</see>.</param>
1114/// <returns>The created <see cref="Task{TResult}">Task</see> that
1119public Task<TResult> FromAsync<TArg1, TArg2, TArg3>(
1129internal static Task<TResult> FromAsyncImpl<TArg1, TArg2, TArg3>(Func<TArg1, TArg2, TArg3, AsyncCallback, object?, IAsyncResult> beginMethod,
1143Task<TResult> promise = new Task<TResult>(state, creationOptions);
1193internal static Task<TResult> FromAsyncTrim<TInstance, TArgs>(
1325private static Task<TResult> CreateCanceledTask(TaskContinuationOptions continuationOptions, CancellationToken ct)
1336/// Creates a continuation <see cref="Task{TResult}">Task</see>
1342/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1351public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction)
1359/// Creates a continuation <see cref="Task{TResult}">Task</see>
1367/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1379public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken)
1387/// Creates a continuation <see cref="Task{TResult}">Task</see>
1395/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1396/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1413public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions)
1421/// Creates a continuation <see cref="Task{TResult}">Task</see>
1431/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1435/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1457public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction,
1466/// Creates a continuation <see cref="Task{TResult}">Task</see>
1473/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1482public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction)
1490/// Creates a continuation <see cref="Task{TResult}">Task</see>
1499/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1511public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1520/// Creates a continuation <see cref="Task{TResult}">Task</see>
1529/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1530/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1547public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1556/// Creates a continuation <see cref="Task{TResult}">Task</see>
1567/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1570/// cref="Task{TResult}"/>.</param>
1571/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1593public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1604internal static Task<TResult> ContinueWhenAllImpl<TAntecedentResult>(Task<TAntecedentResult>[] tasks,
1605Func<Task<TAntecedentResult>[], TResult>? continuationFunction, Action<Task<TAntecedentResult>[]>? continuationAction,
1615Task<TAntecedentResult>[] tasksCopy = TaskFactory.CheckMultiContinuationTasksAndCopy(tasks);
1626Task<Task<TAntecedentResult>[]> starter = TaskFactory.CommonCWAllLogic(tasksCopy);
1632static (starter, continuationFunction) => ((Func<Task<TAntecedentResult>[], TResult>)continuationFunction!)(starter.Result),
1642((Action<Task<TAntecedentResult>[]>)continuationAction!)(starter.Result);
1651internal static Task<TResult> ContinueWhenAllImpl(Task[] tasks,
1673Task<Task[]> starter = TaskFactory.CommonCWAllLogic(tasksCopy);
1706/// Creates a continuation <see cref="Task{TResult}">Task</see>
1712/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1721public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction)
1729/// Creates a continuation <see cref="Task{TResult}">Task</see>
1737/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1749public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
1757/// Creates a continuation <see cref="Task{TResult}">Task</see>
1765/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1766/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1783public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
1791/// Creates a continuation <see cref="Task{TResult}">Task</see>
1801/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1805/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1827public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction,
1836/// Creates a continuation <see cref="Task{TResult}">Task</see>
1843/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1852public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction)
1860/// Creates a continuation <see cref="Task{TResult}">Task</see>
1869/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1881public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1890/// Creates a continuation <see cref="Task{TResult}">Task</see>
1899/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1900/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1917public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1926/// Creates a continuation <see cref="Task{TResult}">Task</see>
1937/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1940/// cref="Task{TResult}"/>.</param>
1941/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1963public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1973internal static Task<TResult> ContinueWhenAnyImpl(Task[] tasks,
1986Task<Task> starter = TaskFactory.CommonCWAnyLogic(tasks);
2024internal static Task<TResult> ContinueWhenAnyImpl<TAntecedentResult>(Task<TAntecedentResult>[] tasks,
2025Func<Task<TAntecedentResult>, TResult>? continuationFunction, Action<Task<TAntecedentResult>>? continuationAction,
2036Task<Task<TAntecedentResult>> starter = TaskFactory.CommonCWAnyLogic(tasks);
2050static (starter, continuationFunction) => ((Func<Task<TAntecedentResult>, TResult>)continuationFunction!)(starter.Result),
2059((Action<Task<TAntecedentResult>>)continuationAction!)(starter.Result);
src\runtime\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)
18public virtual Task<string> GetValueAsync()
25public virtual async Task<object> ReadContentAsObjectAsync()
36public virtual Task<string> ReadContentAsStringAsync()
47public virtual async Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver? namespaceResolver)
75public virtual async Task<object> ReadElementContentAsObjectAsync()
87public virtual async Task<string> ReadElementContentAsStringAsync()
99public virtual async Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
113public virtual Task<bool> ReadAsync()
125public virtual Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
131public virtual Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
137public virtual Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
143public virtual Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
150public virtual Task<int> ReadValueChunkAsync(char[] buffer, int index, int count)
158public virtual async Task<XmlNodeType> MoveToContentAsync()
180public virtual async Task<string> ReadInnerXmlAsync()
263public virtual async Task<string> ReadOuterXmlAsync()
298private async Task<bool> SkipSubtreeAsync()
322internal async Task<string> InternalReadContentAsStringAsync()
368private async Task<bool> SetupReadElementContentAsXxxAsync(string methodName)
399private 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 (12)
System.Runtime (1)
System.Runtime.InteropServices.JavaScript (23)
System.Security.Cryptography (9)
src\runtime\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)
811/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
842public Task<bool> VerifyDetachedAsync(AsymmetricAlgorithm key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
874/// <returns>A task whose <see cref="Task{TResult}"/> property is <see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns>
904public Task<bool> VerifyDetachedAsync(CoseKey key, Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default)
928private 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)
615private async Task<bool> VerifyAsyncCore(CoseKey key, Stream content, ReadOnlyMemory<byte> associatedData, CancellationToken cancellationToken)
System.Security.Principal.Windows (5)
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 (3)
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)
TestProject.IntegrationServiceA (2)
UnitTests.Common (11)
vbc (12)
VBCSCompiler (32)
src\roslyn\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);
vstest.console (4)
vstest.console.arm64 (4)
WaitFor.Frontend (1)