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)
1336Task<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)
1620internal static readonly Task<VoidTaskResult> s_cachedCompleted = new Task<VoidTaskResult>(false, default, (TaskCreationOptions)InternalTaskOptions.DoNotDispose, default);
5267return new Task<TResult>(result);
5291var task = new Task<TResult>();
5315return new Task<TResult>(true, default, TaskCreationOptions.None, cancellationToken);
5339var task = new Task<TResult>();
6098return new Task<TResult[]>(false, [], TaskCreationOptions.None, default);
6132new Task<TResult[]>(false, [], TaskCreationOptions.None, default) :
6209return new Task<TResult[]>(false, [], TaskCreationOptions.None, default);
System.Threading.Tasks.Dataflow (1)
VBCSCompiler (1)
17386 references to Task
aspire (1197)
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)
59public Task<AspireSkillsInstallResult> InstallAsync(CancellationToken cancellationToken)
66private async Task<AspireSkillsInstallResult> InstallCoreAsync(CancellationToken cancellationToken)
84async Task<AspireSkillsInstallResult> CompleteInstallationAsync(AspireSkillsBundle bundle, string archiveSha512)
163private async Task<AcquisitionResult> InstallFromGitHubAsync(
286private async Task<AcquisitionResult> InstallFromEmbeddedAsync(
428private async Task<GitHubReleaseInfo?> TryGetGitHubReleaseAsync(HttpClient httpClient, string version, CancellationToken cancellationToken)
530private static async Task<bool> TryDownloadGitHubAssetAsync(HttpClient httpClient, string downloadUrl, string archivePath, CancellationToken cancellationToken)
553private async Task<AcquisitionResult?> TryLoadCachedBundleAsync(
583private async Task<AcquisitionResult?> TryLoadCachedBundleCoreAsync(
655private async Task<AcquisitionResult?> TryLoadCachedBundleDirectoryAsync(
724private async Task<AspireSkillsBundle> CacheArchiveAsync(
752private async Task<AspireSkillsBundle> CacheStagedBundleAsync(
843private Task<FileStream> AcquireCacheLockAsync(string cacheRoot, string version, CancellationToken cancellationToken)
848private Task<FileStream> AcquireCacheLockForCleanupAsync(string cacheRoot, string version, CancellationToken cancellationToken)
853private 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,
254Task<JsonRpc>? initialTask = null;
257var currentTask = GetRpcTaskAsync();
280var rpcTask = GetRpcTaskAsync();
484public async Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
531public async Task<GetPipelineStepsResponse> GetPipelineStepsAsync(string? step, CancellationToken cancellationToken)
550public 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, IEnumerable<T>? preSelected, 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,
604public async Task<bool> ConfirmAsync(string promptText, bool defaultValue, CancellationToken cancellationToken)
628public async Task<string> PromptForStringAsync(string promptText, string? defaultValue, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken)
654public async Task<string> PromptForSecretStringAsync(string promptText, Func<string, ValidationResult>? validator, bool required, CancellationToken cancellationToken)
680public async Task<string?> PromptForFilePathAsync(string promptText, string? defaultValue, bool directory, CancellationToken cancellationToken)
779public async Task<bool> HasCapabilityAsync(string capability, CancellationToken cancellationToken)
785public async Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
Commands\AddCommand.cs (12)
78protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
546private static async Task<IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)>> GetAllPackageVersions(
572private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> GetPackageByInteractiveFlow(
672private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
678private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, string? configuredChannel, CancellationToken cancellationToken)
684private async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> GetPackageByInteractiveFlowWithNoMatchesMessage(
713Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken);
714Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, string? configuredChannel, CancellationToken cancellationToken);
719public virtual async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationVersionAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, string? configuredChannel, CancellationToken cancellationToken)
729async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForChannelPackagesAsync(
784var rootChoices = new List<(string Label, Func<CancellationToken, Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)>> Action)>();
849public virtual async Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
Commands\ConfigCommand.cs (16)
42protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
76protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
87public override async Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
93private async Task<int> ExecuteAsync(string key, CancellationToken cancellationToken)
133protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
152public override async Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
165private async Task<int> ExecuteAsync(string key, string value, bool isGlobal, CancellationToken cancellationToken)
225protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
231public override Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
236private async Task<int> ExecuteAsync(bool showAll, CancellationToken cancellationToken)
382protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
395public override async Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
415private async Task<int> ExecuteAsync(string key, bool isGlobal, CancellationToken cancellationToken)
465protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
471public override Task<int> InteractiveExecuteAsync(CancellationToken cancellationToken)
476private Task<int> ExecuteAsync(bool useJson)
Commands\NewCommand.cs (22)
189private async Task<string> PromptForAppHostLanguageAsync(IReadOnlyList<string> selectableLanguages, CancellationToken cancellationToken)
250private async Task<(bool Success, string? LanguageId)> ResolveSelectedLanguageAsync(ITemplate template, ParseResult parseResult, CancellationToken cancellationToken)
322private async Task<(ITemplate? Template, bool IsConfigured)> GetProjectTemplateAsync(ITemplate[] availableTemplates, ParseResult parseResult, CancellationToken cancellationToken)
384private async Task<ITemplate?> SearchConfiguredTemplatesAsync(CancellationToken cancellationToken)
440private async Task<ResolveTemplateVersionResult> ResolveCliTemplateVersionAsync(ParseResult parseResult, string? source, CancellationToken cancellationToken)
586protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
729private async Task<CommandResult> CreateFromSourceAsync(TemplateSource source, ConfigSource? configSource, ParseResult parseResult, CancellationToken cancellationToken)
762private async Task<CommandResult> CreateFromSelectedSourceTemplateAsync(
790private async Task<CommandResult> CompleteTemplateAsync(TemplateResult templateResult, ConfigSource? configSource, ParseResult parseResult, CancellationToken cancellationToken)
844private async Task<string?> ResolveIdentityChannelNameAsync(CancellationToken cancellationToken)
884Task<TemplateSelection> PromptForTemplateOrSearchAsync(ITemplate[] validTemplates, CancellationToken cancellationToken);
885Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken);
886Task<string> PromptForProjectNameAsync(string defaultName, ParseResult parseResult, CancellationToken cancellationToken);
887Task<string> PromptForOutputPath(string v, ParseResult parseResult, Func<string, ValidationResult>? validator = null, Func<string, string>? outputPathResolver = null, CancellationToken cancellationToken = default);
898Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken);
903public virtual Task<TemplateSelection> PromptForTemplateOrSearchAsync(ITemplate[] validTemplates, CancellationToken cancellationToken)
912public virtual async Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken)
943async Task<(NuGetPackage Package, PackageChannel Channel)> PromptForChannelPackagesAsync(
966var rootChoices = new List<(string Label, Func<CancellationToken, Task<(NuGetPackage, PackageChannel)>> Action)>();
1009public virtual async Task<string> PromptForOutputPath(string path, ParseResult parseResult, Func<string, ValidationResult>? validator = null, Func<string, string>? outputPathResolver = null, CancellationToken cancellationToken = default)
1029public virtual async Task<string> PromptForProjectNameAsync(string defaultName, ParseResult parseResult, CancellationToken cancellationToken)
1040public virtual async Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken)
Commands\PipelineCommandBase.cs (11)
148protected abstract Task<string[]> GetRunArgumentsAsync(string? fullyQualifiedOutputPath, string[] unmatchedTokens, string? targetStep, ParseResult parseResult, CancellationToken cancellationToken);
172protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
231Task<int>? pendingRun = null;
319var backchannel = await InteractionService.ShowStatusAsync(GetProgressMessage(parseResult), (Func<Task<IAppHostCliBackchannel>>)(async () =>
786public async Task<bool> ProcessPublishingActivitiesDebugAsync(IAsyncEnumerable<PublishingActivity> publishingActivities, IAppHostCliBackchannel backchannel, CancellationToken cancellationToken)
880public async Task<bool> ProcessAndDisplayPublishingActivitiesAsync(IAsyncEnumerable<PublishingActivity> publishingActivities, IAppHostCliBackchannel backchannel, bool isDebugOrTraceLoggingEnabled, CancellationToken cancellationToken)
1192private async Task<string?> HandleSingleInputAsync(PublishingPromptInput input, string promptText, IAppHostCliBackchannel backchannel, string interactionId, CancellationToken cancellationToken)
1239private async Task<string?> HandleSelectInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
1273private async Task<string?> HandleNumberInputAsync(PublishingPromptInput input, string promptText, CancellationToken cancellationToken)
1293private async Task<string?> HandleFileInputAsync(PublishingPromptInput input, string promptText, IAppHostCliBackchannel backchannel, string interactionId, CancellationToken cancellationToken)
1390private 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)
175protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
259Task<int>? runTask = null;
834private static async Task<int?> ObserveEarlyDetachedStartupExitAsync(Task<int> pendingRun, CancellationToken cancellationToken)
850private static async Task<AppHostExitResolution> ResolveAppHostExitCodeAsync(Task<int> appHostFailureTask, CancellationToken cancellationToken)
886private static async Task<int> GetAppHostStartupExitCodeAsync(Task<int> pendingRun)
898private async Task<AppHostStartupResult> WaitForAppHostStartupAsync(
899Task<int> pendingRun,
910var happyPathTask = RunStartupHappyPathAsync(backchannelCompletionSource, onBackchannelEstablished, logCaptureCancellationSource, pendingRun, startupStartTimestamp, startupTimeout, startupCts.Token);
987private async Task<AppHostStartupResult> RunStartupHappyPathAsync(
991Task<int> pendingRun,
1085private static async Task<bool> RequestAppHostStopForProfileAsync(
1087Task<int> pendingRun,
1231var structuredLogSupportProbe = ExtensionHelper.IsExtensionHost(interactionService, out var extensionInteractionService, out var extensionBackchannel)
1245Task<bool>? moveNextTask = null;
1408private static async Task<bool> SupportsStructuredAppHostLogsAsync(
1486private Task<CommandResult> ExecuteDetachedAsync(ParseResult parseResult, FileInfo? passedAppHostProjectFile, bool isExtensionHost, int timeoutSeconds, CancellationToken cancellationToken)
1539Task<int> pendingRun,
1569private async Task DrainAppHostRunAfterCancellationAsync(Task<int> pendingRun)
Commands\StopCommand.cs (12)
109protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
183private async Task<int> StopAppHostByPidAsync(int processId, FileInfo? appHostFile, CancellationToken cancellationToken)
217private async Task<int> ForceStopAppHostAsync(FileInfo? passedAppHostProjectFile, bool deleteVolumes, CancellationToken cancellationToken)
244private async Task<FileInfo?> TryResolveAppHostFileAsync(
284private async Task<int> ExecuteNonInteractiveAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken)
290private async Task<StopAppHostResult> ExecuteNonInteractiveWithResultAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken, bool treatNotRunningAsSuccess = false)
349private async Task<int> ExecuteInteractiveAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken)
355private async Task<StopAppHostResult> ExecuteInteractiveWithResultAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken)
387private async Task<StopAppHostResult> StopRunningAppHostsForResolvedFileAsync(FileInfo appHostFile, AppHostConnectionResult[] allConnections, CancellationToken cancellationToken)
430private async Task<int> CleanupPersistentResourcesAsync(FileInfo appHostFile, bool deleteVolumes, CancellationToken cancellationToken)
536private async Task<int> StopAllAppHostsAsync(CancellationToken cancellationToken)
590private async Task<int> StopAppHostAsync(IAppHostAuxiliaryBackchannel connection, string appHostIdentifier, bool useConnectionOnly, 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)
70protected override async Task<CommandResult> ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken)
102private async Task<int> FetchSpansAsync(
161private async Task<int> GetSpansSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
183private async Task<int> StreamSpansAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
Configuration\ConfigSourceService.cs (14)
146public Task<ConfigSource?> ResolveAndAcquireConfigSourceAsync(ParseResult parseResult, CancellationToken cancellationToken) =>
149internal async Task<ConfigSource?> ResolveAndAcquireConfigSourceAsync(
203public async Task<ConfigSource?> SelectForInitializationAsync(
270internal async Task<JsonObject> GetTemplateSourcesAsync(CancellationToken cancellationToken)
289internal async Task<JsonObject> GetTemplateSourcesAsync(ConfigSource source, CancellationToken cancellationToken)
462internal async Task<ConfigSource?> ReadBindingAsync(string configPath, CancellationToken cancellationToken)
467private async Task<JsonObject?> ReadProjectConfigurationAsync(string configPath, CancellationToken cancellationToken)
474private static async Task<JsonObject?> ReadConfigurationFileAsync(string path, CancellationToken cancellationToken)
529internal Task<ConfigSourceSnapshot> AcquireAsync(ConfigSource source, bool force, CancellationToken cancellationToken) =>
532private async Task<ConfigSourceSnapshot> AcquireAsync(
610private async Task<ConfigSourceCheckMetadata> CheckVersionAsync(ConfigSource source, CancellationToken cancellationToken)
666private async Task<(string Commit, string Version, JsonObject Configuration)> AcquireRepositoryAsync(
720private async Task<(string Commit, string Version)> CheckRepositoryAsync(ConfigSource source, string directory, CancellationToken cancellationToken)
742private async Task<(GitRepositoryLocation Directory, string Commit, string Version)> FetchVersionAsync(
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);
225private async Task<int> ExecuteAsync(
728public async Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
756public async Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, string[] targets, ProcessInvocationOptions options, CancellationToken cancellationToken)
892public 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)
950public async Task<int> RunAppHostCommandAsync(
1023public async Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, ProcessInvocationOptions options, CancellationToken cancellationToken)
1234public async Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, ProcessInvocationOptions options, CancellationToken cancellationToken)
1249public async Task<int> RestoreAsync(FileInfo projectFilePath, ProcessInvocationOptions options, CancellationToken cancellationToken)
1269public Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
1272public async Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, IDictionary<string, string>? env, ProcessInvocationOptions options, CancellationToken cancellationToken)
1294public async Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
1358public async Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
1387public async Task<string> ComputeNuGetConfigHierarchySha256Async(DirectoryInfo workingDirectory, ProcessInvocationOptions options, CancellationToken cancellationToken)
1450public 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)
1631public async Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, ProcessInvocationOptions options, CancellationToken cancellationToken)
1673public async Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
1741public async Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProject, ProcessInvocationOptions options, CancellationToken cancellationToken)
1770public Task<int> InitUserSecretsAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
Git\GitClient.cs (6)
13public async Task<string> ResolveReferenceAsync(string repository, string? reference, DirectoryInfo workingDirectory, GitCommandMode mode, CancellationToken cancellationToken)
79public async Task<string> GetCommitAsync(GitRepositoryLocation repository, string reference, GitCommandMode mode, CancellationToken cancellationToken) =>
82public async Task<GitTreeEntry?> GetFileAsync(GitRepositoryLocation repository, string commit, string path, GitCommandMode mode, CancellationToken cancellationToken)
94public async Task<long?> GetObjectSizeAsync(GitRepositoryLocation repository, string objectId, GitCommandMode mode, CancellationToken cancellationToken)
100public Task<string> ReadBlobAsync(GitRepositoryLocation repository, string objectId, GitCommandMode mode, CancellationToken cancellationToken) =>
103private Task<string> RunAsync(GitRepositoryLocation repository, string[] arguments, GitCommandMode mode, CancellationToken cancellationToken)
Git\GitCommandRunner.cs (9)
15Task<string> RunAsync(DirectoryInfo workingDirectory, string[] arguments, GitCommandMode mode, CancellationToken cancellationToken);
32public async Task<string> RunAsync(DirectoryInfo workingDirectory, string[] arguments, GitCommandMode mode, CancellationToken cancellationToken)
200private async Task<string?> GetOpenSshExecutableAsync(ProcessStartInfo gitStartInfo, string executable, CancellationToken cancellationToken)
277var stdout = ReadOutputAsync(process.StandardOutput, token);
278var stderr = ReadOutputAsync(process.StandardError, token);
330internal async Task<string> RunProcessAsync(ProcessStartInfo startInfo, bool captureCancellationOutput, GitCommandMode mode, CancellationToken cancellationToken)
353var stdout = ReadOutputAsync(process.StandardOutput, token);
354var stderr = startInfo.RedirectStandardError
399private static async Task<string> ReadOutputAsync(StreamReader reader, CancellationToken cancellationToken)
Git\IGitClient.cs (5)
8Task<string> ResolveReferenceAsync(string repository, string? reference, DirectoryInfo workingDirectory, GitCommandMode mode, CancellationToken cancellationToken);
12Task<string> GetCommitAsync(GitRepositoryLocation repository, string reference, GitCommandMode mode, CancellationToken cancellationToken);
13Task<GitTreeEntry?> GetFileAsync(GitRepositoryLocation repository, string commit, string path, GitCommandMode mode, CancellationToken cancellationToken);
14Task<long?> GetObjectSizeAsync(GitRepositoryLocation repository, string objectId, GitCommandMode mode, CancellationToken cancellationToken);
15Task<string> ReadBlobAsync(GitRepositoryLocation repository, string objectId, GitCommandMode mode, 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, bool logResponse = true, 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, bool logResponse = true, 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,
450public async Task<bool> SupportsMessageActionsAsync(CancellationToken cancellationToken)
472public 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, bool logResponse = true, 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 (19)
18Task<NuGetPackageOperationConfiguration> CreateChannelConfigurationAsync(DirectoryInfo workingDirectory, IReadOnlyList<PackageMapping>? channelMappings, CancellationToken cancellationToken);
19Task<NuGetPackageOperationConfiguration> CreateSourceRestrictedConfigurationAsync(DirectoryInfo workingDirectory, PackageMapping[] mappings, CancellationToken cancellationToken);
20Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(NuGetPackageOperationConfiguration configuration, bool prerelease, CancellationToken cancellationToken);
21Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(NuGetPackageOperationConfiguration configuration, bool prerelease, CancellationToken cancellationToken);
22Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(NuGetPackageOperationConfiguration configuration, bool prerelease, CancellationToken cancellationToken);
23Task<IEnumerable<NuGetPackage>> GetPackagesAsync(NuGetPackageOperationConfiguration configuration, string packageId, Func<string, bool>? filter, bool prerelease, bool useCache, CancellationToken cancellationToken);
24Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(NuGetPackageOperationConfiguration configuration, string exactPackageId, bool prerelease, bool useCache, CancellationToken cancellationToken);
26Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
29Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
32Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(DirectoryInfo workingDirectory, bool prerelease, FileInfo? nugetConfigFile, CancellationToken cancellationToken)
35Task<IEnumerable<NuGetPackage>> GetPackagesAsync(DirectoryInfo workingDirectory, string packageId, Func<string, bool>? filter, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
38Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(DirectoryInfo workingDirectory, string exactPackageId, bool prerelease, FileInfo? nugetConfigFile, bool useCache, CancellationToken cancellationToken)
108public Task<NuGetPackageOperationConfiguration> CreateChannelConfigurationAsync(
118public Task<NuGetPackageOperationConfiguration> CreateSourceRestrictedConfigurationAsync(
124public async Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(
141public async Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(
149public async Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(
167public async Task<IEnumerable<NuGetPackage>> GetPackagesAsync(
248public async Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(
Packaging\IntegrationPackageSearchService.cs (8)
27public async Task<IEnumerable<(NuGetPackage Package, PackageChannel Channel)>> GetIntegrationPackagesWithChannelsAsync(DirectoryInfo workingDirectory, string? configuredChannel, CancellationToken cancellationToken)
36public async Task<IEnumerable<(NuGetPackage Package, PackageChannel Channel)>> GetIntegrationPackagesWithChannelsAsync(
79public async Task<(IReadOnlyList<(NuGetPackage Package, PackageChannel Channel)> Packages, IReadOnlySet<string> PolyglotCompatibleIds)> GetIntegrationPackagesWithPolyglotCompatibilityAsync(DirectoryInfo workingDirectory, string? configuredChannel, CancellationToken cancellationToken)
88public async Task<(IReadOnlyList<(NuGetPackage Package, PackageChannel Channel)> Packages, IReadOnlySet<string> PolyglotCompatibleIds)> GetIntegrationPackagesWithPolyglotCompatibilityAsync(
107var integrationPackagesTask = sourceMappings is null
110var polyglotIdsTask = sourceMappings is null
125private async Task<IEnumerable<PackageChannel>> GetSearchChannelsAsync(
169public async Task<(DirectoryInfo WorkingDirectory, string? ConfiguredChannel, string? LanguageId, int? ExitCode)> GetPackageSearchContextAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken)
Processes\ProcessTreeGracefulShutdownService.cs (20)
33public async Task<bool> StopAppHostByConnectionAsync(
35Func<CancellationToken, Task<bool>> requestRpcStopAsync,
47public Task<bool> StopProcessTreeAsync(
60public async Task<bool> StopAppHostAsync(
62Func<CancellationToken, Task<bool>>? requestRpcStopAsync,
92internal async Task<bool> StopProcessesAsync(
94Func<CancellationToken, Task<bool>> requestGracefulShutdownAsync,
104private async Task<bool> StopProcessesAsync(
107Func<CancellationToken, Task<bool>> requestGracefulShutdownAsync,
151private async Task<bool> RequestAppHostGracefulShutdownAsync(
153Func<CancellationToken, Task<bool>>? requestRpcStopAsync,
199private async Task<bool> TryRequestGracefulShutdownAsync(
200Func<CancellationToken, Task<bool>> requestGracefulShutdownAsync,
214private async Task<bool> TryRequestRpcStopAsync(Func<CancellationToken, Task<bool>> requestRpcStopAsync, CancellationToken cancellationToken)
236public async Task<bool> RequestProcessTreeGracefulShutdownAsync(
248private async Task<bool> RequestProcessTreeGracefulShutdownAsync(
276internal async Task<bool> TryStopProcessTreeWithDcpAsync(int pid, DateTimeOffset? startTime, bool includeStartTime, CancellationToken cancellationToken)
284private async Task<bool> TryStopProcessTreeWithDcpAsync(ProcessTarget target, bool includeStartTime, CancellationToken cancellationToken)
347private 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)
144public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default)
1379public async Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
1431public async Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken)
1443public async Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
1697private async Task<(int? ExitCode, bool BuiltByCli, bool DeferBuildCompletion)> PrepareAppHostAsync(
1742private async Task<(int? ExitCode, bool BuiltByCli, bool DeferBuildCompletion)> BuildAppHostIfNeededAsync(
1794private async Task<(bool IsCompatibleAppHost, string? AspireHostingVersion)> CheckAppHostCompatibilityAsync(
1832private async Task<DirectAppHostRunSpec?> TryCreateDirectRunSpecAsync(
1895private async Task<bool> IsDirectLaunchDisabledAsync(FileInfo effectiveAppHostFile, CancellationToken cancellationToken)
2395public async Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
2502public async Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
2525public async Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
2532public async Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
2556public async Task<string?> GetUserSecretsIdAsync(FileInfo projectFile, bool autoInit, CancellationToken cancellationToken)
2584private async Task<string?> QueryUserSecretsIdAsync(FileInfo projectFile, CancellationToken cancellationToken)
2601private Task<BundleLayoutLease?> AcquireCliBundleLayoutAsync(CancellationToken cancellationToken)
2713private async Task<string?> ConfigureIsolatedModeAsync(
Projects\GuestAppHostProject.cs (24)
181public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default)
226private async Task<List<IntegrationReference>> GetIntegrationReferencesAsync(
300public Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken)
317private static async Task<(bool Success, OutputCollector? Output, string? ChannelName, bool NeedsCodeGen)> PrepareAppHostServerAsync(
340internal Task<bool> BuildAndGenerateSdkAsync(DirectoryInfo directory, string? packageSourceOverride = null, CancellationToken cancellationToken = default)
343internal Task<bool> BuildAndGenerateSdkAsync(FileInfo appHostFile, string? packageSourceOverride = null, CancellationToken cancellationToken = default)
359private async Task<bool> BuildAndGenerateSdkAsync(
460private async Task<int> GenerateSdkAndInstallDependenciesAsync(
509Task<bool> IGuestAppHostSdkGenerator.BuildAndGenerateSdkAsync(DirectoryInfo directory, string? packageSourceOverride, CancellationToken cancellationToken)
519public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
549public async Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
708Task<int> serverCompletion;
1047private async Task<bool> RestoreIntegrationHostDependenciesAsync(
1101internal async Task<bool> InstallIntegrationHostPackageAsync(string name, string npmPath, string hostDir, CancellationToken cancellationToken)
1401public async Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
1508Task<int> serverCompletion;
1823public async Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
1857public async Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
2045public async Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
2173internal static async Task<bool> WriteGeneratedFileAsync(string filePath, string content, bool preserveUnchangedFiles, CancellationToken cancellationToken)
2537private async Task<int> InstallDependenciesAsync(
2599private async Task<(int ExitCode, OutputCollector? Output)> ExecuteGuestAppHostAsync(
2625private async Task<(int ExitCode, OutputCollector? Output)> ExecuteGuestAppHostForPublishAsync(
2649public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
Projects\IAppHostProject.cs (9)
202Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default);
231Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken);
239Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken);
247Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken);
255Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken);
263Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken);
271Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken);
280Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken);
288Task<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\ProjectLocator.cs (25)
32Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(
71Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, int? maxDepth, CancellationToken cancellationToken)
84Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken, bool skipValidation = false);
95Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, int? maxDepth, CancellationToken cancellationToken, bool skipValidation = false)
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)
260public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken, bool skipValidation = false)
274public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, int? maxDepth, CancellationToken cancellationToken, bool skipValidation = false)
295public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(string searchDirectory, CancellationToken cancellationToken, bool skipValidation = false)
304private async Task<(List<AppHostProjectCandidate> BuildableAppHost, List<AppHostProjectCandidate> UnbuildableSuspectedAppHostProjects, List<FileInfo> UnsupportedProjects)> FindAppHostProjectFilesAsync(
325async Task<(List<AppHostProjectCandidate> BuildableAppHost, List<AppHostProjectCandidate> UnbuildableSuspectedAppHostProjects, List<FileInfo> UnsupportedProjects)> FindAppHostsAsync()
603public async Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default)
609public async Task<FileInfo?> GetAppHostFromSettingsAsync(DirectoryInfo searchDirectory, bool searchParentDirectories, CancellationToken cancellationToken = default)
676private async Task<SettingsAppHostResult> GetValidatedAppHostProjectFileFromSettingsAsync(DirectoryInfo searchDirectory, bool searchParentDirectories, CancellationToken cancellationToken)
723private async Task<FileInfo?> GetAppHostProjectFileFromSettingsAsync(DirectoryInfo searchDirectory, bool searchParentDirectories, bool silent, CancellationToken cancellationToken)
916public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default)
921public async Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, bool displayProgress, CancellationToken cancellationToken = default)
931private async Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileCoreAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, bool displayProgress, CancellationToken cancellationToken)
1266public async Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken = default)
1426private async Task<FileLock?> TryAcquireWorkspaceConfigLockAsync(FileInfo settingsFile, CancellationToken cancellationToken)
Projects\ProjectUpdater.cs (13)
28Task<ProjectUpdateResult> UpdateProjectAsync(UpdatePackagesContext context, CancellationToken cancellationToken = default);
33public async Task<ProjectUpdateResult> UpdateProjectAsync(UpdatePackagesContext context, CancellationToken cancellationToken = default)
384private async Task<DotNetRestoreSettings?> ReadRestoreConfigurationForUpdateAsync(
418private async Task<(bool Accepted, DotNetAppHostNuGetConfigMergerCandidate? Candidate)> PrepareNuGetConfigurationAsync(
462private async Task<UpdateContext> GetUpdateStepsAsync(
579private async Task<JsonDocument> GetItemsAndPropertiesAsync(FileInfo projectFile, CancellationToken cancellationToken)
584private async Task<JsonDocument> GetItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, CancellationToken cancellationToken)
608private async Task<JsonDocument> GetItemsAndPropertiesWithFallbackAsync(FileInfo projectFile, UpdateContext context, CancellationToken cancellationToken)
613private async Task<JsonDocument> GetItemsAndPropertiesWithFallbackAsync(FileInfo projectFile, string[] items, string[] properties, UpdateContext context, CancellationToken cancellationToken)
654private async Task<NuGetPackageCli?> GetLatestVersionOfPackageAsync(UpdateContext context, string packageId, bool throwIfNotFound = true, CancellationToken cancellationToken = default)
1596private async Task<string?> GetPackageVersionFromDirectoryPackagesPropsAsync(string packageId, FileInfo directoryPackagesPropsFile, FileInfo projectFile, CancellationToken cancellationToken)
1666private async Task<string?> ResolveMSBuildPropertyAsync(string propertyName, FileInfo projectFile, CancellationToken cancellationToken)
1759private async Task<bool> AnalyzeAndConfirmNuGetConfigChanges(UpdatePackagesContext context, XmlDocument? originalDocument, XmlDocument proposedDocument, CancellationToken cancellationToken)
Projects\RepositoryToolUpdater.cs (5)
32public async Task<IReadOnlyList<RepositoryToolManifest>> FindManifestsAsync(DirectoryInfo directory, CancellationToken cancellationToken)
86public async Task<RepositoryToolUpdateResult> UpdateAsync(IReadOnlyList<RepositoryToolManifest> manifests, PackageChannel channel, PromptBinding<bool> confirmBinding, CancellationToken cancellationToken)
107public async Task<UpdateStep?> GetUpdateStepAsync(IReadOnlyList<RepositoryToolManifest> manifests, PackageChannel channel, CancellationToken cancellationToken)
237private async Task<string> GetTargetVersionAsync(RepositoryToolManifest manifest, PackageChannel channel, CancellationToken cancellationToken)
275private static async Task<RepositoryToolManifest?> ReadManifestAsync(string path, bool isNpm, CancellationToken cancellationToken)
src\Shared\Telemetry\InternalMicrosoftDetector.cs (30)
24Task<InternalMicrosoftDetectionResult> IsInternalMicrosoftMachineAsync(CancellationToken cancellationToken = default);
114public async Task<InternalMicrosoftDetectionResult> IsInternalMicrosoftMachineAsync(CancellationToken cancellationToken = default)
244private async Task<InternalMicrosoftDetectionResult> RunProbeStagesAsync(
291private async Task<InternalMicrosoftProbeStageResult> RunProbeStageAsync(IReadOnlyList<InternalMicrosoftProbe> probes, CancellationToken cancellationToken)
324foreach (var task in probeTasks)
366private Task<InternalMicrosoftProbeRunResult> RunProbeAsync(InternalMicrosoftProbe probe, CancellationToken cancellationToken)
471private async Task DrainCancelledProbesAsync(IReadOnlyList<Task<InternalMicrosoftProbeRunResult>> probeTasks)
493private async Task<InternalMicrosoftCacheReadResult> TryReadCacheAsync(CancellationToken cancellationToken)
598internal Task<InternalMicrosoftProbeResult> CheckWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
608private async Task<InternalMicrosoftProbeResult> CheckWslWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
631private async Task<InternalMicrosoftProbeResult> CheckVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
659private async Task<InternalMicrosoftProbeResult> CheckWslVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
678internal async Task<InternalMicrosoftProbeResult> CheckMacPlatformSsoAsync(CancellationToken cancellationToken)
800internal async Task<InternalMicrosoftProbeResult> CheckWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
818private async Task<InternalMicrosoftProbeResult> CheckWslWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
834private Task<InternalMicrosoftProbeResult> CheckGhCliAsync(CancellationToken cancellationToken)
837private Task<InternalMicrosoftProbeResult> CheckWslWindowsGhCliAsync(CancellationToken cancellationToken)
840internal async Task<InternalMicrosoftProbeResult> CheckGhCliExecutableAsync(string executable, CancellationToken cancellationToken)
871private async Task<InternalMicrosoftProbeResult> CheckEnvironmentGitHubTokenAsync(CancellationToken cancellationToken)
887internal async Task<InternalMicrosoftProbeResult> CheckCopilotCliAsync(CancellationToken cancellationToken)
920private async Task<GitHubMembershipCheckResult> CheckAnyGitHubMembershipCandidateAsync(IReadOnlyList<TokenCandidate> candidates, CancellationToken cancellationToken)
939var completedTask = await Task.WhenAny(candidateTasks).WaitAsync(linkedSource.Token).ConfigureAwait(false);
972private async Task<GitHubMembershipCheckResult> CheckGitHubMembershipCandidateAsync(TokenCandidate candidate, CancellationToken cancellationToken)
999private async Task DrainGitHubCandidateTasksAsync(IReadOnlyList<Task<GitHubMembershipCheckResult>> candidateTasks)
1019internal async Task<bool> CheckGitHubMembershipWithTokenAsync(string token, CancellationToken cancellationToken)
1025internal async Task<InternalMicrosoftProbeResult> CheckGitHubMembershipWithTokenResultForTestingAsync(string token, CancellationToken cancellationToken)
1031private static async Task<GitHubMembershipCheckResult> CheckGitHubMembershipWithTokenAsync(HttpClient http, string token, CancellationToken cancellationToken)
1128private static async Task<string?> ReadJsonPropertyAsync(HttpResponseMessage response, string propertyName, CancellationToken cancellationToken)
1134private async Task<ProcessResult> RunProcessAsync(string fileName, string[] arguments, CancellationToken cancellationToken)
1935Func<CancellationToken, Task<InternalMicrosoftProbeResult>> DetectAsync,
Templating\DotNetTemplateFactory.cs (16)
66public async Task<IEnumerable<ITemplate>> GetTemplatesAsync(TemplateSource? source, CancellationToken cancellationToken = default)
82public async Task<IEnumerable<ITemplate>> GetInitTemplatesAsync(CancellationToken cancellationToken = default)
92private async Task<bool> IsDotNetSdkAvailableAsync(CancellationToken cancellationToken)
253private async Task<string[]> PromptForExtraAspireStarterOptionsAsync(ParseResult result, CancellationToken cancellationToken)
264private async Task<string[]> PromptForExtraAspireSingleFileOptionsAsync(ParseResult result, CancellationToken cancellationToken)
273private async Task<string[]> PromptForExtraAspireJsFrontendStarterOptionsAsync(ParseResult result, CancellationToken cancellationToken)
283private async Task<string[]> PromptForExtraAspireXUnitOptionsAsync(ParseResult result, CancellationToken cancellationToken)
412private async Task<TemplateResult> ApplyTemplateWithNoExtraArgsAsync(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, CancellationToken cancellationToken)
417private async Task<TemplateResult> ApplySingleFileTemplate(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
444private async Task<TemplateResult> ApplyTemplateAsync(CallbackTemplate template, TemplateInputs inputs, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
462private async Task<TemplateResult> ApplyTemplateAsync(CallbackTemplate template, TemplateInputs inputs, string name, string outputPath, ParseResult parseResult, Func<ParseResult, CancellationToken, Task<string[]>> extraArgsCallback, CancellationToken cancellationToken)
597private async Task<string> GetProjectNameAsync(TemplateInputs inputs, string templateName, ParseResult parseResult, CancellationToken cancellationToken)
608private async Task<string?> GetOutputPathAsync(TemplateInputs inputs, Func<CliExecutionContext, string, string> pathDeriver, string projectName, ParseResult parseResult, CancellationToken cancellationToken)
Templating\TemplateEngineFactory.cs (9)
46public Task<IEnumerable<ITemplate>> GetInitTemplatesAsync(CancellationToken cancellationToken = default) =>
49public async Task<IEnumerable<ITemplate>> GetTemplatesAsync(TemplateSource? source, CancellationToken cancellationToken = default)
87private async Task<ITemplate[]> DiscoverTemplatesAsync(string fullPath, CancellationToken cancellationToken)
141private async Task<string> GetRepositoryTemplateAsync(string repository, string templatePath, string? reference, CancellationToken cancellationToken)
237private async Task<T> WithGitTimeoutAsync<T>(Func<CancellationToken, Task<T>> operation, CancellationToken cancellationToken)
337private async Task<TemplateResult> ApplyAsync(IEngineEnvironmentSettings settings, TemplateCreator creator, ITemplateInfo template, TemplateInputs inputs, ParseResult parseResult, CancellationToken cancellationToken)
505private async Task<PackageChannel?> GetIdentityPackageChannelAsync(CancellationToken cancellationToken)
524private async Task<string?> PromptForParameterAsync(ITemplateParameter parameter, bool required, string? displayName, string? defaultValue, 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)
Utils\EnvironmentChecker\GoAppHostToolingCheck.cs (9)
43private readonly Func<string, CancellationToken, Task<string?>> _versionResolver;
44private readonly Func<string, string, CancellationToken, Task<string?>> _toolchainResolver;
70Func<string, CancellationToken, Task<string?>> versionResolver,
71Func<string, string, CancellationToken, Task<string?>> toolchainResolver)
84public async Task<IReadOnlyList<EnvironmentCheckResult>> CheckAsync(CancellationToken cancellationToken = default)
144private async Task<FileInfo?> ResolveGoAppHostAsync(CancellationToken cancellationToken)
169private async Task<EnvironmentCheckResult> CreateOutdatedGoResultAsync(
219private async Task<string> GetEffectiveToolchainAsync(string goPath, CancellationToken cancellationToken)
346internal static async Task<string?> RunProbeAsync(
aspire-managed (6)
aspire-tray (13)
Aspire.Acquisition.Tests (24)
Aspire.Azure.AI.Extensions.OpenAI.Tests (1)
Aspire.Azure.AI.Projects.Tests (1)
Aspire.Azure.Messaging.WebPubSub (1)
Aspire.Azure.Search.Documents (1)
Aspire.Azure.Storage.Files.DataLake (2)
Aspire.Cli.EndToEnd.Tests (19)
Aspire.Cli.Tests (825)
Agents\PlaywrightCliInstallerTests.cs (6)
1248public Task<NpmPackageInfo?> ResolvePackageAsync(string packageName, string versionRange, CancellationToken cancellationToken)
1254public Task<string?> PackAsync(string packageName, string version, string outputDirectory, CancellationToken cancellationToken)
1267public Task<bool> InstallGlobalAsync(string tarballPath, CancellationToken cancellationToken)
1281public Task<ProvenanceVerificationResult> VerifyProvenanceAsync(string packageName, string version, string expectedSourceRepository, string expectedWorkflowPath, string expectedBuildType, Func<WorkflowRefInfo, bool>? validateWorkflowRef, string? sriIntegrity, CancellationToken cancellationToken)
1305public Task<SemVersion?> GetVersionAsync(CancellationToken cancellationToken)
1308public Task<bool> InstallSkillsAsync(string workingDirectory, CancellationToken cancellationToken)
Backchannel\TrayWatchStreamTests.cs (14)
30var run = stream.RunAsync((json, _) =>
239var run = CreateStream(monitor, new FakeTimeProvider()).RunAsync(async (json, token) =>
286var run = CreateStream(monitor, new FakeTimeProvider()).RunAsync(async (_, token) =>
330var run = CreateStream(monitor, time).RunAsync(async (json, _) =>
402var run = new TrayWatchStream(monitor, new TestProcessIdentityProvider(), time, logger).RunAsync((json, _) =>
455var run = CreateStream(monitor, time).RunAsync((json, _) =>
520var run = new TrayWatchStream(monitor, new TestProcessIdentityProvider(), new FakeTimeProvider(), logger).RunAsync((json, _) =>
587var run = new TrayWatchStream(monitor, new TestProcessIdentityProvider(), time, logger).RunAsync((json, _) =>
640var run = CreateStream(monitor, time).RunAsync((json, _) =>
745var run = CreateStream(monitor, new FakeTimeProvider(), new TestProcessIdentityProvider { GetStartTime = _ => 1000 })
790async Task<TrayAppHost> ReadHostAsync()
829var run = new TrayWatchStream(monitor, new TestProcessIdentityProvider(), new FakeTimeProvider(), logger)
872var run = CreateStream(monitor, new FakeTimeProvider(), new TestProcessIdentityProvider { GetStartTime = _ => Volatile.Read(ref startedAt) })
945var run = CreateStream(monitor, time).RunAsync((json, _) =>
Commands\AddCommandTests.cs (3)
3187private async Task<(int ExitCode, string SelectedVersion, bool PromptInvoked)> RunAddRedisWithHiveScenarioAsync(
3931public override Task<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> PromptForIntegrationAsync(IEnumerable<(string FriendlyName, NuGetPackage Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
3940public 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, bool skipValidation = false)
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, bool skipValidation = false)
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, bool skipValidation = false)
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, bool skipValidation = false)
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\GoAppHostToolingCheckTests.cs (7)
577Func<string, CancellationToken, Task<string?>>? versionResolver = null,
579Func<string, string, CancellationToken, Task<string?>>? toolchainResolver = null,
597private static Task<string?> RunVersionProbeAsync(
613Func<ProcessInvocationOptions, CancellationToken, Task<int>>? waitForExitAsyncCallback = null) =>
625private static Func<string, CancellationToken, Task<string?>> ReturnsVersion(string? versionOutput) =>
628private static Func<string, string, CancellationToken, Task<string?>> ReturnsToolchain(string? toolchainOutput) =>
633private static Task<string?> ThrowsIfToolchainIsProbed(string goPath, string workingDirectory, CancellationToken cancellationToken) =>
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, bool logResponse = true, 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 (45)
91var pendingRun = command.Parse($"run --apphost \"{appHostFile.FullName}\" {arguments}")
544var pendingCommand = result.InvokeAsync(cancellationToken: cancellationManager.Token);
636var pendingCommand = result.InvokeAsync(cancellationToken: cts.Token);
839var pendingCommand = command.Parse($"run --apphost {appHostFile.FullName}")
935var pendingRun = result.InvokeAsync(cancellationToken: TestContext.Current.CancellationToken);
1042var pendingCommand = result.InvokeAsync(cancellationToken: TestContext.Current.CancellationToken);
1140var pendingCommand = result.InvokeAsync(cancellationToken: cts.Token);
1221var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
1719public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
1724public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken, bool skipValidation = false)
1729public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
1734public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
1739public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
1802var pendingCommand = result.InvokeAsync();
1872var pendingCommand = result.InvokeAsync();
2056var pendingCommand = result.InvokeAsync(cancellationToken: cts.Token);
2127var pendingCommand = result.InvokeAsync(cancellationToken: cts.Token);
2235var pendingCommand = command.Parse($"run --apphost {appHostFile.FullName}")
2535public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
2540public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken, bool skipValidation = false)
2545public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
2550public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
2555public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
2560public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
2565public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken, bool skipValidation = false)
2570public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
2575public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
2580public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
2663var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
2731var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
2862var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3113var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3224var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3330var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3400var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3469var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
3592var pendingRun = result.InvokeAsync();
4215public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
4221public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken, bool skipValidation = false)
4226public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken)
4231public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
4237public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
4378var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
5305var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
5378var pendingRun = result.InvokeAsync(cancellationToken: cts.Token);
Commands\SecretCommandTests.cs (14)
420public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
423public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken, bool skipValidation = false)
426public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default)
429public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
432public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default)
454public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
456public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken) => throw new NotSupportedException();
457public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default) => Task.FromResult<string[]>([]);
458public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
464public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
465public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
466public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken) => throw new NotSupportedException();
467public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken) => throw new NotSupportedException();
468public Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken) => throw new NotSupportedException();
Commands\TerminalCommandTests.cs (11)
855public Task<GetTerminalInfoResponse> GetTerminalInfoAsync(string resourceName, CancellationToken cancellationToken = default)
861public Task<ListTerminalsResponse> ListTerminalsAsync(CancellationToken cancellationToken = default)
866public Task<global::Aspire.Cli.Backchannel.DashboardUrlsState?> GetDashboardUrlsAsync(CancellationToken cancellationToken = default)
868public Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(bool includeHidden, CancellationToken cancellationToken = default)
874public Task<bool> StopAppHostAsync(CancellationToken cancellationToken = default)
876public Task<ExecuteResourceCommandResponse> ExecuteResourceCommandAsync(string resourceName, string commandName, ExecuteResourceCommandOptions? options = null, CancellationToken cancellationToken = default)
878public Task<WaitForResourceResponse> WaitForResourceAsync(string resourceName, string status, int timeoutSeconds, CancellationToken cancellationToken = default)
880public Task<global::ModelContextProtocol.Protocol.CallToolResult> CallResourceMcpToolAsync(string resourceName, string toolName, IReadOnlyDictionary<string, global::System.Text.Json.JsonElement>? arguments, CancellationToken cancellationToken = default)
882public Task<GetDashboardInfoResponse?> GetDashboardInfoV2Async(CancellationToken cancellationToken = default)
885public Task<GetAppHostInfoResponse?> GetAppHostInfoV2Async(CancellationToken cancellationToken = default)
888public Task<WaitForAppHostReadyResponse?> WaitForAppHostReadyAsync(CancellationToken cancellationToken = default)
Commands\UpdateCommandTests.cs (17)
2952private Task<(int ExitCode, string UpdatedWithChannel, bool PromptInvoked)> RunGuestUpdateAndCaptureChannelAsync(
2959private Task<(int ExitCode, string UpdatedWithChannel, bool PromptInvoked)> RunGuestUpdateAndCaptureChannelAsync(
2973private async Task<(int ExitCode, string UpdatedWithChannel, bool PromptInvoked)> RunGuestUpdateAndCaptureChannelAsync(
2986private async Task<(int ExitCode, UpdatePackagesContext? Context, bool PromptInvoked)> RunUpdateAndCaptureContextAsync(
3425private async Task<(int ExitCode, string? CapturedChannel, bool PromptInvoked, TestInteractionService InteractionService)> RunNonInteractiveSelfUpdateAsync(
3473private static async Task<string> CreateSelfUpdateArchiveAsync(
3704public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false) => _innerService.ShowStatusAsync(statusText, action, emoji, allowMarkup);
3705public Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null) => _innerService.ShowDynamicStatusAsync(initialStatusText, action, emoji);
3707public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, bool logResponse = true, CancellationToken cancellationToken = default)
3709public 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)
3711public Task<bool> PromptConfirmAsync(string promptText, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default)
3713public 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
3715public 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
3745public Func<UpdatePackagesContext, CancellationToken, Task<ProjectUpdateResult>>? UpdateProjectAsyncCallback { get; set; }
3747public Task<ProjectUpdateResult> UpdateProjectAsync(UpdatePackagesContext context, CancellationToken cancellationToken = default)
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, bool logResponse = true, 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)
2170public Task<bool> DeleteConfigurationAsync(string key, bool isGlobal = false, CancellationToken cancellationToken = default)
2176public Task<Dictionary<string, string>> GetAllConfigurationAsync(CancellationToken cancellationToken = default)
2181public Task<Dictionary<string, string>> GetLocalConfigurationAsync(CancellationToken cancellationToken = default)
2186public Task<Dictionary<string, string>> GetGlobalConfigurationAsync(CancellationToken cancellationToken = default)
2191public Task<string?> GetConfigurationAsync(string key, CancellationToken cancellationToken = default)
2197public Task<string?> GetConfigurationFromDirectoryAsync(string key, DirectoryInfo startDirectory, bool continueSearchWhenKeyMissing = false, CancellationToken cancellationToken = default)
2212public Task<IEnumerable<LanguageInfo>> GetAvailableLanguagesAsync(CancellationToken cancellationToken = default)
2215public Task<string?> GetPackageForLanguageAsync(LanguageId languageId, CancellationToken cancellationToken = default)
2218public Task<LanguageId?> DetectLanguageAsync(DirectoryInfo directory, CancellationToken cancellationToken = default)
2221public Task<LanguageId?> DetectLanguageRecursiveAsync(DirectoryInfo directory, CancellationToken cancellationToken = default)
2265public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken)
2274public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
2277public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
2280public Task<IReadOnlyList<(string PackageId, string Version)>> GetPackageReferencesAsync(FileInfo appHostFile, CancellationToken cancellationToken)
2283public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
2286public Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken)
2289public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
2292public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
2295public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
2298public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
Templating\DotNetTemplateFactoryTests.cs (31)
375public 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
378public 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
381public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, bool logResponse = true, CancellationToken cancellationToken = default)
384public 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)
387public Task<bool> PromptConfirmAsync(string prompt, PromptBinding<bool>? binding = null, CancellationToken cancellationToken = default)
390public Task<TResult> ShowStatusAsync<TResult>(string message, Func<Task<TResult>> work, KnownEmoji? emoji = null, bool allowMarkup = false)
393public Task<TResult> ShowDynamicStatusAsync<TResult>(string initialStatusText, Func<Action<string>, Task<TResult>> action, KnownEmoji? emoji = null)
422public Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, ProcessInvocationOptions options, CancellationToken cancellationToken)
425public Task<int> NewProjectAsync(string templateName, string projectName, string outputPath, string[] extraArgs, ProcessInvocationOptions? options, CancellationToken cancellationToken)
428public Task<int> RestoreAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
431public Task<int> BuildAsync(FileInfo projectFile, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
434public Task<int> BuildAsync(FileInfo projectFile, bool noRestore, IDictionary<string, string>? env, ProcessInvocationOptions options, CancellationToken cancellationToken)
437public Task<int> AddPackageAsync(FileInfo projectFile, string packageName, string version, string? packageSourceUrl, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
440public Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
443public Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
446public Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProjectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
449public 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)
452public Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
455public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, string[] targets, ProcessInvocationOptions options, CancellationToken cancellationToken)
458public Task<int> RunAsync(FileInfo projectFile, bool watch, bool noBuild, bool noRestore, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken)
461public Task<int> RunAppHostCommandAsync(FileInfo projectFile, string command, DirectoryInfo workingDirectory, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken)
464public Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, ProcessInvocationOptions options, CancellationToken cancellationToken)
467public Task<int> InitUserSecretsAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
473public Task<EnsureCertificatesTrustedResult> EnsureCertificatesTrustedAsync(CancellationToken cancellationToken)
485public Task<TemplateSelection> PromptForTemplateOrSearchAsync(ITemplate[] templates, CancellationToken cancellationToken)
488public Task<string> PromptForProjectNameAsync(string defaultName, ParseResult parseResult, CancellationToken cancellationToken)
491public Task<string> PromptForOutputPath(string defaultPath, ParseResult parseResult, Func<string, ValidationResult>? validator = null, Func<string, string>? outputPathResolver = null, CancellationToken cancellationToken = default)
494public Task<(Aspire.Shared.NuGetPackageCli Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(Aspire.Shared.NuGetPackageCli Package, PackageChannel Channel)> packages, CancellationToken cancellationToken)
497public Task<ITemplate> PromptForTemplateAsync(ITemplate[] templates, CancellationToken cancellationToken)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
TestServices\CallbackNuGetPackageCache.cs (8)
11Func<DirectoryInfo, bool, FileInfo?, CancellationToken, Task<IEnumerable<NuGetPackage>>> getTemplatePackagesAsyncCallback) : INuGetPackageCache
13public Task<NuGetPackageOperationConfiguration> CreateChannelConfigurationAsync(
19public Task<NuGetPackageOperationConfiguration> CreateSourceRestrictedConfigurationAsync(
25public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(NuGetPackageOperationConfiguration configuration, bool prerelease, CancellationToken cancellationToken)
30public Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(NuGetPackageOperationConfiguration configuration, bool prerelease, CancellationToken cancellationToken)
33public Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(NuGetPackageOperationConfiguration configuration, bool prerelease, CancellationToken cancellationToken)
36public Task<IEnumerable<NuGetPackage>> GetPackagesAsync(NuGetPackageOperationConfiguration configuration, string packageId, Func<string, bool>? filter, bool prerelease, bool useCache, CancellationToken cancellationToken)
39public Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(NuGetPackageOperationConfiguration configuration, string exactPackageId, bool prerelease, bool useCache, CancellationToken cancellationToken)
TestServices\DotNetAppHostNuGetConfigTestHelper.cs (4)
17Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback = null,
33Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback = null,
43public static Task<DotNetAppHostNuGetConfigMergerCandidate?> PrepareAsync(
47public static Task<DotNetAppHostNuGetConfigMergerCandidate?> PrepareAsync(
TestServices\FakeAppHostServerSession.cs (14)
30public Func<CancellationToken, Task<IAppHostRpcClient>>? GetRpcClientAsyncCallback { get; init; }
65public Task<int> WaitForExitAsync() => _exit.Task;
67public Task<IAppHostRpcClient> GetRpcClientAsync(CancellationToken cancellationToken)
134public Func<string, string, string?, CancellationToken, Task<Dictionary<string, string>>>? ScaffoldAppHostAsyncCallback { get; init; }
135public Func<string, CancellationToken, Task<Dictionary<string, string>>>? GenerateCodeAsyncCallback { get; init; }
136public Func<string, object?[], CancellationToken, Task<object?>>? InvokeAsyncCallback { get; init; }
138public virtual Task<RuntimeSpec> GetRuntimeSpecAsync(string languageId, CancellationToken cancellationToken)
148public virtual Task<Dictionary<string, string>> ScaffoldAppHostAsync(string languageId, string targetPath, string? projectName, CancellationToken cancellationToken)
153public virtual Task<Dictionary<string, string>> GenerateCodeAsync(string languageId, CancellationToken cancellationToken)
157public virtual Task<Dictionary<string, string>> GenerateCodeForAssemblyAsync(string languageId, string assemblyName, CancellationToken cancellationToken)
160public virtual Task<CapabilitiesInfo> GetCapabilitiesAsync(CancellationToken cancellationToken)
163public virtual Task<CapabilitiesInfo> GetCapabilitiesForAssembliesAsync(IReadOnlyList<string> assemblyNames, CancellationToken cancellationToken)
166public virtual Task<JsonElement> ExportApiAsync(string languageId, string packageName, string packageVersion, CancellationToken cancellationToken)
169public virtual async Task<T> InvokeAsync<T>(string methodName, object?[] parameters, CancellationToken cancellationToken)
TestServices\FakeNuGetPackageCache.cs (12)
12public Func<DirectoryInfo, bool, FileInfo?, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetTemplatePackagesAsyncCallback { get; set; }
13public Func<DirectoryInfo, bool, FileInfo?, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetIntegrationPackagesAsyncCallback { get; set; }
14public Func<DirectoryInfo, bool, FileInfo?, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetCliPackagesAsyncCallback { get; set; }
15public Func<DirectoryInfo, string, bool, FileInfo?, bool, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetPackageVersionsAsyncCallback { get; set; }
17public Task<NuGetPackageOperationConfiguration> CreateChannelConfigurationAsync(
26public Task<NuGetPackageOperationConfiguration> CreateSourceRestrictedConfigurationAsync(
32public Task<IEnumerable<NuGetPackage>> GetTemplatePackagesAsync(NuGetPackageOperationConfiguration configuration, bool prerelease, CancellationToken cancellationToken)
36public Task<IEnumerable<NuGetPackage>> GetIntegrationPackagesAsync(NuGetPackageOperationConfiguration configuration, bool prerelease, CancellationToken cancellationToken)
40public Task<IEnumerable<NuGetPackage>> GetCliPackagesAsync(NuGetPackageOperationConfiguration configuration, bool prerelease, CancellationToken cancellationToken)
44public Func<DirectoryInfo, string, Func<string, bool>?, bool, FileInfo?, bool, CancellationToken, Task<IEnumerable<NuGetPackage>>>? GetPackagesAsyncCallback { get; set; }
46public Task<IEnumerable<NuGetPackage>> GetPackagesAsync(NuGetPackageOperationConfiguration configuration, string packageId, Func<string, bool>? filter, bool prerelease, bool useCache, CancellationToken cancellationToken)
67public Task<IEnumerable<NuGetPackage>> GetPackageVersionsAsync(NuGetPackageOperationConfiguration configuration, string exactPackageId, bool prerelease, bool useCache, CancellationToken cancellationToken)
TestServices\FakePlaywrightServices.cs (8)
21public Func<string, string, CancellationToken, Task<NpmPackageInfo?>>? ResolvePackageAsyncCallback { get; set; }
23public Task<NpmPackageInfo?> ResolvePackageAsync(string packageName, string versionRange, CancellationToken cancellationToken)
26public Task<string?> PackAsync(string packageName, string version, string outputDirectory, CancellationToken cancellationToken)
29public Task<bool> InstallGlobalAsync(string tarballPath, CancellationToken cancellationToken)
38public Task<ProvenanceVerificationResult> VerifyProvenanceAsync(string packageName, string version, string expectedSourceRepository, string expectedWorkflowPath, string expectedBuildType, Func<WorkflowRefInfo, bool>? validateWorkflowRef, string? sriIntegrity, CancellationToken cancellationToken)
70public async Task<AspireSkillsInstallResult> InstallAsync(CancellationToken cancellationToken)
225public Task<SemVersion?> GetVersionAsync(CancellationToken cancellationToken)
228public Task<bool> InstallSkillsAsync(string workingDirectory, CancellationToken cancellationToken)
TestServices\NoProjectFileProjectLocator.cs (5)
10public Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken)
15public Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken, bool skipValidation = false)
20public Task<AppHostProjectSearchResult> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, MultipleAppHostProjectsFoundBehavior multipleAppHostProjectsFoundBehavior, bool createSettingsFile, CancellationToken cancellationToken = default)
25public Task<FileInfo?> UseOrFindAppHostProjectFileAsync(FileInfo? projectFile, bool createSettingsFile, CancellationToken cancellationToken)
30public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
TestServices\TestAppHostAuxiliaryBackchannel.cs (19)
53public Func<CancellationToken, Task<DashboardUrlsState?>>? GetDashboardUrlsHandler { get; set; }
59public Func<CancellationToken, Task<GetAppHostInfoResponse?>>? GetAppHostInfoV2Handler { get; set; }
62public Func<CancellationToken, Task<WaitForAppHostReadyResponse?>>? WaitForAppHostReadyHandler { get; set; }
76public Func<CancellationToken, Task<bool>>? StopAppHostHandler { get; set; }
81public Func<string, string, IReadOnlyDictionary<string, JsonElement>?, CancellationToken, Task<CallToolResult>>? CallResourceMcpToolHandler { get; set; }
87public Func<CancellationToken, Task<List<ResourceSnapshot>>>? GetResourceSnapshotsHandler { get; set; }
129public Task<DashboardUrlsState?> GetDashboardUrlsAsync(CancellationToken cancellationToken = default)
134public Task<GetAppHostInfoResponse?> GetAppHostInfoV2Async(CancellationToken cancellationToken = default)
162public Task<WaitForAppHostReadyResponse?> WaitForAppHostReadyAsync(CancellationToken cancellationToken = default)
177public Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(bool includeHidden, CancellationToken cancellationToken = default)
296public Task<bool> StopAppHostAsync(CancellationToken cancellationToken = default)
313public Task<ExecuteResourceCommandResponse> ExecuteResourceCommandAsync(
333public Func<string, string, int, CancellationToken, Task<WaitForResourceResponse>>? WaitForResourceHandler { get; set; }
335public Task<WaitForResourceResponse> WaitForResourceAsync(
349public Task<CallToolResult> CallResourceMcpToolAsync(
371public Task<GetDashboardInfoResponse?> GetDashboardInfoV2Async(CancellationToken cancellationToken = default)
381public Func<string, CancellationToken, Task<GetTerminalInfoResponse>>? GetTerminalInfoHandler { get; set; }
383public Task<GetTerminalInfoResponse> GetTerminalInfoAsync(string resourceName, CancellationToken cancellationToken = default)
399public 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; }
157public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken)
182public Task<int> RunAsync(AppHostProjectContext context, CancellationToken cancellationToken)
187public Task<int> PublishAsync(PublishContext context, CancellationToken cancellationToken)
190public Task<IReadOnlyList<(string PackageId, string Version)>> GetPackageReferencesAsync(FileInfo appHostFile, CancellationToken cancellationToken)
193public Task<AppHostValidationResult> ValidateAppHostAsync(FileInfo appHostFile, CancellationToken cancellationToken)
219public Task<string?> GetAspireHostingVersionAsync(FileInfo appHostFile, CancellationToken cancellationToken)
226public Task<bool> AddPackageAsync(AddPackageContext context, CancellationToken cancellationToken)
231public Task<UpdatePackagesResult> UpdatePackagesAsync(UpdatePackagesContext context, CancellationToken cancellationToken)
236public Task<RunningInstanceResult> FindAndStopRunningInstanceAsync(FileInfo appHostFile, DirectoryInfo homeDirectory, CancellationToken cancellationToken)
239public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken)
TestServices\TestConfigSourceServices.cs (10)
39public static async Task<(string Commit, string Version, JsonObject Configuration)> AcquireAsync(
47public static async Task<(string Commit, string Version)> CheckAsync(
75public Task<InternalMicrosoftDetectionResult> IsInternalMicrosoftMachineAsync(CancellationToken cancellationToken = default)
95public Func<ConfigSource, CancellationToken, Task<(string Version, JsonObject Configuration)>> ReadConfiguration { get; set; }
97public Func<ConfigSource, CancellationToken, Task<string>> InspectConfiguration { get; set; }
110public Task<string> GetCommitAsync(GitRepositoryLocation repository, string reference, GitCommandMode mode, CancellationToken cancellationToken) =>
113public async Task<GitTreeEntry?> GetFileAsync(GitRepositoryLocation repository, string commit, string path, GitCommandMode mode, CancellationToken cancellationToken)
139public Task<long?> GetObjectSizeAsync(GitRepositoryLocation repository, string objectId, GitCommandMode mode, CancellationToken cancellationToken) =>
142public Task<string> ReadBlobAsync(GitRepositoryLocation repository, string objectId, GitCommandMode mode, CancellationToken cancellationToken) =>
145public Task<string> ResolveReferenceAsync(string repository, string? reference, DirectoryInfo workingDirectory, GitCommandMode mode, CancellationToken cancellationToken)
TestServices\TestDotNetCliRunner.cs (22)
16public Func<FileInfo, string, string, string?, bool, ProcessInvocationOptions, CancellationToken, Task<int>>? AddPackageAsyncCallbackAsync { get; set; }
21public Func<FileInfo, ProcessInvocationOptions, CancellationToken, Task<int>>? RestoreAsyncCallbackAsync { get; set; }
24public Func<FileInfo, string[], string[], string[], ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, JsonDocument? Output)>>? GetProjectItemsAndPropertiesAsyncCallbackWithTargetsAsync { get; set; }
26public Func<FileInfo, string[], string[], ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, JsonDocument? Output)>>? GetProjectItemsAndPropertiesAsyncCallbackAsync { get; set; }
31public Func<FileInfo, bool, bool, bool, string[], IDictionary<string, string>?, TaskCompletionSource<IAppHostCliBackchannel>?, ProcessInvocationOptions, CancellationToken, Task<int>>? RunAsyncCallback { get; set; }
32public Func<FileInfo, string, DirectoryInfo, string[], IDictionary<string, string>?, TaskCompletionSource<IAppHostCliBackchannel>?, ProcessInvocationOptions, CancellationToken, Task<int>>? RunAppHostCommandAsyncCallback { get; set; }
38public Task<int> AddPackageAsync(FileInfo projectFilePath, string packageName, string packageVersion, string? nugetSource, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
50public Task<int> AddProjectToSolutionAsync(FileInfo solutionFile, FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
57public Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, ProcessInvocationOptions options, CancellationToken cancellationToken)
60public Task<int> BuildAsync(FileInfo projectFilePath, bool noRestore, IDictionary<string, string>? env, ProcessInvocationOptions options, CancellationToken cancellationToken)
72public Task<int> RestoreAsync(FileInfo projectFilePath, ProcessInvocationOptions options, CancellationToken cancellationToken)
83public Task<(int ExitCode, bool IsAspireHost, string? AspireHostingVersion)> GetAppHostInformationAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
92public Task<(int ExitCode, string[] ConfigPaths)> GetNuGetConfigPathsAsync(DirectoryInfo workingDirectory, ProcessInvocationOptions options, CancellationToken cancellationToken)
106public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, string[] targets, ProcessInvocationOptions options, CancellationToken cancellationToken)
181public Task<(int ExitCode, string? TemplateVersion)> InstallTemplateAsync(string packageName, string version, FileInfo? nugetConfigFile, string? nugetSource, bool force, ProcessInvocationOptions options, CancellationToken cancellationToken)
188public Task<int> NewProjectAsync(string templateName, string name, string outputPath, string[] extraArgs, ProcessInvocationOptions options, CancellationToken cancellationToken)
197public 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)
212public Task<int> RunAppHostCommandAsync(FileInfo projectFile, string command, DirectoryInfo workingDirectory, string[] args, IDictionary<string, string>? env, TaskCompletionSource<IAppHostCliBackchannel>? backchannelCompletionSource, ProcessInvocationOptions options, CancellationToken cancellationToken)
224public 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)
231public Task<(int ExitCode, IReadOnlyList<FileInfo> Projects)> GetSolutionProjectsAsync(FileInfo solutionFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
238public Task<int> AddProjectReferenceAsync(FileInfo projectFile, FileInfo referencedProject, ProcessInvocationOptions options, CancellationToken cancellationToken)
245public Task<int> InitUserSecretsAsync(FileInfo projectFile, ProcessInvocationOptions options, CancellationToken cancellationToken)
TestServices\TestExtensionBackchannel.cs (15)
52public Func<string, IReadOnlyList<string>, IReadOnlyList<string>, Task<IReadOnlyList<string>>>? PromptForSelectionsAsyncCallback { get; set; }
55public Func<string, bool, Task<bool>>? ConfirmAsyncCallback { get; set; }
58public Func<string, string?, Func<string, ValidationResult>?, bool, Task<string>>? PromptForStringAsyncCallback { get; set; }
61public Func<string, Func<string, ValidationResult>?, bool, Task<string>>? PromptForSecretStringAsyncCallback { get; set; }
64public Func<string, string?, bool, Task<string?>>? PromptForFilePathAsyncCallback { get; set; }
73public Func<CancellationToken, Task<string[]>>? GetCapabilitiesAsyncCallback { get; set; }
76public Func<string, CancellationToken, Task<bool>>? HasCapabilityAsyncCallback { get; set; }
174public Task<string?> PromptForFilePathAsync(string promptText, string? defaultValue, bool directory, CancellationToken cancellationToken)
182public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, CancellationToken cancellationToken) where T : notnull
194public async Task<IReadOnlyList<T>> PromptForSelectionsAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, IEnumerable<T>? preSelected, CancellationToken cancellationToken) where T : notnull
218public Task<bool> ConfirmAsync(string promptText, bool defaultValue = true, CancellationToken cancellationToken = default)
226public Task<string> PromptForStringAsync(string promptText, string? defaultValue = null, Func<string, ValidationResult>? validator = null, bool required = false, CancellationToken cancellationToken = default)
234public Task<string> PromptForSecretStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool required = false, CancellationToken cancellationToken = default)
258public Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken)
266public 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, bool logResponse = true, 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)
79public Task<T> ShowStatusAsync<T>(string statusText, Func<Task<T>> action, KnownEmoji? emoji = null, bool allowMarkup = false)
92public Task<T> ShowDynamicStatusAsync<T>(string initialStatusText, Func<Action<string>, Task<T>> action, KnownEmoji? emoji = null)
119public Task<string> PromptForStringAsync(string promptText, Func<string, ValidationResult>? validator = null, bool isSecret = false, bool required = false, PromptBinding<string?>? binding = null, bool logResponse = true, CancellationToken cancellationToken = default)
133public 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)
146private Task<string> PromptForResponseAsync(Func<string, ValidationResult>? validator, PromptBinding<string?>? binding, CancellationToken cancellationToken)
171public 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
212public 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
303public 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 (5)
16public override async Task<TemplateSelection> PromptForTemplateOrSearchAsync(ITemplate[] validTemplates, CancellationToken cancellationToken) =>
25public override Task<ITemplate> PromptForTemplateAsync(ITemplate[] validTemplates, CancellationToken cancellationToken)
34public override Task<string> PromptForProjectNameAsync(string defaultName, ParseResult parseResult, CancellationToken cancellationToken)
43public override Task<string> PromptForOutputPath(string path, ParseResult parseResult, Func<string, ValidationResult>? validator = null, Func<string, string>? outputPathResolver = null, CancellationToken cancellationToken = default)
64public override Task<(NuGetPackage Package, PackageChannel Channel)> PromptForTemplatesVersionAsync(IEnumerable<(NuGetPackage Package, PackageChannel Channel)> candidatePackages, CancellationToken cancellationToken)
TestServices\TestProcessExecutionFactory.cs (6)
81public Func<int, ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, string? Stdout)>>? AsyncAttemptCallback { get; set; }
180private readonly Func<int, ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, string? Stdout)>> _attemptCallback;
191Func<int, ProcessInvocationOptions, CancellationToken, Task<(int ExitCode, string? Stdout)>> attemptCallback,
236public Func<ProcessInvocationOptions, CancellationToken, Task<int>>? WaitForExitAsyncCallback { get; init; }
248public Task<bool> StartAsync(CancellationToken cancellationToken)
266public 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, bool, Task<List<FileInfo>>>? FindAppHostProjectFilesAsyncCallback { get; set; }
24public Func<DirectoryInfo, AppHostDiscoveryScope, int?, CancellationToken, bool, Task<List<FileInfo>>>? FindAppHostProjectFilesWithDepthAsyncCallback { get; set; }
26public async Task<List<AppHostProjectCandidate>> FindAppHostProjectsAsync(
62public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, CancellationToken cancellationToken, bool skipValidation = false)
72public async Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo searchDirectory, AppHostDiscoveryScope scope, int? maxDepth, CancellationToken cancellationToken, bool skipValidation = false)
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)
Utils\CliTestHelper.cs (6)
814public Task<BundleExtractResult> ExtractAsync(string destinationPath, bool force = false, CancellationToken cancellationToken = default)
817public Task<BundleLayoutLease?> EnsureExtractedAndAcquireLayoutAsync(string holderKind, string? commandName = null, CancellationToken cancellationToken = default)
834public Task<BundleExtractResult> ExtractAsync(string destinationPath, bool force = false, CancellationToken cancellationToken = default)
837public Task<BundleLayoutLease?> EnsureExtractedAndAcquireLayoutAsync(string holderKind, string? commandName = null, CancellationToken cancellationToken = default)
891public Task<BundleExtractResult> ExtractAsync(string destinationPath, bool force = false, CancellationToken cancellationToken = default)
894public async Task<BundleLayoutLease?> EnsureExtractedAndAcquireLayoutAsync(string holderKind, string? commandName = null, CancellationToken cancellationToken = default)
Aspire.Components.Common.TestUtilities (1)
Aspire.Confluent.Kafka (2)
Aspire.Dashboard (243)
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 (13)
39Task<PagedResult<OtlpLogEntry>> GetLogsAsync(GetLogsContext context, CancellationToken cancellationToken);
40Task<PagedResult<LogSummary>> GetLogSummariesAsync(GetLogsContext context, CancellationToken cancellationToken);
42Task<List<OtlpLogEntry>> GetLogsForSpanAsync(string traceId, string spanId, CancellationToken cancellationToken);
43Task<List<OtlpLogEntry>> GetLogsForTraceAsync(string traceId, CancellationToken cancellationToken);
44Task<List<string>> GetLogPropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken);
45Task<List<string>> GetTracePropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken);
46Task<GetTracesResponse> GetTracesAsync(GetTracesRequest context, CancellationToken cancellationToken);
47Task<GetTraceSummariesResponse> GetTraceSummariesAsync(GetTracesRequest context, CancellationToken cancellationToken);
48Task<GetSpansResponse> GetSpansAsync(GetSpansRequest context, CancellationToken cancellationToken);
54Task<GetRequestSpansResponse> GetRequestSpansAsync(GetRequestSpansRequest request, CancellationToken cancellationToken);
55Task<Dictionary<string, int>> GetTraceFieldValuesAsync(string attributeName, CancellationToken cancellationToken);
56Task<Dictionary<string, int>> GetLogsFieldValuesAsync(string attributeName, CancellationToken cancellationToken);
72Task<OtlpInstrumentData?> GetInstrumentAsync(GetInstrumentRequest request, CancellationToken cancellationToken);
Otlp\Storage\SqliteTelemetryRepository.cs (14)
196internal static Task<T> RunReadAsync<T>(Func<CancellationToken, T> read, CancellationToken cancellationToken) =>
212public Task<PagedResult<OtlpLogEntry>> GetLogsAsync(GetLogsContext context, CancellationToken cancellationToken) =>
214public Task<PagedResult<LogSummary>> GetLogSummariesAsync(GetLogsContext context, CancellationToken cancellationToken) =>
217public async Task<List<OtlpLogEntry>> GetLogsForSpanAsync(string traceId, string spanId, CancellationToken cancellationToken)
232public async Task<List<OtlpLogEntry>> GetLogsForTraceAsync(string traceId, CancellationToken cancellationToken)
246public Task<List<string>> GetLogPropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken) =>
248public Task<List<string>> GetTracePropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken) =>
250public Task<GetTracesResponse> GetTracesAsync(GetTracesRequest context, CancellationToken cancellationToken) =>
252public Task<GetTraceSummariesResponse> GetTraceSummariesAsync(GetTracesRequest context, CancellationToken cancellationToken) =>
254public Task<GetSpansResponse> GetSpansAsync(GetSpansRequest context, CancellationToken cancellationToken) =>
256public Task<GetRequestSpansResponse> GetRequestSpansAsync(GetRequestSpansRequest request, CancellationToken cancellationToken) =>
258public Task<Dictionary<string, int>> GetTraceFieldValuesAsync(string attributeName, CancellationToken cancellationToken) =>
260public Task<Dictionary<string, int>> GetLogsFieldValuesAsync(string attributeName, CancellationToken cancellationToken) =>
269public Task<OtlpInstrumentData?> GetInstrumentAsync(GetInstrumentRequest request, CancellationToken cancellationToken) =>
ServiceClient\DashboardClient.cs (9)
409private async Task<bool> ConnectWithRetryAsync(CancellationToken cancellationToken)
504private async Task WatchWithRecoveryAsync(Func<RetryContext, CancellationToken, Task<RetryResult>> action, string actionName, Action? onRetry, CancellationToken cancellationToken)
605private async Task<RetryResult> WatchResourcesAsync(RetryContext retryContext, CancellationToken cancellationToken)
740private async Task<RetryResult> WatchInteractionsAsync(RetryContext retryContext, CancellationToken cancellationToken)
822private static async Task<bool> IsUnimplemented(AsyncDuplexStreamingCall<WatchInteractionsRequestUpdate, WatchInteractionsResponseUpdate> call)
904public async Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
1090public async Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
1165public async Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken)
1297public async Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken)
ServiceClient\IDashboardClient.cs (3)
75Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken);
77Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken);
87Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken);
ServiceClient\SelectedDashboardClient.cs (4)
39public Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken) => dataSource.ResourceRepository.SubscribeResourcesAsync(cancellationToken);
66public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
72public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken)
78public Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken)
src\Shared\Telemetry\InternalMicrosoftDetector.cs (30)
24Task<InternalMicrosoftDetectionResult> IsInternalMicrosoftMachineAsync(CancellationToken cancellationToken = default);
114public async Task<InternalMicrosoftDetectionResult> IsInternalMicrosoftMachineAsync(CancellationToken cancellationToken = default)
244private async Task<InternalMicrosoftDetectionResult> RunProbeStagesAsync(
291private async Task<InternalMicrosoftProbeStageResult> RunProbeStageAsync(IReadOnlyList<InternalMicrosoftProbe> probes, CancellationToken cancellationToken)
324foreach (var task in probeTasks)
366private Task<InternalMicrosoftProbeRunResult> RunProbeAsync(InternalMicrosoftProbe probe, CancellationToken cancellationToken)
471private async Task DrainCancelledProbesAsync(IReadOnlyList<Task<InternalMicrosoftProbeRunResult>> probeTasks)
493private async Task<InternalMicrosoftCacheReadResult> TryReadCacheAsync(CancellationToken cancellationToken)
598internal Task<InternalMicrosoftProbeResult> CheckWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
608private async Task<InternalMicrosoftProbeResult> CheckWslWindowsUserDnsDomainAsync(CancellationToken cancellationToken)
631private async Task<InternalMicrosoftProbeResult> CheckVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
659private async Task<InternalMicrosoftProbeResult> CheckWslVisualStudioMicrosoftTenantAsync(CancellationToken cancellationToken)
678internal async Task<InternalMicrosoftProbeResult> CheckMacPlatformSsoAsync(CancellationToken cancellationToken)
800internal async Task<InternalMicrosoftProbeResult> CheckWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
818private async Task<InternalMicrosoftProbeResult> CheckWslWindowsWorkplaceJoinAsync(CancellationToken cancellationToken)
834private Task<InternalMicrosoftProbeResult> CheckGhCliAsync(CancellationToken cancellationToken)
837private Task<InternalMicrosoftProbeResult> CheckWslWindowsGhCliAsync(CancellationToken cancellationToken)
840internal async Task<InternalMicrosoftProbeResult> CheckGhCliExecutableAsync(string executable, CancellationToken cancellationToken)
871private async Task<InternalMicrosoftProbeResult> CheckEnvironmentGitHubTokenAsync(CancellationToken cancellationToken)
887internal async Task<InternalMicrosoftProbeResult> CheckCopilotCliAsync(CancellationToken cancellationToken)
920private async Task<GitHubMembershipCheckResult> CheckAnyGitHubMembershipCandidateAsync(IReadOnlyList<TokenCandidate> candidates, CancellationToken cancellationToken)
939var completedTask = await Task.WhenAny(candidateTasks).WaitAsync(linkedSource.Token).ConfigureAwait(false);
972private async Task<GitHubMembershipCheckResult> CheckGitHubMembershipCandidateAsync(TokenCandidate candidate, CancellationToken cancellationToken)
999private async Task DrainGitHubCandidateTasksAsync(IReadOnlyList<Task<GitHubMembershipCheckResult>> candidateTasks)
1019internal async Task<bool> CheckGitHubMembershipWithTokenAsync(string token, CancellationToken cancellationToken)
1025internal async Task<InternalMicrosoftProbeResult> CheckGitHubMembershipWithTokenResultForTestingAsync(string token, CancellationToken cancellationToken)
1031private static async Task<GitHubMembershipCheckResult> CheckGitHubMembershipWithTokenAsync(HttpClient http, string token, CancellationToken cancellationToken)
1128private static async Task<string?> ReadJsonPropertyAsync(HttpResponseMessage response, string propertyName, CancellationToken cancellationToken)
1134private async Task<ProcessResult> RunProcessAsync(string fileName, string[] arguments, CancellationToken cancellationToken)
1935Func<CancellationToken, Task<InternalMicrosoftProbeResult>> DetectAsync,
Aspire.Dashboard.Components.Tests (60)
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(IRenderedComponent<IComponent> cut, string id, bool drawer, Action<DialogEventArgs>? onStateChange)
94Task<DialogResult> result = null!;
Shared\TestTelemetryRepository.cs (14)
12public Func<GetLogsContext, CancellationToken, Task<PagedResult<LogSummary>>>? GetLogSummariesAsyncHandler { get; init; }
34public Task<PagedResult<OtlpLogEntry>> GetLogsAsync(GetLogsContext context, CancellationToken cancellationToken) => inner.GetLogsAsync(context, cancellationToken);
35public Task<PagedResult<LogSummary>> GetLogSummariesAsync(GetLogsContext context, CancellationToken cancellationToken) =>
38public Task<List<OtlpLogEntry>> GetLogsForSpanAsync(string traceId, string spanId, CancellationToken cancellationToken) => inner.GetLogsForSpanAsync(traceId, spanId, cancellationToken);
39public Task<List<OtlpLogEntry>> GetLogsForTraceAsync(string traceId, CancellationToken cancellationToken) => inner.GetLogsForTraceAsync(traceId, cancellationToken);
40public Task<List<string>> GetLogPropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken) => inner.GetLogPropertyKeysAsync(resourceKey, cancellationToken);
41public Task<List<string>> GetTracePropertyKeysAsync(ResourceKey? resourceKey, CancellationToken cancellationToken) => inner.GetTracePropertyKeysAsync(resourceKey, cancellationToken);
42public Task<GetTracesResponse> GetTracesAsync(GetTracesRequest context, CancellationToken cancellationToken) => inner.GetTracesAsync(context, cancellationToken);
43public Task<GetTraceSummariesResponse> GetTraceSummariesAsync(GetTracesRequest context, CancellationToken cancellationToken) => inner.GetTraceSummariesAsync(context, cancellationToken);
44public Task<GetSpansResponse> GetSpansAsync(GetSpansRequest context, CancellationToken cancellationToken) => inner.GetSpansAsync(context, cancellationToken);
45public Task<GetRequestSpansResponse> GetRequestSpansAsync(GetRequestSpansRequest request, CancellationToken cancellationToken) => inner.GetRequestSpansAsync(request, cancellationToken);
46public Task<Dictionary<string, int>> GetTraceFieldValuesAsync(string attributeName, CancellationToken cancellationToken) => inner.GetTraceFieldValuesAsync(attributeName, cancellationToken);
47public Task<Dictionary<string, int>> GetLogsFieldValuesAsync(string attributeName, CancellationToken cancellationToken) => inner.GetLogsFieldValuesAsync(attributeName, cancellationToken);
54public Task<OtlpInstrumentData?> GetInstrumentAsync(GetInstrumentRequest request, CancellationToken cancellationToken) => inner.GetInstrumentAsync(request, cancellationToken);
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestDashboardClient.cs (8)
23private readonly Func<string, CancellationToken, Task<Stream>>? _attachTerminal;
25private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand;
63Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null,
70Func<string, CancellationToken, Task<Stream>>? attachTerminal = null,
101public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
116public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken)
121public Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken)
198public async Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
Aspire.Dashboard.Playwright.Tests (53)
tests\Aspire.Dashboard.Tests\Shared\MockDashboardClient.cs (4)
54public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
55public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken) => throw new NotImplementedException();
56public Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken) => throw new NotImplementedException();
78public Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestDashboardClient.cs (8)
23private readonly Func<string, CancellationToken, Task<Stream>>? _attachTerminal;
25private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand;
63Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null,
70Func<string, CancellationToken, Task<Stream>>? attachTerminal = null,
101public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
116public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken)
121public Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken)
198public async Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
Aspire.Dashboard.Tests (98)
ResourceOutgoingPeerResolverTests.cs (5)
682private sealed class MockDashboardClient(Task<ResourceViewModelSubscription> subscribeResult) : IDashboardClient
696public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
697public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken) => throw new NotImplementedException();
698public Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken) => throw new NotImplementedException();
708public Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
Shared\MockDashboardClient.cs (4)
54public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
55public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken) => throw new NotImplementedException();
56public Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken) => throw new NotImplementedException();
78public Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
Terminal\DefaultTerminalConnectionResolverTests.cs (4)
196public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
197public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken) => throw new NotImplementedException();
198public Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken) => throw new NotImplementedException();
204public Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken) => throw new NotImplementedException();
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestDashboardClient.cs (8)
23private readonly Func<string, CancellationToken, Task<Stream>>? _attachTerminal;
25private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand;
63Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null,
70Func<string, CancellationToken, Task<Stream>>? attachTerminal = null,
101public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
116public Task<string> UploadFileAsync(Stream fileStream, string fileName, long expectedSize, int interactionId, string inputName, CancellationToken cancellationToken)
121public Task<Stream> AttachTerminalAsync(string terminalId, CancellationToken cancellationToken)
198public async Task<ResourceViewModelSubscription> SubscribeResourcesAsync(CancellationToken cancellationToken)
Aspire.Deployment.EndToEnd.Tests (94)
Aspire.EndToEnd.Tests (12)
Aspire.Hosting (381)
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 (11)
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)
126var waitTask = WaitForResourceCoreAsync(
209public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, CancellationToken cancellationToken = default)
242public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, WaitBehavior waitBehavior, CancellationToken cancellationToken = default)
259var healthyTask = WaitForResourceCoreAsync(
282var readyTask = WaitForResourceCoreAsync(
696/// <returns>A <see cref="Task{ResourceEvent}"/> representing the wait operation and which of the target states the resource reached.</returns>
699public async Task<ResourceEvent> WaitForResourceAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default)
701var waitTask = WaitForResourceCoreAsync(
721private async Task<ResourceEvent> WaitForResourceCoreAsync(string resourceName, Func<ResourceEvent, bool> predicate, string cancellationMessage, CancellationToken cancellationToken = default, string waitCondition = "predicate")
Backchannel\AuxiliaryBackchannelRpcTarget.cs (29)
47public Task<GetCapabilitiesResponse> GetCapabilitiesAsync(GetCapabilitiesRequest? request = null, CancellationToken cancellationToken = default)
72public async Task<GetAppHostInfoResponse> GetAppHostInfoAsync(GetAppHostInfoRequest? request = null, CancellationToken cancellationToken = default)
95public async Task<GetDashboardInfoResponse> GetDashboardInfoAsync(GetDashboardInfoRequest? request = null, CancellationToken cancellationToken = default)
126public async Task<GetResourcesResponse> GetResourcesAsync(GetResourcesRequest? request = null, CancellationToken cancellationToken = default)
229public async Task<CallMcpToolResponse> CallMcpToolAsync(CallMcpToolRequest request, CancellationToken cancellationToken = default)
263public async Task<StopAppHostResponse> StopAsync(StopAppHostRequest? request = null, CancellationToken cancellationToken = default)
276public async Task<ExecuteResourceCommandResponse> ExecuteResourceCommandAsync(ExecuteResourceCommandRequest request, CancellationToken cancellationToken = default)
361private static async Task<(ExecuteCommandResult Result, InteractionInputCollection? Arguments)> ValidateResourceCommandAsync(ResourceCommandService resourceCommandService, string resourceName, string commandName, InteractionInputCollection arguments, CancellationToken cancellationToken)
435public async Task<GetTerminalInfoResponse> GetTerminalInfoAsync(GetTerminalInfoRequest request, CancellationToken cancellationToken = default)
477private async Task<(TerminalReplicaInfo[] Replicas, bool AnyHostReachable)> CollectReplicaInfosAsync(
483var tasks = new Task<(TerminalReplicaInfo Info, bool HostResponded)>[hosts.Count];
507private async Task<(TerminalReplicaInfo Info, bool HostResponded)> QueryReplicaAsync(
590public async Task<ListTerminalsResponse> ListTerminalsAsync(ListTerminalsRequest? request = null, CancellationToken cancellationToken = default)
656public async Task<WaitForResourceResponse> WaitForResourceAsync(WaitForResourceRequest request, CancellationToken cancellationToken = default)
698private static async Task<WaitForResourceResponse> WaitForHealthyAsync(ResourceNotificationService notificationService, WaitResourceTarget target, CancellationToken cancellationToken)
729private static async Task<WaitForResourceResponse> WaitForRunningAsync(ResourceNotificationService notificationService, WaitResourceTarget target, CancellationToken cancellationToken)
753private static async Task<WaitForResourceResponse> WaitForTerminalAsync(ResourceNotificationService notificationService, WaitResourceTarget target, CancellationToken cancellationToken)
770private static async Task<ResourceEvent> WaitForResourceEventAsync(
882public Task<AppHostInformation> GetAppHostInformationAsync(CancellationToken cancellationToken = default)
945public async Task<DashboardUrlsState> GetDashboardUrlsAsync(CancellationToken cancellationToken = default)
968public async Task<WaitForAppHostReadyResponse> WaitForAppHostReadyAsync(WaitForAppHostReadyRequest? request = null, CancellationToken cancellationToken = default)
982public Task<DashboardMcpConnectionInfo?> GetDashboardMcpConnectionInfoAsync(CancellationToken cancellationToken = default)
994public async Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(CancellationToken cancellationToken = default)
999private async Task<List<ResourceSnapshot>> GetResourceSnapshotsAsync(bool resourcePropertiesAsJson, CancellationToken cancellationToken)
1068private async Task<ResourceSnapshot?> CreateResourceSnapshotFromEventAsync(
1257private async Task<HashSet<string>> GetResolvedSecretParameterValuesAsync(CancellationToken cancellationToken)
1324private async Task<IReadOnlyList<ParameterResource>> GetSecretParametersAsync(CancellationToken cancellationToken)
1798public async Task<CallToolResult> CallResourceMcpToolAsync(
1910private async Task<Tool[]?> TryListToolsAsync(Uri endpointUri, CancellationToken cancellationToken)
ContainerResourceBuilderExtensions.cs (5)
847public static IResourceBuilder<T> WithDockerfileFactory<T>(this IResourceBuilder<T> builder, string contextPath, Func<DockerfileFactoryContext, Task<string>> dockerfileFactory, string? stage = null) where T : ContainerResource
1005public static IResourceBuilder<ContainerResource> AddDockerfileFactory(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, Func<DockerfileFactoryContext, Task<string>> dockerfileFactory, string? stage = null)
1490public 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
1633Func<ContainerFileSystemCallbackContext, CancellationToken, Task<IEnumerable<ContainerFileSystemItem>>> callback,
1815Func<DockerfileFactoryContext, Task<string>> dockerfileFactory = async factoryContext =>
Dcp\KubernetesService.cs (17)
43Task<T> GetAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
45Task<T> CreateAsync<T>(T obj, CancellationToken cancellationToken = default)
47Task<T> PatchAsync<T>(T obj, V1Patch patch, CancellationToken cancellationToken = default)
49Task<List<T>> ListAsync<T>(string? namespaceParameter = null, CancellationToken cancellationToken = default)
51Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
70Task<Stream> GetLogStreamAsync<T>(
101public Task<T> GetAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
132public async Task<T> CreateAsync<T>(T obj, CancellationToken cancellationToken = default)
203public Task<T> PatchAsync<T>(T obj, V1Patch patch, CancellationToken cancellationToken = default)
238public Task<List<T>> ListAsync<T>(string? namespaceParameter = null, CancellationToken cancellationToken = default)
268public Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default)
378public Task<Stream> GetLogStreamAsync<T>(
556private async Task<T> CreateOnceAsync<T>(
600private async Task<TResult> ExecuteWithRetry<TResult>(
603Func<DcpKubernetesClient, CancellationToken, Task<TResult>> operation,
696private async Task<TimeSpan> DelayCreateRetryAsync(
796private async Task<KubernetesClientReady> EnsureKubernetesAsync(CancellationToken cancellationToken = default)
IInteractionService.cs (10)
40Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default);
52Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default);
66Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
79Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
92Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
104Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default);
131Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default);
193Task<InteractionResult<bool>> PromptTerminalAsync(string message, AspireTerminal terminal, TerminalInteractionOptions? options = null, CancellationToken cancellationToken = default);
648public Task<byte[]> ReadAllBytesAsync(CancellationToken cancellationToken = default)
656private static async Task<byte[]> ReadAllBytesAsyncCore(Stream stream, CancellationToken cancellationToken)
InteractionService.cs (11)
101public async Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
111public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
120private async Task<InteractionResult<bool>> PromptMessageBoxCoreAsync(string title, string message, MessageBoxInteractionOptions options, CancellationToken cancellationToken)
149public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
154public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
165public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
274public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
302public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
311public async Task<InteractionResult<bool>> PromptTerminalAsync(string message, AspireTerminal terminal, TerminalInteractionOptions? options = null, CancellationToken cancellationToken = default)
341private async Task<InteractionResult<bool>> PromptWorkAsync(
592private async Task<bool> RunValidationAsync(Interaction interactionState, InteractionCompletionState result, CancellationToken cancellationToken)
ResourceBuilderExtensions.cs (8)
3287Func<ExecuteCommandContext, Task<ExecuteCommandResult>> executeCommand,
3351Func<ExecuteCommandContext, Task<ExecuteCommandResult>> executeCommand,
3635Func<ExecuteCommandContext, Task<ProcessCommandSpecExportData>> createProcessSpec,
3654internal static async Task<ExecuteCommandResult> ExecuteProcessCommandAsync(ExecuteCommandContext context, ProcessCommandSpec processCommandSpec, ProcessCommandOptions commandOptions)
3832private static async Task<ExecuteCommandResult> GetProcessCommandResultAsync(ExecuteCommandContext context, ProcessCommandSpec processCommandSpec, ProcessResult processResult, ProcessCommandOptions commandOptions)
4243internal static async Task<ExecuteCommandResult> GetDefaultHttpCommandResultAsync(HttpResponseMessage response, HttpCommandOptions commandOptions, CancellationToken cancellationToken)
5353Func<string, CancellationToken, Task<TLaunchConfiguration>> launchConfigurationProducer,
5410Func<LaunchConfigurationCallbackContext, Task<TLaunchConfiguration>> launchConfigurationProducer,
Aspire.Hosting.Ats.Abstractions (1)
Aspire.Hosting.Azure (153)
AzureProvisioningController.cs (75)
585public async Task<bool> ChangeAzureContextAsync(DistributedApplicationModel model, CancellationToken cancellationToken = default)
592private async Task<bool> ChangeAzureContextAsync(DistributedApplicationModel model, AzureProvisioningOptionsUpdate options, CancellationToken cancellationToken)
607public async Task<bool> ReprovisionAllAsync(DistributedApplicationModel model, CancellationToken cancellationToken = default)
652public async Task<bool> ReprovisionResourceAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken = default)
676public async Task<bool> ChangeResourceLocationAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken = default)
733private async Task<bool> ChangeResourceLocationAsync(
754private Task<ExecuteCommandResult> ExecuteResetProvisioningStateCommandAsync(ExecuteCommandContext context)
767private Task<ExecuteCommandResult> ExecuteChangeAzureContextCommandAsync(ExecuteCommandContext context)
780private Task<ExecuteCommandResult> ExecuteReprovisionAllCommandAsync(ExecuteCommandContext context)
793private Task<ExecuteCommandResult> ExecuteDeleteAzureResourcesCommandAsync(ExecuteCommandContext context)
809private Task<ExecuteCommandResult> ExecuteChangeResourceLocationCommandAsync(string resourceName, ExecuteCommandContext context)
823private Task<ExecuteCommandResult> ExecuteGetAzureResourceCommandAsync(string resourceName, ExecuteCommandContext context)
836private Task<ExecuteCommandResult> ExecuteCancelCommandAsync(string resourceName, ExecuteCommandContext context)
849private Task<ExecuteCommandResult> ExecuteDeleteAzureResourceCommandAsync(string resourceName, ExecuteCommandContext context)
862private Task<ExecuteCommandResult> ExecuteForgetStateCommandAsync(string resourceName, ExecuteCommandContext context)
875private Task<ExecuteCommandResult> ExecuteReprovisionResourceCommandAsync(string resourceName, ExecuteCommandContext context)
889private async Task<bool> ChangeAzureContextCommandAsync(DistributedApplicationModel model, InteractionInputCollection arguments, CancellationToken cancellationToken)
921private Task<bool> ChangeResourceLocationCommandAsync(DistributedApplicationModel model, string resourceName, InteractionInputCollection arguments, CancellationToken cancellationToken)
1061private async Task<T> RunOperationAsync<T>(DistributedApplicationModel model, AzureIntent intent, CancellationToken cancellationToken)
1069private async Task<bool> EnsureProvisionedCoreAsync(
1172private async Task<bool> EnsureProvisionedOrThrowAsync(
1434private async Task<object?> QueueAndWaitForOperationAsync(
1749private async Task<object?> ExecuteIntentAsync(DistributedApplicationModel model, AzureIntent intent, CancellationToken cancellationToken)
1768private async Task<bool> ExecuteResetStateAsync(DistributedApplicationModel model, ResetStateIntent intent, CancellationToken cancellationToken)
1790private async Task<object?> ExecuteForgetResourceStateAsync(DistributedApplicationModel model, ForgetResourceStateIntent intent, CancellationToken cancellationToken)
1801private async Task<bool> ExecuteChangeAzureContextAsync(DistributedApplicationModel model, ChangeAzureContextIntent intent, CancellationToken cancellationToken)
1833private async Task<bool> ExecuteApplyAzureContextAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
1843private async Task<object?> ExecuteEnsureProvisionedAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
1851private async Task<bool> ExecuteReprovisionAllAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
1859private async Task<DeleteAzureResourcesResult> ExecuteDeleteAzureResourcesAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
1912private async Task<IReadOnlyList<RemainingNonArmResource>> GetRemainingNonArmResourcesAsync(
1948private async Task<string?> DeleteCurrentResourceGroupIfExistsAsync(CancellationToken cancellationToken)
1979private async Task<bool> ExecuteChangeResourceLocationAsync(DistributedApplicationModel model, ChangeResourceLocationIntent intent, CancellationToken cancellationToken)
2032private async Task<bool> ExecuteReprovisionResourceAsync(DistributedApplicationModel model, ReprovisionResourceIntent intent, CancellationToken cancellationToken)
2183private async Task<DeleteAzureResourceResult> ExecuteDeleteAzureResourceAsync(DistributedApplicationModel model, DeleteAzureResourceIntent intent, CancellationToken cancellationToken)
2251private async Task<object?> ExecuteDetectDriftAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
2473private static async Task<ExecuteCommandResult> ExecuteCommandAsync(Func<Task> action, string successMessage, Func<Task<CommandResultData>> createResultData, string? failureOperation = null)
2490private static async Task<ExecuteCommandResult> ExecuteCommandAsync<T>(Func<Task<T>> action, Func<T, string> successMessage, Func<T, Task<CommandResultData>> createResultData, string? failureOperation = null)
2507private static async Task<ExecuteCommandResult> ExecuteCommandAsync(Func<Task<bool>> action, string successMessage, Func<Task<CommandResultData>> createResultData, string? failureOperation = null)
2525private async Task<CommandResultData> CreateEnvironmentCommandResultDataAsync(string commandName, DistributedApplicationModel model, CancellationToken cancellationToken)
2542private async Task<CommandResultData> CreateResourceCommandResultDataAsync(string commandName, DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken)
2545private async Task<CommandResultData> CreateDeleteAzureResourcesCommandResultDataAsync(
2565private async Task<CommandResultData> CreateDeleteAzureResourceCommandResultDataAsync(DistributedApplicationModel model, string resourceName, DeleteAzureResourceResult result, CancellationToken cancellationToken)
2579private async Task<JsonObject> CreateResourceCommandResultJsonAsync(string commandName, DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken)
2593private async Task<CommandResultData> CreateAzureResourceInfoCommandResultDataAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken)
2625private async Task<JsonObject> CreateCachedDeploymentStateInfoAsync(AzureBicepResource resource, AzureContextState context, CancellationToken cancellationToken)
2668private async Task<JsonObject> CreateLiveResourceInfoAsync(string? resourceId, AzureContextState context, CancellationToken cancellationToken)
2787private async Task<JsonObject> CreateCommandResultJsonAsync(string commandName, string? resourceName, CancellationToken cancellationToken)
2887private async Task<string?> GetEffectiveResourceLocationAsync(string resourceName, CancellationToken cancellationToken)
2913private async Task<int> CancelCachedDeploymentsAsync(
3014private async Task<IReadOnlyList<string>> GetAzureResourceIdsForDeletionAsync(
3091private async Task<bool> DeleteAzureResourceIdAndPurgeDeletedKeyVaultAsync(
3121private async Task<bool> PurgeDeletedKeyVaultAsync(
3191private async Task<IArmClient> GetArmClientForResourceIdAsync(string resourceId, CancellationToken cancellationToken)
3361private async Task<IReadOnlyList<KeyValuePair<string, string>>> GetLocationOptionsAsync(CancellationToken cancellationToken)
3366private async Task<IReadOnlyList<KeyValuePair<string, string>>> GetTenantOptionsAsync(CancellationToken cancellationToken)
3404private async Task<IReadOnlyList<KeyValuePair<string, string>>> GetSubscriptionOptionsAsync(string? tenantId, CancellationToken cancellationToken)
3425private async Task<IReadOnlyList<(string Name, string Location)>> GetResourceGroupOptionsAsync(string? subscriptionId, CancellationToken cancellationToken)
3449private async Task<IReadOnlyList<KeyValuePair<string, string>>> GetLocationOptionsAsync(string? subscriptionId, CancellationToken cancellationToken)
3490private async Task<AzureContextState> GetCurrentAzureContextAsync(CancellationToken cancellationToken)
3516private async Task<string?> TryGetResourceIdFromDeploymentStateAsync(AzureBicepResource resource, CancellationToken cancellationToken)
3537private async Task<LocationChangeResourceDeletion?> PrepareCachedResourceDeletionForLocationChangeAsync(
3635private async Task<string?> TryGetPersistedResourceLocationAsync(AzureBicepResource resource, CancellationToken cancellationToken)
3661private async Task<bool> IsMissingCachedResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken)
3915private async Task<bool> TryPublishTerminalDeploymentStateAsync(
3984private async Task<bool> WaitForRoleAssignmentsAsync(
4024var provisioningContextLazy = new Lazy<Task<ProvisioningContext>>(() => provisioningContextProvider.CreateProvisioningContextAsync(cancellationToken));
4037Lazy<Task<ProvisioningContext>> provisioningContextLazy,
4482Func<AzureProvisioningController, ExecuteCommandContext, Task<ExecuteCommandResult>> ExecuteCommand,
4495Func<AzureProvisioningController, string, ExecuteCommandContext, Task<ExecuteCommandResult>> ExecuteCommand,
Provisioning\Internal\BaseProvisioningContextProvider.cs (6)
91public virtual async Task<ProvisioningContext> CreateProvisioningContextAsync(CancellationToken cancellationToken = default)
261protected async Task<(List<KeyValuePair<string, string>>? tenantOptions, bool fetchSucceeded)> TryGetTenantsAsync(CancellationToken cancellationToken)
310protected async Task<(List<KeyValuePair<string, string>>? subscriptionOptions, bool fetchSucceeded)> TryGetSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken)
338protected async Task<(List<KeyValuePair<string, string>>? subscriptionOptions, bool fetchSucceeded)> TryGetSubscriptionsAsync(CancellationToken cancellationToken)
343protected async Task<(List<(string Name, string Location)>? resourceGroupOptions, bool fetchSucceeded)> TryGetResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken)
376protected async Task<(List<KeyValuePair<string, string>> locationOptions, bool fetchSucceeded)> TryGetLocationsAsync(string subscriptionId, CancellationToken cancellationToken)
Provisioning\Internal\DefaultArmClientProvider.cs (12)
62public async Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
86public async Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
98public async Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
110public async Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
131public async Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
138public async Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
147public async Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
160public async Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
210public async Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
244public async Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
335public async Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
416private async Task<AzureDeploymentOperationDetails[]> GetDeploymentOperationsForDeploymentAsync(ResourceIdentifier deploymentId, CancellationToken cancellationToken)
Provisioning\Internal\IProvisioningServices.cs (25)
53Task<string> CompileBicepToArmAsync(string bicepFilePath, CancellationToken cancellationToken = default);
66Task<ProvisioningContext> CreateProvisioningContextAsync(CancellationToken cancellationToken = default);
80Task<bool> EnsureProvisioningOptionsAsync(bool forcePrompt, CancellationToken cancellationToken = default);
87Task<AzureProvisioningOptionsState> GetProvisioningOptionsAsync(CancellationToken cancellationToken = default);
101Task<AzureProvisioningOptionsState> ApplyProvisioningOptionsAsync(AzureProvisioningOptionsUpdate options, CancellationToken cancellationToken = default);
119public Task<bool> EnsureProvisioningOptionsAsync(bool forcePrompt, CancellationToken cancellationToken = default) => Task.FromResult(false);
120public Task<AzureProvisioningOptionsState> GetProvisioningOptionsAsync(CancellationToken cancellationToken = default)
123public Task<AzureProvisioningOptionsState> ApplyProvisioningOptionsAsync(AzureProvisioningOptionsUpdate options, CancellationToken cancellationToken = default)
135Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default);
140Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default);
145Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default);
150Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default);
155Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default);
160Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default);
165Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default);
170Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default);
180Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default);
200Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default);
210Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default);
265Task<Response<IResourceGroupResource>> GetAsync(string resourceGroupName, CancellationToken cancellationToken = default);
270Task<ArmOperation<IResourceGroupResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceGroupName, ResourceGroupData data, CancellationToken cancellationToken = default);
296Task<ArmOperation> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default);
313Task<ArmOperation<RoleAssignmentResource>> CreateOrUpdateAsync(
328Task<ArmOperation<ArmDeploymentResource>> CreateOrUpdateAsync(
379Task<AzurePrincipal> GetPrincipalAsync(CancellationToken cancellationToken = default);
Aspire.Hosting.Azure.AppContainers (2)
Aspire.Hosting.Azure.AppService (3)
Aspire.Hosting.Azure.EntraId (4)
Aspire.Hosting.Azure.EntraId.Tests (15)
Aspire.Hosting.Azure.KeyVault (2)
Aspire.Hosting.Azure.Kubernetes (13)
AzureKubernetesEnvironmentResource.AksPipeline.cs (12)
30internal Func<string, string, ILogger, Task<AzCommandResult>>? AzCommandRunnerForTesting { get; set; }
260Task<AzCommandResult> RunAzAsync(string path, string arguments)
769internal static async Task<(string? SubscriptionId, string? ResourceGroup)> TryGetAzureDeploymentStateAsync(
795internal static async Task<string?> ResolveScopeValueAsync(object? value, CancellationToken cancellationToken)
819internal static async Task<(string SubscriptionId, string? ResourceGroup)> ResolveDeploymentScopeAsync(
879internal static async Task<string> GetResourceGroupAsync(
885Func<string, string, Task<AzCommandResult>> runAzCommandAsync)
942internal static async Task<string> FetchKubeConfigAsync(
947Func<string, string, Task<AzCommandResult>> runAzCommandAsync)
962internal static async Task<bool> AksResourceExistsAsync(
967Func<string, string, Task<AzCommandResult>> runAzCommandAsync)
1011private 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)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Azure.Sandboxes (44)
AzureSandboxContainerDeployment.cs (20)
637private static async Task<AzureDevComputeDiskImage> CreateDiskImageAsync(
667internal static async Task<string?> ResolveImagePullManagedIdentityClientIdAsync(
693private static async Task<AzureDevComputeDiskImage> WaitForDiskImageReadyAsync(
733private static Task<AzureDevComputeSandbox> CreateSandboxAsync(
841internal static async Task<FileLock?> AcquireDeploymentLeaseAsync(
929private static async Task<AzureDevComputeSandboxPort> AddPortAsync(
970private static async Task<string> ResolveContainerImageAsync(PipelineStepContext context, AzureSandboxContainerResource resource)
989private static async Task<string> ResolveContainerImageReferenceForDiskImageAsync(PipelineStepContext context, string imageReference)
998internal static async Task<string> ResolveContainerImageReferenceForDiskImageAsync(
1043private static async Task<ContainerImageMetadata> ResolveContainerImageMetadataAsync(PipelineStepContext context, IResource resource, string imageReference)
1065internal static async Task<ResolvedModeledCommand> ResolveModeledCommandAsync(PipelineStepContext context, IResource resource)
1103private static async Task<ContainerImageMetadata> InspectLocalContainerImageAsync(PipelineStepContext context, string imageReference)
1132private static Task<IContainerRuntime> ResolveContainerRuntimeAsync(PipelineStepContext context)
1137internal static async Task<ResolvedEnvironmentVariables> ResolveEnvironmentVariablesAsync(PipelineStepContext context, IResource resource)
1165internal static async Task<string> ResolveValueAsync(PipelineStepContext context, IResource resource, object? value)
1168internal static async Task<ResolvedValue> ResolveValueWithEgressHostsAsync(PipelineStepContext context, IResource resource, object? value)
1216static async Task<ResolvedValue> ResolveEndpointValueAsync(
1248static async Task<ResolvedValue> ResolveReferenceExpressionAsync(
1767internal static async Task<T> CreateWithResponseLossCleanupAsync<T>(
1768Func<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 (240)
AzureEnvironmentResourceExtensionsTests.cs (112)
706var commandTask = resetCommand.ExecuteCommand(new ExecuteCommandContext
812var outputTask = storage.GetOutput("blobEndpoint").GetValueAsync(CancellationToken.None).AsTask();
1864var activeReprovisionTask = controller.ReprovisionResourceAsync(model, storage.Resource.Name, CancellationToken.None);
1923var activeReprovisionTask = controller.ReprovisionResourceAsync(model, storage1.Resource.Name, CancellationToken.None);
1930var queuedReprovisionTask = queuedReprovisionCommand.ExecuteCommand(new ExecuteCommandContext
2275var commandTask = deleteCommand.ExecuteCommand(new ExecuteCommandContext
2353var deleteTask = deleteCommand.ExecuteCommand(new ExecuteCommandContext
2550var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
2610var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
2687var storageTask = reprovisionStorageCommand.ExecuteCommand(new ExecuteCommandContext
2701var storage2Task = reprovisionStorage2Command.ExecuteCommand(new ExecuteCommandContext
2764var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
2961var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
3028var commandTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
3101var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
3275var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
3406var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
3532var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
3595var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
4391var commandTask = reprovisionCommand.ExecuteCommand(new ExecuteCommandContext
4443var executionTask = changeLocationCommand.ExecuteCommand(new ExecuteCommandContext
5510private static async Task<(IReadOnlyList<PipelineStep> Steps, PipelineContext PipelineContext)> CreateAzureEnvironmentPipelineStepsAsync(
5573public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
5580public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
5586public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
5592public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
5602public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
5610public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
5615public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
5625public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
5631public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
5637public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
5643public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
5704public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
5716public Task<DeploymentStateSection> AcquireCurrentSectionAsync(string sectionName, CancellationToken cancellationToken = default)
5801public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken)
5827public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5837public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken)
5850public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5870public Task<ProvisioningContext> CreateProvisioningContextAsync(CancellationToken cancellationToken = default)
5879public Task<bool> EnsureProvisioningOptionsAsync(bool forcePrompt, CancellationToken cancellationToken = default) => Task.FromResult(true);
5881public async Task<AzureProvisioningOptionsState> GetProvisioningOptionsAsync(CancellationToken cancellationToken = default)
5894public async Task<AzureProvisioningOptionsState> ApplyProvisioningOptionsAsync(AzureProvisioningOptionsUpdate options, CancellationToken cancellationToken = default)
5938public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
5940public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5968public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
5970public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
5988public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
5990public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
6005public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
6007public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
6022public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
6024public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
6048public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false);
6050public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
6104public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken)
6107public Task<bool> ReconcileDeploymentStateAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken)
6156public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
6159public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
6162public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
6165public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
6168public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
6171public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
6174public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
6177public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
6183public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
6189public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
6195public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
6241public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
6244public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
6247public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
6250public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
6253public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
6256public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
6259public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
6262public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
6268public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
6282public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
6288public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
6318public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
6321public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
6324public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
6327public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
6330public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
6333public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
6336public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
6339public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
6345public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
6351public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
6357public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
6386public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
6389public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
6392public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
6395public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
6398public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
6401public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
6404public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
6407public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
6413public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
6419public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
6425public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
6448public Task<(ISubscriptionResource subscription, ITenantResource tenant)> GetSubscriptionAndTenantAsync(CancellationToken cancellationToken = default)
6451public Task<IEnumerable<ITenantResource>> GetAvailableTenantsAsync(CancellationToken cancellationToken = default)
6454public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(CancellationToken cancellationToken = default)
6457public Task<IEnumerable<ISubscriptionResource>> GetAvailableSubscriptionsAsync(string? tenantId, CancellationToken cancellationToken = default)
6460public Task<ISubscriptionResource> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default)
6463public Task<IEnumerable<(string Name, string DisplayName)>> GetAvailableLocationsAsync(string subscriptionId, CancellationToken cancellationToken = default)
6466public Task<IEnumerable<(string Name, string Location)>> GetAvailableResourceGroupsWithLocationAsync(string subscriptionId, CancellationToken cancellationToken = default)
6469public Task<IEnumerable<string>> GetSupportedLocationsAsync(string subscriptionId, string resourceType, CancellationToken cancellationToken = default)
6475public Task<bool> ResourceExistsAsync(string resourceId, CancellationToken cancellationToken = default)
6483public Task<bool> PurgeDeletedKeyVaultAsync(string resourceId, string location, CancellationToken cancellationToken = default)
6489public Task<AzureDeploymentState?> GetDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
AzureSandboxesTests.cs (33)
2604private async Task<AzureDevComputeSandboxResources> CreateSandboxResourcesForTierAsync(AzureSandboxTier tier)
3319var secondLeaseTask = AzureSandboxContainerDeployment.AcquireDeploymentLeaseAsync(
3339private static async Task<List<PipelineStep>> CreateStepsAsync(
3373private async Task<ResponseLossCleanupClient> RunCreateResponseLossAsync(
3451public Task<List<AzureDevComputeSandbox>> ListSandboxesAsync(
3479public Task<List<AzureDevComputeDiskImage>> ListDiskImagesAsync(
3487public Task<AzureDevComputeDiskImage> CreateDiskImageAsync(AzureDevComputeResourceScope scope, AzureDevComputeCreateDiskImageRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3488public Task<AzureDevComputeDiskImage> GetDiskImageAsync(AzureDevComputeResourceScope scope, string diskImageId, CancellationToken cancellationToken) => throw new NotSupportedException();
3490public Task<AzureDevComputeSandbox> CreateSandboxAsync(AzureDevComputeResourceScope scope, AzureDevComputeSandboxRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3491public Task<AzureDevComputeSandbox> SetLifecycleAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeSandboxLifecyclePolicy lifecycle, CancellationToken cancellationToken) => throw new NotSupportedException();
3492public Task<List<AzureDevComputeSandboxPort>> AddPortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeAddPortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3493public Task<List<AzureDevComputeSandboxPort>> RemovePortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeRemovePortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3517public Task<string> CreateResourceThenLoseResponseAsync()
3525public Task<List<AzureDevComputeSandbox>> ListSandboxesAsync(
3553public Task<List<AzureDevComputeDiskImage>> ListDiskImagesAsync(
3595public Task<AzureDevComputeDiskImage> CreateDiskImageAsync(AzureDevComputeResourceScope scope, AzureDevComputeCreateDiskImageRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3596public Task<AzureDevComputeDiskImage> GetDiskImageAsync(AzureDevComputeResourceScope scope, string diskImageId, CancellationToken cancellationToken) => throw new NotSupportedException();
3597public Task<AzureDevComputeSandbox> CreateSandboxAsync(AzureDevComputeResourceScope scope, AzureDevComputeSandboxRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3598public Task<AzureDevComputeSandbox> SetLifecycleAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeSandboxLifecyclePolicy lifecycle, CancellationToken cancellationToken) => throw new NotSupportedException();
3599public Task<List<AzureDevComputeSandboxPort>> AddPortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeAddPortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3600public Task<List<AzureDevComputeSandboxPort>> RemovePortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeRemovePortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3610public Task<List<AzureDevComputeSandboxPort>> RemovePortAsync(
3628public Task<List<AzureDevComputeSandbox>> ListSandboxesAsync(AzureDevComputeResourceScope scope, string? labels, CancellationToken cancellationToken) => throw new NotSupportedException();
3629public Task<List<AzureDevComputeDiskImage>> ListDiskImagesAsync(AzureDevComputeResourceScope scope, string? labels, CancellationToken cancellationToken) => throw new NotSupportedException();
3630public Task<AzureDevComputeDiskImage> CreateDiskImageAsync(AzureDevComputeResourceScope scope, AzureDevComputeCreateDiskImageRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3631public Task<AzureDevComputeDiskImage> GetDiskImageAsync(AzureDevComputeResourceScope scope, string diskImageId, CancellationToken cancellationToken) => throw new NotSupportedException();
3637public Task<AzureDevComputeSandbox> CreateSandboxAsync(AzureDevComputeResourceScope scope, AzureDevComputeSandboxRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3638public Task<AzureDevComputeSandbox> SetLifecycleAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeSandboxLifecyclePolicy lifecycle, CancellationToken cancellationToken) => throw new NotSupportedException();
3639public Task<List<AzureDevComputeSandboxPort>> AddPortAsync(AzureDevComputeResourceScope scope, string sandboxId, AzureDevComputeAddPortRequest request, CancellationToken cancellationToken) => throw new NotSupportedException();
3646public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default) => throw new NotSupportedException();
3652private sealed class RecordingHandler(Func<HttpRequestMessage, Task<HttpResponseMessage>> handler) : HttpMessageHandler
3654protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
3708public 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)
584public Task<Response<IResourceGroupResource>> GetAsync(string resourceGroupName, CancellationToken cancellationToken = default)
609public Task<ArmOperation<IResourceGroupResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceGroupName, ResourceGroupData data, CancellationToken cancellationToken = default)
674public Task<ArmOperation> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
705public Task<ArmOperation<RoleAssignmentResource>> CreateOrUpdateAsync(
746public Task<ArmOperation<ArmDeploymentResource>> CreateOrUpdateAsync(
1035public Task<string> CompileBicepToArmAsync(string bicepFilePath, CancellationToken cancellationToken = default)
1052public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
1060public Task<DeploymentStateSection> AcquireCurrentSectionAsync(string sectionName, CancellationToken cancellationToken = default)
1079public Task<AzurePrincipal> GetPrincipalAsync(CancellationToken cancellationToken = default)
1117public (Task<ProcessResult>, IAsyncDisposable) Run(ProcessSpec processSpec)
1128var resultTask = Task.FromResult(result);
tests\Shared\TestInteractionService.cs (10)
33public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
38public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
43public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
51public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
66public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
73public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
82public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
92public Task<InteractionResult<bool>> PromptTerminalAsync(string message, AspireTerminal terminal, TerminalInteractionOptions? options = null, CancellationToken cancellationToken = default)
100private async Task<InteractionResult<bool>> PromptWorkAsync(
116var completionTask = data.CompletionTcs.Task;
Aspire.Hosting.Blazor (10)
Aspire.Hosting.Blazor.Tests (13)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Browsers (77)
BrowserHostRegistry.cs (5)
18private readonly Func<BrowserConfiguration, BrowserHostIdentity, BrowserLogsUserDataDirectory, CancellationToken, Task<IBrowserHost>> _createHostAsync;
39Func<BrowserConfiguration, BrowserHostIdentity, BrowserLogsUserDataDirectory, CancellationToken, Task<IBrowserHost>>? createHostAsync,
50public async Task<BrowserHostLease> AcquireAsync(BrowserConfiguration configuration, CancellationToken cancellationToken)
207private async Task<bool> TryWaitForLockAsync(CancellationToken cancellationToken)
290private 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 (138)
src\Aspire.Hosting.Browsers\BrowserHostRegistry.cs (5)
18private readonly Func<BrowserConfiguration, BrowserHostIdentity, BrowserLogsUserDataDirectory, CancellationToken, Task<IBrowserHost>> _createHostAsync;
39Func<BrowserConfiguration, BrowserHostIdentity, BrowserLogsUserDataDirectory, CancellationToken, Task<IBrowserHost>>? createHostAsync,
50public async Task<BrowserHostLease> AcquireAsync(BrowserConfiguration configuration, CancellationToken cancellationToken)
207private async Task<bool> TryWaitForLockAsync(CancellationToken cancellationToken)
290private 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)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestInteractionService.cs (10)
33public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
38public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
43public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
51public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
66public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
73public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
82public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
92public Task<InteractionResult<bool>> PromptTerminalAsync(string message, AspireTerminal terminal, TerminalInteractionOptions? options = null, CancellationToken cancellationToken = default)
100private async Task<InteractionResult<bool>> PromptWorkAsync(
116var completionTask = data.CompletionTcs.Task;
Aspire.Hosting.CodeGeneration.Go.Tests (34)
Aspire.Hosting.CodeGeneration.Java.Tests (17)
Aspire.Hosting.CodeGeneration.Python.Tests (14)
Aspire.Hosting.CodeGeneration.Rust.Tests (14)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (12)
Aspire.Hosting.Containers.Tests (9)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.DevTunnels (55)
DevTunnelCli.cs (20)
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> ShowPortAsync(
182public Task<int> CreatePortAsync(
202public Task<int> UpdatePortAsync(
221public Task<int> DeletePortAsync(
230protected virtual Task<int> RunAsync(string[] args, TextWriter? outputWriter = null, TextWriter? errorWriter = null, ILogger? logger = default, CancellationToken cancellationToken = default)
233private Task<int> RunAsync(string[] args, TextWriter? outputWriter = null, TextWriter? errorWriter = null, bool useShellExecute = false, ILogger? logger = default, CancellationToken cancellationToken = default)
248private async Task<int> RunAsync(Action<bool, string> onOutput, string[] args, bool useShellExecute = false, ILogger? logger = default, CancellationToken cancellationToken = default)
DevTunnelCliClient.cs (19)
33public async Task<Version> GetVersionAsync(ILogger? logger = default, CancellationToken cancellationToken = default)
67public Task<DevTunnelStatus> CreateTunnelAsync(string tunnelId, DevTunnelOptions options, ILogger? logger = default, CancellationToken cancellationToken = default)
70private async Task<DevTunnelStatus> CreateTunnelCoreAsync(string tunnelId, DevTunnelOptions options, ILogger? logger, CancellationToken cancellationToken)
195public async Task<DevTunnelStatus> GetTunnelAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default)
213public async Task<DevTunnelPortList> GetPortListAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default)
222public Task<DevTunnelPortStatus> CreatePortAsync(string tunnelId, int portNumber, DevTunnelPortOptions portOptions, ILogger? logger = default, CancellationToken cancellationToken = default)
225private async Task<DevTunnelPortStatus> CreatePortCoreAsync(string tunnelId, int portNumber, DevTunnelPortOptions portOptions, ILogger? logger, CancellationToken cancellationToken)
303private async Task<T> RetryProvisioningAsync<T>(Func<Task<T>> operation, ILogger? logger, CancellationToken cancellationToken)
322private async Task<T?> FindExistingAsync<T>(
323Func<TextWriter, TextWriter, ILogger?, CancellationToken, Task<int>> query,
486public async Task<DevTunnelPortDeleteResult> DeletePortAsync(string tunnelId, int portNumber, ILogger? logger = default, CancellationToken cancellationToken = default)
495public async Task<DevTunnelAccessStatus> GetAccessAsync(string tunnelId, int? portNumber = null, ILogger? logger = default, CancellationToken cancellationToken = default)
504public async Task<UserLoginStatus> GetUserLoginStatusAsync(ILogger? logger = default, CancellationToken cancellationToken = default)
513public async Task<UserLoginStatus> UserLoginAsync(LoginProvider provider, ILogger? logger = default, CancellationToken cancellationToken = default)
532private async Task<(T? Result, int ExitCode, string? Error)> CallCliAsJsonAsync<T>(Func<TextWriter, TextWriter, ILogger?, CancellationToken, Task<int>> cliCall, ILogger? logger = default, CancellationToken cancellationToken = default)
537private 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)
11Task<Version> GetVersionAsync(ILogger? logger = default, CancellationToken cancellationToken = default);
13Task<UserLoginStatus> GetUserLoginStatusAsync(ILogger? logger = default, CancellationToken cancellationToken = default);
15Task<UserLoginStatus> UserLoginAsync(LoginProvider provider, ILogger? logger = default, CancellationToken cancellationToken = default);
17Task<DevTunnelStatus> CreateTunnelAsync(string tunnelId, DevTunnelOptions options, ILogger? logger = default, CancellationToken cancellationToken = default);
19Task<DevTunnelPortList> GetPortListAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default);
21Task<DevTunnelPortStatus> CreatePortAsync(string tunnelId, int portNumber, DevTunnelPortOptions options, ILogger? logger = default, CancellationToken cancellationToken = default);
23Task<DevTunnelPortDeleteResult> DeletePortAsync(string tunnelId, int portNumber, ILogger? logger = default, CancellationToken cancellationToken = default);
25Task<DevTunnelStatus> GetTunnelAsync(string tunnelId, ILogger? logger = default, CancellationToken cancellationToken = default);
27Task<DevTunnelAccessStatus> GetAccessAsync(string tunnelId, int? portNumber = null, ILogger? logger = default, CancellationToken cancellationToken = default);
Aspire.Hosting.DevTunnels.Tests (54)
TestDevTunnelClient.cs (11)
26public Func<string, CancellationToken, Task<DevTunnelStatus>>? GetTunnelCallback { get; set; }
28public Func<int?, CancellationToken, Task<DevTunnelAccessStatus>>? GetAccessCallback { get; set; }
30public Task<Version> GetVersionAsync(ILogger? logger = null, CancellationToken cancellationToken = default)
36public Task<UserLoginStatus> GetUserLoginStatusAsync(ILogger? logger = null, CancellationToken cancellationToken = default)
42public Task<UserLoginStatus> UserLoginAsync(LoginProvider provider, ILogger? logger = null, CancellationToken cancellationToken = default)
48public Task<DevTunnelStatus> CreateTunnelAsync(string tunnelId, DevTunnelOptions options, ILogger? logger = null, CancellationToken cancellationToken = default)
54public Task<DevTunnelPortList> GetPortListAsync(string tunnelId, ILogger? logger = null, CancellationToken cancellationToken = default)
60public Task<DevTunnelPortStatus> CreatePortAsync(string tunnelId, int portNumber, DevTunnelPortOptions options, ILogger? logger = null, CancellationToken cancellationToken = default)
66public Task<DevTunnelPortDeleteResult> DeletePortAsync(string tunnelId, int portNumber, ILogger? logger = null, CancellationToken cancellationToken = default)
72public Task<DevTunnelStatus> GetTunnelAsync(string tunnelId, ILogger? logger = null, CancellationToken cancellationToken = default)
78public Task<DevTunnelAccessStatus> GetAccessAsync(string tunnelId, int? portNumber = null, ILogger? logger = null, CancellationToken cancellationToken = default)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestInteractionService.cs (10)
33public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
38public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
43public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
51public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
66public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
73public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
82public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
92public Task<InteractionResult<bool>> PromptTerminalAsync(string message, AspireTerminal terminal, TerminalInteractionOptions? options = null, CancellationToken cancellationToken = default)
100private async Task<InteractionResult<bool>> PromptWorkAsync(
116var completionTask = data.CompletionTcs.Task;
Aspire.Hosting.Docker (4)
Aspire.Hosting.Docker.Tests (5)
Aspire.Hosting.Dotnet (22)
DotnetProjectBuildCoordinator.cs (9)
1056private Task<IReadOnlyDictionary<string, string>> EvaluateOnceAsync(
1074var precedingEvaluation =
1096private async Task<IReadOnlyDictionary<string, string>> WaitForEvaluationAsync(
1160private async Task<IReadOnlyDictionary<string, string>> EvaluateAsync(
1162Task<IReadOnlyDictionary<string, string>>? precedingEvaluation,
1378Task<IReadOnlyDictionary<string, string>>? precedingEvaluation)
1380public Task<IReadOnlyDictionary<string, string>>? PrecedingEvaluation { get; } = precedingEvaluation;
1388Task<IReadOnlyDictionary<string, string>> task,
1391public Task<IReadOnlyDictionary<string, string>> Task { get; } = task;
Aspire.Hosting.Dotnet.Tests (27)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public 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)
200private async Task<EFOperationResult> ExecuteEfCommandAsync(string command, string subCommand, Dictionary<string, string?>? additionalArgs = null, bool noBuild = true)
611public async Task<EFOperationResult> UpdateDatabaseAsync()
617public async Task<EFOperationResult> DropDatabaseAsync()
626public async Task<EFOperationResult> ResetDatabaseAsync()
643public async Task<EFOperationResult> AddMigrationAsync(string? migrationName = null, string? outputDir = null, string? @namespace = null)
666public async Task<EFOperationResult> RemoveMigrationAsync()
675public async Task<EFOperationResult> GetDatabaseStatusAsync()
777public async Task<EFOperationResult> GenerateMigrationScriptAsync(string? outputPath = null, bool idempotent = true, bool noTransactions = false)
808public async Task<EFOperationResult> GenerateMigrationBundleAsync(string? outputPath = null, string? targetRuntime = null, bool selfContained = false)
Aspire.Hosting.EntityFrameworkCore.Tests (5)
Aspire.Hosting.Foundry (54)
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)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Garnet.Tests (1)
Aspire.Hosting.Go (1)
Aspire.Hosting.Go.Tests (7)
Aspire.Hosting.Java.Tests (14)
Aspire.Hosting.JavaScript.Tests (22)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public 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)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Kubernetes (25)
Aspire.Hosting.Kubernetes.Tests (9)
Aspire.Hosting.Maui (6)
Aspire.Hosting.Maui.Tests (20)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.MongoDB (3)
Aspire.Hosting.MongoDB.Tests (1)
Aspire.Hosting.MySql (3)
Aspire.Hosting.MySql.Tests (11)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Native.Client (135)
artifacts\obj\Aspire.Hosting.Native.Client\Debug\native-client\NativeClient.g.cs (91)
360public async Task<string> InviteApplicationObserverAsync(CancellationToken cancellationToken = default)
372public async Task<string> InviteResourceExecutionAsync(DeclaredResource @resource, CancellationToken cancellationToken = default)
384public async Task<ApplicationObservations> ReadApplicationStateAsync(CancellationToken cancellationToken = default)
410public async Task<bool> WaitResourceCompletionAsync(DeclaredResource @resource, int @timeoutMilliseconds, CancellationToken cancellationToken = default)
431public async Task<RuntimeOperation> InvokeResourceCommandAsync(string @resourceName, string @commandName, CancellationToken cancellationToken = default)
444public async Task<PendingConfirmations> ReadConfirmationsAsync(CancellationToken cancellationToken = default)
457public async Task<ResourceLogs> ReadResourceLogsAsync(string @resourceId, long @afterSequence, CancellationToken cancellationToken = default)
470public async Task<ApplicationObservations> ReadResourceObservationsAsync(CancellationToken cancellationToken = default)
498public async Task<ApplicationObservations> WaitResourceObservationsAsync(long @version, int @timeoutMilliseconds, CancellationToken cancellationToken = default)
547public async Task<Composition> BeginRevisionAsync(CancellationToken cancellationToken = default)
571public async Task<ApplicationExecution> GetApplicationExecutionAsync(CancellationToken cancellationToken = default)
582public async Task<string> InviteApplicationWorkspaceAsync(CancellationToken cancellationToken = default)
612public async Task<DeclaredResource> AddComputeEnvironmentAsync(string @name, string @typeId, CancellationToken cancellationToken = default)
628public async Task<DeclaredValue> AddConfiguredParameterAsync(string @name, bool @secret, bool @publishing, CancellationToken cancellationToken = default)
644public async Task<DeclaredResource> AddContainerAsync(string @name, string @image, CancellationToken cancellationToken = default)
660public async Task<DeclaredResource> AddExecutableAsync(string @name, string @executablePath, string @workingDirectory, CancellationToken cancellationToken = default)
677public async Task<DeclaredValue> AddGeneratedParameterAsync(string @name, string @options, bool @secret, CancellationToken cancellationToken = default)
692public async Task<DeclaredValue> AddGeneratedSecretParameterAsync(string @name, CancellationToken cancellationToken = default)
708public async Task<DeclaredValue> AddParameterValueAsync(string @name, string @value, bool @secret, bool @publishValueAsDefault, CancellationToken cancellationToken = default)
725public async Task<DeclaredResource> AddResourceAsync(string @name, string @typeId, CancellationToken cancellationToken = default)
740public async Task<DeclaredValue> AddSecretParameterAsync(string @name, string @value, CancellationToken cancellationToken = default)
756public async Task<DeclaredValue> CreateEndpointValueAsync(DeclaredResource @resource, string @endpointName, string @property, CancellationToken cancellationToken = default)
770public async Task<ApplicationExecution> CreateExecutionAsync(CancellationToken cancellationToken = default)
782public async Task<DeclaredValue> CreateLiteralValueAsync(string @value, CancellationToken cancellationToken = default)
794public async Task<string> ExportPublishModelAsync(CancellationToken cancellationToken = default)
805public async Task<CompositionSnapshot> InspectAsync(CancellationToken cancellationToken = default)
816public async Task<CompositionSnapshot> SealAsync(CancellationToken cancellationToken = default)
827public async Task<ApplicationExecution> StartApplicationAsync(CancellationToken cancellationToken = default)
857public async Task<Composition> StartGenerationAsync(CancellationToken cancellationToken = default)
874public async Task<DeclarationSnapshot> InspectResourceAsync(CancellationToken cancellationToken = default)
885public async Task<SymbolicConfigurationSnapshot> InspectSymbolicConfigurationAsync(CancellationToken cancellationToken = default)
951public async Task<DeclaredResource> WithArgumentAsync(DeclaredValue @value, CancellationToken cancellationToken = default)
966public async Task<DeclaredResource> WithBindMountAsync(string @source, string @target, bool @readOnly, CancellationToken cancellationToken = default)
994public async Task<DeclaredResource> WithEndpointAsync(WorkloadEndpointDeclaration @endpoint, CancellationToken cancellationToken = default)
1007public async Task<DeclaredResource> WithEntrypointAsync(string @entrypoint, CancellationToken cancellationToken = default)
1021public async Task<DeclaredResource> WithEnvironmentAsync(string @name, DeclaredValue @value, CancellationToken cancellationToken = default)
1034public async Task<DeclaredResource> WithExternalHttpEndpointsAsync(CancellationToken cancellationToken = default)
1048public async Task<DeclaredResource> WithLifecycleExecutableAsync(string @phase, ExecutableWorkloadLaunch @launch, SymbolicLaunchBindings @bindings, CancellationToken cancellationToken = default)
1064public async Task<DeclaredResource> WithReferenceAsync(string @environmentName, DeclaredValue @value, CancellationToken cancellationToken = default)
1080public async Task<DeclaredResource> WithVolumeAsync(string @name, string @target, bool @readOnly, CancellationToken cancellationToken = default)
1101public async Task<DeclaredValue> ConcatValueAsync(DeclaredValue @suffix, CancellationToken cancellationToken = default)
1113public async Task<DeclaredValue> EncodeUriValueAsync(CancellationToken cancellationToken = default)
1143public async Task<string[]> ClaimPublishingStepsAsync(CancellationToken cancellationToken = default)
1180public async Task<ApplicationRunLifetime> CreateApplicationLifetimeAsync(CancellationToken cancellationToken = default)
1191public async Task<ApplicationWorkspace> CreateApplicationWorkspaceAsync(CancellationToken cancellationToken = default)
1202public async Task<RpcBuilder> CreateRpcBuilderAsync(CancellationToken cancellationToken = default)
1214public async Task<ApplicationObserver> JoinApplicationObserverAsync(string @invitation, CancellationToken cancellationToken = default)
1227public async Task<ApplicationWorkspace> JoinApplicationWorkspaceAsync(string @invitation, CancellationToken cancellationToken = default)
1240public async Task<ResourceExecution> JoinResourceExecutionAsync(string @invitation, CancellationToken cancellationToken = default)
1252public async Task<CompositionSession> OpenApplicationAsync(CancellationToken cancellationToken = default)
1384public async Task<SymbolicConfigurationSnapshot> InspectExecutionSymbolicConfigurationAsync(CancellationToken cancellationToken = default)
1408public async Task<PendingResourceCommands> ReadResourceCommandsAsync(CancellationToken cancellationToken = default)
1419public async Task<ResourceConfigurationRevision> ReadResourceConfigurationAsync(CancellationToken cancellationToken = default)
1430public async Task<ApplicationObservations> ReadResourceDependenciesAsync(CancellationToken cancellationToken = default)
1442public async Task<RuntimeOperation> RequestConfirmationAsync(string @message, CancellationToken cancellationToken = default)
1456public async Task<StartedWorkload> RestartContainerAsync(long @revision, ContainerLaunch @container, CancellationToken cancellationToken = default)
1473public async Task<WorkloadAllocation> RestartContainerWithValuesAsync(long @revision, string @networkContext, ContainerWorkloadLaunch @launch, SymbolicLaunchBindings @bindings, CancellationToken cancellationToken = default)
1490public async Task<WorkloadAllocation> RestartContainerWorkloadAsync(long @revision, ContainerWorkloadLaunch @launch, CancellationToken cancellationToken = default)
1505public async Task<StartedWorkload> RestartExecutableAsync(long @revision, ExecutableLaunch @executable, CancellationToken cancellationToken = default)
1522public async Task<WorkloadAllocation> RestartExecutableWithValuesAsync(long @revision, string @networkContext, ExecutableWorkloadLaunch @launch, SymbolicLaunchBindings @bindings, CancellationToken cancellationToken = default)
1539public async Task<WorkloadAllocation> RestartExecutableWorkloadAsync(long @revision, ExecutableWorkloadLaunch @launch, CancellationToken cancellationToken = default)
1553public async Task<StartedWorkload> StartContainerAsync(ContainerLaunch @container, CancellationToken cancellationToken = default)
1569public async Task<WorkloadAllocation> StartContainerWithValuesAsync(long @revision, string @networkContext, ContainerWorkloadLaunch @launch, SymbolicLaunchBindings @bindings, CancellationToken cancellationToken = default)
1585public async Task<WorkloadAllocation> StartContainerWorkloadAsync(ContainerWorkloadLaunch @launch, CancellationToken cancellationToken = default)
1598public async Task<StartedWorkload> StartExecutableAsync(ExecutableLaunch @executable, CancellationToken cancellationToken = default)
1614public async Task<WorkloadAllocation> StartExecutableWithValuesAsync(long @revision, string @networkContext, ExecutableWorkloadLaunch @launch, SymbolicLaunchBindings @bindings, CancellationToken cancellationToken = default)
1630public async Task<WorkloadAllocation> StartExecutableWorkloadAsync(ExecutableWorkloadLaunch @launch, CancellationToken cancellationToken = default)
1643public async Task<PendingResourceCommands> WaitResourceCommandsAsync(int @timeoutMilliseconds, CancellationToken cancellationToken = default)
1657public async Task<ResourceConfigurationRevision> WaitResourceConfigurationAsync(long @revision, int @timeoutMilliseconds, CancellationToken cancellationToken = default)
1676public async Task<string> ReadLifecyclePhaseAsync(CancellationToken cancellationToken = default)
1689public async Task<bool> RunLifecycleExecutableAsync(ExecutableWorkloadLaunch @launch, SymbolicLaunchBindings @bindings, CancellationToken cancellationToken = default)
1723public async Task<RuntimeOperationResult> AwaitRuntimeOperationAsync(CancellationToken cancellationToken = default)
1761public async Task<RpcResource> AddContainerAsync(string @name, string @image, CancellationToken cancellationToken = default)
1777public async Task<RpcResource> AddExecutableAsync(string @name, string @executablePath, string @workingDirectory, CancellationToken cancellationToken = default)
1793public async Task<DeclaredValue> AddSecretParameterAsync(string @name, string @value, CancellationToken cancellationToken = default)
1806public async Task<Composition> BuildAsync(CancellationToken cancellationToken = default)
1835public async Task<DeclaredValue> PropertyAsync(string @property, CancellationToken cancellationToken = default)
1875public async Task<RpcEndpoint> GetEndpointAsync(string @name, CancellationToken cancellationToken = default)
1887public async Task<string> GetResourceNameAsync(CancellationToken cancellationToken = default)
1899public async Task<string?> GetSerializedAnnotationAsync(string @annotationId, CancellationToken cancellationToken = default)
1912public async Task<RpcResource> WaitForAsync(RpcResource @dependency, CancellationToken cancellationToken = default)
1925public async Task<RpcResource> WithArgsAsync(string[] @args, CancellationToken cancellationToken = default)
1938public async Task<RpcResource> WithArgsCallbackAsync(Func<RpcArgsEditor, Task> @callback, CancellationToken cancellationToken = default)
1965public async Task<RpcResource> WithConnectionStringAsync(object @value, CancellationToken cancellationToken = default)
1978public async Task<RpcResource> WithEndpointAsync(RpcEndpointOptions @options, CancellationToken cancellationToken = default)
1992public async Task<RpcResource> WithEnvironmentAsync(string @name, object @value, CancellationToken cancellationToken = default)
2006public async Task<RpcResource> WithEnvironmentCallbackAsync(Func<RpcEnvironmentEditor, Task> @callback, CancellationToken cancellationToken = default)
2033public async Task<RpcResource> WithImageTagAsync(string @tag, CancellationToken cancellationToken = default)
2046public async Task<RpcResource> WithReferenceAsync(RpcResource @source, CancellationToken cancellationToken = default)
2060public async Task<RpcResource> WithSerializedAnnotationAsync(string @annotationId, string @json, CancellationToken cancellationToken = default)
2078public static async Task<CompositionSession> CreateSessionAsync(NativeClient client, CancellationToken cancellationToken = default)
NativeClient.cs (20)
24private readonly System.Collections.Concurrent.ConcurrentDictionary<string, Func<JsonElement, Task<JsonElement>>> _callbacks = new(StringComparer.Ordinal);
40new Func<string, JsonElement, string, Task<JsonElement>>(DispatchProviderAsync));
41_rpc.AddLocalRpcMethod("cancelProviderInvocation", new Func<string, Task<bool>>(CancelProviderInvocationAsync));
42_rpc.AddLocalRpcMethod("releaseIntegrationResource", new Func<string, Task<bool>>(ReleaseIntegrationResourceAsync));
44new Func<string, JsonElement, Task<JsonElement>>(DispatchCallbackAsync));
54private async Task<bool> CancelProviderInvocationAsync(string id)
65private async Task<bool> ReleaseIntegrationResourceAsync(string id)
78private async Task<JsonElement> DispatchProviderAsync(string capability, JsonElement arguments, string invocationId)
107private async Task<JsonElement> DispatchCallbackAsync(string id, JsonElement arguments)
131public static async Task<NativeClient> ConnectAsync(EndPoint endpoint, string authenticationToken,
189public async Task<JsonElement> InvokeAsync(string capability, Dictionary<string, JsonElement> arguments,
201private static async Task<T> RequestAsync<T>(Func<Task<T>> send, CancellationToken cancellationToken)
204var request = send();
217public Task<string> ExpectIntegrationHostAsync(string packageName, CancellationToken cancellationToken) =>
220public Task<bool> WaitIntegrationHostRegistrationAsync(string authority, CancellationToken cancellationToken) =>
227public Task<bool> AbandonIntegrationHostRegistrationAsync(string authority, CancellationToken cancellationToken) =>
230public Task<JsonElement> GetIntegrationCapabilitiesAsync(CancellationToken cancellationToken) =>
250public void RegisterCallback(string id, Func<JsonElement, Task<JsonElement>> callback)
263internal Task<JsonElement> InvokeGuestCallbackAsync(string callback, Dictionary<string, JsonElement> arguments) =>
Aspire.Hosting.Native.CodeGeneration (8)
Aspire.Hosting.Native.Core (33)
Runtime\RuntimeGeneration.cs (17)
208internal async Task<RuntimeConfigurationRevision> WaitConfigurationAsync(Guid resourceId, long revision, int timeoutMilliseconds)
270internal Task<WorkloadEndpoint> StartWorkload(Guid resourceId, WorkloadPlan plan) =>
273internal Task<WorkloadEndpoint> StartSymbolicWorkload(Guid resourceId, long revision, WorkloadPlan template,
374private Task<WorkloadEndpoint> StartWorkloadCore(Guid resourceId, WorkloadPlan plan, Func<WorkloadPlan> resolvePlan)
467internal Task<WorkloadEndpoint> ReplaceWorkloadAsync(Guid resourceId, long revision, WorkloadPlan plan) =>
470internal Task<WorkloadEndpoint> ReplaceSymbolicWorkloadAsync(Guid resourceId, long revision, WorkloadPlan template,
483private async Task<WorkloadEndpoint> ReplaceWorkloadCoreAsync(Guid resourceId, long revision, WorkloadPlan plan, Func<WorkloadPlan> resolvePlan)
513Task<WorkloadEndpoint> started;
664public async Task<RuntimeSnapshot> WaitForChangeAsync(long version, int timeoutMilliseconds)
860internal async Task<ImmutableArray<RuntimeCommand>> WaitCommandsAsync(Guid resourceId, int timeoutMilliseconds)
1100public Task<RuntimeConfigurationRevision> WaitConfigurationAsync(long revision, int timeoutMilliseconds)
1111public Task<WorkloadEndpoint> StartWorkload(WorkloadPlan plan)
1117public Task<WorkloadEndpoint> StartSymbolicWorkload(long revision, WorkloadPlan template,
1124public Task<WorkloadEndpoint> ReplaceSymbolicWorkloadAsync(long revision, WorkloadPlan template,
1138public Task<WorkloadEndpoint> ReplaceWorkloadAsync(long revision, WorkloadPlan plan)
1165public Task<ImmutableArray<RuntimeCommand>> WaitCommandsAsync(int timeoutMilliseconds)
1198public Task<RuntimeRequestResult> Completion => _completion.Task;
Aspire.Hosting.Native.Core.Tests (121)
ApplicationRevisionTests.cs (12)
61var commandResult = context.Observer.InvokeAsync("awaitRuntimeOperation", Arguments(("context", command)));
62var confirmationResult = context.Integration.InvokeAsync("awaitRuntimeOperation", Arguments(("context", confirmation)));
130var commit = Commit(context, revision);
173var waiting = context.Integration.InvokeAsync("waitResourceConfiguration",
247var restart = context.Integration.InvokeAsync("restartContainer", RestartArguments(context.Writer, 1));
277var restart = context.Integration.InvokeAsync("restartContainer", RestartArguments(context.Writer, 1));
305var restart = context.Integration.InvokeAsync("restartContainer", RestartArguments(context.Writer, 1));
307var retire = context.Author.InvokeAsync("retireApplicationWorkspace", Arguments(("context", context.Workspace)));
327var configuration = context.Integration.InvokeAsync("waitResourceConfiguration", Arguments(
329var commands = context.Integration.InvokeAsync("waitResourceCommands", Arguments(
343var commit = Commit(context, revision);
381private static Task<JsonObject> Commit(WorkspaceRpcTestContext context, JsonNode revision) =>
NativeTimeProviderTests.cs (7)
83var waitConfiguration = owner.WaitConfigurationAsync(configuration.Revision, 1000);
84var waitCommands = owner.WaitCommandsAsync(1000);
86var waitObservation = runtime.WaitForChangeAsync(version, 1000);
128var started = owner.StartWorkload(new ContainerWorkload("example:1", 0, [], []));
207var started = owner.StartWorkload(new ContainerWorkload("example:1", 0, [], []));
236var changed = runtime.WaitForChangeAsync(version, 5000);
289var wait = DcpConnectionMaterial.WaitAsync("missing-kubeconfig-" + Guid.NewGuid(), () => false, TimeSpan.FromSeconds(1),
Aspire.Hosting.Native.Server (75)
Api\WorkloadApi.cs (8)
19public async Task<WorkloadAllocation> StartContainerWithValues(long revision, string networkContext,
31public async Task<WorkloadAllocation> StartExecutableWithValues(long revision, string networkContext,
38public async Task<WorkloadAllocation> RestartContainerWithValues(long revision, string networkContext,
45public async Task<WorkloadAllocation> RestartExecutableWithValues(long revision, string networkContext,
77public async Task<WorkloadAllocation> StartContainerWorkload(ContainerWorkloadLaunch launch) =>
82public async Task<WorkloadAllocation> RestartContainerWorkload(long revision, ContainerWorkloadLaunch launch) =>
87public async Task<WorkloadAllocation> StartExecutableWorkload(ExecutableWorkloadLaunch launch) =>
92public async Task<WorkloadAllocation> RestartExecutableWorkload(long revision, ExecutableWorkloadLaunch launch) =>
Dcp\DcpApiClient.cs (3)
117public async Task<DcpResource?> GetAsync(DcpResourceCollection collection, string name, CancellationToken cancellationToken)
143public async Task<string[]> ReadLogsAsync(DcpResourceCollection collection, string name, LogStream source, long offset, CancellationToken cancellationToken)
172private async Task<T?> SendAsync<T>(HttpMethod method, string path, JsonElement? body, JsonTypeInfo<T> responseType, CancellationToken cancellationToken,
Rpc\NativeProviderRegistry.cs (6)
22Task<JsonNode?> InvokeAsync(NativeRpcConnection caller, string capability, JsonObject arguments);
23Task<JsonNode?> InvokeCoreAsync(NativeRpcConnection provider, string capability, JsonObject arguments);
24Task<JsonNode?> InvokeCallbackAsync(NativeRpcConnection provider, string callback, JsonObject arguments);
191public async Task<JsonNode?> InvokeAsync(NativeRpcConnection caller, string capability, JsonObject arguments)
281public async Task<JsonNode?> InvokeCoreAsync(NativeRpcConnection provider, string capability, JsonObject arguments)
355public async Task<JsonNode?> InvokeCallbackAsync(NativeRpcConnection provider, string callbackId, JsonObject arguments)
Aspire.Hosting.Nats (2)
Aspire.Hosting.OpenAI (4)
Aspire.Hosting.OpenAI.Tests (9)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Orleans.Tests (1)
Aspire.Hosting.PostgreSQL (4)
Aspire.Hosting.PostgreSQL.Tests (11)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public 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)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Radius (31)
Publishing\SealedSecretApplyStep.cs (14)
269Func<CancellationToken, Task<SealedSecretStatusSnapshot>> getStatus,
270Func<CancellationToken, Task<bool>> secretExists,
318internal static async Task<T> InvokeProbeWithRemainingBudgetAsync<T>(
319Func<CancellationToken, Task<T>> probe,
485private static async Task<long> ApplyManifestAsync(ReadOnlyMemory<byte> content, string? @namespace, string? kubeContext, string storeName, string ns, string name, string manifestPath, ILogger logger, CancellationToken cancellationToken)
498private static async Task<SealedSecretStatusSnapshot> GetSealedSecretStatusAsync(string ns, string name, string? kubeContext, CancellationToken cancellationToken)
509internal static async Task<SealedSecretStatusSnapshot> GetSealedSecretStatusAsync(
514Func<IReadOnlyList<string>, CancellationToken, Task<(int ExitCode, string StdOut, string StdErr)>> runKubectl)
581private static async Task<IReadOnlySet<string>> GetSecretDataKeysAsync(string ns, string name, string? kubeContext, CancellationToken cancellationToken)
617private static async Task<bool> SecretExistsAsync(string ns, string name, string? kubeContext, CancellationToken cancellationToken)
627internal static async Task<bool> SecretExistsAsync(
632Func<IReadOnlyList<string>, CancellationToken, Task<(int ExitCode, string StdOut, string StdErr)>> runKubectl)
694private static async Task<bool> DetectKubectlAsync(CancellationToken cancellationToken)
749private static async Task<(int ExitCode, string StdOut, string StdErr)> RunKubectlAsync(
Aspire.Hosting.Radius.Tests (4)
Aspire.Hosting.Redis (2)
Aspire.Hosting.Redis.Tests (2)
Aspire.Hosting.RemoteHost (36)
Aspire.Hosting.RemoteHost.Tests (75)
ExternalCapabilityRegistryTests.cs (11)
68var invocation = registry.TryInvokeAsync("test.external/stall", null);
228var invocation = registry.TryInvokeAsync("test.external/value", null, cancellationToken: cancellation.Token);
269var invocation = dispatcher.InvokeAsync("test.external/cancel",
315var invocation = registry.InvokeGuestCallbackAsync(integration.ServerRpc, relayId, null, TestContext.Current.CancellationToken);
376var invocation = registry.InvokeGuestCallbackAsync(integration.ServerRpc, relayId, null, TestContext.Current.CancellationToken);
422var registration = registry.ExpectHostRegistration("attempt");
440var replacement = registry.ExpectHostRegistration("replacement");
455var registration = registry.ExpectHostRegistration("original");
636var invocation = registry.TryInvokeAsync("test.external/callback",
679var firstInvocation = registry.TryInvokeAsync("test.external/callback", firstArgs, firstOwner);
681var secondInvocation = registry.TryInvokeAsync("test.external/callback", secondArgs, secondOwner);
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestInteractionService.cs (10)
33public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
38public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
43public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
51public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
66public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
73public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
82public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
92public Task<InteractionResult<bool>> PromptTerminalAsync(string message, AspireTerminal terminal, TerminalInteractionOptions? options = null, CancellationToken cancellationToken = default)
100private async Task<InteractionResult<bool>> PromptWorkAsync(
116var completionTask = data.CompletionTcs.Task;
TestServices\IntegrationHostTestConnection.cs (6)
22public IntegrationHostTestConnection(JsonElement capabilities, Func<string, JsonObject?, Task<JsonNode?>> handleCapability)
27public IntegrationHostTestConnection(JsonElement capabilities, Func<string, JsonObject?, CancellationToken, Task<JsonNode?>> invokeCallback)
32public IntegrationHostTestConnection(Func<CancellationToken, Task<JsonElement>> getCapabilities)
38Func<CancellationToken, Task<JsonElement>> getCapabilities,
39Func<string, JsonObject?, Task<JsonNode?>>? handleCapability,
40Func<string, JsonObject?, CancellationToken, Task<JsonNode?>>? invokeCallback)
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 (20)
AppHostSdkTargetsTests.cs (20)
232private static async Task<string> RunWriteDashboardAndDcpTargetAsync(TemporaryWorkspace workspace, string? extraProjectXml, bool setUsingAspireAppHostSdkMarker = true)
1285Task<bool>? executionTask = null;
1471private static async Task<string[]> RunAddReferenceToDashboardAndDcpAsync(TemporaryWorkspace workspace, string? extraProjectXml)
1514private static async Task<RunHookProject> CreateRunHookProjectAsync(
1568private static async Task<Dictionary<string, string>> GetComputeRunArgumentsPropertiesAsync(
1581private static async Task<Dictionary<string, string>> GetResolveAspireCliBundlePathPropertiesAsync(
1594private static async Task<Dictionary<string, string>> GetTargetPropertiesAsync(
1629private static async Task<string> CreateFakeAspireCliAsync(string fakeCliDirectory)
1650private static async Task<string> CreateFakeAspireCliThatSetsUpBundleAsync(string fakeCliDirectory)
1708private static async Task<string> CreateFakeAspireCommandShimAsync(string fakeCliDirectory, string extension = ".cmd")
1744private static async Task<string> CreateFakeDnxAsync(string fakeCliDirectory)
1843private static async Task<string> CreateFailingWorkingDirectoryShadowAsync(string workingDirectory, string command)
2061private static async Task<string?> FindFullFrameworkMSBuildAsync()
2241private static async Task<(int ExitCode, string Output)> RunDotNetAsync(string workingDirectory, string arguments)
2254var outputTask = process.StandardOutput.ReadToEndAsync();
2255var errorTask = process.StandardError.ReadToEndAsync();
2275private static Task<DotNetResult> RunDotNetWithArgumentsAsync(string workingDirectory, string[] arguments, IDictionary<string, string>? environment = null)
2278private static async Task<DotNetResult> RunProcessWithArgumentsAsync(
2313var outputTask = process.StandardOutput.ReadToEndAsync();
2314var errorTask = process.StandardError.ReadToEndAsync();
Aspire.Hosting.SqlServer (2)
Aspire.Hosting.Tasks (7)
Aspire.Hosting.Testing (22)
DistributedApplicationTestingBuilder.cs (14)
33public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(CancellationToken cancellationToken = default)
62public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(
82public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, CancellationToken cancellationToken = default)
108public static Task<IDistributedApplicationTestingBuilder> CreateAsync(
131public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(string[] args, CancellationToken cancellationToken = default)
145public static Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, CancellationToken cancellationToken = default)
161public static Task<IDistributedApplicationTestingBuilder> CreateAsync<TEntryPoint>(string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder, CancellationToken cancellationToken = default)
175public static async Task<IDistributedApplicationTestingBuilder> CreateAsync(Type entryPoint, string[] args, Action<DistributedApplicationOptions, HostApplicationBuilderSettings> configureBuilder, CancellationToken cancellationToken = default)
178private static async Task<IDistributedApplicationTestingBuilder> CreateAsyncCore(
470public async Task<IDistributedApplicationTestingBuilder> CreateBuilderAsync(CancellationToken cancellationToken)
492public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
538public 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)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Hosting.Tests (265)
Dcp\KubernetesServiceTests.cs (28)
148var moveNext = enumerator.MoveNextAsync().AsTask();
228var moveNext = enumerator.MoveNextAsync().AsTask();
315var moveNext = enumerator.MoveNextAsync().AsTask();
381Task<bool>? moveNext = null;
425var moveNext = enumerator.MoveNextAsync().AsTask();
479var moveNext = enumerator.MoveNextAsync().AsTask();
527var moveNext = enumerator.MoveNextAsync().AsTask();
670var moveNext = enumerator.MoveNextAsync().AsTask();
723var moveNext = enumerator.MoveNextAsync().AsTask();
881private Task<TestDcpApiServer> StartServerAsync(
1490var createTask = service.CreateAsync(Container.Create("frontend", "test-image"), cts.Token);
1532var createTask = service.CreateAsync(Container.Create("frontend", "test-image"), cts.Token);
1625var createTask = service.CreateAsync(Container.Create("frontend", "test-image"), cts.Token);
1675var createTask = service.CreateAsync(Container.Create("frontend", "test-image"), cts.Token);
1737var createTask = service.CreateAsync(Container.Create("frontend", "test-image"), createCts.Token);
1762var listTask = service.ListAsync<Container>(cancellationToken: cts.Token);
1786var listTask = service.ListAsync<Container>(cancellationToken: cts.Token);
1867var listTask = service.ListAsync<Container>(cancellationToken: cts.Token);
1921var createTask = service.CreateAsync(Container.Create("frontend", "test-image"), cts.Token);
1949var listTask = service.ListAsync<Container>(cancellationToken: cts.Token);
2047var listTask = service.ListAsync<Container>(cancellationToken: cts.Token);
2075var watchTask = watchEnumerator.MoveNextAsync().AsTask();
2107var watchTask = watchEnumerator.MoveNextAsync().AsTask();
2164var watchTask = watchEnumerator.MoveNextAsync().AsTask();
2233var watchTask = watchEnumerator.MoveNextAsync().AsTask();
2261var listTask = service.ListAsync<Container>(cancellationToken: cts.Token);
2312private static async Task<Container> ReadContainerAsync(HttpContext context)
2521public static async Task<TestDcpApiServer> StartAsync(
Dcp\TestKubernetesService.cs (6)
77public Task<T> GetAsync<T>(string name, string? namespaceParameter = null, CancellationToken _ = default) where T : CustomResource, IKubernetesStaticMetadata
98public async Task<T> CreateAsync<T>(T obj, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
289public async Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
309public Task<List<T>> ListAsync<T>(string? namespaceParameter = null, CancellationToken cancellationToken = default) where T : CustomResource, IKubernetesStaticMetadata
370public Task<Stream> GetLogStreamAsync<T>(
385public 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");
467var resultTask = interactionService.PromptInputAsync(
504var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
527var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
550var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
571var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
594var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
627var resultTask = interactionService.PromptInputAsync("Please provide", "please", input);
965var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
1030var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
1085var resultTask = interactionService.PromptInputsAsync("Login", "Please enter credentials", inputs);
1148var resultTask = interactionService.PromptInputsAsync("Validation Test", "Test validation", inputs, options);
1261var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions
1294var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions
1328var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions
1361var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions { Title = "Working..." }, cancellationToken: cts.Token);
1380var resultTask = interactionService.PromptProgressAsync("Please wait", new ProgressInteractionOptions
1402var resultTask = interactionService.PromptProgressAsync("Please wait...", cancellationToken: cts.Token);
1458var resultTask = interactionService.PromptInputAsync("Select file", "please", input);
1487var resultTask = interactionService.PromptInputAsync("Select file", "please", input);
1512var resultTask = interactionService.PromptInputAsync("Select file", "please", input, cancellationToken: cancellationTokenSource.Token);
1531var resultTask = interactionService.PromptInputAsync("Enter text", "please", input);
1555var resultTask = interactionService.PromptInputAsync("Enter text", "please", input);
Orchestrator\ParameterProcessorTests.cs (8)
497var logsTask = ConsoleLoggingTestHelpers.WatchForLogsAsync(loggerService, 1, parameterWithMissingValue);
521var logsTask = ConsoleLoggingTestHelpers.WatchForLogsAsync(loggerService, 1, parameterWithError);
552var logsTask = ConsoleLoggingTestHelpers.WatchForLogsAsync(loggerService, 1, parameter);
1740public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
1745public Task<DeploymentStateSection> AcquireCurrentSectionAsync(string sectionName, CancellationToken cancellationToken = default)
2337var waitingValue = parameter.GetValueAsync(CancellationToken.None).AsTask();
2558public Task<DeploymentStateSection> AcquireSectionAsync(string sectionName, CancellationToken cancellationToken = default)
2570public Task<DeploymentStateSection> AcquireCurrentSectionAsync(string sectionName, CancellationToken cancellationToken = default)
Publishing\PipelineActivityReporterTests.cs (6)
569var promptTask = _interactionService.PromptInputAsync("Test Prompt", "test-description", "text-label", "test-placeholder");
594var promptTask = _interactionService.PromptInputAsync("Test Prompt", "test-description", "text-label", "test-placeholder");
623var promptTask = _interactionService.PromptInputAsync("Test Prompt", "test-description", "text-label", "test-placeholder");
655var promptTask = _interactionService.PromptInputAsync("Upload", "Select a file", input);
695var promptTask = _interactionService.PromptInputAsync("Upload", "Select a file", input, cancellationToken: cancellationTokenSource.Token);
722var notificationTask = _interactionService.PromptNotificationAsync("Test Notification", "This is a test notification message", notificationOptions);
ResourceNotificationTests.cs (25)
78var watchTask = Task.Run(async () =>
102async Task<List<ResourceEvent>> GetValuesAsync(CancellationToken cancellationToken)
120var enumerableTask = GetValuesAsync(cts.Token);
180async Task<List<ResourceEvent>> GetValuesAsync(CancellationToken cancellation)
198var enumerableTask = GetValuesAsync(cts.Token);
292var waitTask = notificationService.WaitForResourceAsync("MYRESOURCE", ["SomeState", "someotherstate"]);
323var waitTask = notificationService.WaitForResourceAsync("myResource1", ["SomeState", "SomeOtherState"]);
355var waitTask = notificationService.WaitForResourceAsync("myResource1", ["SomeState", "SomeOtherState"], default);
1140async Task<List<ResourceEvent>> GetValuesAsync(CancellationToken cancellationToken)
1158var enumerableTask = GetValuesAsync(cts.Token);
1200async Task<ResourceEvent> GetFirstValueAsync(CancellationToken cancellationToken)
1210var enumerableTask = GetFirstValueAsync(cts.Token);
1236async Task<ResourceEvent> GetFirstValueAsync(CancellationToken cancellationToken)
1246var enumerableTask = GetFirstValueAsync(cts.Token);
1377var waitTask = notificationService.WaitForResourceHealthyAsync("myResource");
1422var waitTask = notificationService.WaitForResourceHealthyAsync("myResource");
1447var waitTask = notificationService.WaitForResourceHealthyAsync("myResource");
1513var waitTask = notificationService.WaitForResourceAsync(resource.Name, resourceEvent =>
1556var waitTask = notificationService.WaitForResourceAsync(resource.Name, resourceEvent =>
1577var waitTask = notificationService.WaitForResourceAsync("myResource", _ => true, cts.Token);
1601var waitTask = notificationService.WaitForResourceAsync(resource.Name, _ => throw expectedException);
1640var waitTask = notificationService.WaitForResourceHealthyAsync(resource.Name);
1662var waitTask = notificationService.WaitForResourceHealthyAsync(resource.Name);
1748var waitTask = notificationService.WaitForResourceHealthyAsync("does-not-exist", WaitBehavior.WaitOnResourceUnavailable, cts.Token);
1755private static async Task<bool> PublishAndGetIsHiddenAsync<T>(
Terminals\InteractionServiceTerminalTests.cs (12)
119var prompt = service.PromptInputsAsync("Title", "Message", [input]);
137var prompt = service.PromptTerminalAsync("Message", terminal, cancellationToken: cts.Token);
163var prompt = service.PromptTerminalAsync("Message", terminal, options);
206var prompt = service.PromptTerminalAsync("Message", terminal, cancellationToken: cts.Token);
231var prompt = service.PromptTerminalAsync("Message", terminal, new TerminalInteractionOptions
283var firstUpdate = updates.MoveNextAsync().AsTask();
287var prompt = progress
330var second = service.PromptTerminalAsync("Again", terminal, cancellationToken: cts.Token);
347var prompt = progress
370var prompt = service.PromptTerminalAsync("Message", terminal);
401var prompt = service.PromptTerminalAsync("Message", terminal);
427var prompt = service.PromptTerminalAsync("Message", terminal, cancellationToken: cts.Token);
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
tests\Shared\TestInteractionService.cs (10)
33public Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
38public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
43public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
51public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
66public async Task<InteractionResult<bool>> PromptNotificationAsync(string title, string message, NotificationInteractionOptions? options = null, CancellationToken cancellationToken = default)
73public async Task<InteractionResult<bool>> PromptMessageBoxAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
82public async Task<InteractionResult<bool>> PromptProgressAsync(string message, ProgressInteractionOptions? options = null, CancellationToken cancellationToken = default)
92public Task<InteractionResult<bool>> PromptTerminalAsync(string message, AspireTerminal terminal, TerminalInteractionOptions? options = null, CancellationToken cancellationToken = default)
100private async Task<InteractionResult<bool>> PromptWorkAsync(
116var completionTask = data.CompletionTcs.Task;
Aspire.Hosting.TestUtilities (36)
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 (2)
Aspire.Hosting.Valkey.Tests (10)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.Managed.Tests (10)
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)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public 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.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 (9)
Aspire.TerminalHost.Tests (33)
tests\Shared\AsyncTestHelpers.cs (9)
134public static Task<T> DefaultTimeout<T>(this Task<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
144public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
149public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
159public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default)
164public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout,
215public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
Aspire.TestTools (13)
Aspire.TestUtilities (1)
Aspire.Tray.Tests (37)
AzureFunctionsEndToEnd.Functions (1)
AzureFunctionsWithDts.Functions (1)
BasketService (14)
Binding.Http.IntegrationTests (3)
Binding.ReliableSession.IntegrationTests (10)
blazor-gateway (1)
CatalogDb (3)
CatalogModel (2)
cdac-build-tool (3)
CdkSample.ApiService (9)
Client.ClientBase.IntegrationTests (1)
Client.ExpectedExceptions.IntegrationTests (7)
Client.TypedClient.IntegrationTests (3)
Contract.Service.IntegrationTests (6)
Contract.XmlSerializer.IntegrationTests (1)
CosmosEndToEnd.ApiService (1)
CreateLayout (2)
csc (12)
dotnet-aot (49)
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)
EntraId.Web (1)
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)
GenerateTemplateManifest (2)
GetDocument.Insider (1)
ILCompiler.ReadyToRun (16)
ILLink.CodeFixProvider (2)
ILLink.RoslynAnalyzer (1)
Infrastructure.Common (4)
Infrastructure.Tests (118)
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.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.Platform (2)
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;
153public Task<bool>? TransportTask { get; set; }
264public Func<AuthenticationRefreshContext, Task<bool>> OnAuthenticationRefresh
324internal async Task<UserUpdateResult> UpdateUserAsync(
328Func<AuthenticationRefreshContext, Task<bool>>? additionalAuthenticationRefresh = null,
333Func<AuthenticationRefreshContext, Task<bool>> callback;
453Func<AuthenticationRefreshContext, Task<bool>> callback,
467Func<AuthenticationRefreshContext, Task<bool>> callback)
472private async Task<bool> InvokeOnAuthenticationRefreshAsync(Func<AuthenticationRefreshContext, Task<bool>> callback, AuthenticationRefreshContext context)
493private static Task<bool> DefaultOnAuthenticationRefreshAsync(AuthenticationRefreshContext context)
842async Task<bool> Func()
904internal 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 (164)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\GeneratedRouteBuilderExtensions.g.cs (68)
89var 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!);
107var 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)!);
134var task = handler(registration_local!, context_local, sp_local);
172var 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!);
209var 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!);
227var 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)!);
287var task = handler(login_local!, useCookies_local, useSessionCookies_local, sp_local);
358var 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!);
392var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.ContentHttpResult> (global::Microsoft.AspNetCore.Identity.Data.PasskeyRequestOptionsRequest arg0, global::System.IServiceProvider arg1) => throw null!);
410var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.PasskeyRequestOptionsRequest>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
436var task = handler(request_local!, sp_local);
473var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.ContentHttpResult> (global::Microsoft.AspNetCore.Identity.Data.PasskeyRequestOptionsRequest arg0, global::System.IServiceProvider arg1) => throw null!);
510var 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.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.PasskeyLoginRequest arg0, global::System.Boolean? arg1, global::System.Boolean? arg2, global::System.IServiceProvider arg3) => throw null!);
528var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.PasskeyLoginRequest>(0)!, ic.GetArgument<global::System.Boolean?>(1)!, ic.GetArgument<global::System.Boolean?>(2)!, ic.GetArgument<global::System.IServiceProvider>(3)!);
588var task = handler(login_local!, useCookies_local, useSessionCookies_local, sp_local);
659var 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.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.PasskeyLoginRequest arg0, global::System.Boolean? arg1, global::System.Boolean? arg2, global::System.IServiceProvider arg3) => throw null!);
694var 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!);
712var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.RefreshRequest>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
738var task = handler(refreshRequest_local!, sp_local);
775var 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!);
811var 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!);
828var 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)!);
869var task = handler(userId_local, code_local, changedEmail_local, sp_local);
921var 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!);
957var 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.ResendConfirmationEmailRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!);
975var 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)!);
1002var task = handler(resendRequest_local!, context_local, sp_local);
1040var 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.ResendConfirmationEmailRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!);
1075var 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!);
1093var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.ForgotPasswordRequest>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
1119var task = handler(resetRequest_local!, sp_local);
1156var 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!);
1191var 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!);
1209var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.ResetPasswordRequest>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
1235var task = handler(resetRequest_local!, sp_local);
1272var 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!);
1306var 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.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!);
1323var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
1343var task = handler(claimsPrincipal_local, sp_local);
1374var 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.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!);
1410var 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.PasskeyInfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.PasskeyRegistrationRequest arg1, global::System.IServiceProvider arg2) => throw null!);
1428var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.PasskeyRegistrationRequest>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!);
1455var task = handler(claimsPrincipal_local, registration_local!, sp_local);
1493var 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.PasskeyInfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.PasskeyRegistrationRequest arg1, global::System.IServiceProvider arg2) => throw null!);
1527var 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.PasskeyInfoResponse[]>, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!);
1544var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
1564var task = handler(claimsPrincipal_local, sp_local);
1595var 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.PasskeyInfoResponse[]>, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!);
1632var 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.PasskeyInfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.String arg1, global::Microsoft.AspNetCore.Identity.Data.PasskeyUpdateRequest arg2, global::System.IServiceProvider arg3) => throw null!);
1651var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.String>(1)!, ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.PasskeyUpdateRequest>(2)!, ic.GetArgument<global::System.IServiceProvider>(3)!);
1687var task = handler(claimsPrincipal_local, credentialId_local!, request_local!, sp_local);
1734var 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.PasskeyInfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.String arg1, global::Microsoft.AspNetCore.Identity.Data.PasskeyUpdateRequest arg2, global::System.IServiceProvider arg3) => throw null!);
1769var 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.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.String arg1, global::System.IServiceProvider arg2) => throw null!);
1787var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.String>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!);
1816var task = handler(claimsPrincipal_local, credentialId_local!, sp_local);
1856var 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.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.String arg1, global::System.IServiceProvider arg2) => throw null!);
1892var 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!);
1910var 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)!);
1937var task = handler(claimsPrincipal_local, tfaRequest_local!, sp_local);
1975var 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!);
2009var 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!);
2026var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!);
2046var task = handler(claimsPrincipal_local, sp_local);
2077var 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!);
2114var 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!);
2132var 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)!);
2160var task = handler(claimsPrincipal_local, infoRequest_local!, context_local, sp_local);
2199var 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 (18)
64routeGroup.MapPost("/register", async Task<Results<Ok, ValidationProblem>>
97routeGroup.MapPost("/login", async Task<Results<Ok<AccessTokenResponse>, EmptyHttpResult, ProblemHttpResult>>
128passkeyGroup.MapPost("/requestOptions", async Task<ContentHttpResult>
143passkeyGroup.MapPost("/login", async Task<Results<Ok<AccessTokenResponse>, EmptyHttpResult, ProblemHttpResult, ValidationProblem>>
176routeGroup.MapPost("/refresh", async Task<Results<Ok<AccessTokenResponse>, UnauthorizedHttpResult, SignInHttpResult, ChallengeHttpResult>>
199routeGroup.MapGet("/confirmEmail", async Task<Results<ContentHttpResult, UnauthorizedHttpResult>>
250routeGroup.MapPost("/resendConfirmationEmail", async Task<Results<Ok, ValidationProblem>>
269routeGroup.MapPost("/forgotPassword", async Task<Results<Ok, ValidationProblem>>
294routeGroup.MapPost("/resetPassword", async Task<Results<Ok, ValidationProblem>>
330passkeyAccountGroup.MapPost("/creationOptions", async Task<Results<ContentHttpResult, NotFound>>
355passkeyAccountGroup.MapPost("", async Task<Results<Ok<PasskeyInfoResponse>, ValidationProblem, NotFound>>
410passkeyAccountGroup.MapGet("", async Task<Results<Ok<PasskeyInfoResponse[]>, NotFound>>
432passkeyAccountGroup.MapPut("/{credentialId}", async Task<Results<Ok<PasskeyInfoResponse>, ValidationProblem, NotFound>>
471passkeyAccountGroup.MapDelete("/{credentialId}", async Task<Results<Ok, ValidationProblem, NotFound>>
502accountGroup.MapPost("/2fa", async Task<Results<Ok<TwoFactorResponse>, ValidationProblem, NotFound>>
578accountGroup.MapGet("/info", async Task<Results<Ok<InfoResponse>, ValidationProblem, NotFound>>
590accountGroup.MapPost("/info", async Task<Results<Ok<InfoResponse>, ValidationProblem, NotFound>>
745private static async Task<InfoResponse> CreateInfoResponseAsync<TUser>(TUser user, UserManager<TUser> userManager)
SignInManager.cs (49)
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)
537public virtual async Task<string> MakePasskeyCreationOptionsAsync(PasskeyUserEntity userEntity)
565public virtual async Task<string> MakePasskeyCreationOptionsAsync(PasskeyUserEntity userEntity, bool isConditionallyMediated)
586public virtual async Task<string> MakePasskeyRequestOptionsAsync(TUser? user)
643public virtual async Task<string> MakeAllAcceptedCredentialsSignalOptionsAsync(TUser user)
689public virtual async Task<string> MakeCurrentUserDetailsSignalOptionsAsync(TUser user, PasskeyUserEntity userEntity)
722public virtual async Task<string?> MakeUnknownCredentialSignalOptionsAsync(string credentialJson)
743public virtual async Task<PasskeyAttestationResult> PerformPasskeyAttestationAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
787public virtual async Task<PasskeyAssertionResult<TUser>> PerformPasskeyAssertionAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
808internal async Task<PasskeyAuthenticationInfo> GetPasskeyAssertionInfoAsync()
837public virtual Task<SignInResult> PasskeySignInAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
854public virtual async Task<SignInResult> PasskeySignInAsync(
873private async Task<SignInResult> PasskeySignInCoreAsync(string credentialJson, bool isPersistent)
934private async Task<PasskeyAuthenticationInfo?> RetrievePasskeyAuthenticationInfoAsync()
938async Task<PasskeyAuthenticationInfo?> RetrievePasskeyInfoCoreAsync()
971public virtual async Task<bool> IsTwoFactorClientRememberedAsync(TUser user)
1029public virtual async Task<SignInResult> TwoFactorRecoveryCodeSignInAsync(string recoveryCode)
1046private async Task<SignInResult> TwoFactorRecoveryCodeSignInCoreAsync(string recoveryCode)
1064private async Task<SignInResult> DoTwoFactorSignInAsync(TUser user, TwoFactorAuthenticationInfo twoFactorInfo, bool isPersistent, bool rememberClient)
1111public virtual async Task<SignInResult> TwoFactorAuthenticatorSignInAsync(string code, bool isPersistent, bool rememberClient)
1128private async Task<SignInResult> TwoFactorAuthenticatorSignInCoreAsync(string code, bool isPersistent, bool rememberClient)
1176public virtual async Task<SignInResult> TwoFactorSignInAsync(string provider, string code, bool isPersistent, bool rememberClient)
1193private async Task<SignInResult> TwoFactorSignInCoreAsync(string provider, string code, bool isPersistent, bool rememberClient)
1235public virtual async Task<TUser?> GetTwoFactorAuthenticationUserAsync()
1254public virtual Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent)
1266public virtual async Task<SignInResult> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1283private async Task<SignInResult> ExternalLoginSignInCoreAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1303public virtual async Task<IEnumerable<AuthenticationScheme>> GetExternalAuthenticationSchemesAsync()
1315public virtual async Task<ExternalLoginInfo?> GetExternalLoginInfoAsync(string? expectedXsrf = null)
1353public virtual async Task<IdentityResult> UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo externalLogin)
1402internal async Task<ClaimsPrincipal> StoreTwoFactorInfo(TUser user, string? loginProvider)
1419internal async Task<ClaimsPrincipal> StoreRememberClient(TUser user)
1439public virtual async Task<bool> IsTwoFactorEnabledAsync(TUser user)
1453protected virtual async Task<SignInResult> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
1492private async Task<TwoFactorAuthenticationInfo?> RetrieveTwoFactorInfoAsync()
1525protected virtual async Task<bool> IsLockedOut(TUser user)
1535protected virtual Task<SignInResult> LockedOut(TUser user)
1546protected virtual async Task<SignInResult?> PreSignInCheck(TUser user)
1578private async Task<IdentityResult> ResetLockoutWithResult(TUser user)
1595if (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.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)
1724if (handler.HasResult && task is Task<object?> resultTask)
2401public bool HasResult => _callback.Method.ReturnType == typeof(Task<object>);
2820public 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.WebSockets (2)
Microsoft.AspNetCore.WebUtilities (20)
Microsoft.Bcl.TimeProvider (2)
Microsoft.Build (41)
BackEnd\Components\RequestBuilder\TargetBuilder.cs (5)
111public async Task<BuildResult> BuildTargets(ProjectLoggingContext loggingContext, BuildRequestEntry entry, IRequestBuilderCallback callback, (string name, TargetBuiltReason reason)[] targetNames, Lookup baseLookup, CancellationToken cancellationToken)
253async Task<ITargetResult[]> ITargetBuilderCallback.LegacyCallTarget(string[] targets, bool continueOnError, ElementLocation taskLocation)
332async Task<BuildResult[]> IRequestBuilderCallback.BuildProjects(string[] projectFiles, Microsoft.Build.Collections.PropertyDictionary<ProjectPropertyInstance>[] properties, string[] toolsVersions, string[] targets, bool waitForResults, bool skipNonexistentTargets)
703private async Task<bool> PushTargets(IList<TargetSpecification> targets, TargetEntry parentTargetEntry, Lookup baseLookup, bool addAsErrorTarget, bool stopProcessingOnCompletion, TargetBuiltReason buildReason)
806private async Task<bool> CompleteOutstandingActiveRequests(string targetName)
BackEnd\Components\RequestBuilder\TaskBuilder.cs (2)
151public async Task<WorkUnitResult> ExecuteTask(TargetLoggingContext loggingContext, BuildRequestEntry requestEntry, ITargetBuilderCallback targetBuilderCallback, ProjectTargetInstanceChild taskInstance, TaskExecutionMode mode, Lookup inferLookup, Lookup executeLookup, CancellationToken cancellationToken)
722private async Task<WorkUnitResult> InitializeAndExecuteTask(TaskLoggingContext taskLoggingContext, ItemBucket bucket, TaskHostParameters taskIdentityParameters, TaskHost taskHost, TaskExecutionMode howToExecuteTask)
BackEnd\Components\RequestBuilder\TaskHost.cs (2)
1011public async Task<BuildEngineResult> InternalBuildProjects(string[] projectFileNames, string[] targetNames, IDictionary[] globalProperties, IList<String>[] undefineProperties, string[] toolsVersion, bool returnTargetOutputs, bool skipNonexistentTargets = false)
1184private 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.TaskAuthoring.Analyzer (6)
Microsoft.Build.Tasks.CodeAnalysis (10)
Microsoft.Build.Tasks.Core (6)
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 (62)
Microsoft.CodeAnalysis.CSharp.Features (275)
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 (3)
Microsoft.CodeAnalysis.ExternalAccess.HotReload (3)
Microsoft.CodeAnalysis.Features (1287)
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)
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 (45)
Copilot\Internal\Analyzer\AbstractCopilotCodeAnalysisService.cs (18)
21protected abstract Task<bool> IsOnTheFlyDocsAvailableCoreAsync(CancellationToken cancellationToken);
22protected abstract Task<bool> IsFileExcludedFromOnTheFlyDocsCoreAsync(string filePath, CancellationToken cancellationToken);
23protected abstract Task<string> GetOnTheFlyDocsPromptCoreAsync(OnTheFlyDocsInfo onTheFlyDocsInfo, CancellationToken cancellationToken);
24protected abstract Task<(string responseString, bool isQuotaExceeded)> GetOnTheFlyDocsResponseCoreAsync(string prompt, CancellationToken cancellationToken);
25protected abstract Task<bool> IsGenerateDocumentationCommentAvailableCoreAsync(CancellationToken cancellationToken);
26protected abstract Task<bool> IsFileExcludedFromDocumentationCommentGenerationCoreAsync(string filePath, CancellationToken cancellationToken);
27protected abstract Task<(Dictionary<string, string>? responseDictionary, bool isQuotaExceeded)> GetDocumentationCommentCoreAsync(DocumentationCommentProposal proposal, CancellationToken cancellationToken);
28protected abstract Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsCoreAsync(Document document, ImmutableDictionary<SyntaxNode, ImmutableArray<ReferencedSymbol>> methodOrProperties, CancellationToken cancellationToken);
29protected abstract Task<bool> IsImplementNotImplementedExceptionsAvailableCoreAsync(CancellationToken cancellationToken);
31public Task<bool> IsOnTheFlyDocsAvailableAsync(CancellationToken cancellationToken)
34public async Task<bool> IsFileExcludedFromOnTheFlyDocsAsync(string filePath, CancellationToken cancellationToken)
42public async Task<string> GetOnTheFlyDocsPromptAsync(OnTheFlyDocsInfo onTheFlyDocsInfo, CancellationToken cancellationToken)
47public async Task<(string responseString, bool isQuotaExceeded)> GetOnTheFlyDocsResponseAsync(string prompt, CancellationToken cancellationToken)
55public Task<bool> IsGenerateDocumentationCommentAvailableAsync(CancellationToken cancellationToken)
58public async Task<bool> IsFileExcludedFromDocumentationCommentGenerationAsync(string filePath, CancellationToken cancellationToken)
66public async Task<(Dictionary<string, string>? responseDictionary, bool isQuotaExceeded)> GetDocumentationCommentAsync(DocumentationCommentProposal proposal, CancellationToken cancellationToken)
74public Task<bool> IsImplementNotImplementedExceptionsAvailableAsync(CancellationToken cancellationToken)
77public async Task<ImmutableDictionary<SyntaxNode, ImplementationDetails>> ImplementNotImplementedExceptionsAsync(
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.Razor.DotNetFormat (14)
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 (867)
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)
63public async Task<RemoteBuildHost> GetBuildHostWithFallbackAsync(string projectFilePath, CancellationToken cancellationToken)
73public async Task<(RemoteBuildHost buildHost, BuildHostProcessKind actualKind)> GetBuildHostWithFallbackAsync(BuildHostProcessKind buildHostKind, string projectOrSolutionFilePath, CancellationToken cancellationToken)
99public Task<RemoteBuildHost> GetBuildHostAsync(BuildHostProcessKind buildHostKind, CancellationToken cancellationToken)
104public async Task<RemoteBuildHost> GetBuildHostAsync(BuildHostProcessKind buildHostKind, string? projectOrSolutionFilePath, string? dotnetPath, CancellationToken cancellationToken)
119async 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.InternalMicrosoft (30)
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 (58)
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 (32)
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)
2813public virtual async Task<byte[]> CreateSecurityTokenAsync(TUser user)
2834protected virtual Task<IdentityResult> UpdatePasswordHash(TUser user, string newPassword, bool validatePassword)
2837private async Task<IdentityResult> UpdatePasswordHash(IUserPasswordStore<TUser> passwordStore,
2919protected async Task<IdentityResult> ValidateUserAsync(TUser user)
2959protected async Task<IdentityResult> ValidatePasswordAsync(TUser user, string? password)
2993protected virtual async Task<IdentityResult> UpdateUserAsync(TUser user)
3007private 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)
607public virtual OptionsBuilder<TOptions> Validate(Func<TOptions, CancellationToken, Task<bool>> validation)
625public virtual OptionsBuilder<TOptions> Validate(Func<TOptions, CancellationToken, Task<bool>> validation, string failureMessage)
649public virtual OptionsBuilder<TOptions> Validate<TDep>(Func<TOptions, TDep, CancellationToken, Task<bool>> validation) where TDep : notnull
668public virtual OptionsBuilder<TOptions> Validate<TDep>(Func<TOptions, TDep, CancellationToken, Task<bool>> validation, string failureMessage) where TDep : notnull
697public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2>(Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> validation)
719public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2>(Func<TOptions, TDep1, TDep2, CancellationToken, Task<bool>> validation, string failureMessage)
752public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3>(Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> validation)
776public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3>(Func<TOptions, TDep1, TDep2, TDep3, CancellationToken, Task<bool>> validation, string failureMessage)
812public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> validation)
838public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, CancellationToken, Task<bool>> validation, string failureMessage)
877public virtual OptionsBuilder<TOptions> Validate<TDep1, TDep2, TDep3, TDep4, TDep5>(Func<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5, CancellationToken, Task<bool>> validation)
905public 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 (6)
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 (2)
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.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 (11)
Microsoft.ML.Tokenizers.Tests (2)
Microsoft.NET.Build.Containers (68)
AuthHandshakeMessageHandler.cs (5)
175private async Task<(AuthenticationHeaderValue, DateTimeOffset)?> GetAuthenticationAsync(string registry, string scheme, AuthInfo? bearerAuthInfo, CancellationToken cancellationToken)
524private async Task<(AuthenticationHeaderValue, DateTimeOffset)?> TryOAuthPostAsync(DockerCredentials privateRepoCreds, AuthInfo bearerAuthInfo, Uri realmUri, CancellationToken cancellationToken)
580private async Task<(AuthenticationHeaderValue, DateTimeOffset)?> TryTokenGetAsync(DockerCredentials privateRepoCreds, AuthInfo bearerAuthInfo, Uri realmUri, CancellationToken cancellationToken)
616private static async Task<DockerCredentials> GetLoginCredentials(string registry)
641protected 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)
NativeIntegrations.Contracts (4)
NativeIntegrations.DockerCompose (9)
NativeIntegrations.ExternalApi (3)
NativeIntegrations.Redis (3)
NativeIntegrations.Redis.Contracts (6)
NativeIntegrations.Redis.Provider (1)
netstandard (1)
NuGet.Build.Tasks (2)
NuGet.Build.Tasks.Console (3)
NuGet.CommandLine.XPlat (90)
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, HashSet<string> packagesAwaitingCooldown)> SelectVulnerablePackagesToUpdateAsync(
346private static async Task<(int? exitCode, Dictionary<string, List<PackageUpdateResult>> projectPackageUpdates, int totalPackagesScanned, HashSet<string> packagesAwaitingCooldown)>
458private static async Task<(int? exitCode, int totalPackagesScanned, HashSet<string> packagesAwaitingCooldown)> ProcessProjectsInParallelAsync(
461Func<string, CancellationToken, Task<(List<PackageUpdateResult>? packagesToUpdate, HashSet<string> scannedPackages, HashSet<string> packagesAwaitingCooldown, int? errorExitCode)>> processProject,
501internal static async Task<(List<PackageUpdateResult>?, HashSet<string> scannedPackages, HashSet<string> packagesAwaitingCooldown)> SelectSpecificPackagesToUpdateAsync(
695internal static async Task<(List<PackageUpdateResult>? packagesToUpdate, HashSet<string> scannedPackages, HashSet<string> packagesAwaitingCooldown)> 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)
592private async Task<(RestoreResult, bool, CacheFile)> EvaluateNoOpAsync(TelemetryActivity telemetry, CacheFile cacheFile, Stopwatch restoreTime)
728private async Task<EvaluateLockFileResult>
750private async Task<(bool, List<RestoreTargetGraph>)> GenerateRestoreGraphsAsync(TelemetryActivity telemetry, RemoteWalkContext contextForProject, bool success, CancellationToken token)
797private async Task<(bool, IEnumerable<MSBuildOutputFile>, string, string, LockFile, List<RestoreTargetGraph>, PackagesLockFile, string, CacheFile)> ProcessRestoreResultAsync(TelemetryActivity telemetry,
953private async Task<bool> PerformAuditAsync(List<RestoreTargetGraph> graphs, TelemetryActivity telemetry, CancellationToken token)
1624private async Task<(bool success, bool isLockFileValid, PackagesLockFile packagesLockFile)> EvaluatePackagesLockFileAsync(
1878private async Task<bool> ValidateRestoreGraphsAsync(IEnumerable<RestoreTargetGraph> graphs, ILogger logger)
1901private static async Task<bool> ValidateCyclesAsync(IEnumerable<RestoreTargetGraph> graphs, ILogger logger)
1919private async Task<bool> ValidateConflictsAsync(IEnumerable<RestoreTargetGraph> graphs, ILogger logger)
2020private static async Task<IList<CompatibilityCheckResult>> VerifyCompatibilityAsync(
2068private async Task<(bool, List<RestoreTargetGraph>)> ExecuteLegacyRestoreAsync(
2253private 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)
478private async Task<(Exception? ex, bool synchronous)> SendAsyncInternal<TIOAdapter>(MailMessage message, bool invokeSendCompleted, object? userToken, bool forceWrapExceptions = false, CancellationToken cancellationToken = default)
661Task<(Exception? ex, bool _)> task = SendAsyncInternal<AsyncReadWriteAdapter>(message, true, userToken, true);
731Task<(Exception?, bool)> task = SendAsyncInternal<AsyncReadWriteAdapter>(message, false, null, true, cancellationToken);
752static 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)
2521Task<int> t = SendAsync(new ReadOnlyMemory<byte>(buffer, offset, size), socketFlags, default).AsTask();
2547Task<int> t = SendAsync(buffers, socketFlags);
2596Task<int> t = SendToAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2617Task<int> t = ReceiveAsync(new ArraySegment<byte>(buffer, offset, size), socketFlags, fromNetworkStream: false, default).AsTask();
2642Task<int> t = ReceiveAsync(buffers, socketFlags);
2663Task<int> ti = TaskToAsyncResult.Unwrap<int>(asyncResult);
2687Task<SocketReceiveMessageFromResult> t = ReceiveMessageFromAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2728Task<SocketReceiveFromResult> t = ReceiveFromAsync(buffer.AsMemory(offset, size), socketFlags, remoteEP).AsTask();
2766private 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\net12.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 (979)
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 (127)
96/// For operations that return values, the <see cref="Task{TResult}"/> class
1609/// Provides access to factory methods for creating <see cref="Task"/> and <see cref="Task{TResult}"/> instances.
1619/// <remarks>It's a <see cref="Task{VoidTaskResult}"/> so it can be shared with <see cref="AsyncTaskMethodBuilder"/>.</remarks>
1620internal static readonly Task<VoidTaskResult> s_cachedCompleted = new Task<VoidTaskResult>(false, default, (TaskCreationOptions)InternalTaskOptions.DoNotDispose, default);
3084_ => completingTask is Task<TResult> taskTResult ? TrySetResult(taskTResult.Result) : TrySetResult(),
4045/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4047/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4054public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction)
4071/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4073/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4083public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
4101/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4103/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4113public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler)
4135/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4137/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4149public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
4176/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4178/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4195public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken,
4202private Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler,
4219Task<TResult> continuationTask = new ContinuationResultTaskFromTask<TResult>(
4245/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4247/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4254public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state)
4272/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4274/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4284public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken)
4303/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4305/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4315public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler)
4338/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4340/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4352public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskContinuationOptions continuationOptions)
4380/// <returns>A new continuation <see cref="Task{TResult}"/>.</returns>
4382/// The returned <see cref="Task{TResult}"/> will not be scheduled for execution until the current task has
4399public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken,
4406private Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler,
4423Task<TResult> continuationTask = new ContinuationResultTaskFromTask<TResult>(
5212/// <summary>Gets a <see cref="Task{TResult}"/> that's completed successfully with the specified result.</summary>
5218public static unsafe Task<TResult> FromResult<TResult>(TResult result)
5229return Task<TResult>.s_defaultResultTask;
5235Task<bool> task = *(bool*)&result ? TaskCache.s_trueTask : TaskCache.s_falseTask;
5236return *(Task<TResult>*)&task;
5246Task<int> task = TaskCache.s_int32Tasks[value - TaskCache.InclusiveInt32Min];
5247return *(Task<TResult>*)&task;
5262return Task<TResult>.s_defaultResultTask;
5270/// <summary>Creates a <see cref="Task{TResult}"/> that's completed exceptionally with the specified exception.</summary>
5283/// <summary>Creates a <see cref="Task{TResult}"/> that's completed exceptionally with the specified exception.</summary>
5287public static Task<TResult> FromException<TResult>(Exception exception)
5291var task = new Task<TResult>();
5307/// <summary>Creates a <see cref="Task{TResult}"/> that's completed due to cancellation with the specified token.</summary>
5311public static Task<TResult> FromCanceled<TResult>(CancellationToken cancellationToken)
5331/// <summary>Creates a <see cref="Task{TResult}"/> that's completed due to cancellation with the specified exception.</summary>
5335internal static Task<TResult> FromCanceled<TResult>(OperationCanceledException exception)
5339var task = new Task<TResult>();
5389public static Task<TResult> Run<TResult>(Func<TResult> function)
5391return Task<TResult>.StartNew(null, function, default,
5407public static Task<TResult> Run<TResult>(Func<TResult> function, CancellationToken cancellationToken)
5409return Task<TResult>.StartNew(null, function, cancellationToken,
5449Task<Task?> task1 = Task<Task?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
5468public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function)
5484public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function, CancellationToken cancellationToken)
5493Task<Task<TResult>?> task1 = Task<Task<TResult>?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
6084public static Task<TResult[]> WhenAll<TResult>(IEnumerable<Task<TResult>> tasks)
6087if (tasks is Task<TResult>[] taskArray)
6093if (tasks is ICollection<Task<TResult>> taskCollection)
6101taskArray = new Task<TResult>[count];
6103foreach (Task<TResult> task in taskArray)
6120List<Task<TResult>> taskList = new List<Task<TResult>>();
6121foreach (Task<TResult> task in tasks)
6167public static Task<TResult[]> WhenAll<TResult>(params Task<TResult>[] tasks)
6174return WhenAll((ReadOnlySpan<Task<TResult>>)tasks);
6205public static Task<TResult[]> WhenAll<TResult>(params ReadOnlySpan<Task<TResult>> tasks)
6212Task<TResult>[] tasksCopy = tasks.ToArray();
6213foreach (Task<TResult> task in tasksCopy)
6235private readonly Task<T>?[] m_tasks;
6239internal WhenAllPromise(Task<T>[] tasks)
6253foreach (Task<T> task in tasks)
6279Task<T>? task = m_tasks[i];
6357public static Task<Task> WhenAny(params Task[] tasks)
6376public static Task<Task> WhenAny(params ReadOnlySpan<Task> tasks) =>
6391private static Task<TTask> WhenAnyCore<TTask>(ReadOnlySpan<TTask> tasks) where TTask : Task
6429public static Task<Task> WhenAny(Task task1, Task task2) =>
6443private static Task<TTask> WhenAny<TTask>(TTask task1, TTask task2) where TTask : Task
6549public static Task<Task> WhenAny(IEnumerable<Task> tasks) =>
6565private static Task<TTask> WhenAny<TTask>(IEnumerable<TTask> tasks) where TTask : Task
6643public static Task<Task<TResult>> WhenAny<TResult>(params Task<TResult>[] tasks)
6647return WhenAnyCore((ReadOnlySpan<Task<TResult>>)tasks);
6663public static Task<Task<TResult>> WhenAny<TResult>(params ReadOnlySpan<Task<TResult>> tasks) =>
6678public static Task<Task<TResult>> WhenAny<TResult>(Task<TResult> task1, Task<TResult> task2) =>
6679WhenAny<Task<TResult>>(task1, task2);
6697public static Task<Task<TResult>> WhenAny<TResult>(IEnumerable<Task<TResult>> tasks) =>
6698WhenAny<Task<TResult>>(tasks);
6730public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(params Task<TResult>[] tasks)
6733return WhenEach((ReadOnlySpan<Task<TResult>>)tasks);
6739public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(params ReadOnlySpan<Task<TResult>> tasks) =>
6740WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(ReadOnlySpan<Task>.CastUp(tasks)));
6745public static IAsyncEnumerable<Task<TResult>> WhenEach<TResult>(IEnumerable<Task<TResult>> tasks) =>
6746WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(tasks));
6894internal static Task<TResult> CreateUnwrapPromise<TResult>(Task outerTask, bool lookForOce)
7340ProcessInnerTask(task is Task<Task<TResult>> taskOfTaskOfTResult ? // it's either a Task<Task> or Task<Task<TResult>>
7341taskOfTaskOfTResult.Result : ((Task<Task>)task).Result);
7386result = 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 (203)
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(
653/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
664/// <returns>The created <see cref="Task{TResult}">Task</see> that
669public Task<TResult> FromAsync(
677/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
683/// created <see cref="Task{TResult}">Task</see>.</param>
693/// <returns>The created <see cref="Task{TResult}">Task</see> that
698public Task<TResult> FromAsync(
707internal static Task<TResult> FromAsyncImpl(Func<AsyncCallback, object?, IAsyncResult> beginMethod,
721Task<TResult> promise = new Task<TResult>(state, creationOptions);
760/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
775/// <returns>The created <see cref="Task{TResult}">Task</see> that
780public Task<TResult> FromAsync<TArg1>(
789/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
799/// created <see cref="Task{TResult}">Task</see>.</param>
809/// <returns>The created <see cref="Task{TResult}">Task</see> that
814public Task<TResult> FromAsync<TArg1>(
824internal static Task<TResult> FromAsyncImpl<TArg1>(Func<TArg1, AsyncCallback, object?, IAsyncResult> beginMethod,
838Task<TResult> promise = new Task<TResult>(state, creationOptions);
877/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
896/// <returns>The created <see cref="Task{TResult}">Task</see> that
901public Task<TResult> FromAsync<TArg1, TArg2>(
910/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
924/// created <see cref="Task{TResult}">Task</see>.</param>
934/// <returns>The created <see cref="Task{TResult}">Task</see> that
939public Task<TResult> FromAsync<TArg1, TArg2>(
949internal static Task<TResult> FromAsyncImpl<TArg1, TArg2>(Func<TArg1, TArg2, AsyncCallback, object?, IAsyncResult> beginMethod,
963Task<TResult> promise = new Task<TResult>(state, creationOptions);
1002/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1025/// <returns>The created <see cref="Task{TResult}">Task</see> that
1030public Task<TResult> FromAsync<TArg1, TArg2, TArg3>(
1039/// Creates a <see cref="Task{TResult}">Task</see> that represents a pair of
1057/// created <see cref="Task{TResult}">Task</see>.</param>
1067/// <returns>The created <see cref="Task{TResult}">Task</see> that
1072public Task<TResult> FromAsync<TArg1, TArg2, TArg3>(
1082internal static Task<TResult> FromAsyncImpl<TArg1, TArg2, TArg3>(Func<TArg1, TArg2, TArg3, AsyncCallback, object?, IAsyncResult> beginMethod,
1096Task<TResult> promise = new Task<TResult>(state, creationOptions);
1146internal static Task<TResult> FromAsyncTrim<TInstance, TArgs>(
1278private static Task<TResult> CreateCanceledTask(TaskContinuationOptions continuationOptions, CancellationToken ct)
1289/// Creates a continuation <see cref="Task{TResult}">Task</see>
1295/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1304public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction)
1312/// Creates a continuation <see cref="Task{TResult}">Task</see>
1320/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1332public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken)
1340/// Creates a continuation <see cref="Task{TResult}">Task</see>
1348/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1349/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1366public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions)
1374/// Creates a continuation <see cref="Task{TResult}">Task</see>
1384/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1388/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1410public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction,
1419/// Creates a continuation <see cref="Task{TResult}">Task</see>
1426/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1435public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction)
1443/// Creates a continuation <see cref="Task{TResult}">Task</see>
1452/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1464public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1473/// Creates a continuation <see cref="Task{TResult}">Task</see>
1482/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1483/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1500public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1509/// Creates a continuation <see cref="Task{TResult}">Task</see>
1520/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1523/// cref="Task{TResult}"/>.</param>
1524/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1546public Task<TResult> ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>[], TResult> continuationFunction,
1557internal static Task<TResult> ContinueWhenAllImpl<TAntecedentResult>(Task<TAntecedentResult>[] tasks,
1558Func<Task<TAntecedentResult>[], TResult>? continuationFunction, Action<Task<TAntecedentResult>[]>? continuationAction,
1568Task<TAntecedentResult>[] tasksCopy = TaskFactory.CheckMultiContinuationTasksAndCopy(tasks);
1579Task<Task<TAntecedentResult>[]> starter = TaskFactory.CommonCWAllLogic(tasksCopy);
1585static (starter, continuationFunction) => ((Func<Task<TAntecedentResult>[], TResult>)continuationFunction!)(starter.Result),
1595((Action<Task<TAntecedentResult>[]>)continuationAction!)(starter.Result);
1604internal static Task<TResult> ContinueWhenAllImpl(Task[] tasks,
1626Task<Task[]> starter = TaskFactory.CommonCWAllLogic(tasksCopy);
1659/// Creates a continuation <see cref="Task{TResult}">Task</see>
1665/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1674public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction)
1682/// Creates a continuation <see cref="Task{TResult}">Task</see>
1690/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1702public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
1710/// Creates a continuation <see cref="Task{TResult}">Task</see>
1718/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1719/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1736public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
1744/// Creates a continuation <see cref="Task{TResult}">Task</see>
1754/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1758/// <returns>The new continuation <see cref="Task{TResult}">Task</see>.</returns>
1780public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction,
1789/// Creates a continuation <see cref="Task{TResult}">Task</see>
1796/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1805public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction)
1813/// Creates a continuation <see cref="Task{TResult}">Task</see>
1822/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1834public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1843/// Creates a continuation <see cref="Task{TResult}">Task</see>
1852/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1853/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1870public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1879/// Creates a continuation <see cref="Task{TResult}">Task</see>
1890/// the created continuation <see cref="Task{TResult}">Task</see>.</param>
1893/// cref="Task{TResult}"/>.</param>
1894/// <returns>The new continuation <see cref="Task{TResult}"/>.</returns>
1916public Task<TResult> ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Func<Task<TAntecedentResult>, TResult> continuationFunction,
1926internal static Task<TResult> ContinueWhenAnyImpl(Task[] tasks,
1939Task<Task> starter = TaskFactory.CommonCWAnyLogic(tasks);
1977internal static Task<TResult> ContinueWhenAnyImpl<TAntecedentResult>(Task<TAntecedentResult>[] tasks,
1978Func<Task<TAntecedentResult>, TResult>? continuationFunction, Action<Task<TAntecedentResult>>? continuationAction,
1989Task<Task<TAntecedentResult>> starter = TaskFactory.CommonCWAnyLogic(tasks);
2003static (starter, continuationFunction) => ((Func<Task<TAntecedentResult>, TResult>)continuationFunction!)(starter.Result),
2012((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()
1199private async Task<bool> ParseXmlDeclarationAsync(bool isTextDecl)
1499private Task<bool> ParseDocumentContentAsync()
1631private Task<bool> ParseDocumentContentAsync_CData()
1640private async Task<bool> ParseDocumentContentAsync_ParseEntity()
1682private Task<bool> ParseDocumentContentAsync_WhiteSpace()
1684Task<bool> task = ParseTextAsync();
1706private async Task<bool> _ParseDocumentContentAsync_WhiteSpace(Task<bool> task)
1719private async Task<bool> ParseDocumentContentAsync_ReadData(bool needMoreChars)
1759private Task<bool> ParseElementContentAsync()
1858private async Task<bool> ParseElementContent_ReadData()
1949Task<(int, int)> parseQNameTask = ParseQNameAsync();
1956private Task ParseElementAsync_ContinueWithSetElement(Task<(int, int)> task)
1971private async Task _ParseElementAsync_ContinueWithSetElement(Task<(int, int)> task)
2916private Task<bool> ParseTextAsync()
2974private async Task<bool> _ParseTextAsync(Task<(int, int, int, bool)>? parseTask)
3131private Task<bool> ParseTextAsync_IgnoreNode()
3194private readonly Task<(int, int, int, bool)> _parseText_dummyTask = Task.FromResult((0, 0, 0, false));
3199Task<(int, int, int, bool)> task = ParseTextAsync(outOrChars, _ps.chars, _ps.charPos, 0, -1, outOrChars);
3237private async Task<(int, int, int, bool)> ParseTextAsync_AsyncFunc(Task<(int, int, int, bool)> task)
3273private Task<(int, int, int, bool)> ParseTextAsync(int outOrChars, char[] chars, int pos, int rcount, int rpos, int orChars)
3380private async Task<(int, int, int, bool)> ParseTextAsync_ParseEntity(int outOrChars, char[] chars, int pos, int rcount, int rpos, int orChars, char c)
3450private async Task<(int, int, int, bool)> ParseTextAsync_Surrogate(int outOrChars, char[] chars, int pos, int rcount, int rpos, int orChars, char c)
3488private async Task<(int, int, int, bool)> ParseTextAsync_ReadData(int outOrChars, char[] chars, int pos, int rcount, int rpos, int orChars, char c)
3705private async Task<bool> ParseRootLevelWhitespaceAsync()
3755private async Task<(int, EntityType)> HandleEntityReferenceAsync(bool isInAttributeValue, EntityExpandType expandType)
3839private async Task<EntityType> HandleGeneralEntityReferenceAsync(string name, bool isInAttributeValue, bool pushFakeEntityIfNullResolver, int entityStartLinePos)
3924private Task<bool> ParsePIAsync()
3931private async Task<bool> ParsePIAsync(StringBuilder? piInDtdStringBuilder)
4047private async Task<(int, int, bool)> ParsePIValueAsync()
4202private async Task<bool> ParseCommentAsync()
4272private async Task<(int, int, bool)> ParseCDataOrCommentTupleAsync(XmlNodeType type)
4439private async Task<bool> ParseDoctypeDeclAsync()
4833private async Task<int> EatWhitespacesAsync(StringBuilder? sb)
4934private async Task<(EntityType, int)> ParseNumericCharRefAsync(bool expand, StringBuilder? internalSubsetBuilder)
4969private async Task<int> ParseNamedCharRefAsync(bool expand, StringBuilder? internalSubsetBuilder)
4996private async Task<int> ParseNameAsync()
5002private Task<(int, int)> ParseQNameAsync()
5007private async Task<(int, int)> ParseQNameAsync(bool isQName, int startOffset)
5095private async Task<(int, bool)> ReadDataInNameAsync(int pos)
5104private async Task<string> ParseEntityNameAsync()
5189private async Task<bool> OpenAndPushAsync(Uri uri)
5225private async Task<bool> PushExternalEntityAsync(IDtdEntityInfo entity)
5273private async Task<bool> ZeroEndingStreamAsync(int pos)
5298private async Task<bool> InitReadContentAsBinaryAsync()
5324private async Task<bool> InitReadElementContentAsBinaryAsync()
5354private async Task<bool> MoveToNextContentNodeAsync(bool moveIfOnContentNode)
5387private async Task<int> ReadContentAsBinaryAsync(byte[] buffer, int index, int count)
5482private 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 (167)
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 (11)
System.ServiceModel.UnixDomainSocket (2)
System.Text.Json (9)
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>(
1410static async Task<bool> Impl(ISourceBlock<TOutput> source, CancellationToken cancellationToken)
1646/// A <see cref="System.Threading.Tasks.Task{Int32}"/> that represents the asynchronous choice.
1651/// will end with its <see cref="System.Threading.Tasks.Task{Int32}.Result"/> set to either 0 or 1 to
1662public static Task<int> Choose<T1, T2>(
1680/// A <see cref="System.Threading.Tasks.Task{Int32}"/> that represents the asynchronous choice.
1686/// will end with its <see cref="System.Threading.Tasks.Task{Int32}.Result"/> set to either 0 or 1 to
1700public static Task<int> Choose<T1, T2>(
1729/// A <see cref="System.Threading.Tasks.Task{Int32}"/> that represents the asynchronous choice.
1734/// will end with its <see cref="System.Threading.Tasks.Task{Int32}.Result"/> set to the 0-based index of the source.
1746public static Task<int> Choose<T1, T2, T3>(
1768/// A <see cref="System.Threading.Tasks.Task{Int32}"/> that represents the asynchronous choice.
1774/// will end with its <see cref="System.Threading.Tasks.Task{Int32}.Result"/> set to the 0-based index of the source.
1789public static Task<int> Choose<T1, T2, T3>(
1820private static Task<int> ChooseCore<T1, T2, T3>(
1837Task<int>? resultTask;
1870[NotNullWhen(true)] out Task<int>? task)
1905private static Task<int> ChooseCoreByLinking<T1, T2, T3>(
1928var branchTasks = new Task<int>[hasThirdSource ? 3 : 2];
1951foreach (Task<int> task in tasks)
2002private static Task<int> CreateChooseBranch<T>(
2371private List<Task<bool>>? _tempSendAsyncTaskList;
2424Task<bool> sendAsyncTask = targetObserver.SendAsyncToTarget(item);
2428_tempSendAsyncTaskList ??= new List<Task<bool>>();
2444Task<bool[]> allSendAsyncTasksConsolidated = Task.WhenAll(_tempSendAsyncTaskList);
2549Task<bool> task = SendAsyncToTarget(value);
2571internal 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)
222private void ProcessMessageWithTask(Func<TInput, Task<TOutput>> transform, KeyValuePair<TInput, long> messageWithId)
227Task<TOutput>? task = null;
267private 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)
Terminals.AppHost (3)
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)