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)
1352Task<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)
15928 references to Task
aspire (1009)
Acquisition\PeerInstallProbe.cs (8)
67public async Task<PeerProbeResult> ProbeAsync(string binaryPath, CancellationToken cancellationToken)
198private async Task<SpawnResult> SpawnAndCaptureAsync(string binaryPath, string[] arguments, CancellationToken cancellationToken)
327private static async Task<PeerProcessOutput> CapturePeerOutputAsync(Process process, CancellationToken cancellationToken)
329var readStdoutTask = ReadCappedAsync(process.StandardOutput.BaseStream, OutputCap, cancellationToken);
330var readStderrTask = ReadCappedAsync(process.StandardError.BaseStream, OutputCap, cancellationToken);
347private static async Task<CappedOutput> ReadCappedAsync(Stream stream, int cap, CancellationToken cancellationToken)
437private static async Task<CappedOutput> SwallowAsync(Task<CappedOutput> task)
Agents\AspireSkills\AspireSkillsInstaller.cs (15)
58public Task<AspireSkillsInstallResult> InstallAsync(CancellationToken cancellationToken)
65private async Task<AspireSkillsInstallResult> InstallCoreAsync(CancellationToken cancellationToken)
83async Task<AspireSkillsInstallResult> CompleteInstallationAsync(AspireSkillsBundle bundle, string archiveSha512)
162private async Task<AcquisitionResult> InstallFromGitHubAsync(
285private async Task<AcquisitionResult> InstallFromEmbeddedAsync(
427private async Task<GitHubReleaseInfo?> TryGetGitHubReleaseAsync(HttpClient httpClient, string version, CancellationToken cancellationToken)
529private static async Task<bool> TryDownloadGitHubAssetAsync(HttpClient httpClient, string downloadUrl, string archivePath, CancellationToken cancellationToken)
552private async Task<AcquisitionResult?> TryLoadCachedBundleAsync(
582private async Task<AcquisitionResult?> TryLoadCachedBundleCoreAsync(
654private async Task<AcquisitionResult?> TryLoadCachedBundleDirectoryAsync(
723private async Task<AspireSkillsBundle> CacheArchiveAsync(
751private async Task<AspireSkillsBundle> CacheStagedBundleAsync(
842private Task<FileStream> AcquireCacheLockAsync(string cacheRoot, string version, CancellationToken cancellationToken)
847private Task<FileStream> AcquireCacheLockForCleanupAsync(string cacheRoot, string version, CancellationToken cancellationToken)
852private async Task<FileStream> AcquireCacheLockCoreAsync(
Backchannel\AppHostAuxiliaryBackchannel.cs (21)
132public static Task<AppHostAuxiliaryBackchannel> ConnectAsync(
156internal static Task<AppHostAuxiliaryBackchannel> CreateFromSocketAsync(
165internal static async Task<AppHostAuxiliaryBackchannel> CreateFromSocketAsync(
203var appHostInfoTask = rpc.InvokeWithProfilingAsync<AppHostInformation?>(
212var capabilitiesTask = FetchCapabilitiesAsync(rpc, logger, profilingTelemetry, handshakeCancellation.Token);
253private static async Task<string[]?> FetchCapabilitiesAsync(JsonRpc rpc, ILogger logger, ProfilingTelemetry? profilingTelemetry, CancellationToken cancellationToken)
292public async Task<AppHostInformation?> GetAppHostInformationAsync(CancellationToken cancellationToken = default)
309public async Task<bool> StopAppHostAsync(CancellationToken cancellationToken = default)
336public async Task<DashboardUrlsState?> GetDashboardUrlsAsync(CancellationToken cancellationToken = default)
369public async Task<WaitForAppHostReadyResponse?> WaitForAppHostReadyAsync(CancellationToken cancellationToken = default)
397public async Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(bool includeHidden, CancellationToken cancellationToken = default)
543public async Task<CallToolResult> CallResourceMcpToolAsync(
569public async Task<GetAppHostInfoResponse?> GetAppHostInfoV2Async(CancellationToken cancellationToken = default)
609public async Task<GetDashboardInfoResponse?> GetDashboardInfoV2Async(CancellationToken cancellationToken = default)
654public async Task<GetResourcesResponse> GetResourcesV2Async(GetResourcesRequest? request = null, CancellationToken cancellationToken = default)
910public async Task<CallMcpToolResponse> CallMcpToolV2Async(
961public async Task<bool> StopAppHostV2Async(StopAppHostRequest? request = null, CancellationToken cancellationToken = default)
993public async Task<ExecuteResourceCommandResponse> ExecuteResourceCommandAsync(
1028public async Task<WaitForResourceResponse> WaitForResourceAsync(
1069public async Task<GetTerminalInfoResponse> GetTerminalInfoAsync(string resourceName, CancellationToken cancellationToken = default)
1103public async Task<ListTerminalsResponse> ListTerminalsAsync(CancellationToken cancellationToken = default)
Backchannel\AppHostCliBackchannel.cs (13)
19Task<DashboardUrlsState> GetDashboardUrlsAsync(CancellationToken cancellationToken);
26Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken);
29Task<GetPipelineStepsResponse> GetPipelineStepsAsync(string? step, CancellationToken cancellationToken);
30Task<UploadFileResponse> UploadFileAsync(string filePath, string fileName, int interactionId, string inputName, CancellationToken cancellationToken);
51private Task<JsonRpc> GetRpcTaskAsync()
110public async Task<DashboardUrlsState> GetDashboardUrlsAsync(CancellationToken cancellationToken)
153Func<JsonRpc, CancellationToken, Task<IAsyncEnumerable<T>>> startStream,
261Task<JsonRpc>? initialTask = null;
264var currentTask = GetRpcTaskAsync();
287var rpcTask = GetRpcTaskAsync();
491public async Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
538public async Task<GetPipelineStepsResponse> GetPipelineStepsAsync(string? step, CancellationToken cancellationToken)
557public async Task<UploadFileResponse> UploadFileAsync(string filePath, string fileName, int interactionId, string inputName, CancellationToken cancellationToken)
Backchannel\ExtensionBackchannel.cs (16)
36Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull;
37Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull;
38Task<bool> ConfirmAsync(string promptText, bool defaultValue, CancellationToken cancellationToken);
39Task<string> PromptForStringAsync(string promptText, string? defaultValue, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken);
40Task<string> PromptForSecretStringAsync(string promptText, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken);
41Task<string?> PromptForFilePathAsync(string promptText, string? defaultValue, bool directory, CancellationToken cancellationToken);
44Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken);
45Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken);
541public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
571public async Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
601public async Task<bool> ConfirmAsync(string promptText, bool defaultValue, CancellationToken cancellationToken)
625public async Task<string> PromptForStringAsync(string promptText, string? defaultValue, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken)
651public async Task<string> PromptForSecretStringAsync(string promptText, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken)
677public async Task<string?> PromptForFilePathAsync(string promptText, string? defaultValue, bool directory, CancellationToken cancellationToken)
776public async Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken)
782public async Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
Commands\AddCommand.cs (12)
74protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
448private static async Task<IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)>> GetAllPackageVersions(DirectoryInfo workingDirectory, IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> possiblePackages, CancellationToken cancellationToken)
465private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> GetPackageByInteractiveFlow(
564private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
570private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, string? configuredChannel, CancellationToken cancellationToken)
576private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> GetPackageByInteractiveFlowWithNoMatchesMessage(
597Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken);
598Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, string? configuredChannel, CancellationToken cancellationToken);
603public virtual async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, string? configuredChannel, CancellationToken cancellationToken)
613async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForChannelPackagesAsync(
668var rootChoices = new List<(string Label, Func<CancellationToken, Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)>> Action)>();
733public virtual async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
Commands\ConfigCommand.cs (16)
41protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
75protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
86public override async Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
92private async Task<int> ExecuteAsync(string key, CancellationToken cancellationToken)
132protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
151public override async Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
164private async Task<int> ExecuteAsync(string key, string value, bool isGlobal, CancellationToken cancellationToken)
212protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
218public override Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
223private async Task<int> ExecuteAsync(bool showAll, CancellationToken cancellationToken)
369protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
382public override async Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
402private async Task<int> ExecuteAsync(string key, bool isGlobal, CancellationToken cancellationToken)
452protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
458public override Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
463private Task<int> ExecuteAsync(bool useJson)
Commands\IntegrationPackageSearchService.cs (6)
24public async Task<IEnumerable<(NuGetPackage Package, PackageChannel Channel)>> GetIntegrationPackagesWithChannelsAsync(DirectoryInfo workingDirectory, string? configuredChannel, CancellationToken cancellationToken)
55public async Task<(IReadOnlyList<(NuGetPackage Package, PackageChannel Channel)> Packages, IReadOnlySet<string> PolyglotCompatibleIds)> GetIntegrationPackagesWithPolyglotCompatibilityAsync(DirectoryInfo workingDirectory, string? configuredChannel, CancellationToken cancellationToken)
67var integrationPackagesTask = channel.GetIntegrationPackagesAsync(workingDirectory: workingDirectory, cancellationToken: ct);
68var polyglotIdsTask = channel.GetPolyglotCompatiblePackageIdsAsync(workingDirectory: workingDirectory, cancellationToken: ct);
81private async Task<IEnumerable<PackageChannel>> GetSearchChannelsAsync(string? configuredChannel, CancellationToken cancellationToken)
112public async Task<(DirectoryInfo WorkingDirectory, string? ConfiguredChannel, string? LanguageId, int? ExitCode)> GetPackageSearchContextAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken)
Commands\NewCommand.cs (16)
163private async Task<string> PromptForAppHostLanguageAsync(IReadOnlyList<string> selectableLanguages, CancellationToken cancellationToken)
224private async Task<(bool Success, string? LanguageId)> ResolveSelectedLanguageAsync(ITemplate template, ParseResult parseResult, CancellationToken cancellationToken)
296private async Task<ITemplate?> GetProjectTemplateAsync(ITemplate[] availableTemplates, ParseResult parseResult, CancellationToken cancellationToken)
353private async Task<ResolveTemplateVersionResult> ResolveCliTemplateVersionAsync(ParseResult parseResult, string? source, CancellationToken cancellationToken)
493protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
635private async Task<string?> ResolveIdentityChannelNameAsync(CancellationToken cancellationToken)
661Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken);
662Task<string> PromptForProjectNameAsync(string defaultName, ParseResult parseResult, CancellationToken cancellationToken);
663Task<string> PromptForOutputPath(string v, ParseResult parseResult, Func<string, ValidationResult>? validator = null, Func<string, string>? outputPathResolver = null, CancellationToken cancellationToken = default);
674Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken);
679public virtual async Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken)
710async Task<(NuGetPackage Package, PackageChannel Channel)> PromptForChannelPackagesAsync(
733var rootChoices = new List<(string Label, Func<CancellationToken, Task<(NuGetPackage, PackageChannel)>> Action)>();
776public virtual async Task<string> PromptForOutputPath(string path, ParseResult parseResult, Func<string, ValidationResult>? validator = null, Func<string, string>? outputPathResolver = null, CancellationToken cancellationToken = default)
796public virtual async Task<string> PromptForProjectNameAsync(string defaultName, ParseResult parseResult, CancellationToken cancellationToken)
807public virtual async Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken)
Commands\PipelineCommandBase.cs (11)
124protected abstract Task<string[]> GetRunArgumentsAsync(string? fullyQualifiedOutputPath, string[] unmatchedTokens, string? targetStep, ParseResult parseResult, CancellationToken cancellationToken);
149protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
208Task<int>? pendingRun = null;
295var backchannel = await InteractionService.ShowStatusAsync(GetProgressMessage(parseResult), (Func<Task<IAppHostCliBackchannel>>)(async () =>
716public async Task<bool> ProcessPublishingActivitiesDebugAsync(IAsyncEnumerable<PublishingActivity> publishingActivities, IAppHostCliBackchannel backchannel, CancellationToken cancellationToken)
810public async Task<bool> ProcessAndDisplayPublishingActivitiesAsync(IAsyncEnumerable<PublishingActivity> publishingActivities, IAppHostCliBackchannel backchannel, bool isDebugOrTraceLoggingEnabled, CancellationToken cancellationToken)
1122private async Task<string?> HandleSingleInputAsync(PublishingPromptInput input, string promptText, IAppHostCliBackchannel backchannel, string interactionId, CancellationToken cancellationToken)
1169private async Task<string?> HandleSelectInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
1203private async Task<string?> HandleNumberInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
1223private async Task<string?> HandleFileInputAsync(PublishingPromptInput input, string promptText, IAppHostCliBackchannel backchannel, string interactionId, CancellationToken cancellationToken)
1320private static async Task<string> UploadFilesAsync(List<string> filePaths, IAppHostCliBackchannel backchannel, string interactionId, string inputName, CancellationToken cancellationToken)
Commands\ResourceCommand.cs (7)
116protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
184private static async Task<CommandResult> LoadCommandArgumentsAsync(
223private static async Task<ResourceSnapshotCommand?> GetCommandMetadataAsync(IAppHostAuxiliaryBackchannel connection, string resourceName, string commandName, bool includeHidden, CancellationToken cancellationToken)
234private static async Task<(string Name, string Description)[]> GetAvailableCommandMetadataAsync(IAppHostAuxiliaryBackchannel connection, string resourceName, bool includeHidden, CancellationToken cancellationToken)
597public override async Task<int> InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
664private async Task<IAppHostAuxiliaryBackchannel?> ResolveConnectionForAvailableCommandsAsync(ParseResult parseResult, CancellationToken cancellationToken)
683private async Task<IAppHostAuxiliaryBackchannel?> ResolveExplicitConnectionForAvailableCommandsAsync(FileInfo appHostProjectFile, CancellationToken cancellationToken)
Commands\RunCommand.cs (21)
169protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
253Task<int>? runTask = null;
824private static async Task<int?> ObserveEarlyDetachedStartupExitAsync(Task<int> pendingRun, CancellationToken cancellationToken)
840private static async Task<AppHostExitResolution> ResolveAppHostExitCodeAsync(Task<int> appHostFailureTask, CancellationToken cancellationToken)
876private static async Task<int> GetAppHostStartupExitCodeAsync(Task<int> pendingRun)
888private async Task<AppHostStartupResult> WaitForAppHostStartupAsync(
889Task<int> pendingRun,
900var happyPathTask = RunStartupHappyPathAsync(backchannelCompletionSource, onBackchannelEstablished, logCaptureCancellationSource, pendingRun, startupStartTimestamp, startupTimeout, startupCts.Token);
977private async Task<AppHostStartupResult> RunStartupHappyPathAsync(
981Task<int> pendingRun,
1075private static async Task<bool> RequestAppHostStopForProfileAsync(
1077Task<int> pendingRun,
1221var structuredLogSupportProbe = ExtensionHelper.IsExtensionHost(interactionService, out var extensionInteractionService, out var extensionBackchannel)
1235Task<bool>? moveNextTask = null;
1398private static async Task<bool> SupportsStructuredAppHostLogsAsync(
1476private Task<CommandResult> ExecuteDetachedAsync(ParseResult parseResult, FileInfo? passedAppHostProjectFile, bool isExtensionHost, int timeoutSeconds, CancellationToken cancellationToken)
1529Task<int> pendingRun,
1559private async Task DrainAppHostRunAfterCancellationAsync(Task<int> pendingRun)
Commands\StopCommand.cs (11)
85protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
123private async Task<int> ForceStopAppHostAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken)
150private async Task<FileInfo?> TryResolveAppHostFileAsync(
190private async Task<int> ExecuteNonInteractiveAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken)
196private async Task<StopAppHostResult> ExecuteNonInteractiveWithResultAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken, bool treatNotRunningAsSuccess = false)
255private async Task<int> ExecuteInteractiveAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken)
261private async Task<StopAppHostResult> ExecuteInteractiveWithResultAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken)
293private async Task<StopAppHostResult> StopRunningAppHostsForResolvedFileAsync(FileInfo appHostFile, AppHostConnectionResult[] allConnections, CancellationToken cancellationToken)
336private async Task<int> CleanupPersistentResourcesAsync(FileInfo appHostFile, CancellationToken cancellationToken)
429private async Task<int> StopAllAppHostsAsync(CancellationToken cancellationToken)
483private async Task<int> StopAppHostAsync(IAppHostAuxiliaryBackchannel connection, string appHostIdentifier, CancellationToken cancellationToken)
Commands\TelemetryLogsCommand.cs (4)
79protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
111private async Task<int> FetchLogsAsync(
166private async Task<int> GetLogsSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
188private async Task<int> StreamLogsAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
Commands\TelemetrySpansCommand.cs (4)
69protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
101private async Task<int> FetchSpansAsync(
158private async Task<int> GetSpansSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
180private async Task<int> StreamSpansAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
DotNet\DotNetCliRunner.cs (34)
33Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken);
34Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, string[] targets, ProcessInvocationOptions options, CancellationToken cancellationToken);
35Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, bool noRestore, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken);
36Task<int> RunAppHostCommandAsync(FileInfo projectFile, string command, DirectoryInfo workingDirectory, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken);
37Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, ProcessInvocationOptions options, CancellationToken cancellationToken);
38Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, ProcessInvocationOptions options, CancellationToken cancellationToken);
39Task<int> RestoreAsync(FileInfo projectFilePath, ProcessInvocationOptions options, CancellationToken cancellationToken);
40Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken);
41Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, IDictionary<string, string>? env, ProcessInvocationOptions options, CancellationToken cancellationToken);
42Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken);
43Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken);
44Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool exactMatch, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, bool useCache, ProcessInvocationOptions options, CancellationToken cancellationToken);
45Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, ProcessInvocationOptions options, CancellationToken cancellationToken);
46Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, ProcessInvocationOptions options, CancellationToken cancellationToken);
47Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProject, ProcessInvocationOptions options, CancellationToken cancellationToken);
48Task<int> InitUserSecretsAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken);
202private async Task<int> ExecuteAsync(
695public async Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
785public async Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, string[] targets, ProcessInvocationOptions options, CancellationToken cancellationToken)
909public async Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, bool noRestore, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken)
967public async Task<int> RunAppHostCommandAsync(
1040public async Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, ProcessInvocationOptions options, CancellationToken cancellationToken)
1251public async Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, ProcessInvocationOptions options, CancellationToken cancellationToken)
1266public async Task<int> RestoreAsync(FileInfo projectFilePath, ProcessInvocationOptions options, CancellationToken cancellationToken)
1282public Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
1285public async Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, IDictionary<string, string>? env, ProcessInvocationOptions options, CancellationToken cancellationToken)
1307public async Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
1371public async Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
1400public async Task<string> ComputeNuGetConfigHierarchySha256Async(DirectoryInfo workingDirectory, ProcessInvocationOptions options, CancellationToken cancellationToken)
1463public async Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool exactMatch, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, bool useCache, ProcessInvocationOptions options, CancellationToken cancellationToken)
1644public async Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, ProcessInvocationOptions options, CancellationToken cancellationToken)
1686public async Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
1754public async Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProject, ProcessInvocationOptions options, CancellationToken cancellationToken)
1783public Task<int> InitUserSecretsAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
Interaction\ConsoleInteractionService.cs (10)
105public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
144public async Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null)
218public async Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, CancellationToken cancellationToken = default)
281public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, PromptBinding<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
286public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
350public async Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, PromptBinding<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
665public async Task<bool> PromptConfirmAsync(string promptText, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default)
710private async Task<bool> PromptConfirmWithSingleKeyAsync(string promptText, char yesChoice, char noChoice, bool defaultValue, CancellationToken cancellationToken)
Interaction\ExtensionInteractionService.cs (12)
20Task<bool> TryDisplayCommandFailureAsync(string? errorMessage, string cliLogFilePath, string? appHostCliLogFilePath, CancellationToken cancellationToken);
87public async Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
104public async Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null)
145public async Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, CancellationToken cancellationToken = default)
202public async Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, PromptBinding<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
271public async Task<bool> PromptConfirmAsync(string promptText, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default)
308public async Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
346public async Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter,
452public async Task<bool> SupportsMessageActionsAsync(CancellationToken cancellationToken)
474public async Task<bool> TryDisplayCommandFailureAsync(
Interaction\IInteractionService.cs (10)
13Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false);
21/// Use this instead of <see cref="ShowStatusAsync{T}(string, Func{Task{T}}, KnownEmoji?, bool)"/> when the
24Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null);
25Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, CancellationToken cancellationToken = default);
26Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, PromptBinding<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default);
27public Task<bool> PromptConfirmAsync(string promptText, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default);
28Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull;
29Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, PromptBinding<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull;
NuGet\NuGetPackageCache.cs (11)
17Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
18Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
19Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken);
20Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken);
21Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(DirectoryInfo workingDirectory, string exactPackageId, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken);
74public async Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
89public async Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
94public async Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
110private static async Task<string> ComputeNuGetConfigHashSuffixAsync(FileInfo nugetConfigFile, CancellationToken cancellationToken)
118public async Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string query, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
189public async Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(DirectoryInfo workingDirectory, string exactPackageId, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
Packaging\NuGetConfigMerger.cs (5)
33public static async Task CreateOrUpdateAsync(DirectoryInfo targetDirectory, PackageChannel channel, Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback = null, CancellationToken cancellationToken = default)
55Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback = null,
81private static async Task CreateNewNuGetConfigAsync(DirectoryInfo targetDirectory, PackageMapping[] mappings, bool configureGlobalPackagesFolder, Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback, CancellationToken cancellationToken)
115private static async Task UpdateExistingNuGetConfigAsync(FileInfo nugetConfigFile, PackageMapping[] mappings, bool configureGlobalPackagesFolder, Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback, CancellationToken cancellationToken)
166private static async Task<NuGetConfigContext> LoadAndValidateConfigAsync(FileInfo nugetConfigFile, PackageMapping[] mappings)
Packaging\PackageChannel.cs (13)
129public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, CancellationToken cancellationToken)
137public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, PackageMapping[]? mappings, CancellationToken cancellationToken)
146public async Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(
169var tasks = new List<Task<IEnumerable<NuGetPackage>>>();
207public async Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, CancellationToken cancellationToken)
218var tasks = new List<Task<IEnumerable<NuGetPackage>>>();
377public async Task<IReadOnlySet<string>> GetPolyglotCompatiblePackageIdsAsync(DirectoryInfo workingDirectory, CancellationToken cancellationToken)
389var tasks = new List<Task<IEnumerable<NuGetPackage>>>();
490public async Task<IEnumerable<NuGetPackage>> GetPackagesAsync(string packageId, DirectoryInfo workingDirectory, CancellationToken cancellationToken)
497var tasks = new List<Task<IEnumerable<NuGetPackage>>>();
561public async Task<NuGetPackage?> GetLatestGuestAppHostSdkPackageAsync(DirectoryInfo workingDirectory, CancellationToken cancellationToken)
586public async Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(string packageId, DirectoryInfo workingDirectory, CancellationToken cancellationToken)
588var tasks = new List<Task<IEnumerable<NuGetPackage>>>();
Processes\ProcessTreeGracefulShutdownService.cs (18)
30public Task<bool> StopProcessTreeAsync(
43public async Task<bool> StopAppHostAsync(
45Func<CancellationToken, Task<bool>>? requestRpcStopAsync,
75internal async Task<bool> StopProcessesAsync(
77Func<CancellationToken, Task<bool>> requestGracefulShutdownAsync,
87private async Task<bool> StopProcessesAsync(
90Func<CancellationToken, Task<bool>> requestGracefulShutdownAsync,
134private async Task<bool> RequestAppHostGracefulShutdownAsync(
136Func<CancellationToken, Task<bool>>? requestRpcStopAsync,
182private async Task<bool> TryRequestGracefulShutdownAsync(
183Func<CancellationToken, Task<bool>> requestGracefulShutdownAsync,
197private async Task<bool> TryRequestRpcStopAsync(Func<CancellationToken, Task<bool>> requestRpcStopAsync, CancellationToken cancellationToken)
219public async Task<bool> RequestProcessTreeGracefulShutdownAsync(
231private async Task<bool> RequestProcessTreeGracefulShutdownAsync(
259internal async Task<bool> TryStopProcessTreeWithDcpAsync(int pid, DateTimeOffset? startTime, bool includeStartTime, CancellationToken cancellationToken)
267private async Task<bool> TryStopProcessTreeWithDcpAsync(ProcessTarget target, bool includeStartTime, CancellationToken cancellationToken)
330private async Task<bool> MonitorProcessesForTerminationAsync(IReadOnlyCollection<ProcessTarget> processes, CancellationToken cancellationToken)
Projects\AppHostRpcClient.cs (12)
38public static async Task<AppHostRpcClient> ConnectAsync(
82public Task<RuntimeSpec> GetRuntimeSpecAsync(string languageId, CancellationToken cancellationToken)
86public Task<Dictionary<string, string>> ScaffoldAppHostAsync(
98public Task<Dictionary<string, string>> GenerateCodeAsync(string languageId, CancellationToken cancellationToken)
102public Task<Dictionary<string, string>> GenerateCodeForAssemblyAsync(string languageId, string assemblyName, CancellationToken cancellationToken)
106public Task<Commands.Sdk.CapabilitiesInfo> GetCapabilitiesAsync(CancellationToken cancellationToken)
110public Task<Commands.Sdk.CapabilitiesInfo> GetCapabilitiesForAssembliesAsync(IReadOnlyList<string> assemblyNames, CancellationToken cancellationToken)
114public Task<JsonElement> ExportApiAsync(string languageId, string packageName, string packageVersion, CancellationToken cancellationToken)
118public Task<T> InvokeAsync<T>(string methodName, object?[] parameters, CancellationToken cancellationToken)
130private async Task<T> InvokeCodeGenerationAsync<T>(string methodName, object?[] parameters, CancellationToken cancellationToken)
186private static async Task<Stream> ConnectToServerAsync(string socketPath, IEnvironment environment, CancellationToken cancellationToken)
258public async Task<IAppHostRpcClient> ConnectAsync(string socketPath, string authenticationToken, CancellationToken cancellationToken)
Projects\DotNetAppHostProject.cs (17)
139public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default)
1375public async Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
1427public async Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken)
1439public async Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
1678private async Task<(int? ExitCode, bool BuiltByCli, bool DeferBuildCompletion)> PrepareAppHostAsync(
1723private async Task<(int? ExitCode, bool BuiltByCli, bool DeferBuildCompletion)> BuildAppHostIfNeededAsync(
1775private async Task<(bool IsCompatibleAppHost, string? AspireHostingVersion)> CheckAppHostCompatibilityAsync(
1813private async Task<DirectAppHostRunSpec?> TryCreateDirectRunSpecAsync(
1876private async Task<bool> IsDirectLaunchDisabledAsync(FileInfo effectiveAppHostFile, CancellationToken cancellationToken)
2376public async Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
2483public async Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
2506public async Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
2513public async Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
2537public async Task<string?> GetUserSecretsIdAsync(FileInfo projectFile, bool autoInit, CancellationToken cancellationToken)
2565private async Task<string?> QueryUserSecretsIdAsync(FileInfo projectFile, CancellationToken cancellationToken)
2582private Task<BundleLayoutLease?> AcquireCliBundleLayoutAsync(CancellationToken cancellationToken)
2700private async Task<string?> ConfigureIsolatedModeAsync(
Projects\GuestAppHostProject.cs (20)
154public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default)
199private async Task<List<IntegrationReference>> GetIntegrationReferencesAsync(
261public Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken)
278private static async Task<(bool Success, OutputCollector? Output, string? ChannelName, bool NeedsCodeGen)> PrepareAppHostServerAsync(
294internal async Task<bool> BuildAndGenerateSdkAsync(DirectoryInfo directory, string? packageSourceOverride = null, CancellationToken cancellationToken = default)
300private async Task<bool> BuildAndGenerateSdkAsync(DirectoryInfo directory, AspireConfigFile config, string? packageSourceOverride = null, CancellationToken cancellationToken = default)
353Task<bool> IGuestAppHostSdkGenerator.BuildAndGenerateSdkAsync(DirectoryInfo directory, string? packageSourceOverride, CancellationToken cancellationToken)
363public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
393public async Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
500Task<int> serverCompletion;
1067public async Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
1127Task<int> serverCompletion;
1436public async Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
1462public async Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
1607public async Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
1736internal static async Task<bool> WriteGeneratedFileAsync(string filePath, string content, bool preserveUnchangedFiles, CancellationToken cancellationToken)
2116private async Task<int> InstallDependenciesAsync(
2178private async Task<(int ExitCode, OutputCollector? Output)> ExecuteGuestAppHostAsync(
2204private async Task<(int ExitCode, OutputCollector? Output)> ExecuteGuestAppHostForPublishAsync(
2228public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
Projects\IAppHostProject.cs (9)
182Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default);
211Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken);
219Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken);
227Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken);
235Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken);
243Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken);
251Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken);
260Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken);
268Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken);
Projects\IAppHostRpcClient.cs (9)
24Task<RuntimeSpec> GetRuntimeSpecAsync(string languageId, CancellationToken cancellationToken);
30Task<Dictionary<string, string>> ScaffoldAppHostAsync(
42Task<Dictionary<string, string>> GenerateCodeAsync(string languageId, CancellationToken cancellationToken);
54Task<Dictionary<string, string>> GenerateCodeForAssemblyAsync(string languageId, string assemblyName, CancellationToken cancellationToken);
62Task<CapabilitiesInfo> GetCapabilitiesAsync(CancellationToken cancellationToken);
73Task<CapabilitiesInfo> GetCapabilitiesForAssembliesAsync(IReadOnlyList<string> assemblyNames, CancellationToken cancellationToken);
86Task<JsonElement> ExportApiAsync(string languageId, string packageName, string packageVersion, CancellationToken cancellationToken);
96Task<T> InvokeAsync<T>(string methodName, object?[] parameters, CancellationToken cancellationToken);
113Task<IAppHostRpcClient> ConnectAsync(string socketPath, string authenticationToken, CancellationToken cancellationToken);
Projects\PrebuiltAppHostServer.cs (13)
144public async Task<AppHostServerPrepareResult> PrepareAsync(
302private async Task<string> RestoreNuGetPackagesAsync(
361internal static async Task<RestoreInputs> ComputeRestoreInputsAsync(
709private async Task<(int ExitCode, OutputCollector Output)> BuildIntegrationProjectAsync(
733private async Task<AppHostServerClosureManifest> BuildIntegrationClosureManifestAsync(
1008internal async Task<IEnumerable<string>?> GetNuGetSourcesAsync(string? requestedChannel, string? packageSourceOverride, CancellationToken cancellationToken)
1091internal async Task<TemporaryNuGetConfig?> TryCreateTemporaryNuGetConfigAsync(string? requestedChannel, string? packageSourceOverride, CancellationToken cancellationToken)
1252private async Task<string?> ResolveLocalPackageSourceOverrideAsync(string? requestedChannel, CancellationToken cancellationToken)
1318private async Task<IEnumerable<PackageChannel>> GetExplicitRestoreChannelsAsync(string? requestedChannel, CancellationToken cancellationToken)
1350public async Task<AppHostServerRunResult> RunAsync(
1540private async Task<List<string>> ReadProjectRefAssemblyNamesAsync(string filePath, CancellationToken cancellationToken)
1552private static async Task<List<string>> ReadManifestFileAsync(string filePath, CancellationToken cancellationToken)
1585private static async Task<Dictionary<string, string>> ReadPackageFingerprintsAsync(string assetsFilePath, CancellationToken cancellationToken)
Projects\ProjectLocator.cs (24)
34Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(
73Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, int? maxDepth, CancellationToken cancellationToken)
85Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken);
95Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, int? maxDepth, CancellationToken cancellationToken)
99Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default);
101Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, bool displayProgress, CancellationToken cancellationToken = default)
104Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken);
120Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default);
126Task<FileInfo?> GetAppHostFromSettingsAsync(DirectoryInfo searchDirectory, bool searchParentDirectories, CancellationToken cancellationToken = default)
164public async Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(
180public async Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, int? maxDepth, CancellationToken cancellationToken)
255public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
268public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, int? maxDepth, CancellationToken cancellationToken)
280public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(string searchDirectory, CancellationToken cancellationToken)
289private async Task<(List<AppHostProjectCandidate> BuildableAppHost, List<AppHostProjectCandidate> UnbuildableSuspectedAppHostProjects, List<FileInfo> UnsupportedProjects)> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, bool stopAfterMultipleBuildableAppHosts, bool displayProgress, AppHostDiscoveryScope scope, int? maxDepth, ChannelWriter<AppHostProjectCandidate>? candidateWriter = null, Action<int>? onDirectoryEnumerated = null, CancellationToken cancellationToken = default)
293async Task<(List<AppHostProjectCandidate> BuildableAppHost, List<AppHostProjectCandidate> UnbuildableSuspectedAppHostProjects, List<FileInfo> UnsupportedProjects)> FindAppHostsAsync()
563public async Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default)
569public async Task<FileInfo?> GetAppHostFromSettingsAsync(DirectoryInfo searchDirectory, bool searchParentDirectories, CancellationToken cancellationToken = default)
636private async Task<SettingsAppHostResult> GetValidatedAppHostProjectFileFromSettingsAsync(DirectoryInfo searchDirectory, bool searchParentDirectories, CancellationToken cancellationToken)
683private async Task<FileInfo?> GetAppHostProjectFileFromSettingsAsync(DirectoryInfo searchDirectory, bool searchParentDirectories, bool silent, CancellationToken cancellationToken)
876public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default)
881public async Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, bool displayProgress, CancellationToken cancellationToken = default)
1210public async Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken = default)
1369private async Task<FileLock?> TryAcquireWorkspaceConfigLockAsync(FileInfo settingsFile, CancellationToken cancellationToken)
Projects\ProjectUpdater.cs (11)
26Task<ProjectUpdateResult> UpdateProjectAsync(UpdatePackagesContext context, CancellationToken cancellationToken = default);
31public async Task<ProjectUpdateResult> UpdateProjectAsync(UpdatePackagesContext context, CancellationToken cancellationToken = default)
222private async Task<(IEnumerable<UpdateStep> UpdateSteps, bool FallbackUsed)> GetUpdateStepsAsync(FileInfo projectFile, PackageChannel channel, CancellationToken cancellationToken)
306private async Task<JsonDocument> GetItemsAndPropertiesAsync(FileInfo projectFile, CancellationToken cancellationToken)
311private async Task<JsonDocument> GetItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, CancellationToken cancellationToken)
331private async Task<JsonDocument> GetItemsAndPropertiesWithFallbackAsync(FileInfo projectFile, UpdateContext context, CancellationToken cancellationToken)
336private async Task<JsonDocument> GetItemsAndPropertiesWithFallbackAsync(FileInfo projectFile, string[] items, string[] properties, UpdateContext context, CancellationToken cancellationToken)
377private async Task<NuGetPackageCli?> GetLatestVersionOfPackageAsync(UpdateContext context, string packageId, bool throwIfNotFound = true, CancellationToken cancellationToken = default)
1111private async Task<string?> GetPackageVersionFromDirectoryPackagesPropsAsync(string packageId, FileInfo directoryPackagesPropsFile, FileInfo projectFile, CancellationToken cancellationToken)
1181private async Task<string?> ResolveMSBuildPropertyAsync(string propertyName, FileInfo projectFile, CancellationToken cancellationToken)
1251private async Task<bool> AnalyzeAndConfirmNuGetConfigChanges(UpdatePackagesContext context, XmlDocument? originalDocument, XmlDocument proposedDocument, CancellationToken cancellationToken)
Telemetry\InternalMicrosoftDetector.cs (30)
26Task<InternalMicrosoftDetectionResult> IsInternalMicrosoftMachineAsync(CancellationToken cancellationToken = default);
110public async Task<InternalMicrosoftDetectionResult> IsInternalMicrosoftMachineAsync(CancellationToken cancellationToken = default)
240private async Task<InternalMicrosoftDetectionResult> RunProbeStagesAsync(
287private async Task<InternalMicrosoftProbeStageResult> RunProbeStageAsync(IReadOnlyList<InternalMicrosoftProbe> probes, CancellationToken cancellationToken)
320foreach (var task in probeTasks)
362private Task<InternalMicrosoftProbeRunResult> RunProbeAsync(InternalMicrosoftProbe probe, CancellationToken cancellationToken)
467private async Task DrainCancelledProbesAsync(IReadOnlyList<Task<InternalMicrosoftProbeRunResult>> probeTasks)
489private async Task<InternalMicrosoftCacheReadResult> TryReadCacheAsync(CancellationToken cancellationToken)
587internal Task<InternalMicrosoftProbeResult> CheckWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
597private async Task<InternalMicrosoftProbeResult> CheckWslWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
620private async Task<InternalMicrosoftProbeResult> CheckVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
648private async Task<InternalMicrosoftProbeResult> CheckWslVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
667internal async Task<InternalMicrosoftProbeResult> CheckMacPlatformSsoAsync(CancellationToken cancellationToken)
789internal async Task<InternalMicrosoftProbeResult> CheckWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
807private async Task<InternalMicrosoftProbeResult> CheckWslWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
823private Task<InternalMicrosoftProbeResult> CheckGhCliAsync(CancellationToken cancellationToken)
826private Task<InternalMicrosoftProbeResult> CheckWslWindowsGhCliAsync(CancellationToken cancellationToken)
829internal async Task<InternalMicrosoftProbeResult> CheckGhCliExecutableAsync(string executable, CancellationToken cancellationToken)
860private async Task<InternalMicrosoftProbeResult> CheckEnvironmentGitHubTokenAsync(CancellationToken cancellationToken)
876internal async Task<InternalMicrosoftProbeResult> CheckCopilotCliAsync(CancellationToken cancellationToken)
909private async Task<GitHubMembershipCheckResult> CheckAnyGitHubMembershipCandidateAsync(IReadOnlyList<TokenCandidate> candidates, CancellationToken cancellationToken)
928var completedTask = await Task.WhenAny(candidateTasks).WaitAsync(linkedSource.Token).ConfigureAwait(false);
961private async Task<GitHubMembershipCheckResult> CheckGitHubMembershipCandidateAsync(TokenCandidate candidate, CancellationToken cancellationToken)
988private async Task DrainGitHubCandidateTasksAsync(IReadOnlyList<Task<GitHubMembershipCheckResult>> candidateTasks)
1008internal async Task<bool> CheckGitHubMembershipWithTokenAsync(string token, CancellationToken cancellationToken)
1014internal async Task<InternalMicrosoftProbeResult> CheckGitHubMembershipWithTokenResultForTestingAsync(string token, CancellationToken cancellationToken)
1020private static async Task<GitHubMembershipCheckResult> CheckGitHubMembershipWithTokenAsync(HttpClient http, string token, CancellationToken cancellationToken)
1117private static async Task<string?> ReadJsonPropertyAsync(HttpResponseMessage response, string propertyName, CancellationToken cancellationToken)
1123private async Task<ProcessResult> RunProcessAsync(string fileName, string[] arguments, CancellationToken cancellationToken)
1917Func<CancellationToken, Task<InternalMicrosoftProbeResult>> DetectAsync,
Templating\DotNetTemplateFactory.cs (16)
66public async Task<IEnumerable<ITemplate>> GetTemplatesAsync(CancellationToken cancellationToken = default)
77public async Task<IEnumerable<ITemplate>> GetInitTemplatesAsync(CancellationToken cancellationToken = default)
87private async Task<bool> IsDotNetSdkAvailableAsync(CancellationToken cancellationToken)
248private async Task<string[]> PromptForExtraAspireStarterOptionsAsync(ParseResult result, CancellationToken cancellationToken)
259private async Task<string[]> PromptForExtraAspireSingleFileOptionsAsync(ParseResult result, CancellationToken cancellationToken)
268private async Task<string[]> PromptForExtraAspireJsFrontendStarterOptionsAsync(ParseResult result, CancellationToken cancellationToken)
278private async Task<string[]> PromptForExtraAspireXUnitOptionsAsync(ParseResult result, CancellationToken cancellationToken)
407private async Task<TemplateResult> ApplyTemplateWithNoExtraArgsAsync(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, CancellationToken cancellationToken)
412private async Task<TemplateResult> ApplySingleFileTemplate(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
439private async Task<TemplateResult> ApplyTemplateAsync(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
457private async Task<TemplateResult> ApplyTemplateAsync(CallbackTemplate template, TemplateInputs inputs, string name, string outputPath, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
592private async Task<string> GetProjectNameAsync(TemplateInputs inputs, string templateName, ParseResult parseResult, CancellationToken cancellationToken)
603private async Task<string?> GetOutputPathAsync(TemplateInputs inputs, Func<CliExecutionContext, string, string> pathDeriver, string projectName, ParseResult parseResult, CancellationToken cancellationToken)
Utils\AppHostHelper.cs (3)
16internal static async Task<(bool IsCompatibleAppHost, string? AspireHostingVersion)> CheckAppHostCompatibilityAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, AspireCliTelemetry telemetry, DirectoryInfo workingDirectory, string logFilePath, CancellationToken cancellationToken)
71internal static async Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, AspireCliTelemetry telemetry, DirectoryInfo workingDirectory, CancellationToken cancellationToken)
87internal static async Task<int> BuildAppHostAsync(IDotNetCliRunner runner, IInteractionService interactionService, FileInfo projectFile, bool noRestore, IDictionary<string, string>? env, ProcessInvocationOptions options, DirectoryInfo workingDirectory, CancellationToken cancellationToken)
Utils\EnvironmentChecker\DevCertsCheck.cs (4)
35public async Task<IReadOnlyList<EnvironmentCheckResult>> CheckAsync(CancellationToken cancellationToken = default)
267private async Task<OpenSslCertificateCacheStatus?> EvaluateOpenSslCertificateCacheAsync(string trustPath, IReadOnlyList<DevCertInfo> currentCertificates, string? openSslPath, CancellationToken cancellationToken)
361private async Task<bool> HasOpenSslHashEntryAsync(string trustPath, string certificateFile, X509Certificate2 certificate, string? openSslPath, CancellationToken cancellationToken)
408private async Task<(bool Success, string Hash)> TryGetOpenSslHashAsync(string openSslPath, string certificateFile, CancellationToken cancellationToken)
aspire-managed (8)
Aspire.Acquisition.Tests (24)
Aspire.Azure.AI.Inference (2)
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 (6)
Aspire.Cli.Tests (691)
Agents\PlaywrightCliInstallerTests.cs (6)
1013public Task<NpmPackageInfo?> ResolvePackageAsync(string packageName, string versionRange, CancellationToken cancellationToken)
1019public Task<string?> PackAsync(string packageName, string version, string outputDirectory, CancellationToken cancellationToken)
1031public Task<bool> InstallGlobalAsync(string tarballPath, CancellationToken cancellationToken)
1045public Task<ProvenanceVerificationResult> VerifyProvenanceAsync(string packageName, string version, string expectedSourceRepository, string expectedWorkflowPath, string expectedBuildType, Func<WorkflowRefInfo, bool>? validateWorkflowRef, string? sriIntegrity, CancellationToken cancellationToken)
1068public Task<SemVersion?> GetVersionAsync(CancellationToken cancellationToken)
1071public Task<bool> InstallSkillsAsync(string workingDirectory, CancellationToken cancellationToken)
Commands\AddCommandTests.cs (3)
2947private async Task<(int ExitCode, string SelectedVersion, bool PromptInvoked)> RunAddRedisWithHiveScenarioAsync(
3562public override Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
3571public override Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, string? configuredChannel, CancellationToken cancellationToken)
Commands\ExtensionInternalCommandTests.cs (32)
237public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(
247public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
252public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
257public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(
265public Task<AppHostProjectSearchResult> UseOrFindServiceProjectFileAsync(
274public Task<FileInfo?> UseOrFindServiceProjectFileAsync(
282public Task<FileInfo?> UseOrFindSolutionFileAsync(
290public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
302public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(
312public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
317public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
322public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(
330public Task<AppHostProjectSearchResult> UseOrFindServiceProjectFileAsync(
339public Task<FileInfo?> UseOrFindServiceProjectFileAsync(
347public Task<FileInfo?> UseOrFindSolutionFileAsync(
355public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
360public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
365public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
370public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(
379public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(
387public Task<AppHostProjectSearchResult> UseOrFindServiceProjectFileAsync(
396public Task<FileInfo?> UseOrFindServiceProjectFileAsync(
404public Task<FileInfo?> UseOrFindSolutionFileAsync(
412public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
417public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
422public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
427public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(
436public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(
444public Task<AppHostProjectSearchResult> UseOrFindServiceProjectFileAsync(
453public Task<FileInfo?> UseOrFindServiceProjectFileAsync(
461public Task<FileInfo?> UseOrFindSolutionFileAsync(
469public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
Commands\PublishCommandPromptingIntegrationTests.cs (13)
1097public Task<DashboardUrlsState> GetDashboardUrlsAsync(CancellationToken cancellationToken) =>
1118public Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken) => Task.FromResult(new[] { "baseline.v2" });
1120public Task<GetPipelineStepsResponse> GetPipelineStepsAsync(string? step, CancellationToken cancellationToken) =>
1123public Task<UploadFileResponse> UploadFileAsync(string filePath, string fileName, int interactionId, string inputName, CancellationToken cancellationToken)
1161public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, CancellationToken cancellationToken = default)
1177public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, PromptBinding<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
1180public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
1200public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, PromptBinding<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
1218public Task<bool> PromptConfirmAsync(string promptText, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default)
1237public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => action();
1238public Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null) => action(_ => { });
Commands\RunCommandTests.cs (44)
498var pendingCommand = result.InvokeAsync(cancellationToken: cancellationManager.Token);
590var pendingCommand = result.InvokeAsync(cancellationToken: cts.Token);
793var pendingCommand = command.Parse($"run --apphost {appHostFile.FullName}")
887var pendingRun = result.InvokeAsync(cancellationToken: TestContext.Current.CancellationToken);
988var pendingCommand = result.InvokeAsync(cancellationToken: TestContext.Current.CancellationToken);
1086var pendingCommand = result.InvokeAsync(cancellationToken: cts.Token);
1167var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
1662public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
1667public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
1672public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
1677public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
1682public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
1745var pendingCommand = result.InvokeAsync();
1815var pendingCommand = result.InvokeAsync();
1999var pendingCommand = result.InvokeAsync(cancellationToken: cts.Token);
2070var pendingCommand = result.InvokeAsync(cancellationToken: cts.Token);
2178var pendingCommand = command.Parse($"run --apphost {appHostFile.FullName}")
2478public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
2483public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
2488public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
2493public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
2498public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
2503public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
2508public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
2513public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
2518public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
2523public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
2606var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
2674var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
2805var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3056var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3167var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3273var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3343var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3412var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3535var pendingRun = result.InvokeAsync();
4158public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
4164public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
4169public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
4174public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
4180public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
4321var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
5248var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
5321var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
Commands\SecretCommandTests.cs (14)
89public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
92public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
95public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default)
98public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
101public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default)
122public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
124public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken) => throw new NotSupportedException();
125public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default) => Task.FromResult<string[]>([]);
126public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken) => Task.FromResult<string?>(userSecretsId);
128public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
129public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
130public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
131public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken) => throw new NotSupportedException();
132public Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken) => throw new NotSupportedException();
Commands\TerminalCommandTests.cs (11)
682public Task<GetTerminalInfoResponse> GetTerminalInfoAsync(string resourceName, CancellationToken cancellationToken = default)
688public Task<ListTerminalsResponse> ListTerminalsAsync(CancellationToken cancellationToken = default)
693public Task<global::Aspire.Cli.Backchannel.DashboardUrlsState?> GetDashboardUrlsAsync(CancellationToken cancellationToken = default)
695public Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(bool includeHidden, CancellationToken cancellationToken = default)
701public Task<bool> StopAppHostAsync(CancellationToken cancellationToken = default)
703public Task<ExecuteResourceCommandResponse> ExecuteResourceCommandAsync(string resourceName, string commandName, ExecuteResourceCommandOptions? options = null, CancellationToken cancellationToken = default)
705public Task<WaitForResourceResponse> WaitForResourceAsync(string resourceName, string status, int timeoutSeconds, CancellationToken cancellationToken = default)
707public Task<global::ModelContextProtocol.Protocol.CallToolResult> CallResourceMcpToolAsync(string resourceName, string toolName, IReadOnlyDictionary<string, global::System.Text.Json.JsonElement>? arguments, CancellationToken cancellationToken = default)
709public Task<GetDashboardInfoResponse?> GetDashboardInfoV2Async(CancellationToken cancellationToken = default)
712public Task<GetAppHostInfoResponse?> GetAppHostInfoV2Async(CancellationToken cancellationToken = default)
715public Task<WaitForAppHostReadyResponse?> WaitForAppHostReadyAsync(CancellationToken cancellationToken = default)
Commands\UpdateCommandTests.cs (16)
2794private Task<(int ExitCode, string UpdatedWithChannel, bool PromptInvoked)> RunUpdateAndCaptureChannelAsync(
2801private Task<(int ExitCode, string UpdatedWithChannel, bool PromptInvoked)> RunUpdateAndCaptureChannelAsync(
2815private async Task<(int ExitCode, string UpdatedWithChannel, bool PromptInvoked)> RunUpdateAndCaptureChannelAsync(
3243private async Task<(int ExitCode, string? CapturedChannel, bool PromptInvoked, TestInteractionService InteractionService)> RunNonInteractiveSelfUpdateAsync(
3291private static async Task<string> CreateSelfUpdateArchiveAsync(
3522public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => _innerService.ShowStatusAsync(statusText, action, emoji, allowMarkup);
3523public Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null) => _innerService.ShowDynamicStatusAsync(initialStatusText, action, emoji);
3525public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, CancellationToken cancellationToken = default)
3527public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, PromptBinding<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
3529public Task<bool> PromptConfirmAsync(string promptText, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default)
3531public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
3533public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, PromptBinding<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
3563public Func<UpdatePackagesContext, CancellationToken, Task<ProjectUpdateResult>>? UpdateProjectAsyncCallback { get; set; }
3565public Task<ProjectUpdateResult> UpdateProjectAsync(UpdatePackagesContext context, CancellationToken cancellationToken = default)
DotNet\ProcessExecutionDetachedTests.cs (8)
168var startTask = detachedExecution.StartAsync(cts.Token);
448var startTask = detachedProcess.StartAsync(CancellationToken.None);
545public Task<BundleExtractResult> ExtractAsync(string destinationPath, bool force = false, CancellationToken cancellationToken = default)
553public Task<BundleLayoutLease?> EnsureExtractedAndAcquireLayoutAsync(string holderKind, string? commandName = null, CancellationToken cancellationToken = default)
578public Task<BundleExtractResult> ExtractAsync(string destinationPath, bool force = false, CancellationToken cancellationToken = default)
586public Task<BundleLayoutLease?> EnsureExtractedAndAcquireLayoutAsync(string holderKind, string? commandName = null, CancellationToken cancellationToken = default)
617public Task<BundleExtractResult> ExtractAsync(string destinationPath, bool force = false, CancellationToken cancellationToken = default)
625public async Task<BundleLayoutLease?> EnsureExtractedAndAcquireLayoutAsync(string holderKind, string? commandName = null, CancellationToken cancellationToken = default)
Packaging\PackagingServiceTests.cs (5)
2323public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
2332public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
2335public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
2338public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
2341public Task<IEnumerable<Aspire.Shared.NuGetPackageCli>> GetPackageVersionsAsync(DirectoryInfo workingDirectory, string exactPackageId, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
Projects\ExtensionGuestLauncherTests.cs (10)
203public Task<bool> TryDisplayCommandFailureAsync(string? errorMessage, string cliLogFilePath, string? appHostCliLogFilePath, CancellationToken cancellationToken) => throw new NotImplementedException();
227public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => throw new NotImplementedException();
228public Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null) => throw new NotImplementedException();
230public Task<string> PromptForStringAsync(string promptText, Func<string, Spectre.Console.ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
231public Task<string> PromptForFilePathAsync(string promptText, Func<string, Spectre.Console.ValidationResult>? validator = null, bool directory = false, bool required = false, PromptBinding<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default) => throw new NotImplementedException();
232public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull => throw new NotImplementedException();
233public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, PromptBinding<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull => throw new NotImplementedException();
240public Task<bool> PromptConfirmAsync(string promptText, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
Projects\ProjectLocatorTests.cs (21)
37private static async Task<FileInfo> CreateSingleFileAppHostAsync(DirectoryInfo directory)
2168public Task<bool> DeleteConfigurationAsync(string key, bool isGlobal = false, CancellationToken cancellationToken = default)
2174public Task<Dictionary<string, string>> GetAllConfigurationAsync(CancellationToken cancellationToken = default)
2179public Task<Dictionary<string, string>> GetLocalConfigurationAsync(CancellationToken cancellationToken = default)
2184public Task<Dictionary<string, string>> GetGlobalConfigurationAsync(CancellationToken cancellationToken = default)
2189public Task<string?> GetConfigurationAsync(string key, CancellationToken cancellationToken = default)
2195public Task<string?> GetConfigurationFromDirectoryAsync(string key, DirectoryInfo startDirectory, bool continueSearchWhenKeyMissing = false, CancellationToken cancellationToken = default)
2210public Task<IEnumerable<LanguageInfo>> GetAvailableLanguagesAsync(CancellationToken cancellationToken = default)
2213public Task<string?> GetPackageForLanguageAsync(LanguageId languageId, CancellationToken cancellationToken = default)
2216public Task<LanguageId?> DetectLanguageAsync(DirectoryInfo directory, CancellationToken cancellationToken = default)
2219public Task<LanguageId?> DetectLanguageRecursiveAsync(DirectoryInfo directory, CancellationToken cancellationToken = default)
2263public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken)
2272public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
2275public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
2278public Task<IReadOnlyList<(string PackageId, string Version)>> GetPackageReferencesAsync(FileInfo appHostFile, CancellationToken cancellationToken)
2281public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
2284public Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken)
2287public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
2290public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
2293public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
2296public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
Templating\DotNetTemplateFactoryTests.cs (30)
376public Task<T> PromptForSelectionAsync<T>(string prompt, IEnumerable<T> choices, Func<T, string> displaySelector, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
379public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, PromptBinding<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
382public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, CancellationToken cancellationToken = default)
385public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, PromptBinding<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
388public Task<bool> PromptConfirmAsync(string prompt, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default)
391public Task<TResult> ShowStatusAsync<TResult>(string message, Func<Task<TResult>> work, KnownEmoji? emoji = null, bool allowMarkup = false)
394public Task<TResult> ShowDynamicStatusAsync<TResult>(string initialStatusText, Func<Action<string>, Task<TResult>> action, KnownEmoji? emoji = null)
423public Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, ProcessInvocationOptions options, CancellationToken cancellationToken)
426public Task<int> NewProjectAsync(string templateName, string projectName, string outputPath, string[] extraArgs, ProcessInvocationOptions? options, CancellationToken cancellationToken)
429public Task<int> RestoreAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
432public Task<int> BuildAsync(FileInfo projectFile, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
435public Task<int> BuildAsync(FileInfo projectFile, bool noRestore, IDictionary<string, string>? env, ProcessInvocationOptions options, CancellationToken cancellationToken)
438public Task<int> AddPackageAsync(FileInfo projectFile, string packageName, string version, string? packageSourceUrl, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
441public Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
444public Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
447public Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProjectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
450public Task<(int ExitCode, NuGetPackageCli[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool exactMatch, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, bool useCache, ProcessInvocationOptions options, CancellationToken cancellationToken)
453public Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
456public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, string[] targets, ProcessInvocationOptions options, CancellationToken cancellationToken)
459public Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, bool noRestore, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken)
462public Task<int> RunAppHostCommandAsync(FileInfo projectFile, string command, DirectoryInfo workingDirectory, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken)
465public Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, ProcessInvocationOptions options, CancellationToken cancellationToken)
468public Task<int> InitUserSecretsAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
474public Task<EnsureCertificatesTrustedResult> EnsureCertificatesTrustedAsync(CancellationToken cancellationToken)
486public Task<string> PromptForProjectNameAsync(string defaultName, ParseResult parseResult, CancellationToken cancellationToken)
489public Task<string> PromptForOutputPath(string defaultPath, ParseResult parseResult, Func<string, ValidationResult>? validator = null, Func<string, string>? outputPathResolver = null, CancellationToken cancellationToken = default)
492public Task<(Aspire.Shared.NuGetPackageCli Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(Aspire.Shared.NuGetPackageCli Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
495public 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\CallbackNuGetPackageCache.cs (6)
10Func<DirectoryInfo, bool, FileInfo?, CancellationToken, Task<IEnumerable<NuGetPackage>>> getTemplatePackagesAsyncCallback) : INuGetPackageCache
12public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
17public Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
20public Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
23public Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
26public Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(DirectoryInfo workingDirectory, string exactPackageId, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
TestServices\FakeAppHostServerSession.cs (12)
29public Func<CancellationToken, Task<IAppHostRpcClient>>? GetRpcClientAsyncCallback { get; init; }
64public Task<int> WaitForExitAsync() => _exit.Task;
66public Task<IAppHostRpcClient> GetRpcClientAsync(CancellationToken cancellationToken)
127public Func<string, string, string?, CancellationToken, Task<Dictionary<string, string>>>? ScaffoldAppHostAsyncCallback { get; init; }
129public virtual Task<RuntimeSpec> GetRuntimeSpecAsync(string languageId, CancellationToken cancellationToken)
139public virtual Task<Dictionary<string, string>> ScaffoldAppHostAsync(string languageId, string targetPath, string? projectName, CancellationToken cancellationToken)
144public virtual Task<Dictionary<string, string>> GenerateCodeAsync(string languageId, CancellationToken cancellationToken)
147public virtual Task<Dictionary<string, string>> GenerateCodeForAssemblyAsync(string languageId, string assemblyName, CancellationToken cancellationToken)
150public virtual Task<CapabilitiesInfo> GetCapabilitiesAsync(CancellationToken cancellationToken)
153public virtual Task<CapabilitiesInfo> GetCapabilitiesForAssembliesAsync(IReadOnlyList<string> assemblyNames, CancellationToken cancellationToken)
156public virtual Task<JsonElement> ExportApiAsync(string languageId, string packageName, string packageVersion, CancellationToken cancellationToken)
159public virtual Task<T> InvokeAsync<T>(string methodName, object?[] parameters, CancellationToken cancellationToken)
TestServices\FakeNuGetPackageCache.cs (10)
11public Func<DirectoryInfo, bool, FileInfo?, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetTemplatePackagesAsyncCallback { get; set; }
12public Func<DirectoryInfo, bool, FileInfo?, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetIntegrationPackagesAsyncCallback { get; set; }
13public Func<DirectoryInfo, bool, FileInfo?, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetCliPackagesAsyncCallback { get; set; }
14public Func<DirectoryInfo, string, bool, FileInfo?, bool, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetPackageVersionsAsyncCallback { get; set; }
16public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
20public Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
24public Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
28public Func<DirectoryInfo, string, Func<string, bool>?, bool, FileInfo?, bool, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetPackagesAsyncCallback { get; set; }
30public Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
51public Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(DirectoryInfo workingDirectory, string exactPackageId, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
TestServices\FakePlaywrightServices.cs (7)
21public Task<NpmPackageInfo?> ResolvePackageAsync(string packageName, string versionRange, CancellationToken cancellationToken)
24public Task<string?> PackAsync(string packageName, string version, string outputDirectory, CancellationToken cancellationToken)
27public Task<bool> InstallGlobalAsync(string tarballPath, CancellationToken cancellationToken)
36public Task<ProvenanceVerificationResult> VerifyProvenanceAsync(string packageName, string version, string expectedSourceRepository, string expectedWorkflowPath, string expectedBuildType, Func<WorkflowRefInfo, bool>? validateWorkflowRef, string? sriIntegrity, CancellationToken cancellationToken)
67public async Task<AspireSkillsInstallResult> InstallAsync(CancellationToken cancellationToken)
207public Task<SemVersion?> GetVersionAsync(CancellationToken cancellationToken)
210public Task<bool> InstallSkillsAsync(string workingDirectory, CancellationToken cancellationToken)
TestServices\TestAppHostAuxiliaryBackchannel.cs (15)
57public Func<CancellationToken, Task<WaitForAppHostReadyResponse?>>? WaitForAppHostReadyHandler { get; set; }
72public Func<string, string, IReadOnlyDictionary<string, JsonElement>?, CancellationToken, Task<CallToolResult>>? CallResourceMcpToolHandler { get; set; }
78public Func<CancellationToken, Task<List<ResourceSnapshot>>>? GetResourceSnapshotsHandler { get; set; }
119public Task<DashboardUrlsState?> GetDashboardUrlsAsync(CancellationToken cancellationToken = default)
124public Task<GetAppHostInfoResponse?> GetAppHostInfoV2Async(CancellationToken cancellationToken = default)
149public Task<WaitForAppHostReadyResponse?> WaitForAppHostReadyAsync(CancellationToken cancellationToken = default)
164public Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(bool includeHidden, CancellationToken cancellationToken = default)
283public Task<bool> StopAppHostAsync(CancellationToken cancellationToken = default)
299public Task<ExecuteResourceCommandResponse> ExecuteResourceCommandAsync(
316public Func<string, string, int, CancellationToken, Task<WaitForResourceResponse>>? WaitForResourceHandler { get; set; }
318public Task<WaitForResourceResponse> WaitForResourceAsync(
332public Task<CallToolResult> CallResourceMcpToolAsync(
354public Task<GetDashboardInfoResponse?> GetDashboardInfoV2Async(CancellationToken cancellationToken = default)
364public Task<GetTerminalInfoResponse> GetTerminalInfoAsync(string resourceName, CancellationToken cancellationToken = default)
375public Task<ListTerminalsResponse> ListTerminalsAsync(CancellationToken cancellationToken = default)
TestServices\TestAppHostCliBackchannel.cs (8)
16public Func<CancellationToken, Task<DashboardUrlsState>>? GetDashboardUrlsAsyncCallback { get; set; }
32public Func<CancellationToken, Task<string[]>>? GetCapabilitiesAsyncCallback { get; set; }
35public Func<string?, CancellationToken, Task<GetPipelineStepsResponse>>? GetPipelineStepsAsyncCallback { get; set; }
56public Task<DashboardUrlsState> GetDashboardUrlsAsync(CancellationToken cancellationToken)
229public async Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
264public async Task<GetPipelineStepsResponse> GetPipelineStepsAsync(string? step, CancellationToken cancellationToken)
282public Func<string, string, CancellationToken, Task<UploadFileResponse>>? UploadFileAsyncCallback { get; set; }
284public async Task<UploadFileResponse> UploadFileAsync(string filePath, string fileName, int interactionId, string inputName, CancellationToken cancellationToken)
TestServices\TestAppHostProjectFactory.cs (15)
30public Func<FileInfo, CancellationToken, Task<string?>>? GetAspireHostingVersionAsyncCallback { get; set; }
35public Func<FileInfo, CancellationToken, Task<AppHostValidationResult>>? ValidateAppHostAsyncCallback { get; set; }
37public Func<AppHostProjectContext, CancellationToken, Task<int>>? RunAsyncCallback { get; set; }
39public Func<AddPackageContext, CancellationToken, Task<bool>>? AddPackageAsyncCallback { get; set; }
41public Func<UpdatePackagesContext, CancellationToken, Task<UpdatePackagesResult>>? UpdatePackagesAsyncCallback { get; set; }
165public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken)
190public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
195public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
198public Task<IReadOnlyList<(string PackageId, string Version)>> GetPackageReferencesAsync(FileInfo appHostFile, CancellationToken cancellationToken)
201public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
227public Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken)
234public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
239public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
244public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
247public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
TestServices\TestDotNetCliRunner.cs (20)
21public Func<FileInfo, string[], string[], string[], ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, JsonDocument? Output)>>? GetProjectItemsAndPropertiesAsyncCallbackWithTargetsAsync { get; set; }
23public Func<FileInfo, string[], string[], ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, JsonDocument? Output)>>? GetProjectItemsAndPropertiesAsyncCallbackAsync { get; set; }
28public Func<FileInfo, bool, bool, bool, string[], IDictionary<string, string>?, TaskCompletionSource<IAppHostCliBackchannel>?, ProcessInvocationOptions, CancellationToken, Task<int>>? RunAsyncCallback { get; set; }
29public Func<FileInfo, string, DirectoryInfo, string[], IDictionary<string, string>?, TaskCompletionSource<IAppHostCliBackchannel>?, ProcessInvocationOptions, CancellationToken, Task<int>>? RunAppHostCommandAsyncCallback { get; set; }
35public Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
42public Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
49public Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
52public Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, IDictionary<string, string>? env, ProcessInvocationOptions options, CancellationToken cancellationToken)
64public Task<int> RestoreAsync(FileInfo projectFilePath, ProcessInvocationOptions options, CancellationToken cancellationToken)
71public Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
80public Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, ProcessInvocationOptions options, CancellationToken cancellationToken)
96public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, string[] targets, ProcessInvocationOptions options, CancellationToken cancellationToken)
154public Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, ProcessInvocationOptions options, CancellationToken cancellationToken)
161public Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, ProcessInvocationOptions options, CancellationToken cancellationToken)
170public async Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, bool noRestore, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken)
185public Task<int> RunAppHostCommandAsync(FileInfo projectFile, string command, DirectoryInfo workingDirectory, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken)
197public Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool exactMatch, bool prerelease, int take, int skip, FileInfo? nugetConfigFile, bool useCache, ProcessInvocationOptions options, CancellationToken cancellationToken)
204public Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
211public Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProject, ProcessInvocationOptions options, CancellationToken cancellationToken)
218public Task<int> InitUserSecretsAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
TestServices\TestExtensionBackchannel.cs (14)
53public Func<string, bool, Task<bool>>? ConfirmAsyncCallback { get; set; }
56public Func<string, string?, Func<string, ValidationResult>?, bool, Task<string>>? PromptForStringAsyncCallback { get; set; }
59public Func<string, Func<string, ValidationResult>?, bool, Task<string>>? PromptForSecretStringAsyncCallback { get; set; }
62public Func<string, string?, bool, Task<string?>>? PromptForFilePathAsyncCallback { get; set; }
71public Func<CancellationToken, Task<string[]>>? GetCapabilitiesAsyncCallback { get; set; }
74public Func<string, CancellationToken, Task<bool>>? HasCapabilityAsyncCallback { get; set; }
172public Task<string?> PromptForFilePathAsync(string promptText, string? defaultValue, bool directory, CancellationToken cancellationToken)
180public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull
192public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull
204public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
212public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool required = false, CancellationToken cancellationToken = default)
220public Task<string> PromptForSecretStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool required = false, CancellationToken cancellationToken = default)
244public Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
252public async Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken)
TestServices\TestExtensionInteractionService.cs (12)
31public Func<string?, string, string?, CancellationToken, Task<bool>>? TryDisplayCommandFailureAsyncCallback { get; set; }
33public Func<string, Func<string, ValidationResult>?, bool, bool, PromptBinding<string?>?, CancellationToken, Task<string>>? PromptForStringCallback { get; set; }
51public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
56public Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null)
66public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, CancellationToken cancellationToken = default)
76public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, PromptBinding<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
81public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
102public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, PromptBinding<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
170public Task<bool> TryDisplayCommandFailureAsync(
210public Task<bool> PromptConfirmAsync(string promptText, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default)
TestServices\TestInteractionService.cs (10)
77public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
90public Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null)
117public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, CancellationToken cancellationToken = default)
130public Task<string> PromptForFilePathAsync(string promptText, Func<string, ValidationResult>? validator = null, bool directory = false, bool required = false, PromptBinding<string?>? binding = null, bool retryOnValidationFailure = false, CancellationToken cancellationToken = default)
143private Task<string> PromptForResponseAsync(Func<string, ValidationResult>? validator, PromptBinding<string?>? binding, CancellationToken cancellationToken)
168public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
209public Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected = null, bool optional = false, PromptBinding<string?>? binding = null, bool echoSelected = true, IEnumerable<T>? bindingChoices = null, CancellationToken cancellationToken = default) where T : notnull
287public Task<bool> PromptConfirmAsync(string promptText, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default)
TestServices\TestLanguageService.cs (8)
10public Func<CancellationToken, Task<IAppHostProject?>>? GetConfiguredProjectAsyncCallback { get; set; }
12public Func<CancellationToken, Task<IAppHostProject>>? PromptForProjectAsyncCallback { get; set; }
13public Func<string?, bool, CancellationToken, Task<IAppHostProject>>? GetOrPromptForProjectAsyncCallback { get; set; }
14public Func<string?, bool, CancellationToken, Task<AppHostProjectSelection>>? GetOrPromptForProjectSelectionAsyncCallback { get; set; }
21public Task<IAppHostProject?> GetConfiguredProjectAsync(CancellationToken cancellationToken = default)
35public Task<IAppHostProject> PromptForProjectAsync(CancellationToken cancellationToken = default)
50public Task<IAppHostProject> GetOrPromptForProjectAsync(string? explicitLanguageId = null, bool saveLanguageSelection = true, CancellationToken cancellationToken = default)
65public async Task<AppHostProjectSelection> GetOrPromptForProjectSelectionAsync(string? explicitLanguageId = null, bool saveLanguageSelection = true, CancellationToken cancellationToken = default)
TestServices\TestNewCommandPrompter.cs (4)
22public override Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken)
31public override Task<string> PromptForProjectNameAsync(string defaultName, ParseResult parseResult, CancellationToken cancellationToken)
40public override Task<string> PromptForOutputPath(string path, ParseResult parseResult, Func<string, ValidationResult>? validator = null, Func<string, string>? outputPathResolver = null, CancellationToken cancellationToken = default)
61public override Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken)
TestServices\TestProcessExecutionFactory.cs (6)
47public Func<int, ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, string? Stdout)>>? AsyncAttemptCallback { get; set; }
142private readonly Func<int, ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, string? Stdout)>> _attemptCallback;
153Func<int, ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, string? Stdout)>> attemptCallback,
198public Func<ProcessInvocationOptions, CancellationToken, Task<int>>? WaitForExitAsyncCallback { get; init; }
210public Task<bool> StartAsync(CancellationToken cancellationToken)
228public async Task<int> WaitForExitAsync(CancellationToken cancellationToken)
TestServices\TestProjectLocator.cs (13)
12public Func<FileInfo?, bool, CancellationToken, Task<FileInfo?>>? UseOrFindAppHostProjectFileAsyncCallback { get; set; }
14public Func<FileInfo?, MultipleAppHostProjectsFoundBehavior, bool, CancellationToken, Task<AppHostProjectSearchResult>>? UseOrFindAppHostProjectFileWithBehaviorAsyncCallback { get; set; }
16public Func<CancellationToken, Task<FileInfo?>>? GetAppHostFromSettingsAsyncCallback { get; set; }
18public Func<DirectoryInfo, AppHostDiscoveryScope, CancellationToken, Task<List<AppHostProjectCandidate>>>? FindAppHostProjectsAsyncCallback { get; set; }
22public Func<DirectoryInfo, AppHostDiscoveryScope, CancellationToken, Task<List<FileInfo>>>? FindAppHostProjectFilesAsyncCallback { get; set; }
24public Func<DirectoryInfo, AppHostDiscoveryScope, int?, CancellationToken, Task<List<FileInfo>>>? FindAppHostProjectFilesWithDepthAsyncCallback { get; set; }
26public async Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(
62public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
72public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, int? maxDepth, CancellationToken cancellationToken)
82public async Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
99public async Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default)
116public async Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default)
127public async Task<FileInfo?> GetAppHostFromSettingsAsync(DirectoryInfo searchDirectory, bool searchParentDirectories, CancellationToken cancellationToken = default)
TestServices\TestTypeScriptStarterProjectFactory.cs (14)
9internal sealed class TestTypeScriptStarterProjectFactory(Func<DirectoryInfo, CancellationToken, string?, Task<bool>> buildAndGenerateSdkAsync) : IAppHostProjectFactory
44internal sealed class TestTypeScriptStarterProject(Func<DirectoryInfo, CancellationToken, string?, Task<bool>> buildAndGenerateSdkAsync) : IAppHostProject, IGuestAppHostSdkGenerator
50public Func<AddPackageContext, CancellationToken, Task<bool>>? AddPackageAsyncCallback { get; set; }
60public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default)
75public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
80public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
85public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
90public Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken)
95public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
102public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
107public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
112public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
117public Task<IReadOnlyList<(string PackageId, string Version)>> GetPackageReferencesAsync(FileInfo appHostFile, CancellationToken cancellationToken)
122public Task<bool> BuildAndGenerateSdkAsync(DirectoryInfo directory, string? packageSourceOverride = null, CancellationToken cancellationToken = default)
Aspire.Components.Common.TestUtilities (1)
Aspire.Confluent.Kafka (2)
Aspire.Dashboard (150)
Api\TelemetryApiService.cs (4)
28public async Task<TelemetryApiResponse?> GetSpansAsync(string[]? resourceNames, string? traceId, bool? hasError, int? limit, CancellationToken cancellationToken, string? search = null)
81public async Task<TelemetryApiResponse?> GetTracesAsync(string[]? resourceNames, bool? hasError, int? limit, CancellationToken cancellationToken, string? search = null)
166public async Task<TelemetryApiResponse?> GetLogsAsync(string[]? resourceNames, string? traceId, string? severity, int? limit, CancellationToken cancellationToken, string? search = null)
518private async Task<List<ResourceKey>> WaitForResourceKeysAsync(string[]? resourceNames, CancellationToken cancellationToken)
Otlp\Storage\ITelemetryRepository.cs (12)
37Task<PagedResult<OtlpLogEntry>> GetLogsAsync(GetLogsContext context, CancellationToken cancellationToken);
38Task<PagedResult<LogSummary>> GetLogSummariesAsync(GetLogsContext context, CancellationToken cancellationToken);
40Task<List<OtlpLogEntry>> GetLogsForSpanAsync(string traceId, string spanId, CancellationToken cancellationToken);
41Task<List<OtlpLogEntry>> GetLogsForTraceAsync(string traceId, CancellationToken cancellationToken);
42Task<List<string>> GetLogPropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken);
43Task<List<string>> GetTracePropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken);
44Task<GetTracesResponse> GetTracesAsync(GetTracesRequest context, CancellationToken cancellationToken);
45Task<GetTraceSummariesResponse> GetTraceSummariesAsync(GetTracesRequest context, CancellationToken cancellationToken);
46Task<GetSpansResponse> GetSpansAsync(GetSpansRequest context, CancellationToken cancellationToken);
47Task<Dictionary<string, int>> GetTraceFieldValuesAsync(string attributeName, CancellationToken cancellationToken);
48Task<Dictionary<string, int>> GetLogsFieldValuesAsync(string attributeName, CancellationToken cancellationToken);
64Task<OtlpInstrumentData?> GetInstrumentAsync(GetInstrumentRequest request, CancellationToken cancellationToken);
Otlp\Storage\SqliteTelemetryRepository.cs (13)
160internal static Task<T> RunReadAsync<T>(Func<CancellationToken, T> read, CancellationToken cancellationToken) =>
176public Task<PagedResult<OtlpLogEntry>> GetLogsAsync(GetLogsContext context, CancellationToken cancellationToken) =>
178public Task<PagedResult<LogSummary>> GetLogSummariesAsync(GetLogsContext context, CancellationToken cancellationToken) =>
181public async Task<List<OtlpLogEntry>> GetLogsForSpanAsync(string traceId, string spanId, CancellationToken cancellationToken)
196public async Task<List<OtlpLogEntry>> GetLogsForTraceAsync(string traceId, CancellationToken cancellationToken)
210public Task<List<string>> GetLogPropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken) =>
212public Task<List<string>> GetTracePropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken) =>
214public Task<GetTracesResponse> GetTracesAsync(GetTracesRequest context, CancellationToken cancellationToken) =>
216public Task<GetTraceSummariesResponse> GetTraceSummariesAsync(GetTracesRequest context, CancellationToken cancellationToken) =>
218public Task<GetSpansResponse> GetSpansAsync(GetSpansRequest context, CancellationToken cancellationToken) =>
220public Task<Dictionary<string, int>> GetTraceFieldValuesAsync(string attributeName, CancellationToken cancellationToken) =>
222public Task<Dictionary<string, int>> GetLogsFieldValuesAsync(string attributeName, CancellationToken cancellationToken) =>
231public Task<OtlpInstrumentData?> GetInstrumentAsync(GetInstrumentRequest request, CancellationToken cancellationToken) =>
ServiceClient\DashboardClient.cs (8)
383private async Task<bool> ConnectWithRetryAsync(CancellationToken cancellationToken)
465private async Task WatchWithRecoveryAsync(Func<RetryContext, CancellationToken, Task<RetryResult>> action, string actionName, CancellationToken cancellationToken)
564private async Task<RetryResult> WatchResourcesAsync(RetryContext retryContext, CancellationToken cancellationToken)
696private async Task<RetryResult> WatchInteractionsAsync(RetryContext retryContext, CancellationToken cancellationToken)
778private static async Task<bool> IsUnimplemented(AsyncDuplexStreamingCall<WatchInteractionsRequestUpdate, WatchInteractionsResponseUpdate> call)
847public async Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
1033public async Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
1108public async Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken)
Aspire.Dashboard.Components.Tests (51)
Layout\DashboardDialogProviderTests.cs (8)
25var first = await OpenAsync(cut, "first", drawer: false, OnStateChange);
26var second = await OpenAsync(cut, "second", drawer: true, OnStateChange);
49var reopened = await OpenAsync(cut, "reopened", drawer: false, onStateChange: null);
62Task<DialogResult> result = null!;
81var result = await OpenAsync(plainProvider, "after-dispose", drawer: false, onStateChange: null);
91private async Task<Task<DialogResult>> OpenAsync(IRenderedFragment cut, string id, bool drawer, Action<DialogEventArgs>? onStateChange)
94Task<DialogResult> result = null!;
Shared\TestTelemetryRepository.cs (13)
12public Func<GetLogsContext, CancellationToken, Task<PagedResult<LogSummary>>>? GetLogSummariesAsyncHandler { get; init; }
33public Task<PagedResult<OtlpLogEntry>> GetLogsAsync(GetLogsContext context, CancellationToken cancellationToken) => inner.GetLogsAsync(context, cancellationToken);
34public Task<PagedResult<LogSummary>> GetLogSummariesAsync(GetLogsContext context, CancellationToken cancellationToken) =>
37public Task<List<OtlpLogEntry>> GetLogsForSpanAsync(string traceId, string spanId, CancellationToken cancellationToken) => inner.GetLogsForSpanAsync(traceId, spanId, cancellationToken);
38public Task<List<OtlpLogEntry>> GetLogsForTraceAsync(string traceId, CancellationToken cancellationToken) => inner.GetLogsForTraceAsync(traceId, cancellationToken);
39public Task<List<string>> GetLogPropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken) => inner.GetLogPropertyKeysAsync(resourceKey, cancellationToken);
40public Task<List<string>> GetTracePropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken) => inner.GetTracePropertyKeysAsync(resourceKey, cancellationToken);
41public Task<GetTracesResponse> GetTracesAsync(GetTracesRequest context, CancellationToken cancellationToken) => inner.GetTracesAsync(context, cancellationToken);
42public Task<GetTraceSummariesResponse> GetTraceSummariesAsync(GetTracesRequest context, CancellationToken cancellationToken) => inner.GetTraceSummariesAsync(context, cancellationToken);
43public Task<GetSpansResponse> GetSpansAsync(GetSpansRequest context, CancellationToken cancellationToken) => inner.GetSpansAsync(context, cancellationToken);
44public Task<Dictionary<string, int>> GetTraceFieldValuesAsync(string attributeName, CancellationToken cancellationToken) => inner.GetTraceFieldValuesAsync(attributeName, cancellationToken);
45public Task<Dictionary<string, int>> GetLogsFieldValuesAsync(string attributeName, CancellationToken cancellationToken) => inner.GetLogsFieldValuesAsync(attributeName, cancellationToken);
52public Task<OtlpInstrumentData?> GetInstrumentAsync(GetInstrumentRequest request, CancellationToken cancellationToken) => inner.GetInstrumentAsync(request, 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)
tests\Shared\TestDashboardClient.cs (5)
22private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand;
43Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null,
73public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
88public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken)
129public Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
Aspire.Dashboard.Tests (71)
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\TestDashboardClient.cs (5)
22private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand;
43Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null,
73public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
88public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken)
129public Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
Aspire.Deployment.EndToEnd.Tests (72)
Aspire.EndToEnd.Tests (12)
Aspire.Hosting (330)
ApplicationModel\ResourceCommandService.cs (14)
62public async Task<ExecuteCommandResult> ExecuteCommandAsync(string resourceId, string commandName, CancellationToken cancellationToken = default)
92public async Task<ExecuteCommandResult> ExecuteCommandAsync(string resourceId, string commandName, InteractionInputCollection arguments, CancellationToken cancellationToken = default)
115public async Task<ExecuteCommandResult> ExecuteCommandAsync(IResource resource, string commandName, CancellationToken cancellationToken = default)
130public async Task<ExecuteCommandResult> ExecuteCommandAsync(IResource resource, string commandName, InteractionInputCollection arguments, CancellationToken cancellationToken = default)
149var tasks = new List<Task<ExecuteCommandResult>>();
306internal async Task<ExecuteCommandResult> ExecuteCommandAsync(string resourceId, string commandName, ResourceCommandExecutionOptions options, CancellationToken cancellationToken)
313internal async Task<ExecuteCommandResult> ExecuteCommandAsync(IResource resource, string commandName, IReadOnlyDictionary<string, string?>? argumentValues, CancellationToken cancellationToken)
326internal async Task<ExecuteCommandResult> ExecuteCommandCoreAsync(string resourceId, IResource resource, string commandName, InteractionInputCollection arguments, bool argumentsProvided, bool nonInteractive, CancellationToken cancellationToken)
413private async Task<ExecuteCommandResult> ExecuteCommandWithOptionalProgressAsync(
468internal async Task<(ExecuteCommandResult Result, InteractionInputCollection? Arguments)> ValidateCommandArgumentsAsync(string resourceId, string commandName, InteractionInputCollection arguments, CancellationToken cancellationToken)
500private async Task<ExecuteCommandResult> ExecuteCommandCoreAsync(string resourceId, string commandName, ResourceCommandExecutionOptions options, CancellationToken cancellationToken)
572private async Task<bool> ValidateArgumentsAsync(ResourceCommandAnnotation annotation, InteractionInputCollection arguments, HashSet<string>? loadedDynamicArgumentNames, CancellationToken cancellationToken)
659private async Task<HashSet<string>> LoadDynamicCommandArgumentsAsync(InteractionInputCollection arguments, CancellationToken cancellationToken)
698private async Task<(InteractionInputCollection? Arguments, ExecuteCommandResult? Result)> PromptForCommandArgumentsAsync(ResourceCommandAnnotation annotation, InteractionInputCollection arguments, CancellationToken cancellationToken)
ApplicationModel\ResourceNotificationService.cs (7)
121/// <returns>A <see cref="Task{String}"/> representing the wait operation and which of the target states the resource reached.</returns>
124public async Task<string> WaitForResourceAsync(string resourceName, IEnumerable<string> targetStates, CancellationToken cancellationToken = default)
204public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, CancellationToken cancellationToken = default)
237public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, WaitBehavior waitBehavior, CancellationToken cancellationToken = default)
645/// <returns>A <see cref="Task{ResourceEvent}"/> representing the wait operation and which of the target states the resource reached.</returns>
648public async Task<ResourceEvent> WaitForResourceAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default)
661private async Task<ResourceEvent> WaitForResourceCoreAsync(string resourceName, Func<ResourceEvent, bool> predicate, string cancellationMessage, CancellationToken cancellationToken = default, string waitCondition = "predicate")
Backchannel\AuxiliaryBackchannelRpcTarget.cs (29)
45public Task<GetCapabilitiesResponse> GetCapabilitiesAsync(GetCapabilitiesRequest? request = null, CancellationToken cancellationToken = default)
70public async Task<GetAppHostInfoResponse> GetAppHostInfoAsync(GetAppHostInfoRequest? request = null, CancellationToken cancellationToken = default)
93public async Task<GetDashboardInfoResponse> GetDashboardInfoAsync(GetDashboardInfoRequest? request = null, CancellationToken cancellationToken = default)
124public async Task<GetResourcesResponse> GetResourcesAsync(GetResourcesRequest? request = null, CancellationToken cancellationToken = default)
227public async Task<CallMcpToolResponse> CallMcpToolAsync(CallMcpToolRequest request, CancellationToken cancellationToken = default)
261public async Task<StopAppHostResponse> StopAsync(StopAppHostRequest? request = null, CancellationToken cancellationToken = default)
274public async Task<ExecuteResourceCommandResponse> ExecuteResourceCommandAsync(ExecuteResourceCommandRequest request, CancellationToken cancellationToken = default)
359private static async Task<(ExecuteCommandResult Result, InteractionInputCollection? Arguments)> ValidateResourceCommandAsync(ResourceCommandService resourceCommandService, string resourceName, string commandName, InteractionInputCollection arguments, CancellationToken cancellationToken)
433public async Task<GetTerminalInfoResponse> GetTerminalInfoAsync(GetTerminalInfoRequest request, CancellationToken cancellationToken = default)
475private async Task<(TerminalReplicaInfo[] Replicas, bool AnyHostReachable)> CollectReplicaInfosAsync(
481var tasks = new Task<(TerminalReplicaInfo Info, bool HostResponded)>[hosts.Count];
505private async Task<(TerminalReplicaInfo Info, bool HostResponded)> QueryReplicaAsync(
587public async Task<ListTerminalsResponse> ListTerminalsAsync(ListTerminalsRequest? request = null, CancellationToken cancellationToken = default)
634public async Task<WaitForResourceResponse> WaitForResourceAsync(WaitForResourceRequest request, CancellationToken cancellationToken = default)
676private static async Task<WaitForResourceResponse> WaitForHealthyAsync(ResourceNotificationService notificationService, WaitResourceTarget target, CancellationToken cancellationToken)
707private static async Task<WaitForResourceResponse> WaitForRunningAsync(ResourceNotificationService notificationService, WaitResourceTarget target, CancellationToken cancellationToken)
731private static async Task<WaitForResourceResponse> WaitForTerminalAsync(ResourceNotificationService notificationService, WaitResourceTarget target, CancellationToken cancellationToken)
748private static async Task<ResourceEvent> WaitForResourceEventAsync(
860public Task<AppHostInformation> GetAppHostInformationAsync(CancellationToken cancellationToken = default)
923public async Task<DashboardUrlsState> GetDashboardUrlsAsync(CancellationToken cancellationToken = default)
946public async Task<WaitForAppHostReadyResponse> WaitForAppHostReadyAsync(WaitForAppHostReadyRequest? request = null, CancellationToken cancellationToken = default)
960public Task<DashboardMcpConnectionInfo?> GetDashboardMcpConnectionInfoAsync(CancellationToken cancellationToken = default)
972public async Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(CancellationToken cancellationToken = default)
977private async Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(bool resourcePropertiesAsJson, CancellationToken cancellationToken)
1046private async Task<ResourceSnapshot?> CreateResourceSnapshotFromEventAsync(
1234private async Task<HashSet<string>> GetResolvedSecretParameterValuesAsync(CancellationToken cancellationToken)
1301private async Task<IReadOnlyList<ParameterResource>> GetSecretParametersAsync(CancellationToken cancellationToken)
1775public async Task<CallToolResult> CallResourceMcpToolAsync(
1887private async Task<Tool[]?> TryListToolsAsync(Uri endpointUri, CancellationToken cancellationToken)
ContainerResourceBuilderExtensions.cs (5)
823public static IResourceBuilder<T> WithDockerfileFactory<T>(this IResourceBuilder<T> builder, string contextPath, Func<DockerfileFactoryContext, Task<string>> dockerfileFactory, string? stage = null) where T : ContainerResource
981public static IResourceBuilder<ContainerResource> AddDockerfileFactory(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, Func<DockerfileFactoryContext, Task<string>> dockerfileFactory, string? stage = null)
1460public 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
1603Func<ContainerFileSystemCallbackContext, CancellationToken, Task<IEnumerable<ContainerFileSystemItem>>> callback,
1721Func<DockerfileFactoryContext, Task<string>> dockerfileFactory = async factoryContext =>
Dcp\KubernetesService.cs (16)
39Task<T> GetAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
41Task<T> CreateAsync<T>(T obj, CancellationToken cancellationToken = default)
43Task<T> PatchAsync<T>(T obj, V1Patch patch, CancellationToken cancellationToken = default)
45Task<List<T>> ListAsync<T>(string? namespaceParameter = null, CancellationToken cancellationToken = default)
47Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
66Task<Stream> GetLogStreamAsync<T>(
98public Task<T> GetAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
129public Task<T> CreateAsync<T>(T obj, CancellationToken cancellationToken = default)
162public Task<T> PatchAsync<T>(T obj, V1Patch patch, CancellationToken cancellationToken = default)
197public Task<List<T>> ListAsync<T>(string? namespaceParameter = null, CancellationToken cancellationToken = default)
227public Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
276var responseTask = string.IsNullOrEmpty(namespaceParameter)
311public Task<Stream> GetLogStreamAsync<T>(
457private async Task<TResult> ExecuteWithRetry<TResult>(
460Func<DcpKubernetesClient, CancellationToken, Task<TResult>> operation,
582private async Task<KubernetesClientReady> EnsureKubernetesAsync(CancellationToken cancellationToken = default)
IInteractionService.cs (9)
34Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default);
46Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default);
60Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
73Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
86Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
98Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default);
125Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default);
580public Task<byte[]> ReadAllBytesAsync(CancellationToken cancellationToken = default)
588private static async Task<byte[]> ReadAllBytesAsyncCore(Stream stream, CancellationToken cancellationToken)
InteractionService.cs (9)
90public async Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
100public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
109private async Task<InteractionResult<bool>> PromptMessageBoxCoreAsync(string title, string message, MessageBoxInteractionOptions options, CancellationToken cancellationToken)
138public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
143public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
154public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
263public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
291public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
542private async Task<bool> RunValidationAsync(Interaction interactionState, InteractionCompletionState result, CancellationToken cancellationToken)
ResourceBuilderExtensions.cs (8)
2916Func<ExecuteCommandContext, Task<ExecuteCommandResult>> executeCommand,
2980Func<ExecuteCommandContext, Task<ExecuteCommandResult>> executeCommand,
3264Func<ExecuteCommandContext, Task<ProcessCommandSpecExportData>> createProcessSpec,
3283internal static async Task<ExecuteCommandResult> ExecuteProcessCommandAsync(ExecuteCommandContext context, ProcessCommandSpec processCommandSpec, ProcessCommandOptions commandOptions)
3461private static async Task<ExecuteCommandResult> GetProcessCommandResultAsync(ExecuteCommandContext context, ProcessCommandSpec processCommandSpec, ProcessResult processResult, ProcessCommandOptions commandOptions)
3872internal static async Task<ExecuteCommandResult> GetDefaultHttpCommandResultAsync(HttpResponseMessage response, HttpCommandOptions commandOptions, CancellationToken cancellationToken)
4940Func<string, CancellationToken, Task<TLaunchConfiguration>> launchConfigurationProducer,
4997Func<LaunchConfigurationCallbackContext, Task<TLaunchConfiguration>> launchConfigurationProducer,
Aspire.Hosting.Azure (151)
AzureProvisioningController.cs (73)
563public async Task<bool> ChangeAzureContextAsync(DistributedApplicationModel model, CancellationToken cancellationToken = default)
570private async Task<bool> ChangeAzureContextAsync(DistributedApplicationModel model, AzureProvisioningOptionsUpdate options, CancellationToken cancellationToken)
585public async Task<bool> ReprovisionAllAsync(DistributedApplicationModel model, CancellationToken cancellationToken = default)
630public async Task<bool> ReprovisionResourceAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken = default)
654public async Task<bool> ChangeResourceLocationAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken = default)
710private async Task<bool> ChangeResourceLocationAsync(
731private Task<ExecuteCommandResult> ExecuteResetProvisioningStateCommandAsync(ExecuteCommandContext context)
744private Task<ExecuteCommandResult> ExecuteChangeAzureContextCommandAsync(ExecuteCommandContext context)
757private Task<ExecuteCommandResult> ExecuteReprovisionAllCommandAsync(ExecuteCommandContext context)
770private Task<ExecuteCommandResult> ExecuteDeleteAzureResourcesCommandAsync(ExecuteCommandContext context)
782private Task<ExecuteCommandResult> ExecuteChangeResourceLocationCommandAsync(string resourceName, ExecuteCommandContext context)
796private Task<ExecuteCommandResult> ExecuteGetAzureResourceCommandAsync(string resourceName, ExecuteCommandContext context)
809private Task<ExecuteCommandResult> ExecuteCancelCommandAsync(string resourceName, ExecuteCommandContext context)
822private Task<ExecuteCommandResult> ExecuteDeleteAzureResourceCommandAsync(string resourceName, ExecuteCommandContext context)
835private Task<ExecuteCommandResult> ExecuteForgetStateCommandAsync(string resourceName, ExecuteCommandContext context)
848private Task<ExecuteCommandResult> ExecuteReprovisionResourceCommandAsync(string resourceName, ExecuteCommandContext context)
862private async Task<bool> ChangeAzureContextCommandAsync(DistributedApplicationModel model, InteractionInputCollection arguments, CancellationToken cancellationToken)
892private Task<bool> ChangeResourceLocationCommandAsync(DistributedApplicationModel model, string resourceName, InteractionInputCollection arguments, CancellationToken cancellationToken)
1016private async Task<T> RunOperationAsync<T>(DistributedApplicationModel model, AzureIntent intent, CancellationToken cancellationToken)
1024private async Task<bool> EnsureProvisionedCoreAsync(
1127private async Task<bool> EnsureProvisionedOrThrowAsync(
1389private async Task<object?> QueueAndWaitForOperationAsync(
1704private async Task<object?> ExecuteIntentAsync(DistributedApplicationModel model, AzureIntent intent, CancellationToken cancellationToken)
1723private async Task<bool> ExecuteResetStateAsync(DistributedApplicationModel model, ResetStateIntent intent, CancellationToken cancellationToken)
1745private async Task<object?> ExecuteForgetResourceStateAsync(DistributedApplicationModel model, ForgetResourceStateIntent intent, CancellationToken cancellationToken)
1756private async Task<bool> ExecuteChangeAzureContextAsync(DistributedApplicationModel model, ChangeAzureContextIntent intent, CancellationToken cancellationToken)
1788private async Task<bool> ExecuteApplyAzureContextAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
1798private async Task<object?> ExecuteEnsureProvisionedAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
1806private async Task<bool> ExecuteReprovisionAllAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
1814private async Task<object?> ExecuteDeleteAzureResourcesAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
1854private async Task<string?> DeleteCurrentResourceGroupIfExistsAsync(CancellationToken cancellationToken)
1885private async Task<bool> ExecuteChangeResourceLocationAsync(DistributedApplicationModel model, ChangeResourceLocationIntent intent, CancellationToken cancellationToken)
1937private async Task<bool> ExecuteReprovisionResourceAsync(DistributedApplicationModel model, ReprovisionResourceIntent intent, CancellationToken cancellationToken)
2088private async Task<DeleteAzureResourceResult> ExecuteDeleteAzureResourceAsync(DistributedApplicationModel model, DeleteAzureResourceIntent intent, CancellationToken cancellationToken)
2155private async Task<object?> ExecuteDetectDriftAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
2376private static async Task<ExecuteCommandResult> ExecuteCommandAsync(Func<Task> action, string successMessage, Func<Task<CommandResultData>> createResultData, string? failureOperation = null)
2393private static async Task<ExecuteCommandResult> ExecuteCommandAsync<T>(Func<Task<T>> action, string successMessage, Func<T, Task<CommandResultData>> createResultData, string? failureOperation = null)
2410private static async Task<ExecuteCommandResult> ExecuteCommandAsync(Func<Task<bool>> action, string successMessage, Func<Task<CommandResultData>> createResultData, string? failureOperation = null)
2428private async Task<CommandResultData> CreateEnvironmentCommandResultDataAsync(string commandName, DistributedApplicationModel model, CancellationToken cancellationToken)
2445private async Task<CommandResultData> CreateResourceCommandResultDataAsync(string commandName, DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken)
2448private async Task<CommandResultData> CreateDeleteAzureResourceCommandResultDataAsync(DistributedApplicationModel model, string resourceName, DeleteAzureResourceResult result, CancellationToken cancellationToken)
2462private async Task<JsonObject> CreateResourceCommandResultJsonAsync(string commandName, DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken)
2476private async Task<CommandResultData> CreateAzureResourceInfoCommandResultDataAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken)
2507private async Task<JsonObject> CreateCachedDeploymentStateInfoAsync(AzureBicepResource resource, AzureContextState context, CancellationToken cancellationToken)
2550private async Task<JsonObject> CreateLiveResourceInfoAsync(string? resourceId, AzureContextState context, CancellationToken cancellationToken)
2669private async Task<JsonObject> CreateCommandResultJsonAsync(string commandName, string? resourceName, CancellationToken cancellationToken)
2761private async Task<string?> GetEffectiveResourceLocationAsync(string resourceName, CancellationToken cancellationToken)
2787private async Task<int> CancelCachedDeploymentsAsync(
2888private async Task<IReadOnlyList<string>> GetAzureResourceIdsForDeletionAsync(
2965private async Task<bool> DeleteAzureResourceIdAndPurgeDeletedKeyVaultAsync(
2995private async Task<bool> PurgeDeletedKeyVaultAsync(
3065private async Task<IArmClient> GetArmClientForResourceIdAsync(string resourceId, CancellationToken cancellationToken)
3235private async Task<IReadOnlyList<KeyValuePair<string, string>>> GetLocationOptionsAsync(CancellationToken cancellationToken)
3240private async Task<IReadOnlyList<KeyValuePair<string, string>>> GetTenantOptionsAsync(CancellationToken cancellationToken)
3278private async Task<IReadOnlyList<KeyValuePair<string, string>>> GetSubscriptionOptionsAsync(string? tenantId, CancellationToken cancellationToken)
3299private async Task<IReadOnlyList<(string Name, string Location)>> GetResourceGroupOptionsAsync(string? subscriptionId, CancellationToken cancellationToken)
3323private async Task<IReadOnlyList<KeyValuePair<string, string>>> GetLocationOptionsAsync(string? subscriptionId, CancellationToken cancellationToken)
3364private async Task<AzureContextState> GetCurrentAzureContextAsync(CancellationToken cancellationToken)
3390private async Task<string?> TryGetResourceIdFromDeploymentStateAsync(AzureBicepResource resource, CancellationToken cancellationToken)
3411private async Task<LocationChangeResourceDeletion?> PrepareCachedResourceDeletionForLocationChangeAsync(
3509private async Task<string?> TryGetPersistedResourceLocationAsync(AzureBicepResource resource, CancellationToken cancellationToken)
3535private async Task<bool> IsMissingCachedResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken)
3784private async Task<bool> TryPublishTerminalDeploymentStateAsync(
3853private async Task<bool> WaitForRoleAssignmentsAsync(
3893var provisioningContextLazy = new Lazy<Task<ProvisioningContext>>(() => provisioningContextProvider.CreateProvisioningContextAsync(cancellationToken));
3906Lazy<Task<ProvisioningContext>> provisioningContextLazy,
4347Func<AzureProvisioningController, ExecuteCommandContext, Task<ExecuteCommandResult>> ExecuteCommand,
4360Func<AzureProvisioningController, string, ExecuteCommandContext, Task<ExecuteCommandResult>> ExecuteCommand,
Provisioning\Internal\BaseProvisioningContextProvider.cs (6)
91public virtual async Task<ProvisioningContext> CreateProvisioningContextAsync(CancellationToken cancellationToken = default)
249protected async Task<(List<KeyValuePair<string, string>>? tenantOptions, bool fetchSucceeded)> TryGetTenantsAsync(CancellationToken cancellationToken)
298protected async Task<(List<KeyValuePair<string, string>>? subscriptionOptions, bool fetchSucceeded)> TryGetSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken)
326protected async Task<(List<KeyValuePair<string, string>>? subscriptionOptions, bool fetchSucceeded)> TryGetSubscriptionsAsync(CancellationToken cancellationToken)
331protected async Task<(List<(string Name, string Location)>? resourceGroupOptions, bool fetchSucceeded)> TryGetResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken)
364protected async Task<(List<KeyValuePair<string, string>> locationOptions, bool fetchSucceeded)> TryGetLocationsAsync(string subscriptionId, CancellationToken cancellationToken)
Provisioning\Internal\DefaultArmClientProvider.cs (12)
61public async Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
85public async Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
97public async Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
109public async Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
130public async Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
137public async Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
146public async Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
159public async Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
209public async Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
243public async Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
334public async Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
415private async Task<AzureDeploymentOperationDetails[]> GetDeploymentOperationsForDeploymentAsync(ResourceIdentifier deploymentId, CancellationToken cancellationToken)
Provisioning\Internal\IProvisioningServices.cs (25)
52Task<string> CompileBicepToArmAsync(string bicepFilePath, CancellationToken cancellationToken = default);
65Task<ProvisioningContext> CreateProvisioningContextAsync(CancellationToken cancellationToken = default);
79Task<bool> EnsureProvisioningOptionsAsync(bool forcePrompt, CancellationToken cancellationToken = default);
86Task<AzureProvisioningOptionsState> GetProvisioningOptionsAsync(CancellationToken cancellationToken = default);
100Task<AzureProvisioningOptionsState> ApplyProvisioningOptionsAsync(AzureProvisioningOptionsUpdate options, CancellationToken cancellationToken = default);
118public Task<bool> EnsureProvisioningOptionsAsync(bool forcePrompt, CancellationToken cancellationToken = default) => Task.FromResult(false);
119public Task<AzureProvisioningOptionsState> GetProvisioningOptionsAsync(CancellationToken cancellationToken = default)
122public Task<AzureProvisioningOptionsState> ApplyProvisioningOptionsAsync(AzureProvisioningOptionsUpdate options, CancellationToken cancellationToken = default)
134Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default);
139Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default);
144Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default);
149Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default);
154Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default);
159Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default);
164Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default);
169Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default);
179Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default);
199Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default);
209Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default);
264Task<Response<IResourceGroupResource>> GetAsync(string resourceGroupName, CancellationToken cancellationToken = default);
269Task<ArmOperation<IResourceGroupResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceGroupName, ResourceGroupData data, CancellationToken cancellationToken = default);
295Task<ArmOperation> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default);
312Task<ArmOperation<RoleAssignmentResource>> CreateOrUpdateAsync(
327Task<ArmOperation<ArmDeploymentResource>> CreateOrUpdateAsync(
378Task<AzurePrincipal> GetPrincipalAsync(CancellationToken cancellationToken = default);
Aspire.Hosting.Azure.AppContainers (2)
Aspire.Hosting.Azure.AppService (3)
Aspire.Hosting.Azure.KeyVault (2)
Aspire.Hosting.Azure.Kubernetes (13)
AzureKubernetesEnvironmentResource.AksPipeline.cs (12)
35internal Func<string, string, ILogger, Task<AzCommandResult>>? AzCommandRunnerForTesting { get; set; }
265Task<AzCommandResult> RunAzAsync(string path, string arguments)
774internal static async Task<(string? SubscriptionId, string? ResourceGroup)> TryGetAzureDeploymentStateAsync(
800internal static async Task<string?> ResolveScopeValueAsync(object? value, CancellationToken cancellationToken)
824internal static async Task<(string SubscriptionId, string? ResourceGroup)> ResolveDeploymentScopeAsync(
884internal static async Task<string> GetResourceGroupAsync(
890Func<string, string, Task<AzCommandResult>> runAzCommandAsync)
947internal static async Task<string> FetchKubeConfigAsync(
952Func<string, string, Task<AzCommandResult>> runAzCommandAsync)
967internal static async Task<bool> AksResourceExistsAsync(
972Func<string, string, Task<AzCommandResult>> runAzCommandAsync)
1016private static async Task<AzCommandResult> RunAzCommandAsync(
Aspire.Hosting.Azure.Kubernetes.Tests (7)
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.Sandboxes (44)
AzureSandboxContainerDeployment.cs (20)
639private static async Task<AzureDevComputeDiskImage> CreateDiskImageAsync(
669internal static async Task<string?> ResolveImagePullManagedIdentityClientIdAsync(
695private static async Task<AzureDevComputeDiskImage> WaitForDiskImageReadyAsync(
735private static Task<AzureDevComputeSandbox> CreateSandboxAsync(
843internal static async Task<FileLock?> AcquireDeploymentLeaseAsync(
931private static async Task<AzureDevComputeSandboxPort> AddPortAsync(
972private static async Task<string> ResolveContainerImageAsync(PipelineStepContext context, AzureSandboxContainerResource resource)
991private static async Task<string> ResolveContainerImageReferenceForDiskImageAsync(PipelineStepContext context, string imageReference)
1000internal static async Task<string> ResolveContainerImageReferenceForDiskImageAsync(
1045private static async Task<ContainerImageMetadata> ResolveContainerImageMetadataAsync(PipelineStepContext context, IResource resource, string imageReference)
1067internal static async Task<ResolvedModeledCommand> ResolveModeledCommandAsync(PipelineStepContext context, IResource resource)
1105private static async Task<ContainerImageMetadata> InspectLocalContainerImageAsync(PipelineStepContext context, string imageReference)
1134private static Task<IContainerRuntime> ResolveContainerRuntimeAsync(PipelineStepContext context)
1139internal static async Task<ResolvedEnvironmentVariables> ResolveEnvironmentVariablesAsync(PipelineStepContext context, IResource resource)
1167internal static async Task<string> ResolveValueAsync(PipelineStepContext context, IResource resource, object? value)
1170internal static async Task<ResolvedValue> ResolveValueWithEgressHostsAsync(PipelineStepContext context, IResource resource, object? value)
1218static async Task<ResolvedValue> ResolveEndpointValueAsync(
1250static async Task<ResolvedValue> ResolveReferenceExpressionAsync(
1769internal static async Task<T> CreateWithResponseLossCleanupAsync<T>(
1770Func<Task<T>> createResource,
Internal\Adc\AzureDevComputeClient.cs (23)
19Task<AzureDevComputeDiskImage> CreateDiskImageAsync(AzureDevComputeResourceScope scope, AzureDevComputeCreateDiskImageRequest request, CancellationToken cancellationToken);
21Task<List<AzureDevComputeDiskImage>> ListDiskImagesAsync(AzureDevComputeResourceScope scope, string? labels, CancellationToken cancellationToken);
23Task<AzureDevComputeDiskImage> GetDiskImageAsync(AzureDevComputeResourceScope scope, string diskImageId, CancellationToken cancellationToken);
27Task<List<AzureDevComputeSandbox>> ListSandboxesAsync(AzureDevComputeResourceScope scope, string? labels, CancellationToken cancellationToken);
29Task<AzureDevComputeSandbox> CreateSandboxAsync(AzureDevComputeResourceScope scope, AzureDevComputeSandboxRequest request, CancellationToken cancellationToken);
31Task<AzureDevComputeSandbox> SetLifecycleAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeSandboxLifecyclePolicy lifecycle, CancellationToken cancellationToken);
33Task<List<AzureDevComputeSandboxPort>> AddPortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeAddPortRequest request, CancellationToken cancellationToken);
35Task<List<AzureDevComputeSandboxPort>> RemovePortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeRemovePortRequest request, CancellationToken cancellationToken);
60public Task<AzureDevComputeDiskImage> CreateDiskImageAsync(AzureDevComputeResourceScope scope, AzureDevComputeCreateDiskImageRequest request, CancellationToken cancellationToken)
70public Task<List<AzureDevComputeDiskImage>> ListDiskImagesAsync(AzureDevComputeResourceScope scope, string? labels, CancellationToken cancellationToken)
75public Task<AzureDevComputeDiskImage> GetDiskImageAsync(AzureDevComputeResourceScope scope, string diskImageId, CancellationToken cancellationToken)
96public Task<List<AzureDevComputeSandbox>> ListSandboxesAsync(AzureDevComputeResourceScope scope, string? labels, CancellationToken cancellationToken)
101public Task<AzureDevComputeSandbox> CreateSandboxAsync(AzureDevComputeResourceScope scope, AzureDevComputeSandboxRequest request, CancellationToken cancellationToken)
111public Task<AzureDevComputeSandbox> SetLifecycleAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeSandboxLifecyclePolicy lifecycle, CancellationToken cancellationToken)
121public async Task<List<AzureDevComputeSandboxPort>> AddPortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeAddPortRequest request, CancellationToken cancellationToken)
133public async Task<List<AzureDevComputeSandboxPort>> RemovePortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeRemovePortRequest request, CancellationToken cancellationToken)
157private async Task<List<T>> ListAllPagesAsync<T>(AzureDevComputeResourceScope scope, string resourceType, string? labels, CancellationToken cancellationToken)
200private async Task<T> SendAsync<T>(
220private async Task<T> SendCreateAsync<T>(
295private async Task<HttpResponseMessage> SendWithRetryAsync(
412private async Task<HttpResponseMessage> SendCoreAsync(
442private async Task<string> GetAccessTokenAsync(CancellationToken cancellationToken)
468private static Task<string> GetErrorMessageAsync(HttpResponseMessage response, CancellationToken cancellationToken)
Aspire.Hosting.Azure.Tests (231)
AzureEnvironmentResourceExtensionsTests.cs (112)
410var commandTask = resetCommand.ExecuteCommand(new ExecuteCommandContext
516var outputTask = storage.GetOutput("blobEndpoint").GetValueAsync(CancellationToken.None).AsTask();
1546var activeReprovisionTask = controller.ReprovisionResourceAsync(model, storage.Resource.Name, CancellationToken.None);
1605var activeReprovisionTask = controller.ReprovisionResourceAsync(model, storage1.Resource.Name, CancellationToken.None);
1612var queuedReprovisionTask = queuedReprovisionCommand.ExecuteCommand(new ExecuteCommandContext
1957var commandTask = deleteCommand.ExecuteCommand(new ExecuteCommandContext
2035var deleteTask = deleteCommand.ExecuteCommand(new ExecuteCommandContext
2232var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
2292var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
2369var storageTask = reprovisionStorageCommand.ExecuteCommand(new ExecuteCommandContext
2383var storage2Task = reprovisionStorage2Command.ExecuteCommand(new ExecuteCommandContext
2446var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
2643var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
2710var commandTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
2783var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
2957var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
3088var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
3214var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
3277var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
4073var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
4125var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
5180private static async Task<(IReadOnlyList<PipelineStep> Steps, PipelineContext PipelineContext)> CreateAzureEnvironmentPipelineStepsAsync(
5243public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
5250public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
5256public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
5262public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
5272public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
5280public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
5285public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
5295public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
5301public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
5307public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
5313public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
5374public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
5386public Task<DeploymentStateSection> AcquireCurrentSectionAsync(string sectionName, CancellationToken cancellationToken = default)
5471public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken)
5497public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5507public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken)
5520public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5540public Task<ProvisioningContext> CreateProvisioningContextAsync(CancellationToken cancellationToken = default)
5549public Task<bool> EnsureProvisioningOptionsAsync(bool forcePrompt, CancellationToken cancellationToken = default) => Task.FromResult(true);
5551public async Task<AzureProvisioningOptionsState> GetProvisioningOptionsAsync(CancellationToken cancellationToken = default)
5563public async Task<AzureProvisioningOptionsState> ApplyProvisioningOptionsAsync(AzureProvisioningOptionsUpdate options, CancellationToken cancellationToken = default)
5602public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
5604public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5632public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
5634public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5652public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
5654public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5669public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
5671public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5686public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
5688public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5712public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
5714public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5768public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken)
5771public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5820public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
5823public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
5826public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
5829public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
5832public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
5835public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
5838public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
5841public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
5847public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
5853public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
5859public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
5905public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
5908public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
5911public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
5914public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
5917public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
5920public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
5923public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
5926public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
5932public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
5946public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
5952public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
5982public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
5985public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
5988public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
5991public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
5994public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
5997public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
6000public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
6003public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
6009public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
6015public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
6021public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
6050public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
6053public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
6056public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
6059public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
6062public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
6065public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
6068public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
6071public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
6077public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
6083public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
6089public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
6112public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
6115public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
6118public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
6121public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
6124public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
6127public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
6130public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
6133public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
6139public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
6147public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
6153public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
AzureSandboxesTests.cs (32)
3227var secondLeaseTask = AzureSandboxContainerDeployment.AcquireDeploymentLeaseAsync(
3247private static async Task<List<PipelineStep>> CreateStepsAsync(
3281private static async Task<ResponseLossCleanupClient> RunCreateResponseLossAsync(
3359public Task<List<AzureDevComputeSandbox>> ListSandboxesAsync(
3387public Task<List<AzureDevComputeDiskImage>> ListDiskImagesAsync(
3395public Task<AzureDevComputeDiskImage> CreateDiskImageAsync(AzureDevComputeResourceScope scope, AzureDevComputeCreateDiskImageRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3396public Task<AzureDevComputeDiskImage> GetDiskImageAsync(AzureDevComputeResourceScope scope, string diskImageId, CancellationToken cancellationToken) => throw new NotSupportedException();
3398public Task<AzureDevComputeSandbox> CreateSandboxAsync(AzureDevComputeResourceScope scope, AzureDevComputeSandboxRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3399public Task<AzureDevComputeSandbox> SetLifecycleAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeSandboxLifecyclePolicy lifecycle, CancellationToken cancellationToken) => throw new NotSupportedException();
3400public Task<List<AzureDevComputeSandboxPort>> AddPortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeAddPortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3401public Task<List<AzureDevComputeSandboxPort>> RemovePortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeRemovePortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3425public Task<string> CreateResourceThenLoseResponseAsync()
3433public Task<List<AzureDevComputeSandbox>> ListSandboxesAsync(
3461public Task<List<AzureDevComputeDiskImage>> ListDiskImagesAsync(
3503public Task<AzureDevComputeDiskImage> CreateDiskImageAsync(AzureDevComputeResourceScope scope, AzureDevComputeCreateDiskImageRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3504public Task<AzureDevComputeDiskImage> GetDiskImageAsync(AzureDevComputeResourceScope scope, string diskImageId, CancellationToken cancellationToken) => throw new NotSupportedException();
3505public Task<AzureDevComputeSandbox> CreateSandboxAsync(AzureDevComputeResourceScope scope, AzureDevComputeSandboxRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3506public Task<AzureDevComputeSandbox> SetLifecycleAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeSandboxLifecyclePolicy lifecycle, CancellationToken cancellationToken) => throw new NotSupportedException();
3507public Task<List<AzureDevComputeSandboxPort>> AddPortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeAddPortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3508public Task<List<AzureDevComputeSandboxPort>> RemovePortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeRemovePortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3518public Task<List<AzureDevComputeSandboxPort>> RemovePortAsync(
3536public Task<List<AzureDevComputeSandbox>> ListSandboxesAsync(AzureDevComputeResourceScope scope, string? labels, CancellationToken cancellationToken) => throw new NotSupportedException();
3537public Task<List<AzureDevComputeDiskImage>> ListDiskImagesAsync(AzureDevComputeResourceScope scope, string? labels, CancellationToken cancellationToken) => throw new NotSupportedException();
3538public Task<AzureDevComputeDiskImage> CreateDiskImageAsync(AzureDevComputeResourceScope scope, AzureDevComputeCreateDiskImageRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3539public Task<AzureDevComputeDiskImage> GetDiskImageAsync(AzureDevComputeResourceScope scope, string diskImageId, CancellationToken cancellationToken) => throw new NotSupportedException();
3545public Task<AzureDevComputeSandbox> CreateSandboxAsync(AzureDevComputeResourceScope scope, AzureDevComputeSandboxRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3546public Task<AzureDevComputeSandbox> SetLifecycleAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeSandboxLifecyclePolicy lifecycle, CancellationToken cancellationToken) => throw new NotSupportedException();
3547public Task<List<AzureDevComputeSandboxPort>> AddPortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeAddPortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3554public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default) => throw new NotSupportedException();
3560private sealed class RecordingHandler(Func<HttpRequestMessage, Task<HttpResponseMessage>> handler) : HttpMessageHandler
3562protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
3616public override Task<int> ReadAsync(
ProvisioningTestHelpers.cs (24)
213private readonly Func<string, string, CancellationToken, Task<IEnumerable<string>>>? _supportedLocationsProvider;
249Func<string, string, CancellationToken, Task<IEnumerable<string>>>? supportedLocationsProvider = null)
279public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
298public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
307public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
316public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
328public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
347public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
359public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
370public async Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
389public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
402public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
419public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
582public Task<Response<IResourceGroupResource>> GetAsync(string resourceGroupName, CancellationToken cancellationToken = default)
607public Task<ArmOperation<IResourceGroupResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceGroupName, ResourceGroupData data, CancellationToken cancellationToken = default)
670public Task<ArmOperation> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
701public Task<ArmOperation<RoleAssignmentResource>> CreateOrUpdateAsync(
742public Task<ArmOperation<ArmDeploymentResource>> CreateOrUpdateAsync(
1021public Task<string> CompileBicepToArmAsync(string bicepFilePath, CancellationToken cancellationToken = default)
1038public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
1046public Task<DeploymentStateSection> AcquireCurrentSectionAsync(string sectionName, CancellationToken cancellationToken = default)
1065public Task<AzurePrincipal> GetPrincipalAsync(CancellationToken cancellationToken = default)
1103public (Task<ProcessResult>, IAsyncDisposable) Run(ProcessSpec processSpec)
1114var resultTask = Task.FromResult(result);
tests\Shared\TestInteractionService.cs (8)
27public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
32public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
37public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
45public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
60public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
67public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
76public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
90var completionTask = data.CompletionTcs.Task;
Aspire.Hosting.Blazor (8)
Aspire.Hosting.Blazor.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.Browsers (77)
BrowserHostRegistry.cs (5)
20private readonly Func<BrowserConfiguration, BrowserHostIdentity, BrowserLogsUserDataDirectory, CancellationToken, Task<IBrowserHost>> _createHostAsync;
41Func<BrowserConfiguration, BrowserHostIdentity, BrowserLogsUserDataDirectory, CancellationToken, Task<IBrowserHost>>? createHostAsync,
52public async Task<BrowserHostLease> AcquireAsync(BrowserConfiguration configuration, CancellationToken cancellationToken)
209private async Task<bool> TryWaitForLockAsync(CancellationToken cancellationToken)
292private async Task<IBrowserHost> CreateHostCoreAsync(
BrowserLogsCdpConnection.cs (21)
16Task<BrowserLogsCreateTargetResult> CreateTargetAsync(CancellationToken cancellationToken);
18Task<BrowserLogsGetTargetsResult> GetTargetsAsync(CancellationToken cancellationToken);
20Task<BrowserLogsAttachToTargetResult> AttachToTargetAsync(string targetId, CancellationToken cancellationToken);
22Task<BrowserLogsCommandAck> CloseTargetAsync(string targetId, CancellationToken cancellationToken);
24Task<BrowserLogsCommandAck> EnableTargetDiscoveryAsync(CancellationToken cancellationToken);
28Task<BrowserLogsCaptureScreenshotResult> CaptureScreenshotAsync(string sessionId, CancellationToken cancellationToken);
30Task<BrowserLogsCommandAck> NavigateAsync(string sessionId, Uri url, CancellationToken cancellationToken);
67public static async Task<BrowserLogsCdpConnection> ConnectAsync(
81internal static async Task<BrowserLogsCdpConnection> ConnectAsync(
107public Task<BrowserLogsCreateTargetResult> CreateTargetAsync(CancellationToken cancellationToken)
117public Task<BrowserLogsGetTargetsResult> GetTargetsAsync(CancellationToken cancellationToken)
127public Task<BrowserLogsAttachToTargetResult> AttachToTargetAsync(string targetId, CancellationToken cancellationToken)
141public Task<BrowserLogsCommandAck> CloseTargetAsync(string targetId, CancellationToken cancellationToken)
151public Task<BrowserLogsCommandAck> EnableTargetDiscoveryAsync(CancellationToken cancellationToken)
176public Task<BrowserLogsCaptureScreenshotResult> CaptureScreenshotAsync(string sessionId, CancellationToken cancellationToken)
191public Task<BrowserLogsCommandAck> NavigateAsync(string sessionId, Uri url, CancellationToken cancellationToken)
225private async Task<TResult> SendCommandAsync<TResult>(
361public Task<TResult> Task => _taskCompletionSource.Task;
442Task<byte[]> ReceiveAsync(CancellationToken cancellationToken);
455public async Task<byte[]> ReceiveAsync(CancellationToken cancellationToken)
534public async Task<byte[]> ReceiveAsync(CancellationToken cancellationToken)
Aspire.Hosting.Browsers.Tests (136)
src\Aspire.Hosting.Browsers\BrowserHostRegistry.cs (5)
20private readonly Func<BrowserConfiguration, BrowserHostIdentity, BrowserLogsUserDataDirectory, CancellationToken, Task<IBrowserHost>> _createHostAsync;
41Func<BrowserConfiguration, BrowserHostIdentity, BrowserLogsUserDataDirectory, CancellationToken, Task<IBrowserHost>>? createHostAsync,
52public async Task<BrowserHostLease> AcquireAsync(BrowserConfiguration configuration, CancellationToken cancellationToken)
209private async Task<bool> TryWaitForLockAsync(CancellationToken cancellationToken)
292private async Task<IBrowserHost> CreateHostCoreAsync(
src\Aspire.Hosting.Browsers\BrowserLogsCdpConnection.cs (21)
16Task<BrowserLogsCreateTargetResult> CreateTargetAsync(CancellationToken cancellationToken);
18Task<BrowserLogsGetTargetsResult> GetTargetsAsync(CancellationToken cancellationToken);
20Task<BrowserLogsAttachToTargetResult> AttachToTargetAsync(string targetId, CancellationToken cancellationToken);
22Task<BrowserLogsCommandAck> CloseTargetAsync(string targetId, CancellationToken cancellationToken);
24Task<BrowserLogsCommandAck> EnableTargetDiscoveryAsync(CancellationToken cancellationToken);
28Task<BrowserLogsCaptureScreenshotResult> CaptureScreenshotAsync(string sessionId, CancellationToken cancellationToken);
30Task<BrowserLogsCommandAck> NavigateAsync(string sessionId, Uri url, CancellationToken cancellationToken);
67public static async Task<BrowserLogsCdpConnection> ConnectAsync(
81internal static async Task<BrowserLogsCdpConnection> ConnectAsync(
107public Task<BrowserLogsCreateTargetResult> CreateTargetAsync(CancellationToken cancellationToken)
117public Task<BrowserLogsGetTargetsResult> GetTargetsAsync(CancellationToken cancellationToken)
127public Task<BrowserLogsAttachToTargetResult> AttachToTargetAsync(string targetId, CancellationToken cancellationToken)
141public Task<BrowserLogsCommandAck> CloseTargetAsync(string targetId, CancellationToken cancellationToken)
151public Task<BrowserLogsCommandAck> EnableTargetDiscoveryAsync(CancellationToken cancellationToken)
176public Task<BrowserLogsCaptureScreenshotResult> CaptureScreenshotAsync(string sessionId, CancellationToken cancellationToken)
191public Task<BrowserLogsCommandAck> NavigateAsync(string sessionId, Uri url, CancellationToken cancellationToken)
225private async Task<TResult> SendCommandAsync<TResult>(
361public Task<TResult> Task => _taskCompletionSource.Task;
442Task<byte[]> ReceiveAsync(CancellationToken cancellationToken);
455public async Task<byte[]> ReceiveAsync(CancellationToken cancellationToken)
534public async Task<byte[]> ReceiveAsync(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)
tests\Shared\TestInteractionService.cs (8)
27public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
32public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
37public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
45public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
60public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
67public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
76public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
90var completionTask = data.CompletionTcs.Task;
Aspire.Hosting.CodeGeneration.Go.Tests (7)
Aspire.Hosting.CodeGeneration.Java.Tests (12)
Aspire.Hosting.CodeGeneration.Python.Tests (9)
Aspire.Hosting.CodeGeneration.Rust.Tests (7)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (7)
Aspire.Hosting.Containers.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.DevTunnels (45)
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 virtual Task<int> CreateTunnelAsync(
72public virtual Task<int> UpdateTunnelAsync(
90public Task<int> ListPortsAsync(
103public Task<int> ListAccessAsync(
118public Task<int> ResetAccessAsync(
133public Task<int> CreateAccessAsync(
157public Task<int> DeleteTunnelAsync(
165public Task<int> ShowTunnelAsync(
173public Task<int> CreatePortAsync(
192public Task<int> UpdatePortAsync(
211public Task<int> DeletePortAsync(
220protected virtual Task<int> RunAsync(string[] args, TextWriter? outputWriter = null, TextWriter? errorWriter = null, ILogger? logger = default, CancellationToken cancellationToken = default)
223private Task<int> RunAsync(string[] args, TextWriter? outputWriter = null, TextWriter? errorWriter = null, bool useShellExecute = false, ILogger? logger = default, CancellationToken cancellationToken = default)
238private async Task<int> RunAsync(Action<bool, string> onOutput, string[] args, bool useShellExecute = false, ILogger? logger = default, CancellationToken cancellationToken = default)
DevTunnelCliClient.cs (13)
32public async Task<Version> GetVersionAsync(ILogger? logger = default, CancellationToken cancellationToken = default)
66public async Task<DevTunnelStatus> CreateTunnelAsync(string tunnelId, DevTunnelOptions options, ILogger? logger = default, CancellationToken cancellationToken = default)
156public async Task<DevTunnelStatus> GetTunnelAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default)
166public async Task<DevTunnelPortList> GetPortListAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default)
175public async Task<DevTunnelPortStatus> CreatePortAsync(string tunnelId, int portNumber, DevTunnelPortOptions portOptions, ILogger? logger = default, CancellationToken cancellationToken = default)
244public async Task<DevTunnelPortDeleteResult> DeletePortAsync(string tunnelId, int portNumber, ILogger? logger = default, CancellationToken cancellationToken = default)
253public async Task<DevTunnelAccessStatus> GetAccessAsync(string tunnelId, int? portNumber = null, ILogger? logger = default, CancellationToken cancellationToken = default)
262public async Task<UserLoginStatus> GetUserLoginStatusAsync(ILogger? logger = default, CancellationToken cancellationToken = default)
271public async Task<UserLoginStatus> UserLoginAsync(LoginProvider provider, ILogger? logger = default, CancellationToken cancellationToken = default)
290private async Task<(T? Result, int ExitCode, string? Error)> CallCliAsJsonAsync<T>(Func<TextWriter, TextWriter, ILogger?, CancellationToken, Task<int>> cliCall, ILogger? logger = default, CancellationToken cancellationToken = default)
295private 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 (32)
TestDevTunnelClient.cs (9)
26public Task<Version> GetVersionAsync(ILogger? logger = null, CancellationToken cancellationToken = default)
32public Task<UserLoginStatus> GetUserLoginStatusAsync(ILogger? logger = null, CancellationToken cancellationToken = default)
38public Task<UserLoginStatus> UserLoginAsync(LoginProvider provider, ILogger? logger = null, CancellationToken cancellationToken = default)
44public Task<DevTunnelStatus> CreateTunnelAsync(string tunnelId, DevTunnelOptions options, ILogger? logger = null, CancellationToken cancellationToken = default)
50public Task<DevTunnelPortList> GetPortListAsync(string tunnelId, ILogger? logger = null, CancellationToken cancellationToken = default)
56public Task<DevTunnelPortStatus> CreatePortAsync(string tunnelId, int portNumber, DevTunnelPortOptions options, ILogger? logger = null, CancellationToken cancellationToken = default)
62public Task<DevTunnelPortDeleteResult> DeletePortAsync(string tunnelId, int portNumber, ILogger? logger = null, CancellationToken cancellationToken = default)
68public Task<DevTunnelStatus> GetTunnelAsync(string tunnelId, ILogger? logger = null, CancellationToken cancellationToken = default)
74public Task<DevTunnelAccessStatus> GetAccessAsync(string tunnelId, int? portNumber = null, 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)
tests\Shared\TestInteractionService.cs (8)
27public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
32public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
37public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
45public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
60public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
67public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
76public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
90var completionTask = data.CompletionTcs.Task;
Aspire.Hosting.Docker (4)
Aspire.Hosting.Docker.Tests (5)
Aspire.Hosting.Dotnet (21)
DotnetProjectBuildCoordinator.cs (9)
964private Task<IReadOnlyDictionary<string, string>> EvaluateOnceAsync(
982var precedingEvaluation =
1004private async Task<IReadOnlyDictionary<string, string>> WaitForEvaluationAsync(
1068private async Task<IReadOnlyDictionary<string, string>> EvaluateAsync(
1070Task<IReadOnlyDictionary<string, string>>? precedingEvaluation,
1286Task<IReadOnlyDictionary<string, string>>? precedingEvaluation)
1288public Task<IReadOnlyDictionary<string, string>>? PrecedingEvaluation { get; } = precedingEvaluation;
1296Task<IReadOnlyDictionary<string, string>> task,
1299public Task<IReadOnlyDictionary<string, string>> Task { get; } = task;
Aspire.Hosting.Dotnet.Tests (24)
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.DotnetTool.Tests (9)
Aspire.Hosting.EntityFrameworkCore (18)
EFCoreOperationExecutor.cs (9)
197private async Task<EFOperationResult> ExecuteEfCommandAsync(string command, string subCommand, Dictionary<string, string?>? additionalArgs = null, bool noBuild = true)
531public async Task<EFOperationResult> UpdateDatabaseAsync()
537public async Task<EFOperationResult> DropDatabaseAsync()
546public async Task<EFOperationResult> ResetDatabaseAsync()
563public async Task<EFOperationResult> AddMigrationAsync(string? migrationName = null, string? outputDir = null, string? @namespace = null)
586public async Task<EFOperationResult> RemoveMigrationAsync()
595public async Task<EFOperationResult> GetDatabaseStatusAsync()
697public async Task<EFOperationResult> GenerateMigrationScriptAsync(string? outputPath = null, bool idempotent = true, bool noTransactions = false)
728public async Task<EFOperationResult> GenerateMigrationBundleAsync(string? outputPath = null, string? targetRuntime = null, bool selfContained = false)
Aspire.Hosting.EntityFrameworkCore.Tests (2)
Aspire.Hosting.Foundry (53)
FoundryLocalService.cs (15)
58public static async Task<string> DownloadModelAsync(string modelName, Action<float> downloadProgress, CancellationToken cancellationToken)
73public static async Task<string?> TryLoadCachedModelAsync(string modelName, CancellationToken cancellationToken)
110public static Task<bool> IsModelLoadedAsync(Uri endpoint, string modelId, HttpClient httpClient, CancellationToken cancellationToken)
112Func<CancellationToken, Task<string>>? legacyModelListProvider = null;
122internal static async Task<bool> IsModelLoadedCoreAsync(
126Func<CancellationToken, Task<string>>? legacyModelListProvider,
349private static async Task<string> RunFoundryCommandAsync(
370private static async Task<FoundryCommandResult> RunFoundryCommandCoreAsync(
391internal static async Task<FoundryCommandResult> RunProcessAsync(
418var outputTask = ReadOutputAsync(process.StandardOutput, ProcessOutput, cancellationToken, readCancellation.Token);
419var errorTask = ReadOutputAsync(process.StandardError, ProcessOutput, cancellationToken, readCancellation.Token);
434var readersCompletionTask = Task.WhenAll(outputTask, errorTask);
468private static async Task<string> ReadOutputAsync(
508private static async Task<string> GetModelIdAsync(string modelName, CancellationToken cancellationToken)
720private static async Task<string> GetDaemonVerbAsync(CancellationToken cancellationToken)
Aspire.Hosting.Foundry.Tests (18)
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.Go.Tests (1)
Aspire.Hosting.Java.Tests (14)
Aspire.Hosting.JavaScript.Tests (22)
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 (22)
Aspire.Hosting.Kubernetes.Tests (9)
Aspire.Hosting.Maui (6)
Aspire.Hosting.Maui.Tests (20)
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.MongoDB (1)
Aspire.Hosting.MongoDB.Tests (1)
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.Orleans.Tests (1)
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.Python.Tests (1)
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.Radius (22)
Publishing\SealedSecretApplyStep.cs (15)
268Func<CancellationToken, Task<SealedSecretStatusSnapshot>> getStatus,
269Func<CancellationToken, Task<bool>> secretExists,
317internal static async Task<T> InvokeProbeWithRemainingBudgetAsync<T>(
318Func<CancellationToken, Task<T>> probe,
484private static async Task<long> ApplyManifestAsync(ReadOnlyMemory<byte> content, string? @namespace, string? kubeContext, string storeName, string ns, string name, string manifestPath, ILogger logger, CancellationToken cancellationToken)
497private static async Task<SealedSecretStatusSnapshot> GetSealedSecretStatusAsync(string ns, string name, string? kubeContext, CancellationToken cancellationToken)
508internal static async Task<SealedSecretStatusSnapshot> GetSealedSecretStatusAsync(
513Func<IReadOnlyList<string>, CancellationToken, Task<(int ExitCode, string StdOut, string StdErr)>> runKubectl)
580private static async Task<IReadOnlySet<string>> GetSecretDataKeysAsync(string ns, string name, string? kubeContext, CancellationToken cancellationToken)
616private static async Task<bool> SecretExistsAsync(string ns, string name, string? kubeContext, CancellationToken cancellationToken)
626internal static async Task<bool> SecretExistsAsync(
631Func<IReadOnlyList<string>, CancellationToken, Task<(int ExitCode, string StdOut, string StdErr)>> runKubectl)
676private static async Task<string?> ResolveWorkspaceKubeContextAsync(string configPath, CancellationToken cancellationToken)
828private static async Task<bool> DetectKubectlAsync(CancellationToken cancellationToken)
883private static async Task<(int ExitCode, string StdOut, string StdErr)> RunKubectlAsync(
Aspire.Hosting.Radius.Tests (1)
Aspire.Hosting.Redis.Tests (1)
Aspire.Hosting.RemoteHost (13)
Aspire.Hosting.RemoteHost.Tests (25)
tests\Shared\TestInteractionService.cs (8)
27public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
32public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
37public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
45public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
60public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
67public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
76public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
90var completionTask = data.CompletionTcs.Task;
Aspire.Hosting.Rust (6)
CargoMetadataReader.cs (4)
18Task<CargoMetadata> ReadAsync(string workingDirectory, string? manifestPath, string resourceName, IReadOnlyDictionary<string, string> environment, CancellationToken cancellationToken);
63public async Task<CargoMetadata> ReadAsync(string workingDirectory, string? manifestPath, string resourceName, IReadOnlyDictionary<string, string> environment, CancellationToken cancellationToken)
98var stdoutTask = process.StandardOutput.ReadToEndAsync(CancellationToken.None);
99var stderrTask = process.StandardError.ReadToEndAsync(CancellationToken.None);
Aspire.Hosting.Rust.Tests (12)
Aspire.Hosting.Sdk.Tests (19)
AppHostSdkTargetsTests.cs (19)
880Task<bool>? executionTask = null;
1066private static async Task<string[]> RunAddReferenceToDashboardAndDcpAsync(TemporaryWorkspace workspace, string? extraProjectXml)
1109private static async Task<RunHookProject> CreateRunHookProjectAsync(
1158private static async Task<Dictionary<string, string>> GetComputeRunArgumentsPropertiesAsync(
1171private static async Task<Dictionary<string, string>> GetResolveAspireCliBundlePathPropertiesAsync(
1184private static async Task<Dictionary<string, string>> GetTargetPropertiesAsync(
1219private static async Task<string> CreateFakeAspireCliAsync(string fakeCliDirectory)
1240private static async Task<string> CreateFakeAspireCliThatSetsUpBundleAsync(string fakeCliDirectory)
1291private static async Task<string> CreateFakeAspireCommandShimAsync(string fakeCliDirectory, string extension = ".cmd")
1327private static async Task<string> CreateFakeDnxAsync(string fakeCliDirectory)
1414private static async Task<string> CreateFailingWorkingDirectoryShadowAsync(string workingDirectory, string command)
1632private static async Task<string?> FindFullFrameworkMSBuildAsync()
1812private static async Task<(int ExitCode, string Output)> RunDotNetAsync(string workingDirectory, string arguments)
1825var outputTask = process.StandardOutput.ReadToEndAsync();
1826var errorTask = process.StandardError.ReadToEndAsync();
1846private static Task<DotNetResult> RunDotNetWithArgumentsAsync(string workingDirectory, string[] arguments, IDictionary<string, string>? environment = null)
1849private static async Task<DotNetResult> RunProcessWithArgumentsAsync(
1884var outputTask = process.StandardOutput.ReadToEndAsync();
1885var errorTask = process.StandardError.ReadToEndAsync();
Aspire.Hosting.Tasks (7)
Aspire.Hosting.Testing (22)
DistributedApplicationTestingBuilder.cs (14)
37public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(CancellationToken cancellationToken = default)
66public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(
86public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, CancellationToken cancellationToken = default)
112public static Task<IDistributedApplicationTestingBuilder> CreateAsync(
135public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(string[] args, CancellationToken cancellationToken = default)
149public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, CancellationToken cancellationToken = default)
165public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder, CancellationToken cancellationToken = default)
179public static async Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder, CancellationToken cancellationToken = default)
182private static async Task<IDistributedApplicationTestingBuilder> CreateAsyncCore(
474public async Task<IDistributedApplicationTestingBuilder> CreateBuilderAsync(CancellationToken cancellationToken)
496public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
540public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
707public Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
805Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken = default);
Aspire.Hosting.Testing.Tests (20)
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.Tests (191)
Dcp\TestKubernetesService.cs (6)
47public Task<T> GetAsync<T>(string name, string? namespaceParameter = null, CancellationToken _ = default) where T : CustomResource, IKubernetesStaticMetadata
68public Task<T> CreateAsync<T>(T obj, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
253public async Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
273public Task<List<T>> ListAsync<T>(string? namespaceParameter = null, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
316public Task<Stream> GetLogStreamAsync<T>(
331public Task<T> PatchAsync<T>(T obj, V1Patch patch, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
InteractionServiceTests.cs (29)
27var resultTask = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
52var resultTask = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation", cancellationToken: cts.Token);
76var resultTask1 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
77var resultTask2 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
78var resultTask3 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
136var resultTask1 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
140var resultTask2 = interactionService.PromptConfirmationAsync("Are you sure?", "Confirmation");
363var resultTask = interactionService.PromptInputAsync(
400var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
423var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
446var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
467var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
490var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
523var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
861var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
926var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
981var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
1044var resultTask = interactionService.PromptInputsAsync("Validation Test", "Test validation", inputs, options);
1157var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions
1190var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions
1224var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions
1257var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions { Title = "Working..." }, cancellationToken: cts.Token);
1276var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions
1298var resultTask = interactionService.PromptProgressAsync("Please wait...", cancellationToken: cts.Token);
1353var resultTask = interactionService.PromptInputAsync("Select file", "please", input);
1382var resultTask = interactionService.PromptInputAsync("Select file", "please", input);
1407var resultTask = interactionService.PromptInputAsync("Select file", "please", input, cancellationToken: cancellationTokenSource.Token);
1426var resultTask = interactionService.PromptInputAsync("Enter text", "please", input);
1450var resultTask = interactionService.PromptInputAsync("Enter text", "please", input);
Orchestrator\ParameterProcessorTests.cs (7)
336var logsTask = ConsoleLoggingTestHelpers.WatchForLogsAsync(loggerService, 1, parameterWithMissingValue);
360var logsTask = ConsoleLoggingTestHelpers.WatchForLogsAsync(loggerService, 1, parameterWithError);
391var logsTask = ConsoleLoggingTestHelpers.WatchForLogsAsync(loggerService, 1, parameter);
1304public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
1309public Task<DeploymentStateSection> AcquireCurrentSectionAsync(string sectionName, CancellationToken cancellationToken = default)
1661public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
1671public Task<DeploymentStateSection> AcquireCurrentSectionAsync(string sectionName, CancellationToken cancellationToken = default)
Publishing\PipelineActivityReporterTests.cs (6)
571var promptTask = _interactionService.PromptInputAsync("Test Prompt", "test-description", "text-label", "test-placeholder");
596var promptTask = _interactionService.PromptInputAsync("Test Prompt", "test-description", "text-label", "test-placeholder");
625var promptTask = _interactionService.PromptInputAsync("Test Prompt", "test-description", "text-label", "test-placeholder");
657var promptTask = _interactionService.PromptInputAsync("Upload", "Select a file", input);
697var promptTask = _interactionService.PromptInputAsync("Upload", "Select a file", input, cancellationToken: cancellationTokenSource.Token);
724var 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 (8)
27public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
32public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
37public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
45public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
60public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
67public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
76public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
90var completionTask = data.CompletionTcs.Task;
Aspire.Hosting.TestUtilities (29)
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
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.Managed.Tests (6)
Aspire.Microsoft.Azure.Cosmos (1)
Aspire.Milvus.Client (1)
Aspire.NATS.Net (2)
Aspire.OpenAI.Tests (2)
Aspire.Playground.Tests (16)
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)
Aspire.TerminalHost (8)
Aspire.TerminalHost.Tests (27)
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.TestTools (13)
Aspire.TestUtilities (1)
AzureFunctionsEndToEnd.Functions (1)
AzureFunctionsWithDts.Functions (1)
BasketService (14)
Binding.Http.IntegrationTests (3)
Binding.ReliableSession.IntegrationTests (10)
blazor-gateway (1)
BlazorHosted.ClientServiceDefaults (1)
BlazorStandalone.ClientServiceDefaults (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-aot (48)
parent\dotnet\NugetPackageDownloader\NuGetPackageDownloader.cs (22)
157public async Task<string> DownloadPackageAsync(PackageId packageId,
299public async Task<string> GetPackageUrl(PackageId packageId,
322public async Task<IEnumerable<string>> ExtractPackageAsync(string packagePath, DirectoryPath targetFolder)
373public async Task<IEnumerable<IPackageSearchMetadata>> GetLatestVersionsOfPackage(string packageId, bool includePreview, int numberOfResults)
379private async Task<(PackageSource, NuGetVersion)> GetPackageSourceAndVersion(PackageId packageId,
640private async Task<(PackageSource, IPackageSearchMetadata)> GetMatchingVersionInternalAsync(
721private async Task<(PackageSource, IPackageSearchMetadata)> GetLatestVersionInternalAsync(
728private async Task<IEnumerable<(PackageSource, IPackageSearchMetadata)>> GetLatestVersionsInternalAsync(
795public async Task<NuGetVersion> GetBestPackageVersionAsync(PackageId packageId,
809public async Task<(NuGetVersion version, PackageSource source)> GetBestPackageVersionAndSourceAsync(PackageId packageId,
823private async Task<(PackageSource, IPackageSearchMetadata)> GetPackageMetadataAsync(string packageIdentifier,
838List<Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)>> tasks = [.. sources
870foreach (Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)> task in tasks)
883Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)> finishedTask =
906private async Task<(PackageSource source, IEnumerable<IPackageSearchMetadata> foundPackages)>
948public async Task<NuGetVersion> GetLatestPackageVersion(PackageId packageId,
955public async Task<IEnumerable<NuGetVersion>> GetLatestPackageVersions(PackageId packageId, int numberOfResults, PackageSourceLocation packageSourceLocation = null, bool includePreview = false)
965public async Task<IEnumerable<string>> GetPackageIdsAsync(string idStem, bool allowPrerelease, PackageSourceLocation packageSourceLocation = null, CancellationToken cancellationToken = default)
980public async Task<IEnumerable<NuGetVersion>> GetPackageVersionsAsync(PackageId packageId, string versionPrefix = null, bool allowPrerelease = false, PackageSourceLocation packageSourceLocation = null, CancellationToken cancellationToken = default)
994private async Task<IEnumerable<AutoCompleteResource>> GetAutocompleteAsync(PackageSource source, CancellationToken cancellationToken)
1007private async Task<IEnumerable<NuGetVersion>> GetPackageVersionsForSource(AutoCompleteResource autocomplete, PackageId packageId, string versionPrefix, bool allowPrerelease, CancellationToken cancellationToken)
1026private 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)
DotNetInvocationHostedAgent (2)
GenerateDocumentationAndConfigFiles (180)
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 (2)
ILLink.RoslynAnalyzer (1)
Infrastructure.Common (3)
Infrastructure.Tests (91)
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 (16)
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 (17)
OpenIdConnectHandler.cs (15)
87protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new OpenIdConnectEvents());
90public override Task<bool> HandleRequestAsync()
113protected virtual async Task<bool> HandleRemoteSignOutAsync()
321protected virtual async Task<bool> HandleSignOutCallbackAsync()
613private async Task<string> GetPushedAuthorizationRequestUri(HttpResponseMessage parResponseMessage)
638protected override async Task<HandleRequestResult> HandleRemoteAuthenticateAsync()
993protected virtual async Task<OpenIdConnectMessage> RedeemAuthorizationCodeAsync(OpenIdConnectMessage tokenEndpointRequest)
1046protected virtual async Task<HandleRequestResult> GetUserInformationAsync(
1215private async Task<MessageReceivedContext> RunMessageReceivedEventAsync(OpenIdConnectMessage message, AuthenticationProperties? properties)
1239private async Task<TokenValidatedContext> RunTokenValidatedEventAsync(OpenIdConnectMessage authorizationResponse, OpenIdConnectMessage? tokenEndpointResponse, ClaimsPrincipal user, AuthenticationProperties properties, JwtSecurityToken jwt, string? nonce)
1265private async Task<AuthorizationCodeReceivedContext> RunAuthorizationCodeReceivedEventAsync(OpenIdConnectMessage authorizationResponse, ClaimsPrincipal? user, AuthenticationProperties properties, JwtSecurityToken? jwt)
1311private async Task<TokenResponseReceivedContext> RunTokenResponseReceivedEventAsync(
1340private async Task<UserInformationReceivedContext> RunUserInformationReceivedEventAsync(ClaimsPrincipal principal, AuthenticationProperties properties, OpenIdConnectMessage message, JsonDocument user)
1366private async Task<AuthenticationFailedContext> RunAuthenticationFailedEventAsync(OpenIdConnectMessage message, Exception exception)
1448private 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.AI (4)
Microsoft.AspNetCore.Components.Analyzers (4)
Microsoft.AspNetCore.Components.Authorization (17)
Microsoft.AspNetCore.Components.Endpoints (23)
CacheView\CacheViewService.cs (9)
84public async Task<CacheViewRenderState?> PrepareAsync(CacheView cacheView, HttpContext httpContext)
164var pending = state.PendingStoreTask;
195var pending = state.PendingStoreTask;
254private async Task ApplyDuplicateResolutionAsync(CacheViewRenderState state, string key, Task<SerializedRenderFragment?> resolution)
293var inflight = _store.GetOrCreateAsync(
348private async Task ObserveCacheStorePersistAsync(string key, Task<SerializedRenderFragment> pending)
364private static Dictionary<string, (CacheView Owner, Task<SerializedRenderFragment?> Task)> GetInFlightResolutions(HttpContext httpContext)
366if (httpContext.Items[_inFlightResolutionsItemKey] is not Dictionary<string, (CacheView Owner, Task<SerializedRenderFragment?> Task)> resolutions)
368resolutions = 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 (14)
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 (9)
Microsoft.AspNetCore.HeaderPropagation (1)
Microsoft.AspNetCore.Http (11)
Microsoft.AspNetCore.Http.Abstractions (6)
Microsoft.AspNetCore.Http.Connections (24)
Internal\HttpConnectionContext.cs (13)
63private Func<AuthenticationRefreshContext, Task<bool>> _onAuthenticationRefresh = DefaultOnAuthenticationRefreshAsync;
151public Task<bool>? TransportTask { get; set; }
262public Func<AuthenticationRefreshContext, Task<bool>> OnAuthenticationRefresh
322internal async Task<UserUpdateResult> UpdateUserAsync(
326Func<AuthenticationRefreshContext, Task<bool>>? additionalAuthenticationRefresh = null,
331Func<AuthenticationRefreshContext, Task<bool>> callback;
451Func<AuthenticationRefreshContext, Task<bool>> callback,
465Func<AuthenticationRefreshContext, Task<bool>> callback)
470private async Task<bool> InvokeOnAuthenticationRefreshAsync(Func<AuthenticationRefreshContext, Task<bool>> callback, AuthenticationRefreshContext context)
491private static Task<bool> DefaultOnAuthenticationRefreshAsync(AuthenticationRefreshContext context)
840async Task<bool> Func()
902internal async Task<bool> CancelPreviousPoll(HttpContext context)
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 (127)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\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 (47)
133public virtual async Task<ClaimsPrincipal> CreateUserPrincipalAsync(TUser user) => await ClaimsFactory.CreateAsync(user);
155public virtual async Task<bool> CanSignInAsync(TUser user)
201private async Task<(bool success, bool? isPersistent)> RefreshSignInCoreAsync(TUser user)
347public virtual async Task<TUser?> ValidateSecurityStampAsync(ClaimsPrincipal? principal)
370public virtual async Task<TUser?> ValidateTwoFactorSecurityStampAsync(ClaimsPrincipal? principal)
392public virtual async Task<bool> ValidateSecurityStampAsync(TUser? user, string? securityStamp)
407public virtual async Task<SignInResult> PasswordSignInAsync(TUser user, string password,
440public virtual async Task<SignInResult> PasswordSignInAsync(string userName, string password,
462public virtual async Task<SignInResult> CheckPasswordSignInAsync(TUser user, string password, bool lockoutOnFailure)
480private async Task<SignInResult> CheckPasswordSignInCoreAsync(TUser user, string password, bool lockoutOnFailure)
536public virtual async Task<string> MakePasskeyCreationOptionsAsync(PasskeyUserEntity userEntity)
564public virtual async Task<string> MakePasskeyCreationOptionsAsync(PasskeyUserEntity userEntity, bool isConditionallyMediated)
585public virtual async Task<string> MakePasskeyRequestOptionsAsync(TUser? user)
642public virtual async Task<string> MakeAllAcceptedCredentialsSignalOptionsAsync(TUser user)
688public virtual async Task<string> MakeCurrentUserDetailsSignalOptionsAsync(TUser user, PasskeyUserEntity userEntity)
721public virtual async Task<string?> MakeUnknownCredentialSignalOptionsAsync(string credentialJson)
742public virtual async Task<PasskeyAttestationResult> PerformPasskeyAttestationAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
786public virtual async Task<PasskeyAssertionResult<TUser>> PerformPasskeyAssertionAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
829public virtual async Task<SignInResult> PasskeySignInAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
846private async Task<SignInResult> PasskeySignInCoreAsync(string credentialJson)
907private async Task<PasskeyAuthenticationInfo?> RetrievePasskeyAuthenticationInfoAsync()
911async Task<PasskeyAuthenticationInfo?> RetrievePasskeyInfoCoreAsync()
944public virtual async Task<bool> IsTwoFactorClientRememberedAsync(TUser user)
1002public virtual async Task<SignInResult> TwoFactorRecoveryCodeSignInAsync(string recoveryCode)
1019private async Task<SignInResult> TwoFactorRecoveryCodeSignInCoreAsync(string recoveryCode)
1037private async Task<SignInResult> DoTwoFactorSignInAsync(TUser user, TwoFactorAuthenticationInfo twoFactorInfo, bool isPersistent, bool rememberClient)
1084public virtual async Task<SignInResult> TwoFactorAuthenticatorSignInAsync(string code, bool isPersistent, bool rememberClient)
1101private async Task<SignInResult> TwoFactorAuthenticatorSignInCoreAsync(string code, bool isPersistent, bool rememberClient)
1149public virtual async Task<SignInResult> TwoFactorSignInAsync(string provider, string code, bool isPersistent, bool rememberClient)
1166private async Task<SignInResult> TwoFactorSignInCoreAsync(string provider, string code, bool isPersistent, bool rememberClient)
1208public virtual async Task<TUser?> GetTwoFactorAuthenticationUserAsync()
1227public virtual Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent)
1239public virtual async Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1256private async Task<SignInResult> ExternalLoginSignInCoreAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1276public virtual async Task<IEnumerable<AuthenticationScheme>> GetExternalAuthenticationSchemesAsync()
1288public virtual async Task<ExternalLoginInfo?> GetExternalLoginInfoAsync(string? expectedXsrf = null)
1326public virtual async Task<IdentityResult> UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo externalLogin)
1375internal async Task<ClaimsPrincipal> StoreTwoFactorInfo(TUser user, string? loginProvider)
1392internal async Task<ClaimsPrincipal> StoreRememberClient(TUser user)
1412public virtual async Task<bool> IsTwoFactorEnabledAsync(TUser user)
1426protected virtual async Task<SignInResult> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
1465private async Task<TwoFactorAuthenticationInfo?> RetrieveTwoFactorInfoAsync()
1498protected virtual async Task<bool> IsLockedOut(TUser user)
1508protected virtual Task<SignInResult> LockedOut(TUser user)
1519protected virtual async Task<SignInResult?> PreSignInCheck(TUser user)
1551private async Task<IdentityResult> ResetLockoutWithResult(TUser user)
1568if (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)
parent\parent\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.DirectTls (6)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Microsoft.AspNetCore.SignalR.Client.Core (115)
HubConnection.cs (18)
385public virtual IDisposable On(string methodName, Type[] parameterTypes, Func<object?[], object, Task<object?>> handler, object state)
458/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
459/// The <see cref="Task{TResult}.Result"/> property returns a <see cref="ChannelReader{T}"/> for the streamed hub method values.
464public virtual async Task<ChannelReader<object?>> StreamAsChannelCoreAsync(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken = default)
480/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
481/// The <see cref="Task{TResult}.Result"/> property returns an <see cref="object"/> for the hub method return value.
486public virtual async Task<object?> InvokeCoreAsync(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken = default)
601public async Task<TimeSpan?> RefreshAuthenticationAsync(CancellationToken cancellationToken = default)
614private async Task<TimeSpan?> RefreshAuthenticationAsyncCore(ConnectionState connectionState, CancellationToken cancellationToken)
987private async Task<ChannelReader<object?>> StreamAsChannelCoreAsyncCore(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken)
1282private async Task<(ConnectionState, Activity?)> WaitForActiveConnectionWithActivityAsync(string sendingMethodName, string invokedMethodName, CancellationToken token)
1291var connectionStateTask = _state.WaitForActiveConnectionAsync(sendingMethodName, token);
1340private async Task<object?> InvokeCoreAsyncCore(string methodName, Type returnType, object?[] args, CancellationToken cancellationToken)
1348Task<object?> invocationTask;
1595private async Task<CloseMessage?> ProcessMessagesAsync(HubMessage message, ConnectionState connectionState, ChannelWriter<InvocationMessage> invocationMessageWriter)
1717if (handler.HasResult && task is Task<object?> resultTask)
2394public bool HasResult => _callback.Method.ReturnType == typeof(Task<object>);
2810public 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 (41)
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);
parent\parent\parent\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)
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,
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)
1006public async Task<BuildEngineResult> InternalBuildProjects(string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IList<String>[] undefineProperties, string[] toolsVersion, bool returnTargetOutputs, bool skipNonexistentTargets = false)
1179private 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 (10)
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 (211)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (5)
65private async Task<Document> ConvertToEqualsAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
80private async Task<Document> CallOverloadWithEqualityComparerAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
116private static async Task<Document> CallOverloadWithEqualityComparerAsync(Document document, SyntaxNode nodeToReplace, IMethodSymbol? methodSymbol,
187private async Task<Document> EnsureEqualsCorrectAsync(Document document, SemanticModel semanticModel, IInvocationOperation invocationOperation, CancellationToken cancellationToken)
257private static async Task<Document> ConvertToEqualsAsync(Document document, SemanticModel semanticModel, IBinaryOperation binaryOperation, CancellationToken cancellationToken)
src\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.BuildClient.Package (9)
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 (225)
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 (277)
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 (4)
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 (1290)
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,
682private 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 (3)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (24)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (3)
39Protected Overrides Async Function GetDescriptionAsync(diagnostic As Diagnostic, node As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of String)
44Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of (SyntaxTree As SyntaxTree, root As SyntaxNode)?)
57Private Shared Async Function GetMethodFromExpressionAsync(oldNode As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxNode, MethodBlockSyntax))
Microsoft.CodeAnalysis.VisualBasic.Features (134)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (3)
39Protected Overrides Async Function GetDescriptionAsync(diagnostic As Diagnostic, node As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of String)
44Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of (SyntaxTree As SyntaxTree, root As SyntaxNode)?)
57Private Shared Async Function GetMethodFromExpressionAsync(oldNode As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxNode, MethodBlockSyntax))
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (1)
Microsoft.CodeAnalysis.VisualBasic.Scripting (4)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (31)
CodeCleanup\Providers\AbstractTokensCodeCleanupProvider.vb (3)
20document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter)
22Public Async Function CleanupAsync(document As Document, spans As ImmutableArray(Of TextSpan), options As CodeCleanupOptions, cancellationToken As CancellationToken) As Task(Of Document) Implements ICodeCleanupProvider.CleanupAsync
30Public Async Function CleanupAsync(root As SyntaxNode, spans As ImmutableArray(Of TextSpan), options As SyntaxFormattingOptions, services As SolutionServices, cancellationToken As CancellationToken) As Task(Of SyntaxNode) Implements ICodeCleanupProvider.CleanupAsync
Microsoft.CodeAnalysis.Workspaces (864)
CodeActions\CodeAction_Cleanup.cs (12)
47private static readonly Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>> s_cleanupSyntaxPass =
50private static readonly ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> s_cleanupSyntaxPasses = [s_cleanupSyntaxPass];
56private static readonly ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> s_allCleanupPasses =
74internal static Task<Document> CleanupSyntaxAsync(Document document, CodeCleanupOptions options, CancellationToken cancellationToken)
91internal static async Task<Solution> PostProcessChangesAsync(
113private static async Task<Solution> CleanSyntaxAndSemanticsAsync(
117ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> passes,
129async Task<ImmutableArray<(DocumentId documentId, CodeCleanupOptions codeCleanupOptions)>> GetDocumentIdsAndOptionsToCleanAsync()
189private static async Task<Solution> RunCleanupPassesInOrderAsync(
193ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> passes,
205async Task<Solution> RunParallelCleanupPassAsync(
206Solution 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 (66)
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 (57)
Microsoft.Extensions.AI.Abstractions.Tests (29)
Files\DelegatingHostedFileClientTests.cs (4)
47var resultTask = delegating.UploadAsync(expectedStream, expectedMediaType, expectedFileName, expectedOptions, expectedCancellationToken);
73var resultTask = delegating.DownloadAsync(expectedFileId, expectedOptions, expectedCancellationToken);
101var resultTask = delegating.GetFileInfoAsync(expectedFileId, expectedOptions, expectedCancellationToken);
158var resultTask = delegating.DeleteAsync(expectedFileId, expectedOptions, expectedCancellationToken);
TestHostedFileClient.cs (8)
21public Func<Stream, string?, string?, HostedFileClientOptions?, CancellationToken, Task<HostedFileContent>>? UploadAsyncCallback { get; set; }
23public Func<string, HostedFileClientOptions?, CancellationToken, Task<HostedFileDownloadStream>>? DownloadAsyncCallback { get; set; }
25public Func<string, HostedFileClientOptions?, CancellationToken, Task<HostedFileContent?>>? GetFileInfoAsyncCallback { get; set; }
29public Func<string, HostedFileClientOptions?, CancellationToken, Task<bool>>? DeleteAsyncCallback { get; set; }
36public Task<HostedFileContent> UploadAsync(
44public Task<HostedFileDownloadStream> DownloadAsync(
50public Task<HostedFileContent?> GetFileInfoAsync(
61public Task<bool> DeleteAsync(
Microsoft.Extensions.AI.Evaluation (6)
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 (17)
Microsoft.Extensions.AI.OllamaSharp.Integration.Tests (1)
Microsoft.Extensions.AI.OpenAI (23)
OpenAIChatClient.cs (5)
34private static readonly Func<ChatClient, IEnumerable<OpenAI.Chat.ChatMessage>, ChatCompletionOptions, RequestOptions, Task<ClientResult<ChatCompletion>>>?
36(Func<ChatClient, IEnumerable<OpenAI.Chat.ChatMessage>, ChatCompletionOptions, RequestOptions, Task<ClientResult<ChatCompletion>>>?)
42typeof(Func<ChatClient, IEnumerable<OpenAI.Chat.ChatMessage>, ChatCompletionOptions, RequestOptions, Task<ClientResult<ChatCompletion>>>));
90public async Task<ChatResponse> GetResponseAsync(
101var task = _completeChatAsync is not null ?
OpenAIEmbeddingGenerator.cs (5)
25private static readonly Func<EmbeddingClient, IEnumerable<string>, OpenAI.Embeddings.EmbeddingGenerationOptions, RequestOptions, Task<ClientResult<OpenAIEmbeddingCollection>>>?
27(Func<EmbeddingClient, IEnumerable<string>, OpenAI.Embeddings.EmbeddingGenerationOptions, RequestOptions, Task<ClientResult<OpenAIEmbeddingCollection>>>?)
33typeof(Func<EmbeddingClient, IEnumerable<string>, OpenAI.Embeddings.EmbeddingGenerationOptions, RequestOptions, Task<ClientResult<OpenAIEmbeddingCollection>>>));
68public async Task<GeneratedEmbeddings<Embedding<float>>> GenerateAsync(IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
72var t = _generateEmbeddingsAsync is not null ?
Microsoft.Extensions.AI.OpenAI.Tests (8)
Microsoft.Extensions.AI.Templates.Tests (3)
Microsoft.Extensions.AI.Tests (56)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestHostedFileClient.cs (8)
21public Func<Stream, string?, string?, HostedFileClientOptions?, CancellationToken, Task<HostedFileContent>>? UploadAsyncCallback { get; set; }
23public Func<string, HostedFileClientOptions?, CancellationToken, Task<HostedFileDownloadStream>>? DownloadAsyncCallback { get; set; }
25public Func<string, HostedFileClientOptions?, CancellationToken, Task<HostedFileContent?>>? GetFileInfoAsyncCallback { get; set; }
29public Func<string, HostedFileClientOptions?, CancellationToken, Task<bool>>? DeleteAsyncCallback { get; set; }
36public Task<HostedFileContent> UploadAsync(
44public Task<HostedFileDownloadStream> DownloadAsync(
50public Task<HostedFileContent?> GetFileInfoAsync(
61public Task<bool> DeleteAsync(
Microsoft.Extensions.Caching.Abstractions (6)
Microsoft.Extensions.Caching.Hybrid (23)
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 (5)
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 (4)
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 (14)
Microsoft.Extensions.Http.Polly (3)
Microsoft.Extensions.Http.Resilience (2)
Microsoft.Extensions.Http.Resilience.PerformanceTests (13)
Microsoft.Extensions.Http.Resilience.Tests (17)
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 (33)
AsyncValidateOptions.cs (18)
25public AsyncValidateOptions(string? name, Func<TOptions, CancellationToken, Task<bool>> validation, string failureMessage)
42public Func<TOptions, CancellationToken, Task<bool>> Validation { get; }
77public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
112public AsyncValidateOptions(string? name, TDep dependency, Func<TOptions, TDep, CancellationToken, Task<bool>> validation, string failureMessage)
135public Func<TOptions, TDep, CancellationToken, Task<bool>> Validation { get; }
162public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
197public AsyncValidateOptions(string? name, TDep1 dependency1, TDep2 dependency2, Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> validation, string failureMessage)
226public Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> Validation { get; }
253public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
290public AsyncValidateOptions(string? name, TDep1 dependency1, TDep2 dependency2, TDep3 dependency3, Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> validation, string failureMessage)
325public Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> Validation { get; }
352public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
391public AsyncValidateOptions(string? name, TDep1 dependency1, TDep2 dependency2, TDep3 dependency3, TDep4 dependency4, Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> validation, string failureMessage)
432public Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> Validation { get; }
459public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
500public 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)
547public Func<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, CancellationToken, Task<bool>> Validation { get; }
574public async Task<ValidateOptionsResult> ValidateAsync(string? name, TOptions options, CancellationToken cancellationToken = default)
OptionsBuilder.cs (12)
593public virtual OptionsBuilder<TOptions> Validate(Func<TOptions, CancellationToken, Task<bool>> validation)
602public virtual OptionsBuilder<TOptions> Validate(Func<TOptions, CancellationToken, Task<bool>> validation, string failureMessage)
617public virtual OptionsBuilder<TOptions> Validate<TDep>(Func<TOptions, TDep, CancellationToken, Task<bool>> validation) where TDep : notnull
627public virtual OptionsBuilder<TOptions> Validate<TDep>(Func<TOptions, TDep, CancellationToken, Task<bool>> validation, string failureMessage) where TDep : notnull
647public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2>(Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> validation)
660public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2>(Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> validation, string failureMessage)
684public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3>(Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> validation)
699public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3>(Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> validation, string failureMessage)
726public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> validation)
743public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> validation, string failureMessage)
773public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4, TDep5>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, CancellationToken, Task<bool>> validation)
792public 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 (3)
Microsoft.Extensions.ServiceDiscovery (2)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
Microsoft.Extensions.ServiceDiscovery.Yarp (3)
Microsoft.Extensions.TimeProvider.Testing.Tests (6)
Microsoft.Extensions.VectorData.Abstractions (13)
Microsoft.Extensions.VectorData.Abstractions.Tests (1)
Microsoft.Extensions.VectorData.ConformanceTests (7)
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 (4)
Microsoft.Maui (31)
Microsoft.Maui.Controls (85)
Page\Page.cs (5)
278 public Task<string> DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons)
293 public Task<string> DisplayActionSheet(string title, string cancel, string destruction, FlowDirection flowDirection, params string[] buttons)
316 public Task<bool> DisplayAlert(string title, string message, string accept, string cancel)
338 public Task<bool> DisplayAlert(string title, string message, string accept, string cancel, FlowDirection flowDirection)
368 public Task<string> DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string placeholder = null, int maxLength = -1, Keyboard keyboard = default(Keyboard), string initialValue = "")
ViewExtensions.cs (12)
38 static Task<bool> AnimateTo(this VisualElement view, double start, double end, string name,
71 public static Task<bool> FadeTo(this VisualElement view, double opacity, uint length = 250, Easing? easing = null)
89 public static Task<bool> LayoutTo(this VisualElement view, Rect bounds, uint length = 250, Easing? easing = null)
117 public static Task<bool> RelRotateTo(this VisualElement view, double drotation, uint length = 250, Easing? easing = null)
135 public static Task<bool> RelScaleTo(this VisualElement view, double dscale, uint length = 250, Easing? easing = null)
153 public static Task<bool> RotateTo(this VisualElement view, double rotation, uint length = 250, Easing? easing = null)
171 public static Task<bool> RotateXTo(this VisualElement view, double rotation, uint length = 250, Easing? easing = null)
189 public static Task<bool> RotateYTo(this VisualElement view, double rotation, uint length = 250, Easing? easing = null)
206 public static Task<bool> ScaleTo(this VisualElement view, double scale, uint length = 250, Easing? easing = null)
224 public static Task<bool> ScaleXTo(this VisualElement view, double scale, uint length = 250, Easing? easing = null)
242 public static Task<bool> ScaleYTo(this VisualElement view, double scale, uint length = 250, Easing? easing = null)
261 public static Task<bool> TranslateTo(this VisualElement view, double x, double y, uint length = 250, Easing? easing = null)
Microsoft.Maui.Controls.Foldable (2)
Microsoft.Maui.Essentials (150)
Browser\Browser.shared.cs (12)
18 Task<bool> OpenAsync(Uri uri, BrowserLaunchOptions options);
31 public static Task<bool> OpenAsync(string uri) => Default.OpenAsync(uri);
39 public static Task<bool> OpenAsync(string uri, BrowserLaunchMode launchMode) => Default.OpenAsync(uri, launchMode);
47 public static Task<bool> OpenAsync(string uri, BrowserLaunchOptions options) => Default.OpenAsync(uri, options);
54 public static Task<bool> OpenAsync(Uri uri) => Default.OpenAsync(uri);
62 public static Task<bool> OpenAsync(Uri uri, BrowserLaunchMode launchMode) => Default.OpenAsync(uri, launchMode);
70 public static Task<bool> OpenAsync(Uri uri, BrowserLaunchOptions options) => Default.OpenAsync(uri, options);
95 public static Task<bool> OpenAsync(this IBrowser browser, string uri) =>
105 public static Task<bool> OpenAsync(this IBrowser browser, string uri, BrowserLaunchMode launchMode) =>
115 public static Task<bool> OpenAsync(this IBrowser browser, string uri, BrowserLaunchOptions options) =>
124 public static Task<bool> OpenAsync(this IBrowser browser, Uri uri) =>
134 public static Task<bool> OpenAsync(this IBrowser browser, Uri uri, BrowserLaunchMode launchMode) =>
Map\Map.shared.cs (12)
38 Task<bool> TryOpenAsync(double latitude, double longitude, MapLaunchOptions options);
47 Task<bool> TryOpenAsync(Placemark placemark, MapLaunchOptions options);
114 public static Task<bool> TryOpenAsync(Location location) =>
124 public static Task<bool> TryOpenAsync(Location location, MapLaunchOptions options) =>
134 public static Task<bool> TryOpenAsync(double latitude, double longitude) =>
145 public static Task<bool> TryOpenAsync(double latitude, double longitude, MapLaunchOptions options) =>
154 public static Task<bool> TryOpenAsync(Placemark placemark) =>
164 public static Task<bool> TryOpenAsync(Placemark placemark, MapLaunchOptions options) =>
222 public static Task<bool> TryOpenAsync(this IMap map, Location location) =>
234 public static Task<bool> TryOpenAsync(this IMap map, Location location, MapLaunchOptions options)
272 public static Task<bool> TryOpenAsync(this IMap map, double latitude, double longitude) =>
282 public static Task<bool> TryOpenAsync(this IMap map, Placemark placemark) =>
Microsoft.Maui.Graphics (4)
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (2)
Microsoft.Maui.Maps (2)
Microsoft.Maui.Resizetizer (1)
Microsoft.ML.AutoML (6)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Core (8)
Utilities\ResourceManagerUtils.cs (7)
108public async Task<ResourceDownloadResults> EnsureResourceAsync(IHostEnvironment env, IChannel ch, string relativeUrl, string fileName, string dir, int timeout)
125private async Task<string> DownloadFromUrlWithRetryAsync(IHostEnvironment env, IChannel ch, string url, string fileName,
155private async Task<string> DownloadFromUrlAsync(IHostEnvironment env, IChannel ch, string url, string fileName, int timeout, string filePath)
160var t = Task.Run(() => DownloadResource(env, ch, client, new Uri(url), filePath, fileName, downloadCancel.Token));
163var timeoutTask = Task.Delay(timeout).ContinueWith(task => default(Exception), TaskScheduler.Default);
165var completedTask = await Task.WhenAny(t, timeoutTask);
249private async Task<Exception> DownloadResource(IHostEnvironment env, IChannel ch, HttpClient httpClient, Uri uri, string path, string fileName, CancellationToken ct)
Microsoft.ML.Core.Tests (1)
Microsoft.ML.Data (2)
Microsoft.ML.Fairlearn (1)
Microsoft.ML.GenAI.Core (1)
Microsoft.ML.GenAI.LLaMA (4)
Microsoft.ML.GenAI.Mistral (1)
Microsoft.ML.GenAI.Phi (4)
Microsoft.ML.GenAI.Samples (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.TestFramework (1)
Microsoft.ML.Tokenizers (10)
Microsoft.ML.Tokenizers.Tests (1)
Microsoft.NET.Build.Containers (68)
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.ProjectData (12)
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 (6)
Microsoft.TestPlatform.CrossPlatEngine (5)
Microsoft.TestPlatform.Extensions.BlameDataCollector (1)
Microsoft.TestPlatform.TestHostRuntimeProvider (2)
Microsoft.TestPlatform.Utilities (5)
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (4)
Microsoft.VisualBasic.Forms (1)
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)
37internal static Task<int> Run(PackageUpdateArgs args, IVirtualProjectBuilder? virtualProjectBuilder, CancellationToken cancellationToken)
57internal static async Task<int> Run(PackageUpdateArgs args, ILoggerWithColor logger, IPackageUpdateIO packageUpdateIO, CancellationToken cancellationToken)
135private static async Task<(List<PackageUpdateResult> vulnerablePackages, HashSet<string> packagesScanned)> SelectVulnerablePackagesToUpdateAsync(
315private static async Task<(int? exitCode, Dictionary<string, List<PackageUpdateResult>> projectPackageUpdates, int totalPackagesScanned)>
420private static async Task<(int? exitCode, int totalPackagesScanned)> ProcessProjectsInParallelAsync(
423Func<string, CancellationToken, Task<(List<PackageUpdateResult>? packagesToUpdate, HashSet<string> scannedPackages, int? errorExitCode)>> processProject,
461internal static async Task<(List<PackageUpdateResult>?, HashSet<string> scannedPackages)> SelectSpecificPackagesToUpdateAsync(
620internal 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 (503)
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)
55public override async Task<Tuple<bool, INuGetResource?>> TryCreate(SourceRepository source, CancellationToken token)
120private async Task<ServiceIndexResourceV3?> GetServiceIndexResourceV3(
198private async Task<ServiceIndexResourceV3> ConsumeServiceIndexStreamAsync(Stream stream, DateTime utcNow, PackageSource source, CancellationToken token)
216private static async Task<ServiceIndexResourceV3> ConsumeServiceIndexStreamStjAsync(Stream stream, DateTime utcNow, PackageSource source, CancellationToken token)
255private 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)
57public override async Task<IEnumerable<IPackageSearchMetadata>> SearchAsync(string searchTerm, SearchFilter filter, int skip, int take, Common.ILogger log, CancellationToken cancellationToken)
99private async Task<T> SearchPage<T>(
100Func<Uri, Task<T>> getResultAsync,
205internal async Task<IReadOnlyList<PackageSearchMetadata>> Search(
227internal async Task<IReadOnlyList<PackageSearchMetadata>> ProcessHttpStreamTakeCountedItemAsync(HttpResponseMessage? httpInitialResponse, int take, CancellationToken token)
238private async Task<V3SearchResults?> ProcessHttpStreamWithoutBufferingAsync(HttpResponseMessage? httpInitialResponse, uint take, CancellationToken token)
261private static async Task<V3SearchResults?> ProcessHttpStreamWithStjAsync(HttpResponseMessage httpInitialResponse, uint take, CancellationToken token)
282private 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)
PromptAgentChat (1)
Publishers.Frontend (1)
Roslyn.Diagnostics.Analyzers (206)
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (6)
42Func<CancellationToken, Task<Document>> createChangedDocument;
85private async Task<Document> AddObsoleteAttributeAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
117private static async Task<Document> AddDescriptionAndErrorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
138private static async Task<Document> UpdateDescriptionAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
163private static async Task<Document> AddErrorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
182private static async Task<Document> SetErrorToTrueAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
src\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)
Roslyn.Diagnostics.VisualBasic.Analyzers (9)
rzc (27)
ScenarioTests.Common.Tests (17)
SelectTests (4)
Shared.Tests (1)
Stress.ApiService (4)
Stress.AppHost (3)
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)
75internal static async Task<ZipCryptoStream> CreateAsync(Stream baseStream, ZipCryptoKeys keys, byte expectedCheckByte, bool encrypting, CancellationToken cancellationToken = default, bool leaveOpen = false)
203private static async Task<(uint key0, uint key1, uint key2)> ReadAndValidateHeaderCore(bool isAsync, Stream baseStream, ZipCryptoKeys keys, byte expectedCheckByte, CancellationToken cancellationToken)
388public 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)
445private async Task<(Exception? ex, bool synchronous)> SendAsyncInternal<TIOAdapter>(MailMessage message, bool invokeSendCompleted, object? userToken, bool forceWrapExceptions = false, CancellationToken cancellationToken = default)
628Task<(Exception? ex, bool _)> task = SendAsyncInternal<AsyncReadWriteAdapter>(message, true, userToken, true);
698Task<(Exception?, bool)> task = SendAsyncInternal<AsyncReadWriteAdapter>(message, false, null, true, cancellationToken);
719static 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)
63public static Task<DnsResult<AddressRecord>> ResolveAddressesAsync(string name, CancellationToken cancellationToken = default)
82public static Task<DnsResult<AddressRecord>> ResolveAddressesAsync(string name, AddressFamily addressFamily, CancellationToken cancellationToken = default)
109public static Task<DnsResult<SrvRecord>> ResolveSrvAsync(string name, CancellationToken cancellationToken = default)
136public static Task<DnsResult<MxRecord>> ResolveMxAsync(string name, CancellationToken cancellationToken = default)
163public static Task<DnsResult<TxtRecord>> ResolveTxtAsync(string name, CancellationToken cancellationToken = default)
190public static Task<DnsResult<CNameRecord>> ResolveCNameAsync(string name, CancellationToken cancellationToken = default)
229public static Task<DnsResult<PtrRecord>> ResolvePtrAsync(string name, CancellationToken cancellationToken = default)
242public static Task<DnsResult<PtrRecord>> ResolvePtrAsync(IPAddress address, CancellationToken cancellationToken = default)
269public static Task<DnsResult<NsRecord>> ResolveNsAsync(string name, CancellationToken cancellationToken = default)
System\Net\DnsResolver.cs (29)
94Task<DnsResult<AddressRecord>> task = ResolveAddressesCore(async: false, name, addressFamily, default);
111Task<DnsResult<SrvRecord>> task = ResolveSrvCore(async: false, name, default);
128Task<DnsResult<MxRecord>> task = ResolveMxCore(async: false, name, default);
145Task<DnsResult<TxtRecord>> task = ResolveTxtCore(async: false, name, default);
162Task<DnsResult<CNameRecord>> task = ResolveCNameCore(async: false, name, default);
179Task<DnsResult<PtrRecord>> task = ResolvePtrCore(async: false, name, default);
195Task<DnsResult<PtrRecord>> task = ResolvePtrCore(async: false, BuildArpaName(address), default);
212Task<DnsResult<NsRecord>> task = ResolveNsCore(async: false, name, default);
226public Task<DnsResult<AddressRecord>> ResolveAddressesAsync(string name, CancellationToken cancellationToken = default)
243public Task<DnsResult<AddressRecord>> ResolveAddressesAsync(string name, AddressFamily addressFamily, CancellationToken cancellationToken = default)
259public Task<DnsResult<SrvRecord>> ResolveSrvAsync(string name, CancellationToken cancellationToken = default)
275public Task<DnsResult<MxRecord>> ResolveMxAsync(string name, CancellationToken cancellationToken = default)
291public Task<DnsResult<TxtRecord>> ResolveTxtAsync(string name, CancellationToken cancellationToken = default)
307public Task<DnsResult<CNameRecord>> ResolveCNameAsync(string name, CancellationToken cancellationToken = default)
323public Task<DnsResult<PtrRecord>> ResolvePtrAsync(string name, CancellationToken cancellationToken = default)
338public Task<DnsResult<PtrRecord>> ResolvePtrAsync(IPAddress address, CancellationToken cancellationToken = default)
354public Task<DnsResult<NsRecord>> ResolveNsAsync(string name, CancellationToken cancellationToken = default)
383private async Task<DnsResult<AddressRecord>> ResolveAddressesCore(bool async, string name, AddressFamily addressFamily, CancellationToken cancellationToken)
388Task<DnsResult<AddressRecord>> aTask = DoResolve(async, name, AddressFamily.InterNetwork, cancellationToken);
389Task<DnsResult<AddressRecord>> aaaaTask = DoResolve(async, name, AddressFamily.InterNetworkV6, cancellationToken);
399Task<DnsResult<AddressRecord>> DoResolve(bool async, string name, AddressFamily addressFamily, CancellationToken cancellationToken)
407private Task<DnsResult<SrvRecord>> ResolveSrvCore(bool async, string name, CancellationToken cancellationToken)
414private Task<DnsResult<MxRecord>> ResolveMxCore(bool async, string name, CancellationToken cancellationToken)
421private Task<DnsResult<TxtRecord>> ResolveTxtCore(bool async, string name, CancellationToken cancellationToken)
436private Task<DnsResult<CNameRecord>> ResolveCNameCore(bool async, string name, CancellationToken cancellationToken)
443private Task<DnsResult<PtrRecord>> ResolvePtrCore(bool async, string name, CancellationToken cancellationToken)
450private Task<DnsResult<NsRecord>> ResolveNsCore(bool async, string name, CancellationToken cancellationToken)
457private 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)
73public static async Task<DnsResult<AddressRecord>> ResolveAddresses(IList<IPEndPoint> servers, bool async, string name, AddressFamily addressFamily, CancellationToken cancellationToken)
86public static async Task<DnsResult<SrvRecord>> ResolveSrv(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
92public static async Task<DnsResult<MxRecord>> ResolveMx(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
98public static async Task<DnsResult<TxtRecord>> ResolveTxt(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
104public static async Task<DnsResult<CNameRecord>> ResolveCName(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
110public static async Task<DnsResult<PtrRecord>> ResolvePtr(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
116public static async Task<DnsResult<NsRecord>> ResolveNs(IList<IPEndPoint> servers, bool async, string name, CancellationToken cancellationToken)
392private static async Task<DnsResponse> SendQuery(IList<IPEndPoint> servers, bool async, string name, DnsRecordType qtype, CancellationToken cancellationToken)
632private static async Task<int> SendUdpQueryAsync(
656private static async Task<(byte[]? Buffer, int Length, Exception? Error)> TryTcpFallbackAsync(
692private 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)
2516Task<int> t = SendAsync(new ReadOnlyMemory<byte>(buffer, offset, size), socketFlags, default).AsTask();
2542Task<int> t = SendAsync(buffers, socketFlags);
2591Task<int> t = SendToAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2612Task<int> t = ReceiveAsync(new ArraySegment<byte>(buffer, offset, size), socketFlags, fromNetworkStream: false, default).AsTask();
2637Task<int> t = ReceiveAsync(buffers, socketFlags);
2658Task<int> ti = TaskToAsyncResult.Unwrap<int>(asyncResult);
2682Task<SocketReceiveMessageFromResult> t = ReceiveMessageFromAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2723Task<SocketReceiveFromResult> t = ReceiveFromAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2761private 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 (26)
src\runtime\artifacts\obj\System.Net.WebClient\Release\net11.0-browser\System.Net.WebClient.notsupported.cs (26)
115public System.Threading.Tasks.Task<byte[]> DownloadDataTaskAsync(string address) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
116public System.Threading.Tasks.Task<byte[]> DownloadDataTaskAsync(System.Uri address) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
127public System.Threading.Tasks.Task<string> DownloadStringTaskAsync(string address) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
128public System.Threading.Tasks.Task<string> DownloadStringTaskAsync(System.Uri address) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
150public System.Threading.Tasks.Task<System.IO.Stream> OpenReadTaskAsync(string address) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
151public System.Threading.Tasks.Task<System.IO.Stream> OpenReadTaskAsync(System.Uri address) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
159public System.Threading.Tasks.Task<System.IO.Stream> OpenWriteTaskAsync(string address) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
160public System.Threading.Tasks.Task<System.IO.Stream> OpenWriteTaskAsync(string address, string? method) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
161public System.Threading.Tasks.Task<System.IO.Stream> OpenWriteTaskAsync(System.Uri address) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
162public System.Threading.Tasks.Task<System.IO.Stream> OpenWriteTaskAsync(System.Uri address, string? method) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
170public System.Threading.Tasks.Task<byte[]> UploadDataTaskAsync(string address, byte[] data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
171public System.Threading.Tasks.Task<byte[]> UploadDataTaskAsync(string address, string? method, byte[] data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
172public System.Threading.Tasks.Task<byte[]> UploadDataTaskAsync(System.Uri address, byte[] data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
173public System.Threading.Tasks.Task<byte[]> UploadDataTaskAsync(System.Uri address, string? method, byte[] data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
181public System.Threading.Tasks.Task<byte[]> UploadFileTaskAsync(string address, string fileName) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
182public System.Threading.Tasks.Task<byte[]> UploadFileTaskAsync(string address, string? method, string fileName) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
183public System.Threading.Tasks.Task<byte[]> UploadFileTaskAsync(System.Uri address, string fileName) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
184public System.Threading.Tasks.Task<byte[]> UploadFileTaskAsync(System.Uri address, string? method, string fileName) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
192public System.Threading.Tasks.Task<string> UploadStringTaskAsync(string address, string data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
193public System.Threading.Tasks.Task<string> UploadStringTaskAsync(string address, string? method, string data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
194public System.Threading.Tasks.Task<string> UploadStringTaskAsync(System.Uri address, string data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
195public System.Threading.Tasks.Task<string> UploadStringTaskAsync(System.Uri address, string? method, string data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
203public System.Threading.Tasks.Task<byte[]> UploadValuesTaskAsync(string address, System.Collections.Specialized.NameValueCollection data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
204public System.Threading.Tasks.Task<byte[]> UploadValuesTaskAsync(string address, string? method, System.Collections.Specialized.NameValueCollection data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
205public System.Threading.Tasks.Task<byte[]> UploadValuesTaskAsync(System.Uri address, System.Collections.Specialized.NameValueCollection data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
206public System.Threading.Tasks.Task<byte[]> UploadValuesTaskAsync(System.Uri address, string? method, System.Collections.Specialized.NameValueCollection data) { throw new System.PlatformNotSupportedException(System.SR.SystemNetWebClient_PlatformNotSupported); }
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)
1111public static Task<string> ReadAllTextAsync(string path, CancellationToken cancellationToken = default)
1114public static Task<string> ReadAllTextAsync(string path, Encoding encoding, CancellationToken cancellationToken = default)
1123private static async Task<string> InternalReadAllTextAsync(string path, Encoding encoding, CancellationToken cancellationToken)
1196public static Task<byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken = default)
1225private static async Task<byte[]> InternalReadAllBytesAsync(SafeFileHandle sfh, int count, CancellationToken cancellationToken)
1248private static async Task<byte[]> InternalReadAllBytesUnknownLengthAsync(SafeFileHandle sfh, CancellationToken cancellationToken)
1321public static Task<string[]> ReadAllLinesAsync(string path, CancellationToken cancellationToken = default)
1324public static Task<string[]> ReadAllLinesAsync(string path, Encoding encoding, CancellationToken cancellationToken = default)
1333private 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)
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (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)