48 interfaces inheriting from IResource
Aspire.Hosting (15)
ApplicationModel\IComputeEnvironmentResource.cs (1)
12public interface IComputeEnvironmentResource : IResource
ApplicationModel\IComputeResource.cs (1)
13public interface IComputeResource : IResource
ApplicationModel\IContainerFilesDestinationResource.cs (1)
15public interface IContainerFilesDestinationResource : IResource
ApplicationModel\IDotnetProgramResource.cs (1)
15public interface IDotnetProgramResource : IResource
ApplicationModel\IResourceWithArgs.cs (1)
9public interface IResourceWithArgs : IResource
ApplicationModel\IResourceWithConnectionString.cs (1)
9public interface IResourceWithConnectionString : IResource, IExpressionValue, IValueWithReferences
ApplicationModel\IResourceWithContainerFiles.cs (1)
15public interface IResourceWithContainerFiles : IResource
ApplicationModel\IResourceWithCustomWithReference.cs (1)
15public interface IResourceWithCustomWithReference<TSelf> : IResource
ApplicationModel\IResourceWithEndpoints.cs (1)
9public interface IResourceWithEndpoints : IResource
ApplicationModel\IResourceWithEnvironment.cs (1)
9public interface IResourceWithEnvironment : IResource
ApplicationModel\IResourceWithoutLifetime.cs (1)
9public interface IResourceWithoutLifetime : IResource
ApplicationModel\IResourceWithParameters.cs (1)
12public interface IResourceWithParameters : IResource
ApplicationModel\IResourceWithParentOfT.cs (1)
23public interface IResourceWithParent : IResource
ApplicationModel\IResourceWithProbes.cs (1)
9public interface IResourceWithProbes : IResource
ApplicationModel\IResourceWithWaitSupport.cs (1)
9public interface IResourceWithWaitSupport : IResource
Aspire.Hosting.Azure (6)
IAzureDelegatedSubnetResource.cs (1)
13public interface IAzureDelegatedSubnetResource : IResource
IAzureKeyVaultResource.cs (1)
12public interface IAzureKeyVaultResource : IResource, IAzureResource
IAzureNspAssociationTarget.cs (1)
18public interface IAzureNspAssociationTarget : IResource
IAzurePrivateEndpointTarget.cs (1)
13public interface IAzurePrivateEndpointTarget : IResource
IAzureResource.cs (1)
12public interface IAzureResource : IResource
IResourceWithAzureFunctionsConfig.cs (1)
11public interface IResourceWithAzureFunctionsConfig : IResource
Aspire.Hosting.Azure.Functions (1)
AzureFunctionsResource.cs (1)
9internal interface IAzureFunctionsResource : IResource
Aspire.Hosting.CodeGeneration.Go.Tests (5)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestPromiseCollisionResources.cs (4)
11public interface ITestPromiseCollisionResource : IResource 29public interface ITestPromiseCollisionResourcePromise : IResource 47public interface ITestMutablePromiseCollisionResource : IResource 59public interface ITestMutablePromiseCollisionResourcePromise : IResource
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestRedisResource.cs (1)
38public interface ITestVaultResource : IResource
Aspire.Hosting.CodeGeneration.Java.Tests (5)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestPromiseCollisionResources.cs (4)
11public interface ITestPromiseCollisionResource : IResource 29public interface ITestPromiseCollisionResourcePromise : IResource 47public interface ITestMutablePromiseCollisionResource : IResource 59public interface ITestMutablePromiseCollisionResourcePromise : IResource
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestRedisResource.cs (1)
38public interface ITestVaultResource : IResource
Aspire.Hosting.CodeGeneration.Python.Tests (5)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestPromiseCollisionResources.cs (4)
11public interface ITestPromiseCollisionResource : IResource 29public interface ITestPromiseCollisionResourcePromise : IResource 47public interface ITestMutablePromiseCollisionResource : IResource 59public interface ITestMutablePromiseCollisionResourcePromise : IResource
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestRedisResource.cs (1)
38public interface ITestVaultResource : IResource
Aspire.Hosting.CodeGeneration.Rust.Tests (5)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestPromiseCollisionResources.cs (4)
11public interface ITestPromiseCollisionResource : IResource 29public interface ITestPromiseCollisionResourcePromise : IResource 47public interface ITestMutablePromiseCollisionResource : IResource 59public interface ITestMutablePromiseCollisionResourcePromise : IResource
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestRedisResource.cs (1)
38public interface ITestVaultResource : IResource
Aspire.Hosting.CodeGeneration.TypeScript.Tests (6)
TestTypes\TestMarkerResource.cs (1)
20public interface ITestMarkerResource : IResource
TestTypes\TestPromiseCollisionResources.cs (4)
11public interface ITestPromiseCollisionResource : IResource 29public interface ITestPromiseCollisionResourcePromise : IResource 47public interface ITestMutablePromiseCollisionResource : IResource 59public interface ITestMutablePromiseCollisionResourcePromise : IResource
TestTypes\TestRedisResource.cs (1)
38public interface ITestVaultResource : IResource
13 implementations of IResource
Aspire.Hosting (1)
ApplicationModel\Resource.cs (1)
12public abstract class Resource : IResource
Aspire.Hosting.Azure.AppConfiguration (1)
AzureAppConfigurationEmulatorResource.cs (1)
12public class AzureAppConfigurationEmulatorResource(AzureAppConfigurationResource innerResource) : ContainerResource(innerResource.Name), IResource
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsEmulatorResource.cs (1)
13: ContainerResource(innerResource.Name), IResource
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusEmulatorResource.cs (1)
12public class AzureServiceBusEmulatorResource(AzureServiceBusResource innerResource) : ContainerResource(innerResource.Name), IResource
Aspire.Hosting.Azure.SignalR (1)
AzureSignalREmulatorResource.cs (1)
12public class AzureSignalREmulatorResource(AzureSignalRResource innerResource) : ContainerResource(innerResource.Name), IResource
Aspire.Hosting.Azure.Storage (1)
AzureStorageEmulatorResource.cs (1)
12public class AzureStorageEmulatorResource(AzureStorageResource innerResource) : ContainerResource(innerResource.Name), IResource
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubEmulatorResource.cs (1)
12public class AzureWebPubSubEmulatorResource(AzureWebPubSubResource innerResource) : ContainerResource((innerResource ?? throw new ArgumentNullException(nameof(innerResource))).Name), IResource
Aspire.Hosting.CodeGeneration.Python.Tests (2)
AtsPythonCodeGeneratorTests.cs (2)
1269private sealed class CollidingAlphaResource : IResource 1276private sealed class CollidingBetaResource : IResource
Aspire.Hosting.Tests (4)
DistributedApplicationBuilderTests.cs (1)
1506private sealed class TestResource : IResource
DistributedApplicationModelExtensionsTests.cs (1)
72private sealed class CustomResource : IResource
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
563private sealed class TestResource(string name) : IResource
Utils\VolumeNameGeneratorTests.cs (1)
47private sealed class TestResource(string name) : IResource
1893 references to IResource
Aspire.Hosting (687)
ApplicationModel\ArgumentsExecutionConfigurationGatherer.cs (2)
17public async ValueTask GatherAsync(IExecutionConfigurationGathererContext context, IResource resource, ILogger resourceLogger, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken = default) 51private static async ValueTask GatherLaunchToolArgumentsAsync(IExecutionConfigurationGathererContext context, IResource resource, ILogger resourceLogger, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken)
ApplicationModel\BeforeResourceStartedEvent.cs (2)
17public class BeforeResourceStartedEvent(IResource resource, IServiceProvider services) : IDistributedApplicationResourceEvent 20public IResource Resource { get; } = resource;
ApplicationModel\CertificateTrustConfigurationCallbackAnnotation.cs (1)
34public required IResource Resource { get; init; }
ApplicationModel\CertificateTrustExecutionConfigurationGatherer.cs (1)
34public async ValueTask GatherAsync(IExecutionConfigurationGathererContext context, IResource resource, ILogger resourceLogger, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken = default)
ApplicationModel\CommandLineArgsCallbackAnnotation.cs (3)
98private readonly IResource? _resource; 106public CommandLineArgsCallbackContext(IList<object> args, IResource resource, CancellationToken cancellationToken = default) 149public IResource Resource => _resource ?? throw new InvalidOperationException($"{nameof(Resource)} is not set. This callback context is not associated with a resource.");
ApplicationModel\CommandsConfigurationExtensions.cs (4)
19internal static void AddLifeCycleCommands(this IResource resource) 145private static void AddRebuildCommand(IResource projectResource) 194private static async Task<ExecuteCommandResult> ExecuteRebuildAsync(ExecuteCommandContext context, IResource projectResource) 441internal static CancellationToken GetCommandCancellationToken(ExecuteCommandContext context, IResource resource)
ApplicationModel\ConnectionStringAvailableEvent.cs (3)
11/// <param name="resource">The <see cref="IResource"/> for the event.</param> 15public class ConnectionStringAvailableEvent(IResource resource, IServiceProvider services) : IDistributedApplicationResourceEvent 18public IResource Resource => resource;
ApplicationModel\ContainerBuildOptionsCallbackAnnotation.cs (2)
52IResource resource, 68public IResource Resource { get; }
ApplicationModel\ContainerFilesDestinationAnnotation.cs (1)
20public required IResource Source { get; init; }
ApplicationModel\ContainerFileSystemCallbackAnnotation.cs (1)
298public required IResource Model { get; init; }
ApplicationModel\ContainerImagePushOptionsCallbackContext.cs (1)
28public required IResource Resource { get; init; }
ApplicationModel\ContainerImageReference.cs (2)
22public ContainerImageReference(IResource resource) 30public IResource Resource { get; }
ApplicationModel\ContainerPortReference.cs (2)
12public class ContainerPortReference(IResource resource) : IManifestExpressionProvider, IValueWithReferences, IValueProvider 17public IResource Resource { get; } = resource;
ApplicationModel\CustomResourceSnapshot.cs (1)
584public static ImmutableArray<RelationshipSnapshot> BuildRelationships(IResource resource)
ApplicationModel\CustomResourceSnapshotExtensions.cs (2)
21/// This method is intended for use with <see cref="ResourceNotificationService.PublishUpdateAsync(IResource, Func{CustomResourceSnapshot, CustomResourceSnapshot})"/> 22/// and <see cref="ResourceNotificationService.PublishUpdateAsync(IResource, string, Func{CustomResourceSnapshot, CustomResourceSnapshot})"/>.
ApplicationModel\DebugSupportExtensions.cs (4)
45public static bool SupportsDebugging(this IResource resource, IConfiguration configuration, [NotNullWhen(true)] out SupportsDebuggingAnnotation? supportsDebuggingAnnotation) 91public static bool HasLaunchToolArgsOwnedBy(this IResource resource, SupportsDebuggingAnnotation supportsDebuggingAnnotation) 130this IResource resource, 169this IResource resource,
ApplicationModel\DeploymentTargetAnnotation.cs (2)
9public sealed class DeploymentTargetAnnotation(IResource target) : IResourceAnnotation 14public IResource DeploymentTarget { get; set; } = target;
ApplicationModel\DistributedApplicationModel.cs (1)
22public DistributedApplicationModel(IEnumerable<IResource> resources) : this(new ResourceCollection(resources)) { }
ApplicationModel\DistributedApplicationModelExtensions.cs (9)
19/// <returns>An enumerable of compute <see cref="IResource"/> in the model.</returns> 21public static IEnumerable<IResource> GetComputeResources(this DistributedApplicationModel model) 23foreach (var r in model.Resources) 49/// <returns>An enumerable of build <see cref="IResource"/> in the model.</returns> 51public static IEnumerable<IResource> GetBuildResources(this DistributedApplicationModel model) 53foreach (var r in model.Resources) 67/// <returns>An enumerable of build and push <see cref="IResource"/> in the model.</returns> 69public static IEnumerable<IResource> GetBuildAndPushResources(this DistributedApplicationModel model) 71foreach (var r in model.Resources)
ApplicationModel\Docker\ContainerFilesExtensions.cs (6)
22public static DockerfileBuilder AddContainerFilesStages(this DockerfileBuilder builder, IResource resource, ILogger? logger) 31var source = containerFileDestination.Source; 79public static DockerfileStage AddContainerFiles(this DockerfileStage stage, IResource resource, string rootDestinationPath, ILogger? logger) 89var source = containerFileDestination.Source; 120private static string GetSourceImageArgName(IResource source) => $"{source.Name.Replace("-", "_").ToUpperInvariant()}_IMAGENAME"; 123private static string GetSourceStageName(IResource source) => $"{source.Name.Replace("-", "_")}_stage";
ApplicationModel\DockerfileBuilderCallbackContext.cs (2)
21public DockerfileBuilderCallbackContext(IResource resource, DockerfileBuilder builder, IServiceProvider services, CancellationToken cancellationToken) 32public IResource Resource { get; }
ApplicationModel\DockerfileFactoryContext.cs (1)
39public required IResource Resource { get; init; }
ApplicationModel\DotnetProgramPublishing.cs (5)
22public static void Configure(IResource resource) 34var stepResource = factoryContext.Resource; 102internal static void ValidatePrebuiltContainerImageConfiguration(IResource resource) 117IResource resource, 162IResource resource,
ApplicationModel\EnvironmentCallbackContext.cs (3)
18private readonly IResource? _resource; 27public EnvironmentCallbackContext(DistributedApplicationExecutionContext executionContext, IResource resource, Dictionary<string, object>? environmentVariables = null, CancellationToken cancellationToken = default) 69public IResource Resource => _resource ?? throw new InvalidOperationException($"{nameof(Resource)} is not set. This callback context is not associated with a resource.");
ApplicationModel\EnvironmentVariablesConfigurationGatherer.cs (1)
14public async ValueTask GatherAsync(IExecutionConfigurationGathererContext context, IResource resource, ILogger resourceLogger, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken = default)
ApplicationModel\ExecutableLaunchRecipe.cs (4)
141IResource resource, 152public IResource Resource { get; } = resource ?? throw new ArgumentNullException(nameof(resource)); 798IResource resource, 850private static bool IsExecutableAnnotatedDotnetProject(IResource resource) =>
ApplicationModel\ExecutionConfigurationBuilder.cs (3)
40private readonly IResource _resource; 43private ExecutionConfigurationBuilder(IResource resource) 79public static IExecutionConfigurationBuilder Create(IResource resource)
ApplicationModel\ExecutionConfigurationGathererContext.cs (1)
40IResource resource,
ApplicationModel\HttpsCertificateConfigurationCallbackAnnotaion.cs (1)
38public required IResource Resource { get; init; }
ApplicationModel\HttpsCertificateExecutionConfigurationGatherer.cs (1)
30public async ValueTask GatherAsync(IExecutionConfigurationGathererContext context, IResource resource, ILogger resourceLogger, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken = default)
ApplicationModel\HttpsEndpointUpdateCallbackContext.cs (2)
22/// Gets the <see cref="IResource"/> that is being configured for HTTPS. 24public required IResource Resource { get; init; }
ApplicationModel\IExecutionConfigurationGatherer.cs (1)
23ValueTask GatherAsync(IExecutionConfigurationGathererContext context, IResource resource, ILogger resourceLogger, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken = default);
ApplicationModel\InitializeResourceEvent.cs (2)
23IResource resource, 30public IResource Resource { get; } = resource;
ApplicationModel\IRequiredCommandValidator.cs (1)
30Task<RequiredCommandValidationResult> ValidateAsync(IResource resource, RequiredCommandAnnotation annotation, CancellationToken cancellationToken);
ApplicationModel\IResourceBuilder.cs (1)
10public interface IResourceBuilder<out T> where T : IResource
ApplicationModel\IResourceCollection.cs (3)
11public interface IResourceCollection : IList<IResource> 22bool TryGetByName(string name, [NotNullWhen(true)] out IResource? resource) 24foreach (var item in this)
ApplicationModel\IResourceWithCustomWithReference.cs (2)
16where TSelf : IResource, IResourceWithCustomWithReference<TSelf> 30IResourceBuilder<IResource> source,
ApplicationModel\IResourceWithParentOfT.cs (3)
10public interface IResourceWithParent<out T> : IResourceWithParent where T : IResource 17IResource IResourceWithParent.Parent => Parent; 28IResource Parent { get; }
ApplicationModel\IValueProvider.cs (1)
19public IResource? Caller { get; init; }
ApplicationModel\LaunchConfigurationCallbackContext.cs (2)
21IResource resource, 43public IResource Resource { get; }
ApplicationModel\PersistenceAnnotation.cs (1)
51public IResource? SourceResource { get; set; }
ApplicationModel\ProjectLaunchConfigurationFactory.cs (4)
14public static ProjectLaunchConfiguration Create(IResource resource, string mode) 26public static ProjectLaunchConfiguration Create(IResource resource, IProjectMetadata projectMetadata, string mode) 54internal static string GetLaunchConfigurationType(IResource resource, IProjectMetadata projectMetadata) => 59private static bool ShouldSuppressIdeBuild(IResource resource, IProjectMetadata projectMetadata)
ApplicationModel\ProjectLaunchDefaultsAnnotation.cs (2)
59internal void ValidateProjectMetadata(IResource resource, IProjectMetadata projectMetadata) 78public static bool ShouldInjectEndpointEnvironment(this IResource resource, EndpointReference e)
ApplicationModel\ProjectRebuilderResource.cs (3)
14internal sealed class ProjectRebuilderResource : ExecutableResource, IResourceWithParent<IResource> 22public ProjectRebuilderResource(string name, IResource parent, string projectPath) 32public IResource Parent { get; }
ApplicationModel\ProjectResourceExtensions.cs (5)
44return GetProjectMetadata((IResource)projectResource); 61return GetProjectMetadata((IResource)programResource); 74public static bool SupportsDotnetProgramPublishing(this IResource resource) 82internal static IProjectMetadata GetProjectMetadata(this IResource projectResource) 92internal static bool TryGetProjectMetadata(this IResource projectResource, [NotNullWhen(true)] out IProjectMetadata? projectMetadata)
ApplicationModel\ReferenceExpression.cs (5)
414where T : IResource, IValueProvider, IManifestExpressionProvider 426where T : IResource, IValueProvider, IManifestExpressionProvider 598var unwrapped = valueProvider is IResourceBuilder<IResource> rb ? rb.Resource : valueProvider; 704where T : IResource, IValueProvider, IManifestExpressionProvider 716where T : IResource, IValueProvider, IManifestExpressionProvider
ApplicationModel\RequiredCommandValidator.cs (1)
50IResource resource,
ApplicationModel\Resource.cs (1)
9/// Represents an abstract resource that can be used by an application, that implements <see cref="IResource"/>.
ApplicationModel\ResourceAnnotationMutationBehavior.cs (1)
8/// method when adding an annotation to the <see cref="IResource.Annotations"/> collection of a resource.
ApplicationModel\ResourceCollection.cs (19)
14private readonly List<IResource> _resources = []; 15private readonly Dictionary<string, IResource> _resourcesByName = new(StringComparers.ResourceName); 19public ResourceCollection(IEnumerable<IResource> resources) 21foreach (var resource in resources) 32public IResource this[int index] 37var old = _resources[index]; 41_resourcesByName.TryGetValue(value.Name, out var existing)) 55public void Add(IResource item) 71public bool Contains(IResource item) => _resources.Contains(item); 72public void CopyTo(IResource[] array, int arrayIndex) => _resources.CopyTo(array, arrayIndex); 73public IEnumerator<IResource> GetEnumerator() => _resources.GetEnumerator(); 74public int IndexOf(IResource item) => _resources.IndexOf(item); 76public void Insert(int index, IResource item) 86public bool Remove(IResource item) 99var item = _resources[index]; 104public bool TryGetByName(string name, [NotNullWhen(true)] out IResource? resource) 118private static void ThrowDuplicateResource(IResource newResource, IResource existingResource) 132public required IResource Resource { get; init; }
ApplicationModel\ResourceCommandService.cs (6)
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) 230private static (InteractionInputCollection Arguments, string? ErrorMessage) CreateCommandArguments(IResource resource, string commandName, IReadOnlyDictionary<string, string?>? argumentValues) 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) 529private static ResourceCommandAnnotation? ResolveCommandAnnotation(IResource resource, ref string commandName, ILogger? logger = null)
ApplicationModel\ResourceEndpointsAllocatedEvent.cs (2)
20public class ResourceEndpointsAllocatedEvent(IResource resource, IServiceProvider services) : IDistributedApplicationResourceEvent 23public IResource Resource { get; } = resource;
ApplicationModel\ResourceExtensions.cs (90)
19/// Provides extension methods for the <see cref="IResource"/> interface. 31public static bool TryGetLastAnnotation<T>(this IResource resource, [NotNullWhen(true)] out T? annotation) where T : IResourceAnnotation 55public static bool TryGetAnnotationsOfType<T>(this IResource resource, [NotNullWhen(true)] out IEnumerable<T>? result) where T : IResourceAnnotation 78public static bool HasAnnotationOfType<T>(this IResource resource) where T : IResourceAnnotation 91public static bool TryGetAnnotationsIncludingAncestorsOfType<T>(this IResource resource, [NotNullWhen(true)] out IEnumerable<T>? result) where T : IResourceAnnotation 129public static bool HasAnnotationIncludingAncestorsOfType<T>(this IResource resource) where T : IResourceAnnotation 163public static bool TryGetEnvironmentVariables(this IResource resource, [NotNullWhen(true)] out IEnumerable<EnvironmentCallbackAnnotation>? environmentVariables) 267this IResource resource, 300IResource resource, 352this IResource resource, 392this IResource resource, 415this IResource resource, 449this IResource resource, 485this IResource resource, 510this IResource resource, 548where T : IResource, IComputeResource 568where T : IResource, IComputeResource 576internal static NetworkIdentifier GetDefaultResourceNetwork(this IResource resource) 581internal static IEnumerable<NetworkIdentifier> GetSupportedNetworks(this IResource resource) 587this IResource resource, 598(DistributedApplicationOperation.Run, IResourceBuilder<IResource> rb) when rb.Resource is IValueProvider provider => await resource.GetValue(executionContext, key, provider, logger, cancellationToken).ConfigureAwait(false), 600(DistributedApplicationOperation.Publish, IResourceBuilder<IResource> rb) when rb.Resource is IManifestExpressionProvider provider => new(provider.ValueExpression, false), 611public static bool IsExcludedFromPublish(this IResource resource) => 615this IResource resource, 658private static async Task<ResolvedValue?> GetValue(this IResource resource, DistributedApplicationExecutionContext executionContext, string? key, IValueProvider valueProvider, ILogger logger, CancellationToken cancellationToken) 664if (valueProvider is IResource providerResource) 722public static bool TryGetContainerMounts(this IResource resource, [NotNullWhen(true)] out IEnumerable<ContainerMountAnnotation>? volumeMounts) 734public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 746public static bool TryGetUrls(this IResource resource, [NotNullWhen(true)] out IEnumerable<ResourceUrlAnnotation>? urls) 755/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 772/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 839public static IReadOnlyList<ResolvedEndpoint> ResolveEndpoints(this IResource resource, IPortAllocator? portAllocator = null) 926public static bool TryGetContainerImageName(this IResource resource, [NotNullWhen(true)] out string? imageName) 939public static bool TryGetContainerImageName(this IResource resource, bool useBuiltImage, [NotNullWhen(true)] out string? imageName) 981public static int GetReplicaCount(this IResource resource) 1004public static bool RequiresImageBuild(this IResource resource) 1026public static bool RequiresImageBuildAndPush(this IResource resource) 1031internal static bool IsBuildOnlyContainer(this IResource resource) 1037internal static bool HasPrebuiltContainerImage(this IResource resource) 1049public static IComputeEnvironmentResource? GetComputeEnvironment(this IResource resource) 1063public static DeploymentTargetAnnotation? GetDeploymentTargetAnnotation(this IResource resource, IComputeEnvironmentResource? targetComputeEnvironment = null) 1117internal static Lifetime GetLifetimeType(this IResource resource) 1122private static Lifetime GetLifetimeType(IResource resource, HashSet<IResource> visitedResources) 1161internal static bool HasPersistentLifetime(this IResource resource) 1166internal static string GetOtelServiceInstanceId(this IResource resource, DcpInstance instance) 1178internal static bool TryGetParentProcessLifetime(this IResource resource, out int parentProcessId, out DateTime parentProcessTimestamp) 1183private static bool TryGetParentProcessLifetime(IResource resource, HashSet<IResource> visitedResources, out int parentProcessId, out DateTime parentProcessTimestamp) 1222internal static bool TryGetContainerImagePullPolicy(this IResource resource, [NotNullWhen(true)] out ImagePullPolicy? pullPolicy) 1240internal static bool SupportsProxy(this IResource resource) 1250internal static IResource GetRootResource(this IResource resource) => 1261internal static string GetResolvedResourceName(this IResource resource) 1281internal static string GetResolvedDisplayResourceName(this IResource resource, string resourceId) 1292internal static bool TryGetInstances(this IResource resource, out ImmutableArray<DcpInstance> instances) 1309internal static string[] GetResolvedResourceNames(this IResource resource) 1329this IResource resource, 1369internal static IContainerRegistry GetContainerRegistry(this IResource resource) 1394var registryNames = string.Join(", ", registryTargetAnnotations.Select(a => a.Registry is IResource res ? res.Name : a.Registry.ToString())); 1416this IResource resource, 1459internal static ILogger GetLogger(this IResource resource, IServiceProvider serviceProvider) 1493public static Task<IReadOnlySet<IResource>> GetResourceDependenciesAsync( 1494this IResource resource, 1525public static Task<IReadOnlySet<IResource>> GetResourceDependenciesAsync( 1526this IResource resource, 1556internal static async Task<IReadOnlySet<IResource>> GetDependenciesAsync( 1557IEnumerable<IResource> resources, 1562var dependencies = new HashSet<IResource>(); 1563var newDependencies = new HashSet<IResource>(); 1564var toProcess = new Queue<IResource>(); 1567foreach (var resource in resources) 1576foreach (var nd in newDependencies) 1583var dep = toProcess.Dequeue(); 1588foreach (var newDep in newDependencies) 1600foreach (var resource in resources) 1618IResource resource, 1619HashSet<IResource> dependencies, 1620HashSet<IResource> newDependencies, 1643IResource resource, 1749private static void CollectAnnotationDependencies(IResource resource, HashSet<IResource> dependencies, HashSet<IResource> newDependencies) 1787HashSet<IResource> dependencies, 1788HashSet<IResource> newDependencies, 1799else if (reference is IResource resource && dependencies.Add(resource)) 1867if (value is IResourceBuilder<IResource> resourceBuilder) 1883HashSet<IResource> dependencies, 1884HashSet<IResource> newDependencies, 1920internal static string GetResourceType(this IResource resource) => resource switch
ApplicationModel\ResourceLoggerService.cs (5)
61public ILogger GetLogger(IResource resource) 157public IAsyncEnumerable<IReadOnlyList<LogLine>> GetAllAsync(IResource resource) 177public IAsyncEnumerable<IReadOnlyList<LogLine>> WatchAsync(IResource resource) 285/// <param name="resource">The <see cref="IResource"/>.</param> 286public void Complete(IResource resource)
ApplicationModel\ResourceNotificationService.cs (24)
147private async Task WaitUntilHealthyAsync(IResource resource, IResource dependency, WaitBehavior waitBehavior, CancellationToken cancellationToken, Func<string, Task>? onDependencyReady = null) 327private async Task WaitUntilCompletionAsync(IResource resource, IResource dependency, int exitCode, CancellationToken cancellationToken, Func<string, Task>? onDependencyReady = null) 401private async Task WaitUntilStateAsync(IResource resource, IResource dependency, WaitBehavior waitBehavior, 477private async Task WaitUntilStartedAsync(IResource resource, IResource dependency, WaitBehavior waitBehavior, CancellationToken cancellationToken, Func<string, Task>? onDependencyReady = null) 505public async Task WaitForDependenciesAsync(IResource resource, CancellationToken cancellationToken) 647private Task PublishWaitingForDependenciesAsync(IResource resource, IEnumerable<string> dependencyNames) 676private Task ClearWaitingForDependenciesAsync(IResource resource) 886public Task PublishUpdateAsync(IResource resource, string resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 1024IResource resource, 1111IResource resource, 1159private CustomResourceSnapshot UpdateCommands(IResource resource, CustomResourceSnapshot previousState) 1239private static CustomResourceSnapshot UpdateIcons(IResource resource, CustomResourceSnapshot previousState) 1267private static CustomResourceSnapshot UpdateDashboardVisibility(IResource resource, CustomResourceSnapshot previousState) 1298public async Task PublishUpdateAsync(IResource resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 1307private static CustomResourceSnapshot GetCurrentSnapshot(IResource resource, ResourceNotificationState notificationState) 1335private ResourceNotificationState GetResourceNotificationState(string resourceId, IResource resource) => 1457private sealed class ResourceNotificationState(IResource resource) 1462public IResource Resource { get; } = resource; 1511public class ResourceEvent(IResource resource, string resourceId, CustomResourceSnapshot snapshot) 1516public IResource Resource { get; } = resource;
ApplicationModel\ResourceReadyEvent.cs (2)
17public class ResourceReadyEvent(IResource resource, IServiceProvider services) : IDistributedApplicationResourceEvent 22public IResource Resource => resource;
ApplicationModel\ResourceRelationshipAnnotation.cs (2)
12public sealed class ResourceRelationshipAnnotation(IResource resource, string type) : IResourceAnnotation 17public IResource Resource { get; } = resource;
ApplicationModel\ResourceStoppedEvent.cs (2)
18public class ResourceStoppedEvent(IResource resource, IServiceProvider services, ResourceEvent resourceEvent) : IDistributedApplicationResourceEvent 21public IResource Resource { get; } = resource;
ApplicationModel\ResourceTerminalCatalog.cs (1)
78foreach (var resource in _model.Resources)
ApplicationModel\ResourceTraitSnapshotProperties.cs (1)
12public static ImmutableArray<ResourcePropertySnapshot> AddTraitProperties(IResource resource, ImmutableArray<ResourcePropertySnapshot> properties)
ApplicationModel\ResourceUrlsCallbackContext.cs (2)
17public class ResourceUrlsCallbackContext(DistributedApplicationExecutionContext executionContext, IResource resource, List<ResourceUrlAnnotation>? urls = null, CancellationToken cancellationToken = default) 23public IResource Resource { get; } = resource;
ApplicationModel\ResourceUrlsCallbackScope.cs (3)
13private readonly IResource _resource; 16public ResourceUrlsCallbackScope(IResource resource) 23public static IResource? CurrentResource
ApplicationModel\TerminalHostResource.cs (3)
12internal sealed class TerminalHostResource : ExecutableResource, IResourceWithParent<IResource> 27public TerminalHostResource(string name, IResource parent, TerminalHostLayout layout) 40public IResource Parent { get; }
ApplicationModel\TerminalResourceSnapshotProperties.cs (2)
36IResource resource, 79private static int ResolveReplicaIndex(IResource resource, string resourceId)
ApplicationModel\WaitAnnotation.cs (2)
18public sealed class WaitAnnotation(IResource resource, WaitType waitType, int exitCode = 0) : IResourceAnnotation 23public IResource Resource { get; } = resource;
Ats\AtsTypeMappings.cs (1)
38[assembly: AspireExport(typeof(IResource))]
Ats\CoreExports.cs (1)
177public static string GetResourceName(this IResourceBuilder<IResource> resource)
Ats\DockerfileBuilderExports.cs (2)
174public static DockerfileBuilder AddContainerFilesStages(this DockerfileBuilder builder, IResource resource, ILogger? logger = null) 186public static DockerfileStage AddContainerFiles(this DockerfileStage stage, IResource resource, string rootDestinationPath, ILogger? logger = null)
Ats\EventingExports.cs (4)
73where T : IResource 89where T : IResource 121where T : IResource 153where T : IResource
Ats\ExecutionConfigurationExports.cs (1)
24public static IExecutionConfigurationBuilder CreateExecutionConfiguration(this IResource resource)
Ats\LoggingExports.cs (1)
105public static void CompleteLog(this ResourceLoggerService loggerService, IResourceBuilder<IResource> resource)
Ats\ModelExports.cs (2)
33public static IResource[] GetResources(this DistributedApplicationModel model) 47public static IResource? FindResourceByName(this DistributedApplicationModel model, string name)
Ats\NotificationExports.cs (2)
69IResourceBuilder<IResource> resource) 95IResourceBuilder<IResource> resource,
Ats\ResourceCommandExports.cs (2)
39[AspireUnion(typeof(string), typeof(IResource))] object resource, 51IResource resourceHandle => resourceCommandService.ExecuteCommandAsync(resourceHandle, commandName, arguments, cancellationToken),
Ats\UserSecretsExports.cs (1)
56where T : IResource
Backchannel\AuxiliaryBackchannelRpcTarget.cs (8)
440var resource = appModel.Resources.FirstOrDefault(r => string.Equals(r.Name, request.ResourceName, StringComparisons.ResourceName)); 597foreach (var resource in appModel.Resources) 808var matchingResource = appModel.Resources.SingleOrDefault(resource => string.Equals(resource.Name, requestedResourceName, StringComparisons.ResourceName)); 1006foreach (var resource in appModel.Resources) 1073var resource = resourceEvent.Resource; 1362IReadOnlySet<IResource> dependencies; 2009foreach (var resource in appModel.Resources) 2034foreach (var resource in appModel.Resources)
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (3)
20foreach (var container in beforeStartEvent.Model.GetContainerResources()) 56foreach (var resource in beforeStartEvent.Model.Resources) 95foreach (var resource in beforeStartEvent.Model.Resources)
ConnectionStringBuilderExtensions.cs (3)
59if (value is IResource resource) 69foreach (var innerRef in valueWithReferences.References.OfType<IResource>())
ContainerRegistryResourceBuilderExtensions.cs (3)
153foreach (var resource in beforeStartEvent.Model.Resources) 188where TDestination : IResource 189where TContainerRegistry : IResource, IContainerRegistry
ContainerResourceBuilderExtensions.cs (1)
1939public static IResourceBuilder<T> WithDockerfileBaseImage<T>(this IResourceBuilder<T> builder, string? buildImage = null, string? runtimeImage = null) where T : IResource
ContainerResourceExtensions.cs (3)
19public static IEnumerable<IResource> GetContainerResources(this DistributedApplicationModel model) 23foreach (var resource in model.Resources) 38public static bool IsContainer(this IResource resource)
CustomResourceExtensions.cs (1)
23where TResource : IResource
Dashboard\DashboardEventHandlers.cs (2)
188private void ConfigureAspireDashboardResource(IResource dashboardResource) 641private void AddDashboardOtlpEndpoint(IResource dashboardResource, string? endpointUrl, string endpointName, EndpointGenerationContext context, string? transport = null)
Dashboard\DashboardServiceData.cs (1)
43static GenericResourceSnapshot CreateResourceSnapshot(IResource resource, string resourceId, DateTime creationTimestamp, CustomResourceSnapshot snapshot)
Dashboard\ResourcePublisher.cs (3)
19private sealed record SourceAndResourceSnapshot(IResource Source, ResourceSnapshot Snapshot); 28internal bool TryGetResource(string resourceName, [NotNullWhen(returnValue: true)] out ResourceSnapshot? snapshot, [NotNullWhen(returnValue: true)] out IResource? resource) 84internal async ValueTask IntegrateAsync(IResource source, ResourceSnapshot snapshot, ResourceSnapshotChangeType changeType)
Dcp\AppResource.cs (4)
71public IResource ModelResource { get; } 73public RenderedModelResource(IResource modelResource, TDcpResource dcpResource) : base(dcpResource) 96public ServiceWithModelResource(IResource modelResource, Service service, EndpointAnnotation sba) : base(modelResource, service) 104IResource ModelResource { get; }
Dcp\ContainerCreator.cs (10)
82foreach (var container in modelContainerResources) 151private static void ApplyMonitorProcess(IResource resource, ContainerSpec spec) 211var modelContainer = cr.ModelResource; 324internal async Task<IEnumerable<HostResourceWithEndpoints>> GetHostDependenciesAsync(IResource resource, CancellationToken cancellationToken) 341if (_model.Resources.TryGetByName(KnownResourceNames.AspireDashboard, out var dashboardResource) 587private async Task<(List<string>, bool)> BuildRunArgsAsync(ILogger resourceLogger, IResource modelResource, CancellationToken cancellationToken) 613private static async Task ApplyBuildArgumentsAsync(Container dcpContainerResource, IResource modelContainerResource, DistributedApplicationExecutionContext executionContext, ILogger logger, CancellationToken cancellationToken) 743private static List<VolumeMount> BuildContainerMounts(IResource container) 764private void EnsureRequiredAnnotations(IResource resource) 772public required IResource Resource { get; init; }
Dcp\ContainerNetworkEndpointProvisioner.cs (3)
25internal static HostResourceWithEndpoints? Create(IResource resource) 134internal void ValidateContainerNameConflicts(IEnumerable<IResource> containerResources) 141foreach (var container in containerResources)
Dcp\DcpExecutor.cs (13)
216List<IResource> endpointAllocatedResources = []; 246foreach (var resource in endpointAllocatedResources.Distinct()) 352internal static string GetResourceType<T>(T resource, IResource appModelResource) where T : CustomResource 739private static bool GetEffectiveIsProxied(IResource resource, EndpointAnnotation endpoint, bool randomizePorts) 802private void EnsureProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint) 823private static PersistentPortAllocationKey GetPersistentPublicPortKey(IResource resource, EndpointAnnotation endpoint) 828internal static void SetInitialResourceState(IResource resource, IAnnotationHolder annotationHolder) 862var groupKey = group.Key; 873IResource modelResource, 1032internal static DcpInstance GetDcpInstance(IResource resource, int instanceIndex) 1298private static void ForgetCachedCallbackResults(IResource resource) 1325private void ForgetConnectionStringAvailableEvent(IResource resource) 1333private async Task PublishConnectionStringAvailableEventAsync(IResource resource, CancellationToken ct)
Dcp\DcpExecutorEvents.cs (4)
11internal record OnResourceStartingContext(CancellationToken CancellationToken, string ResourceType, IResource Resource, string? DcpResourceName); 12internal record OnConnectionStringAvailableContext(CancellationToken CancellationToken, IResource Resource); 14internal record OnResourceChangedContext(CancellationToken CancellationToken, string ResourceType, IResource Resource, string DcpResourceName, ResourceStatus Status, string? PreviousState, Func<CustomResourceSnapshot, CustomResourceSnapshot> UpdateSnapshot); 15internal record OnResourceFailedToStartContext(CancellationToken CancellationToken, string ResourceType, IResource Resource, string? DcpResourceName, string? ErrorMessage = null);
Dcp\DcpHost.cs (1)
761private static bool ResourceUsesTls(IResource resource)
Dcp\DcpModelUtilities.cs (9)
21internal static bool ShouldDeferCreateForExplicitStart(IResource modelResource, bool? start) 31internal static void ValidateEndpointPorts(IResource modelResource, EndpointAnnotation endpoint) 58internal static bool TryGetEffectiveFixedPublicPort(IResource resource, EndpointAnnotation endpoint, bool randomizePorts, out int publicPort) 78internal static bool NeedsGeneratedPublicPort(IResource resource, EndpointAnnotation endpoint, bool randomizePorts) 98var modelResource = appResource.ModelResource; 314internal static bool AreResourceEndpointsAllocated(IResource resource) 320IEnumerable<IResource> affectedResources, 324foreach (var res in affectedResources) 383private static bool TryGetEndpoint(IResource resource, string? endpointName, [NotNullWhen(true)] out EndpointAnnotation? endpoint)
Dcp\DcpNameGenerator.cs (8)
39public void EnsureDcpInstancesPopulated(IResource resource) 71private static void AddInstancesAnnotation(IResource resource, ImmutableArray<DcpInstance> instances) 76private static void ThrowIfPersistentExecutableHasReplicas(IResource resource) 89public (string Name, string Suffix) GetContainerName(IResource container) 100public (string Name, string Suffix) GetExecutableName(IResource project) 113public (string, bool) GetServiceName(IResource resource, EndpointAnnotation endpoint, NetworkIdentifier targetNetworkId) 171public static string GetObjectNameForResource(IResource resource, DcpOptions options, string suffix = "") 190private static string NetworkServiceKey(IResource resource, EndpointAnnotation endpoint, NetworkIdentifier targetNetworkId)
Dcp\DcpResourceState.cs (2)
10internal sealed class DcpResourceState(IDictionary<string, IResource> applicationModel, IEnumerable<IAppResource> appResources) 19public IDictionary<string, IResource> ApplicationModel { get; } = applicationModel;
Dcp\DcpResourceWatcher.cs (3)
332_resourceState.ApplicationModel.TryGetValue(resourceName, out var appModelResource)) 583private void AddDcpResourceObservedEvent(CustomResource resource, IResource appModelResource, string resourceKind, ResourceStatus status) 1007_resourceState.ApplicationModel.TryGetValue(appModelResourceName, out var appModelResource))
Dcp\ExecutableCreator.cs (9)
126IResource resource, 194IResource resource, 344IResource resource, 356private static void ApplyExplicitStart(IResource resource, ExecutableSpec spec) 364private static void ApplyLifetime(IResource resource, ExecutableSpec spec) 383private static void ApplyTerminal(IResource resource, Executable executable, ILogger logger) 420private void EnsureRequiredAnnotations(IResource resource) 426private void AddRenderedResource(IResource resource, Executable executable) 443IResource resource,
Dcp\ExecutableLaunchPolicy.cs (2)
18public ExecutableLaunchDecision Decide(IResource resource) 82IResource resource,
Dcp\PersistentPortAllocator.cs (1)
119foreach (var resource in _model.Resources)
Dcp\ResourceSnapshotBuilder.cs (6)
44_resourceState.ApplicationModel.TryGetValue(container.AppModelResourceName, out var appModelResource)) 101IResource? appModelResource = null; 138IResource? appModelResource = null; 243private static string? GetLaunchConfigurationType(IResource? resource) 265IResource? appModelResource, 555_resourceState.ApplicationModel.TryGetValue(resourceName, out var appModelResource) &&
Diagnostics\ProfilingTelemetry.cs (13)
385IResource appModelResource, 402public static ActivityScope StartResourceBeforeStartWait(IConfiguration? configuration, IResource resource) 409public static ActivityScope StartResourceCreate(IConfiguration? configuration, IResource resource, string resourceKind, int replicaCount) 419IResource resource, 429public static ActivityScope StartResourceStart(IConfiguration? configuration, IResource resource, string resourceKind, string resourceName, string resourceType) 467public static ActivityScope StartResourceStop(IConfiguration? configuration, IResource resource, string resourceKind, string resourceName) 475public static ActivityScope StartResourceWaitForDependencies(IConfiguration? configuration, IResource resource, int dependencyCount) 483public static ActivityScope StartResourceWaitForDependency(IConfiguration? configuration, IResource resource, IResource dependency, WaitType waitType, WaitBehavior? waitBehavior) 993public void SetDependencyWait(IResource resource, IResource dependency, WaitType waitType, WaitBehavior? waitBehavior) 1017public void SetResource(IResource resource) 1033public void SetResourceLifecycle(IResource resource, string resourceId, CustomResourceSnapshot snapshot)
DistributedApplication.cs (2)
845foreach (var resource in app._model.Resources) 861public required IResource Resource { get; init; }
DistributedApplicationBuilder.cs (4)
909foreach (var resource in Resources) 929public IResourceBuilder<T> AddResource<T>(T resource) where T : IResource 940public IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource 1132private static void ValidateResourceName(IResource resource)
DistributedApplicationBuilderExtensions.cs (4)
63public static IResourceBuilder<T> CreateResourceBuilder<T>(this IDistributedApplicationBuilder builder, string name) where T : IResource 67var resource = builder.Resources.FirstOrDefault(r => string.Equals(r.Name, name, StringComparison.OrdinalIgnoreCase)); 95public static bool TryCreateResourceBuilder<T>(this IDistributedApplicationBuilder builder, string name, [NotNullWhen(true)] out IResourceBuilder<T>? resourceBuilder) where T : IResource 100var resource = builder.Resources.FirstOrDefault(r => string.Equals(r.Name, name, StringComparison.OrdinalIgnoreCase));
DistributedApplicationEventingExtensions.cs (5)
102where T : IResource 115where T : IResource 141where T : IResource 167where T : IResource 179where TResource : IResource
DistributedApplicationResourceBuilder.cs (1)
8internal sealed class DistributedApplicationResourceBuilder<T>(IDistributedApplicationBuilder applicationBuilder, T resource) : IResourceBuilder<T> where T : IResource
EmulatorResourceExtensions.cs (1)
19public static bool IsEmulator(this IResource resource)
Eventing\DistributedApplicationEventing.cs (1)
159public DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent
Eventing\DistributedApplicationEventSubscription.cs (2)
25public class DistributedApplicationResourceEventSubscription(IResource? resource, Func<IDistributedApplicationResourceEvent, CancellationToken, Task> callback) 31public IResource? Resource { get; } = resource;
Eventing\IDistributedApplicationEvent.cs (1)
27IResource Resource { get; }
Eventing\IDistributedApplicationEventing.cs (1)
29DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent;
Health\ResourceHealthCheckService.cs (3)
82var resource = resourceEvent.Resource; 118var resource = state.LatestEvent.Resource; 255private void FireResourceReadyEvent(IResource resource, CancellationToken cancellationToken)
IDistributedApplicationBuilder.cs (4)
187/// constructs a resource derived from <see cref="IResource"/> and adds it to the application model using the <see cref="AddResource{T}(T)"/> 200IResourceBuilder<T> AddResource<T>(T resource) where T : IResource; 220/// Calling extension methods on the <see cref="IResourceBuilder{T}"/> typically results in modifications to the <see cref="IResource.Annotations"/> 256IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource;
Lifecycle\DotnetBuildCommandEventingSubscriber.cs (1)
104private static bool IsAspireManagedDotnetBuild(IResource resource)
Lifecycle\RequiredCommandValidationEventingSubscriber.cs (1)
33var resource = @event.Resource;
Orchestrator\ApplicationOrchestrator.cs (16)
26private readonly ILookup<IResource, IResource> _parentChildLookup; 223private async Task PublishResourceEndpointUrls(IResource resource, CancellationToken cancellationToken) 233private static IEnumerable<UrlSnapshot> GetResourceUrls(IResource resource) 298static Task PublishUpdateAsync(ResourceNotificationService notificationService, IResource resource, string? resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 316private async Task ProcessResourceUrlCallbacks(IResource resource, CancellationToken cancellationToken) 746private async Task SetChildResourceAsync(IResource resource, string? state, DateTime? startTimeStamp, DateTime? stopTimeStamp) 748foreach (var child in _parentChildLookup[resource].Where(c => c is IResourceWithParent)) 775foreach (var resource in _model.Resources) 779var parent = resource is IResourceWithParent hasParent 801private static ImmutableArray<HealthReportSnapshot> GetInitialHealthReports(IResource resource) 812private async Task PublishConnectionStringAvailableEvent(IResource resource, CancellationToken cancellationToken) 838private async Task PublishEventToHierarchy<TEvent>(Func<IResource, TEvent> createEvent, IResource resource, CancellationToken cancellationToken) 847foreach (var child in children.Where(c => c is IResourceWithParent)) 862private static bool ResourceHasOwnLifetime(IResource resource) =>
Orchestrator\ParameterProcessor.cs (1)
187foreach (var resource in model.Resources)
Orchestrator\RelationshipEvaluator.cs (19)
13public static ILookup<IResource, IResource> GetParentChildLookup(DistributedApplicationModel model) 18.Select(x => (Child: (IResource)x, Parent: x.Parent)) 24private static IEnumerable<(IResource Child, IResource Parent)> GetParentChildRelationshipsFromAnnotations(DistributedApplicationModel model) 26static bool TryGetParent(IResource resource, [NotNullWhen(true)] out IResource? parent) 39static IResource? SelectParentResource(IResource? resource) => resource switch 41IResource r when TryGetParent(r, out var parent) => parent, 54private static void ValidateRelationships((IResource Child, IResource Parent)[] relationships) 64var visited = new Stack<IResource>(); 70static void ValidateNoCircularDependencies(Dictionary<IResource, IResource> childToParentLookup, IResource child, Stack<IResource> visited) 73if (childToParentLookup.TryGetValue(child, out var parent))
OtlpConfigurationExtensions.cs (6)
29public static void AddOtlpEnvironment(IResource resource, IConfiguration configuration, IHostEnvironment environment) 48public static void AddOtlpEnvironment(IResource resource, IConfiguration configuration, IHostEnvironment environment, OtlpProtocol protocol) 89IResource resource, 201IResource resource, 215private static OtlpExporterAnnotation? GetEffectiveOtlpExporterAnnotation(IResource resource) 305if (!model.Resources.TryGetByName(KnownResourceNames.AspireDashboard, out var resource) || resource is not IResourceWithEndpoints dashboardResource)
Pipelines\DistributedApplicationPipeline.cs (6)
123foreach (var resource in context.Model.GetBuildResources()) 186foreach (var resource in context.Model.Resources) 234var registryNames = string.Join(", ", registryTargetAnnotations.Select(a => a.Registry is IResource res ? res.Name : a.Registry.ToString())); 379foreach (var resource in model.Resources) 721foreach (var resource in context.Model.Resources) 756foreach (var resource in pipelineContext.Model.Resources)
Pipelines\IPipelineOutputService.cs (2)
26string GetOutputDirectory(IResource resource); 39string GetTempDirectory(IResource resource);
Pipelines\PipelineConfigurationContext.cs (3)
47internal ILookup<IResource?, PipelineStep>? StepToResourceMap { get; init; } 80public IEnumerable<PipelineStep> GetSteps(IResource resource) 95public IEnumerable<PipelineStep> GetSteps(IResource resource, string tag)
Pipelines\PipelineOutputService.cs (2)
71public string GetOutputDirectory(IResource resource) 86public string GetTempDirectory(IResource resource)
Pipelines\PipelineStep.cs (1)
59public IResource? Resource { get; set; }
Pipelines\PipelineStepFactoryContext.cs (1)
23public required IResource Resource { get; init; }
Pipelines\PipelineStepFactoryExtensions.cs (7)
24Func<PipelineStepFactoryContext, PipelineStep> factory) where T : IResource 43Func<PipelineStepFactoryContext, Task<PipelineStep>> factory) where T : IResource 62Func<PipelineStepFactoryContext, IEnumerable<PipelineStep>> factory) where T : IResource 81Func<PipelineStepFactoryContext, Task<IEnumerable<PipelineStep>>> factory) where T : IResource 109string? description = null) where T : IResource 138Func<PipelineConfigurationContext, Task> callback) where T : IResource 157Action<PipelineConfigurationContext> callback) where T : IResource
Pipelines\PipelineStepHelpers.cs (3)
28public static async Task PushImageToRegistryAsync(IResource resource, PipelineStepContext context) 62private static async Task TagImageForLocalRegistryAsync(IResource resource, PipelineStepContext context) 105private static async Task PushImageToRemoteRegistryAsync(IResource resource, IContainerRegistry registry, PipelineStepContext context)
ProjectResourceBuilderExtensions.cs (2)
1108private static IConfiguration GetConfiguration(IResource projectResource) 1142where TProjectResource : class, IResource
Publishing\ContainerRuntimeBase.cs (1)
79public virtual async Task PushImageAsync(IResource resource, CancellationToken cancellationToken)
Publishing\IContainerRuntime.cs (1)
59Task PushImageAsync(IResource resource, CancellationToken cancellationToken);
Publishing\ManifestPublishingContext.cs (25)
47private readonly Dictionary<string, IResource> _referencedResources = []; 121foreach (var resource in model.Resources) 129foreach (var resource in model.Resources) 163internal async Task WriteResourceAsync(IResource resource) 205async Task WriteResourceObjectAsync<T>(T resource, Func<Task> action) where T : IResource 233private async Task WriteProjectAsync(IResource project) 279private void WriteContainerFilesDestination(IResource resource) 290var source = containerFileDestination.Source; 537/// <param name="resource">The <see cref="IResource"/>.</param> 538public void WriteConnectionString(IResource resource) 550/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 553/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 554public void WriteBindings(IResource resource) 595/// Writes environment variables to the manifest base on the <see cref="IResource"/> resource's <see cref="EnvironmentCallbackAnnotation"/> annotations."/> 597/// <param name="resource">The <see cref="IResource"/> which contains <see cref="EnvironmentCallbackAnnotation"/> annotations.</param> 598public async Task WriteEnvironmentVariablesAsync(IResource resource) 632/// Writes command line arguments to the manifest based on the <see cref="IResource"/> resource's <see cref="CommandLineArgsCallbackAnnotation"/> annotations. 634/// <param name="resource">The <see cref="IResource"/> that contains <see cref="CommandLineArgsCallbackAnnotation"/> annotations.</param> 636public async Task WriteCommandLineArgumentsAsync(IResource resource) 728/// Ensures that any <see cref="IResource"/> instances referenced by <paramref name="value"/> are 751if (value is IResource resource) 913if (!visited.Add(current) || current is IResource || current is not IValueWithReferences references) 933if (reference is IResource or ReferenceExpression { IsConditional: true }) 1350foreach (var existingResource in model.Resources) 1356foreach (var resource in _referencedResources.Values)
Publishing\ResourceContainerImageManager.cs (19)
150Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default); 158Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default); 165Task PushImageAsync(IResource resource, CancellationToken cancellationToken); 171IResource resource, 272IResource resource, 297public async Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 303foreach (var resource in resourceList) 335foreach (var resource in resourcesToBuild) 344public async Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 421IResource resource, 428IResource resource, 576IResource resource, 742IResource resource, 796IResource resource, 948IResource resource, 988private async Task BuildContainerImageFromDockerfileAsync(IResource resource, DockerfileBuildAnnotation dockerfileBuildAnnotation, string imageName, ResolvedContainerBuildOptions options, CancellationToken cancellationToken) 1080public async Task PushImageAsync(IResource resource, CancellationToken cancellationToken) 1087private async Task<bool> ResourcesRequireContainerRuntimeAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken) 1089foreach (var resource in resources)
RequiredCommandResourceExtensions.cs (2)
32string? helpLink = null) where T : IResource 69string? helpLink = null) where T : IResource
ResourceBuilderExtensions.cs (102)
78where T : IResource 110where T : IResource 134where T : IResource 135where TSource : IResource 183where T : IResource 206where T : IResource 227where T : IResource 730where T : IResource 748internal static IResource WithSerializedAnnotation(this IResource resource, string annotationId, string json) 768where T : IResource 782internal static string GetSerializedAnnotation(this IResource resource, string annotationId) 799where T : IResource 813internal static bool HasSerializedAnnotation(this IResource resource, string annotationId) 831where T : IResource 851where T : IResource 865internal static TData GetAnnotation<TData>(this IResource resource, AnnotationDefinition<TData> definition) 884internal static bool TryGetAnnotation<TData>(this IResource resource, AnnotationDefinition<TData> definition, [NotNullWhen(true)] out TData? data) 923private static string? TryGetSerializedAnnotation(IResource resource, string annotationId) 931private static void RemoveSerializedAnnotation(IResource resource, string annotationId) 1009public static IResourceBuilder<T> WithManifestPublishingCallback<T>(this IResourceBuilder<T> builder, Action<ManifestPublishingContext> callback) where T : IResource 1027public static IResourceBuilder<T> WithManifestPublishingCallback<T>(this IResourceBuilder<T> builder, Func<ManifestPublishingContext, Task> callback) where T : IResource 1164[AspireUnion(typeof(IResourceBuilder<IResource>), typeof(EndpointReference), typeof(string), typeof(Uri))] object source, 1175IResourceBuilder<IResource> resourceBuilder => WithReferenceResource(builder, resourceBuilder, connectionName, optional, name), 1189IResourceBuilder<IResource> source, 1203IResourceBuilder<IResource> source, 1284IResourceBuilder<IResource> source, 1301IResourceBuilder<IResource> source, 1327IResourceBuilder<IResource> source, 1332where TCustom : class, IResource, IResourceWithCustomWithReference<TCustom> 2298where T : IResource 2329where T : IResource 2367where T : IResource 2401where T : IResource 2429where T : IResource 2452where T : IResource 2516where T : IResource 2604where T : IResource 2720public static IResourceBuilder<T> ExcludeFromManifest<T>(this IResourceBuilder<T> builder) where T : IResource 2738/// resources, calling <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> also results 2755public static IResourceBuilder<T> WaitFor<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency) where T : IResourceWithWaitSupport 2769IResourceBuilder<IResource> dependency, 2792/// resources, calling <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource}, WaitBehavior)"/> also results 2800/// behavior with the <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> overload.</para> 2815public static IResourceBuilder<T> WaitFor<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, WaitBehavior waitBehavior) where T : IResourceWithWaitSupport 2823private static IResourceBuilder<T> WaitForCore<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, WaitBehavior? waitBehavior, bool addRelationship) where T : IResourceWithWaitSupport 2825if (builder.Resource as IResource == dependency.Resource) 2865/// <para>Unlike <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>, this method 2880public static IResourceBuilder<T> WaitForStart<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency) where T : IResourceWithWaitSupport 2894IResourceBuilder<IResource> dependency, 2917/// <para>Unlike <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource}, WaitBehavior)"/>, this method 2923/// behavior with the <see cref="WaitForStart{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> overload.</para> 2938public static IResourceBuilder<T> WaitForStart<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, WaitBehavior waitBehavior) where T : IResourceWithWaitSupport 2946private static IResourceBuilder<T> WaitForStartCore<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, WaitBehavior? waitBehavior, bool addRelationship) where T : IResourceWithWaitSupport 2948if (builder.Resource as IResource == dependency.Resource) 2973foreach (var referencedResource in cs.ConnectionStringExpression.ValueProviders.OfType<IResource>()) 3012public static IResourceBuilder<T> WithExplicitStart<T>(this IResourceBuilder<T> builder) where T : IResource 3046public static IResourceBuilder<T> WaitForCompletion<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, int exitCode = 0) where T : IResourceWithWaitSupport 3051if (builder.Resource as IResource == dependency.Resource) 3078/// the <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> to associate a resource 3106public static IResourceBuilder<T> WithHealthCheck<T>(this IResourceBuilder<T> builder, string key) where T : IResource 3308CommandOptions? commandOptions = null) where T : IResource 3378bool isHighlighted = false) where T : IResource 3453where TResource : IResource 3516where TResource : IResource 3574where TResource : IResource 3619where TResource : IResource 3657where TResource : IResource 4748where TResource : IResource 4868IResource resource, 4869string type) where T : IResource 4894IResourceBuilder<IResource> resourceBuilder, 4895string type) where T : IResource 4914IResource resource) where T : IResource 4933ReferenceExpression expression) where T : IResource 4944where T : IResource 4948void AddReference(IResource resource) 4960if (value is IResource resource) 4964else if (value is IResourceBuilder<IResource> resourceBuilder) 4994IResourceBuilder<IResource> resourceBuilder) where T : IResource 5030IResourceBuilder<IResource> parent) where T : IResource 5062IResource parent) where T : IResource 5096IResourceBuilder<IResource> child) where T : IResource 5130IResource child) where T : IResource 5156public static IResourceBuilder<T> WithResourceTypeDisplayName<T>(this IResourceBuilder<T> builder, string resourceTypeDisplayName) where T : IResource 5195public static IResourceBuilder<T> WithIconName<T>(this IResourceBuilder<T> builder, string iconName, IconVariant iconVariant = IconVariant.Filled) where T : IResource 5363where T : IResource 5403where T : IResource 5460where T : IResource 5655public static IResourceBuilder<T> ExcludeFromMcp<T>(this IResourceBuilder<T> builder) where T : IResource 5675public static IResourceBuilder<T> WithHidden<T>(this IResourceBuilder<T> builder) where T : IResource 5695public static IResourceBuilder<T> WithHiddenOnCompletion<T>(this IResourceBuilder<T> builder, int exitCode) where T : IResource 5718internal static IResourceBuilder<T> WithHiddenOnCompletionExport<T>(this IResourceBuilder<T> builder, int? exitCode = null, int[]? exitCodes = null) where T : IResource 5740public static IResourceBuilder<T> WithHiddenOnCompletion<T>(this IResourceBuilder<T> builder, params int[] exitCodes) where T : IResource 5748private static IResourceBuilder<T> WithHiddenOnCompletionCore<T>(IResourceBuilder<T> builder, IReadOnlyList<int> exitCodes) where T : IResource
ResourceLoggerForwarderService.cs (1)
61private async Task WatchResourceLogs(IResource resource, string resourceId, CancellationToken cancellationToken)
ResourceTraitBuilderExtensions.cs (4)
19public static IResourceBuilder<T> WithTrait<T>(this IResourceBuilder<T> builder, string name, string value) where T : IResource 40public static IResourceBuilder<T> WithTags<T>(this IResourceBuilder<T> builder, params ReadOnlySpan<string> tags) where T : IResource 57internal static IResourceBuilder<T> WithTagsForPolyglot<T>(this IResourceBuilder<T> builder, string[] tags) where T : IResource 76public static IResourceBuilder<T> WithDisplayOrder<T>(this IResourceBuilder<T> builder, int order) where T : IResource =>
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (8)
16internal static LaunchSettings? GetLaunchSettings(this IResource projectResource) 33internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this IResource projectResource, bool throwIfNotFound = false) 50internal static LaunchProfile? GetLaunchProfile(this IResource projectResource, string launchProfileName, bool throwIfNotFound = false) 121private static bool TrySelectLaunchProfileByOrder(IResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 145private static bool TrySelectLaunchProfileFromDefaultAnnotation(IResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 171private static bool TrySelectLaunchProfileFromAnnotation(IResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 185internal static string? SelectLaunchProfileName(this IResource projectResource) 207internal delegate bool LaunchProfileSelector(IResource project, out string? launchProfile);
src\Shared\ResourceNameComparer.cs (4)
8internal sealed class ResourceNameComparer : IEqualityComparer<IResource?> 10public bool Equals(IResource? x, IResource? y) 20public int GetHashCode(IResource obj) =>
src\Shared\VolumeMountPathResolver.cs (2)
15internal static string GetOrCreateLocalPath(IAspireStore store, IResource resource, string volumeName) 22internal static string GetLocalPath(IAspireStore store, IResource resource, string volumeName)
TerminalResourceBuilderExtensions.cs (2)
75where T : IResource 127IResource parent,
Utils\DockerfileHelper.cs (1)
22IResource resource,
Utils\ImageNameGenerator.cs (2)
14public static string GenerateImageName<T>(this IResourceBuilder<T> builder) where T : IResource 23public static string GenerateImageTag<T>(this IResourceBuilder<T> builder) where T : IResource
VolumeNameGenerator.cs (1)
21public static string Generate<T>(IResourceBuilder<T> builder, string suffix) where T : IResource
Aspire.Hosting.Azure (78)
AzureProvisioningController.cs (50)
961private static void ThrowIfNonArmTarget(IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> resources) 1071IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> azureResources, 1137private static bool HasMissingAzureContextFailure(IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> azureResources) 1141private static ImmutableArray<ResourcePropertySnapshot> CreateAzureEnvironmentFailureProperties(IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> azureResources) 1155private static Exception? GetProvisioningFailureException(IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> azureResources) 1160private static string CreateProvisioningFailureMessage(IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> azureResources) 1174IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> azureResources, 1191IReadOnlyCollection<(IResource Resource, IAzureResource AzureResource)> azureResources, 1265private static List<(IResource Resource, IAzureResource AzureResource)> GetProvisionableAzureResources(DistributedApplicationModel model) 1276private static List<(IResource Resource, IAzureResource AzureResource)> GetTargetAzureResources( 1293var queue = new Queue<(IResource Resource, IAzureResource AzureResource)>(); 1294var targetResources = new List<(IResource Resource, IAzureResource AzureResource)>(); 1306foreach (var child in parentChildLookup[current.Resource]) 1316foreach (var child in parentChildLookup[current.AzureResource]) 1339void Enqueue((IResource Resource, IAzureResource AzureResource) resource) 1348private static ILookup<IResource, IResource> GetTargetParentChildLookup(DistributedApplicationModel model, bool includeAnnotationParentRelationships) 1358private static IEnumerable<IResource> GetResourceParents(IResource resource, bool includeAnnotationParentRelationships) 1384private static void ThrowIfKeyVaultLocationChangeTarget(IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> targetResources) 1405IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> azureResources, 1406IResource target, 1407out (IResource Resource, IAzureResource AzureResource) azureResource) 1422private static List<(IResource Resource, IAzureResource AzureResource)> GetActiveOperationTargetAzureResources(DistributedApplicationModel model, ActiveAzureOperation activeOperation) 1913IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> resources, CancellationToken cancellationToken) 2910private static string GetDeploymentStateResourceName((IResource Resource, IAzureResource AzureResource) resource) 2914IReadOnlyCollection<(IResource Resource, IAzureResource AzureResource)> targetResources, 3015IReadOnlyCollection<(IResource Resource, IAzureResource AzureResource)> targetResources, 3504private bool ShouldCheckForDrift(IResource resource) 3736private CustomResourceSnapshot ApplyActiveOperationProperties(IResource resource, CustomResourceSnapshot state) 3767foreach (var resource in GetResourcesForCommandStateRefresh(model)) 3775private static IEnumerable<IResource> GetResourcesForCommandStateRefresh(DistributedApplicationModel model) 3778var resources = new List<IResource>(); 3795void Add(IResource resource) 3805(IResource Resource, IAzureResource AzureResource) resource, 3806ILookup<IResource, IResourceWithParent> parentChildLookup, 3809async Task PublishAsync(IResource targetResource) 3845(IResource Resource, IAzureResource AzureResource) resource, 3846ILookup<IResource, IResourceWithParent> parentChildLookup) 3898IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> targetResources, 3916(IResource Resource, IAzureResource AzureResource) resource, 3917ILookup<IResource, IResourceWithParent> parentChildLookup) 3985(IResource Resource, IAzureResource AzureResource) resource, 3986ILookup<IResource, IResourceWithParent> parentChildLookup) 4015IReadOnlyList<(IResource Resource, IAzureResource AzureResource)> azureResources, 4016ILookup<IResource, IResourceWithParent> parentChildLookup, 4038(IResource Resource, IAzureResource AzureResource) resource, 4039ILookup<IResource, IResourceWithParent> parentChildLookup, 4227IResource targetResource, 4228ILookup<IResource, IResourceWithParent> parentChildLookup,
AzurePublishingContext.cs (1)
481foreach (var resource in model.Resources)
AzureResourcePreparer.cs (15)
76private static void AddPerResourceCommands(List<(IResource Resource, IAzureResource AzureResource)> azureResources) 119private static string GetDeploymentStateResourceName((IResource Resource, IAzureResource AzureResource) resource) 155IResource resource, 181internal static List<(IResource Resource, IAzureResource AzureResource)> GetAzureResourcesFromAppModel(DistributedApplicationModel appModel) 188var azureResources = new List<(IResource, IAzureResource)>(); 189foreach (var resource in appModel.Resources) 220foreach (var resource in appModel.Resources) 234private async Task BuildRoleAssignmentAnnotations(DistributedApplicationModel appModel, List<(IResource Resource, IAzureResource AzureResource)> azureResources, CancellationToken cancellationToken) 264foreach (var resource in resourceSnapshot) 326foreach (var dependency in directDependencies) 414private static Dictionary<AzureProvisioningResource, IEnumerable<RoleDefinition>> GetAllRoleAssignments(IResource resource) 433IResource resource, 463IResource resource, 561if (!appModel.Resources.TryGetByName(roleAssignmentResource.Name, out var existingResource)) 579private static void AddDeploymentPrerequisitesAnnotation(IResource resource, HashSet<AzureBicepResource> prerequisiteResources)
AzureRoleAssignmentResource.cs (4)
25IResource? ownerResource, 45public IResource? OwnerResource { get; } = ValidateOwnerAndIdentity(ownerResource, identityResource); 53private static IResource? ValidateOwnerAndIdentity(IResource? ownerResource, AzureUserAssignedIdentityResource? identityResource)
BicepResourceAnnotation.cs (1)
16/// that can be added to any <see cref="IResource"/> will be detected by the <see cref="AzureProvisioner"/> and used to
ExistingAzureResourceExtensions.cs (2)
22public static bool IsExisting(this IResource resource) 37return ((IResource)resource).IsExisting();
IAzureCdnPrivateLinkTarget.cs (2)
37BicepOutputReference GetPrivateLinkResourceId(IResource origin); 49BicepOutputReference GetPrivateLinkLocation(IResource origin);
IAzureKeyVaultSecretReference.cs (2)
28/// The <see cref="IResource"/> that is responsible for writing this secret to the Key Vault, or <c>null</c> if not set. 33public IResource? SecretOwner
IAzureResource.cs (1)
7/// Represents an Azure resource, as a marker interface for <see cref="IResource"/>'s
Aspire.Hosting.Azure.ApiManagement (5)
AzureApiManagementApiResource.cs (1)
83internal IResource? Backend { get; set; }
AzureApiManagementExtensions.cs (3)
81.OfType<IResource>() 83foreach (var target in openApiDeploymentTargets) 1174IResource backend)
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
125IResource resource,
Aspire.Hosting.Azure.AppConfiguration (4)
AzureAppConfigurationExtensions.cs (2)
206where T : IResource 226where T : IResource
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.AppContainers (30)
AzureContainerAppEnvironmentResource.cs (10)
40BicepOutputReference IAzureCdnPrivateLinkTarget.GetPrivateLinkResourceId(IResource origin) => ContainerAppEnvironmentId; 43BicepOutputReference IAzureCdnPrivateLinkTarget.GetPrivateLinkLocation(IResource origin) => ContainerAppLocation; 100foreach (var computeResource in model.GetComputeResources()) 102var deploymentTarget = computeResource.GetDeploymentTargetAnnotation(this)?.DeploymentTarget; 138foreach (var computeResource in context.Model.GetComputeResources()) 140var deploymentTarget = computeResource.GetDeploymentTargetAnnotation(this)?.DeploymentTarget; 158foreach (var computeResource in context.Model.GetBuildResources()) 222foreach (var r in appModel.GetComputeResources()) 344internal Dictionary<string, (IResource resource, ContainerMountAnnotation volume, int index, BicepOutputReference outputReference)> VolumeNames { get; } = []; 465internal BicepOutputReference GetVolumeStorage(IResource resource, ContainerMountAnnotation volume, int volumeIndex)
AzureContainerAppExtensions.cs (1)
80foreach (var r in ctx.Model.GetComputeResources())
AzureContainerAppResource.cs (2)
26public AzureContainerAppResource(string name, Action<AzureResourceInfrastructure> configureInfrastructure, IResource targetResource) 107public IResource TargetResource { get; }
BaseContainerAppContext.cs (3)
15internal abstract class BaseContainerAppContext(IResource resource, ContainerAppEnvironmentContext containerAppEnvironmentContext) 19public IResource Resource => resource; 89protected static bool TryGetContainerImageName(IResource resource, out string? containerImageName)
ContainerAppContext.cs (1)
16internal sealed class ContainerAppContext(IResource resource, ContainerAppEnvironmentContext containerAppEnvironmentContext)
ContainerAppEnvironmentContext.cs (4)
24private readonly Dictionary<IResource, BaseContainerAppContext> _containerApps = new(new ResourceNameComparer()); 72public BaseContainerAppContext GetContainerAppContext(IResource resource) 82public async Task<AzureBicepResource> CreateContainerAppAsync(IResource resource, AzureProvisioningOptions provisioningOptions, CancellationToken cancellationToken) 107private BaseContainerAppContext CreateContainerAppContext(IResource resource)
ContainerAppJobContext.cs (1)
12internal sealed class ContainerAppJobContext(IResource resource, ContainerAppEnvironmentContext containerAppEnvironmentContext)
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
125IResource resource,
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (3)
41where TEnvironment : IResource, IAzureComputeEnvironmentResource 72where TEnvironment : IResource, IAzureComputeEnvironmentResource 104where TEnvironment : IResource, IAzureComputeEnvironmentResource
src\Shared\ResourceNameComparer.cs (4)
8internal sealed class ResourceNameComparer : IEqualityComparer<IResource?> 10public bool Equals(IResource? x, IResource? y) 20public int GetHashCode(IResource obj) =>
Aspire.Hosting.Azure.AppService (30)
AzureAppServiceEnvironmentContext.cs (3)
24private readonly Dictionary<IResource, AzureAppServiceWebsiteContext> _appServices = new(new ResourceNameComparer()); 62public AzureAppServiceWebsiteContext GetAppServiceContext(IResource resource) 72public async Task<AzureBicepResource> CreateAppServiceAsync(IResource resource, AzureProvisioningOptions provisioningOptions, CancellationToken cancellationToken)
AzureAppServiceEnvironmentExtensions.cs (1)
54foreach (var r in ctx.Model.GetComputeResources())
AzureAppServiceEnvironmentResource.cs (14)
44BicepOutputReference IAzureCdnPrivateLinkTarget.GetPrivateLinkResourceId(IResource origin) => 47BicepOutputReference IAzureCdnPrivateLinkTarget.GetPrivateLinkLocation(IResource origin) => 55private readonly Dictionary<IResource, AzureAppServiceWebSiteResource> _websites = new(new ResourceNameComparer()); 57internal AzureAppServiceWebSiteResource GetOrCreateWebsite(IResource origin) 79private AzureAppServiceWebSiteResource GetPrivateLinkWebsite(IResource origin) => GetOrCreateWebsite(origin); 142foreach (var computeResource in model.GetComputeResources()) 144var deploymentTarget = computeResource.GetDeploymentTargetAnnotation(this)?.DeploymentTarget; 180foreach (var computeResource in context.Model.GetComputeResources()) 182var deploymentTarget = computeResource.GetDeploymentTargetAnnotation(this)?.DeploymentTarget; 200foreach (var computeResource in context.Model.GetBuildResources()) 253foreach (var resource in appModel.GetComputeResources()) 311foreach (var computeResource in model.GetComputeResources()) 313var deploymentTarget = computeResource.GetDeploymentTargetAnnotation(this)?.DeploymentTarget; 358private static string? ValidateEnvironmentVariableNames(IResource resource, AzureAppServiceWebsiteContext appServiceContext)
AzureAppServiceWebsiteContext.cs (2)
20IResource resource, 23public IResource Resource => resource;
AzureAppServiceWebSiteResource.cs (2)
26public AzureAppServiceWebSiteResource(string name, Action<AzureResourceInfrastructure> configureInfrastructure, IResource targetResource) 105public IResource TargetResource { get; }
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
125IResource resource,
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (3)
41where TEnvironment : IResource, IAzureComputeEnvironmentResource 72where TEnvironment : IResource, IAzureComputeEnvironmentResource 104where TEnvironment : IResource, IAzureComputeEnvironmentResource
src\Shared\ResourceNameComparer.cs (4)
8internal sealed class ResourceNameComparer : IEqualityComparer<IResource?> 10public bool Equals(IResource? x, IResource? y) 20public int GetHashCode(IResource obj) =>
Aspire.Hosting.Azure.CognitiveServices (4)
AzureOpenAIExtensions.cs (2)
251where T : IResource 271where T : IResource
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.ConnectorNamespace (1)
AzureConnectorNamespaceConnectionResource.cs (1)
59IResourceBuilder<IResource> source,
Aspire.Hosting.Azure.ContainerRegistry (7)
AzureContainerRegistryExtensions.cs (5)
68foreach (var resource in beforeStartEvent.Model.Resources) 90where T : IResource, IComputeEnvironmentResource 114where T : IResource, IAzureComputeEnvironmentResource 271where T : IResource 291where T : IResource
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.EntraId (27)
EntraIdApplicationResource.cs (19)
117IResourceBuilder<IResource> source, 281internal List<IResource> Consumers { get; } = []; 349foreach (var consumer in Consumers) 360internal static void ValidateConsumerReferences(IResource consumer) 389foreach (var target in ClientCredentials.OfType<EntraIdFederatedIdentityCredential>().Select(c => c.ComputeTarget).OfType<IResource>()) 408IEnumerable<IResource> targets = credential.ComputeTarget is { } target ? [target] : Consumers; 409foreach (var resource in targets) 1088internal virtual bool EmitEnvironmentVariables(IDictionary<string, object> envVars, string prefix, string separator, EntraIdApplicationResource application, IResource consumer, DistributedApplicationExecutionContext executionContext) 1125internal override bool EmitEnvironmentVariables(IDictionary<string, object> envVars, string prefix, string separator, EntraIdApplicationResource application, IResource consumer, DistributedApplicationExecutionContext executionContext) 1204internal IResource? ComputeTarget { get; set; } 1212internal static AzureUserAssignedIdentityResource? GetConsumerIdentity(IResource consumer) 1217internal void ValidateConsumer(EntraIdApplicationResource application, IResource consumer) 1235IResource consumer) : IValueProvider, IManifestExpressionProvider, IValueWithReferences, IBicepOutputReferenceProvider 1259internal override bool EmitEnvironmentVariables(IDictionary<string, object> envVars, string prefix, string separator, EntraIdApplicationResource application, IResource consumer, DistributedApplicationExecutionContext executionContext) 1355internal override bool EmitEnvironmentVariables(IDictionary<string, object> envVars, string prefix, string separator, EntraIdApplicationResource application, IResource consumer, DistributedApplicationExecutionContext executionContext) 1410internal override bool EmitEnvironmentVariables(IDictionary<string, object> envVars, string prefix, string separator, EntraIdApplicationResource application, IResource consumer, DistributedApplicationExecutionContext executionContext) 1468internal override bool EmitEnvironmentVariables(IDictionary<string, object> envVars, string prefix, string separator, EntraIdApplicationResource application, IResource consumer, DistributedApplicationExecutionContext executionContext) 1504internal override bool EmitEnvironmentVariables(IDictionary<string, object> envVars, string prefix, string separator, EntraIdApplicationResource application, IResource consumer, DistributedApplicationExecutionContext executionContext)
EntraIdAppRoleAssignment.cs (1)
11internal sealed record EntraIdAppRoleAssignment(IResource Target, string[] RoleValues);
EntraIdLocalDeveloperCertificateCredential.cs (1)
57internal override bool EmitEnvironmentVariables(IDictionary<string, object> envVars, string prefix, string separator, EntraIdApplicationResource application, IResource consumer, DistributedApplicationExecutionContext executionContext)
EntraIdResourceExtensions.cs (5)
882foreach (var consumer in builder.Resource.Consumers) 1034private static void EnsureManagedIdentityRequired(IResource consumer) 1276foreach (var consumer in builder.Resource.Consumers) 1282private static void AddKeyVaultCertificateAccess(IResource consumer, AzureKeyVaultResource keyVault) 2111IResource target,
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
125IResource resource,
Aspire.Hosting.Azure.EntraId.Tests (5)
EntraIdInitializationTests.cs (3)
493private static async Task<CustomResourceSnapshot> InitializeAsync(DistributedApplication app, IResource resource) 521private static Task PublishInitializationAsync(DistributedApplication app, IResource resource, CancellationToken cancellationToken) 534private static async Task<(string Message, bool IsErrorMessage)[]> ReadLogsAsync(DistributedApplication app, IResource resource)
EntraIdPolyglotTests.cs (1)
113IResource consumer;
MicrosoftIdentityWebConfigurationTests.cs (1)
193IResource resource,
Aspire.Hosting.Azure.EventHubs (4)
AzureEventHubsExtensions.cs (2)
526where T : IResource 546where T : IResource
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.FrontDoor (3)
AzureFrontDoorExtensions.cs (2)
220private static IComputeEnvironmentResource GetEffectiveComputeEnvironment(IResource resource) 284IResource originResource,
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
125IResource resource,
Aspire.Hosting.Azure.Functions (16)
AzureFunctionsProjectResourceExtensions.cs (4)
584IResourceBuilder<IResource> source, 609IResourceBuilder<IResource> source, 650IResourceBuilder<IResource> source, 704foreach (var item in data.Model.Resources.Where(r => r is not IAzureFunctionsResource))
AzureFunctionsResource.cs (2)
52IResourceBuilder<IResource> source, 124IResourceBuilder<IResource> source,
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (8)
16internal static LaunchSettings? GetLaunchSettings(this IResource projectResource) 33internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this IResource projectResource, bool throwIfNotFound = false) 50internal static LaunchProfile? GetLaunchProfile(this IResource projectResource, string launchProfileName, bool throwIfNotFound = false) 121private static bool TrySelectLaunchProfileByOrder(IResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 145private static bool TrySelectLaunchProfileFromDefaultAnnotation(IResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 171private static bool TrySelectLaunchProfileFromAnnotation(IResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 185internal static string? SelectLaunchProfileName(this IResource projectResource) 207internal delegate bool LaunchProfileSelector(IResource project, out string? launchProfile);
Aspire.Hosting.Azure.KeyVault (6)
AzureKeyVaultResourceExtensions.cs (2)
178where T : IResource 198where T : IResource
AzureKeyVaultSecretReference.cs (1)
28public IResource? SecretOwner { get; set; }
AzureKeyVaultSecretResource.cs (1)
45IResource? IAzureKeyVaultSecretReference.SecretOwner { get; set; }
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.Kubernetes (2)
AzureKubernetesEnvironmentResource.AksPipeline.cs (2)
57foreach (var r in appModel.GetComputeResources()) 162if (appModel.Resources.TryGetByName("workload", out var existingResource) && existingResource is AksNodePoolResource existingPool)
Aspire.Hosting.Azure.Kusto (3)
AzureKustoBuilderExtensions.cs (1)
36/// the extension method <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.Network (2)
AzureNetworkSecurityPerimeterExtensions.cs (1)
139string? associationName = null) where T : IResource, IAzureNspAssociationTarget
AzurePrivateEndpointExtensions.cs (1)
84IResource rootResource = target.Resource;
Aspire.Hosting.Azure.Sandboxes (32)
AzureSandboxContainerDeployment.cs (18)
86internal static PipelineStep CreateStaleCleanupPipelineStep(IResource resource, IReadOnlySet<string> activeStateSectionNames) 103foreach (var resource in model.GetComputeResources()) 158foreach (var dependency in dependencies) 239var targetResource = resource.TargetResource; 771private static List<AzureDevComputeIdentitySetting>? ResolveIdentitySettings(IResource resource) 792private static void AddManagedIdentityEnvironmentVariables(IResource resource, Dictionary<string, string> environmentVariables) 921internal static void ValidateSandboxCompatibility(IResource resource) 1043private static async Task<ContainerImageMetadata> ResolveContainerImageMetadataAsync(PipelineStepContext context, IResource resource, string imageReference) 1065internal static async Task<ResolvedModeledCommand> ResolveModeledCommandAsync(PipelineStepContext context, IResource resource) 1099internal static bool HasModeledCommandConfiguration(IResource resource) => 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) 1218IResource resource, 1250IResource resource, 1559internal static int? ResolveSandboxTargetPort(IResource resource, ResolvedEndpoint endpoint) 1574private static string ResolveSandboxPortProtocol(IResource resource, EndpointAnnotation endpoint) 2357private static AzureSandboxOptions? GetAzureSandboxContainerOptions(IResource resource)
AzureSandboxContainerResource.cs (2)
12IResource targetResource, 23public IResource TargetResource { get; }
AzureSandboxesExtensions.cs (1)
461foreach (var resource in context.Model.GetComputeResources())
AzureSandboxGroupResource.cs (5)
63foreach (var computeResource in model.GetComputeResources()) 65var deploymentTarget = computeResource.GetDeploymentTargetAnnotation(this)?.DeploymentTarget; 95foreach (var computeResource in context.Model.GetComputeResources()) 97var deploymentTarget = computeResource.GetDeploymentTargetAnnotation(this)?.DeploymentTarget; 211foreach (var resource in context.Model.GetComputeResources())
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
125IResource resource,
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (3)
41where TEnvironment : IResource, IAzureComputeEnvironmentResource 72where TEnvironment : IResource, IAzureComputeEnvironmentResource 104where TEnvironment : IResource, IAzureComputeEnvironmentResource
Aspire.Hosting.Azure.Search (4)
AzureSearchExtensions.cs (2)
138where T : IResource 158where T : IResource
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.ServiceBus (5)
AzureServiceBusExtensions.cs (3)
735private static void RemoveWaitFor(IResource resource, IReadOnlyList<IResourceAnnotation> waitAnnotations) 838where T : IResource 858where T : IResource
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.SignalR (4)
AzureSignalRExtensions.cs (2)
206where T : IResource 226where T : IResource
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.Sql (4)
AzureSqlServerResource.cs (4)
612public IResource Parent => storage; 730private sealed class FakeBuilder<T>(T resource, IDistributedApplicationBuilder applicationBuilder) : IResourceBuilder<T> where T : IResource 755public IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource 760public IResourceBuilder<T> AddResource<T>(T resource) where T : IResource
Aspire.Hosting.Azure.Storage (4)
AzureStorageExtensions.cs (2)
735where T : IResource 760where T : IResource
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Azure.Tests (124)
AzureApiManagementTests.cs (1)
3058public IResource? SecretOwner { get; set; }
AzureAppServiceTests.cs (3)
484var container = Assert.Single(model.GetContainerResources()); 520var container = Assert.Single(model.GetContainerResources()); 1467private static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource) =>
AzureBicepProvisionerTests.cs (1)
1887private static async Task<IReadOnlyList<(string Content, bool IsErrorMessage)>> ReadInitialResourceLogsAsync(ResourceLoggerService loggerService, IResource resource)
AzureBicepResourceTests.cs (6)
29public static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> AzureExtensions => 32private static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> CreateAllAzureExtensions(string resourceName) 72public void AzureExtensionsAutomaticallyAddAzureProvisioning(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource) 84public void BicepResourcesAreIdempotent(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource) 100public static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> AzureExtensionsWithHyphen => 105public void AzureResourcesProduceValidBicep(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource)
AzureConnectorNamespaceTests.cs (2)
23&& parameters[1].ParameterType == typeof(IResourceBuilder<IResource>)); 846IResourceBuilder<IResource> source,
AzureContainerAppEnvironmentExtensionsTests.cs (2)
604var job = Assert.Single(model.Resources, r => r.Name == "myjob"); 630var api = model.Resources.First(r => r.Name == "api");
AzureContainerAppExpressEndpointTests.cs (1)
422private static AzureContainerAppResource GetTarget(IResource resource) =>
AzureContainerAppsTests.cs (43)
63var container = Assert.Single(model.GetContainerResources()); 97var container = Assert.Single(model.GetContainerResources()); 287var container = Assert.Single(model.GetContainerResources()); 330var container = Assert.Single(model.GetContainerResources()); 360var container = Assert.Single(model.GetContainerResources()); 469var container = Assert.Single(model.GetContainerResources()); 584var container = Assert.Single(model.GetContainerResources()); 616var container = Assert.Single(model.GetContainerResources()); 650var container = Assert.Single(model.GetContainerResources()); 686var container = Assert.Single(model.GetContainerResources()); 724var container = Assert.Single(model.GetContainerResources()); 764var container = Assert.Single(model.GetContainerResources()); 796var container = Assert.Single(model.GetContainerResources()); 831foreach (var resource in model.Resources 867var container = Assert.Single(model.GetContainerResources()); 918var container = Assert.Single(model.GetContainerResources()); 1000var container = Assert.Single(model.GetContainerResources()); 1049var container = Assert.Single(model.GetContainerResources()); 1080var container = Assert.Single(model.GetContainerResources()); 1112var container = Assert.Single(model.GetContainerResources()); 1410var container = Assert.Single(model.GetContainerResources()); 1441var container = Assert.Single(model.GetContainerResources()); 1477var container = Assert.Single(model.GetContainerResources()); 1508var container = Assert.Single(model.GetContainerResources()); 1866var container = Assert.Single(model.GetContainerResources()); 1889private static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource) => 1913var container = Assert.Single(model.GetContainerResources()); 2480var container = Assert.Single(model.GetContainerResources()); 2543var funcjob = model.Resources.Single(r => r.Name == "funcjob"); 2587var batch = containers.First(c => c.Name == "batch"); 2588var web = containers.First(c => c.Name == "web"); 2624var container = Assert.Single(model.GetContainerResources()); 2654var container = Assert.Single(model.GetContainerResources()); 2693var container = Assert.Single(model.GetContainerResources()); 2733var container = Assert.Single(model.GetContainerResources()); 2773var container = Assert.Single(model.GetContainerResources()); 2818var container = model.Resources.Single(r => r.Name == "api"); 2822var buildOnly = model.Resources.Single(r => r.Name == "build-only"); 2848var container = Assert.Single(model.GetContainerResources()); 3082var webappAcaResource = model.Resources.First(r => r.Name == "webappaca"); 3088var webappServiceResource = model.Resources.First(r => r.Name == "webappservice"); 3094var containerAcaResource = model.Resources.First(r => r.Name == "containeraca"); 3102var containerAppServiceResource = model.Resources.First(r => r.Name == "containerappservice");
AzureDeployerTests.cs (1)
375var builtImage = Assert.Single(mockImageBuilder.BuildImageResources);
AzureEnvironmentResourceExtensionsTests.cs (2)
815foreach (var resource in new IResource[] { cosmos.Resource, db.Resource, entries.Resource })
AzureEventHubsExtensionsTests.cs (6)
512var azurite = builder.Resources.FirstOrDefault(x => x.Name == "eh-storage"); 516var sourceResource = GetPersistenceReferenceSource(azurite); 530var azurite = builder.Resources.FirstOrDefault(x => x.Name == "eh-storage"); 545private static IResource GetPersistenceReferenceSource(IResource resource) 548return Assert.IsAssignableFrom<IResource>(annotation.SourceResource);
AzureFrontDoorAppServicePrivateLinkTests.cs (1)
196private static AzureAppServiceWebSiteResource GetWebsite(IResource resource, AzureAppServiceEnvironmentResource environment) =>
AzureFrontDoorPrivateLinkTests.cs (4)
573private static IResource GetContainerApp(IResource resource) 595public BicepOutputReference GetPrivateLinkResourceId(IResource origin) => new(PerOrigin ? $"{origin.Name}Id" : "id", this); 597public BicepOutputReference GetPrivateLinkLocation(IResource origin) => new(PerOrigin ? $"{origin.Name}Location" : "location", this);
AzureFunctionsTests.cs (5)
25&& parameters[1].ParameterType == typeof(IResourceBuilder<IResource>)); 285InvokeWithReference(funcApp, (IResourceBuilder<IResource>)blobs, connectionName: "input"); 310InvokeWithReference(funcApp, (IResourceBuilder<IResource>)blobs, connectionName: "input"); 773private static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource) => 1122IResourceBuilder<IResource> source,
AzureManagedRedisExtensionsTests.cs (1)
133var cacheInModel = builder.Resources.Single(r => r.Name == "cache");
AzureManifestUtils.cs (3)
16public static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource, bool skipPreparer = false) => 19public static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(DistributedApplicationModel appModel, IResource resource) => 22private static async Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(DistributedApplicationModel appModel, IResource resource, bool skipPreparer)
AzurePostgresExtensionsTests.cs (2)
297var postgresResourceInModel = builder.Resources.Single(r => r.Name == "postgres-data"); 298var dbResourceInModel = builder.Resources.Single(r => r.Name == "db1");
AzureProvisioningResourceTests.cs (1)
108var containerResource = Assert.Single(model.GetContainerResources());
AzureRedisExtensionsTests.cs (1)
177var cacheInModel = builder.Resources.Single(r => r.Name == "cache");
AzureRunAsEmulatorModeTests.cs (5)
12public static TheoryData<string, Func<IDistributedApplicationBuilder, Action, IResource>> RunAsEmulatorResources => new() 27public void RunAsEmulator_InRunMode_ConfiguresLocalContainer(string resourceType, Func<IDistributedApplicationBuilder, Action, IResource> addResource) 32var resource = addResource(builder, () => callbackInvoked = true); 41public void RunAsEmulator_InPublishMode_DoesNotConfigureLocalContainer(string resourceType, Func<IDistributedApplicationBuilder, Action, IResource> addResource) 46var resource = addResource(builder, () => callbackInvoked = true);
AzureSandboxesTests.cs (13)
510var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend"); 2067var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend"); 2233var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend"); 2295var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend"); 2334var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend"); 2358var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "cache"); 2401var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend"); 2402var explicitComputeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "backend"); 2505var cleanupResource = Assert.Single(model.Resources, resource => resource.Name == "azure-sandbox-cleanup"); 2583var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend"); 2646var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend"); 2914var computeResource = Assert.Single(model.GetComputeResources(), resource => resource.Name == "frontend"); 3371IResource resource,
AzureServiceBusExtensionsTests.cs (16)
607var sql = builder.Resources.FirstOrDefault(x => x.Name == "sb-mssql"); 611var sourceResource = GetPersistenceReferenceSource(sql); 625var sql = builder.Resources.FirstOrDefault(x => x.Name == "sb-mssql"); 647var sql = Assert.Single(builder.Resources, x => x.Name == "sb-mssql"); 669var sql = Assert.Single(builder.Resources, x => x.Name == "sb-mssql"); 681var sql = Assert.Single(builder.Resources, x => x.Name == "sb-mssql"); 695var sql = Assert.Single(builder.Resources, x => x.Name == "sb-mssql"); 712var sql = Assert.Single(builder.Resources, x => x.Name == "sb-mssql"); 727var sql = Assert.Single(builder.Resources, x => x.Name == "sb-mssql"); 826var sql = Assert.Single(builder.Resources, x => x.Name == "sb-mssql"); 968private static IResource GetPersistenceReferenceSource(IResource resource) 971return Assert.IsAssignableFrom<IResource>(annotation.SourceResource); 974private static void AssertWaitsForHealthy(IResource resource, IResource dependency) 981private static void AllocateContainerNetworkEndpoint(IResource resource, string address, int port)
AzureSqlExtensionsTests.cs (2)
217var sqlResourceInModel = builder.Resources.Single(r => r.Name == "sql"); 218var dbResourceInModel = builder.Resources.Single(r => r.Name == "db1");
ContainerRegistryTests.cs (1)
154foreach (var resource in model.Resources)
RoleAssignmentTests.cs (1)
372private static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource) =>
Aspire.Hosting.Azure.WebPubSub (4)
AzureWebPubSubExtensions.cs (2)
424where T : IResource 444where T : IResource
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
Aspire.Hosting.Blazor (17)
BlazorGatewayExtensions.cs (9)
494where TGateway : class, IResource 513where TGateway : class, IResource 624where TGateway : class, IResource 761private static List<EndpointReferenceAnnotation> GetServiceDiscoveryReferences(IResource resource) 798private static HashSet<string> GetReferencedResourceNames(IResource resource) 842private static GatewayAppsAnnotation GetOrAddGatewayAppsAnnotation(IResource resource) 854private static List<GatewayAppRegistration> GetRegisteredApps(IResource resource) 864private static List<EndpointAnnotation> GetAllocatedEndpoints(IResource resource) 911&& model.Resources.TryGetByName("aspire-dashboard", out var resource)
BlazorHostedExtensions.cs (2)
254private static HostedClientAnnotation GetOrAddHostedClientAnnotation(IResource resource) 266private static HashSet<string> GetReferencedResourceNames(IResource resource)
BrowserDebuggerHelper.cs (5)
40IResourceBuilder<IResource> commandTarget, 63IResourceBuilder<IResource> commandTarget, 290IResource commandTargetResource, 291IResource debuggerResource, 340private static string GetDcpInstanceName(IResource resource)
Resources\BlazorWasmAppResource.cs (1)
42public IResource Parent { get; internal set; } = null!;
Aspire.Hosting.Blazor.Tests (17)
AddBlazorGatewayTests.cs (2)
252var companion = Assert.Single(gateway.Resource.Annotations.OfType<ContainerFilesDestinationAnnotation>()).Source; 541IResource resource,
BlazorHostedExtensionsTests.cs (13)
45IResource blazorApp = useDotnetHost 79var blazorApp = builder.Resources.Single(r => r.Name == "blazorapp"); 97var blazorApp = builder.Resources.Single(r => r.Name == "blazorapp"); 120var blazorApp = builder.Resources.Single(r => r.Name == "blazorapp"); 149var blazorApp = builder.Resources.Single(r => r.Name == "blazorapp"); 349var blazorApp = builder.Resources.Single(r => r.Name == "blazorapp"); 369var blazorApp = builder.Resources.Single(r => r.Name == "blazorapp"); 414var blazorApp = builder.Resources.Single(r => r.Name == "blazorapp"); 486var blazorApp = builder.Resources.Single(r => r.Name == "blazorapp"); 505var blazorApp = builder.Resources.Single(r => r.Name == "blazorapp"); 554IResource resource, IDistributedApplicationBuilder builder) 561IResource resource, IDistributedApplicationBuilder builder) 586private static async Task<BrowserLaunchConfiguration> CreateBrowserLaunchConfigurationAsync(IResource resource)
BrowserDebuggerHelperTests.cs (1)
144IResource resource)
WithBlazorAppTests.cs (1)
488private static async Task<BrowserLaunchConfiguration> CreateBrowserLaunchConfigurationAsync(IResource resource)
Aspire.Hosting.CodeGeneration.Go.Tests (25)
AtsGoCodeGeneratorTests.cs (1)
2471Environment = { ["TEST_RESOURCE_TYPE"] = AtsTypeMapping.DeriveTypeId(typeof(IResource)) }
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (24)
158bool enabled = true) where T : IResource 171double multiplier = 1.5) where T : IResource 463TestConfigDto config) where T : IResource 520DateTime createdAt) where T : IResource 532DateTimeOffset modifiedAt) where T : IResource 544Guid correlationId) where T : IResource 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 569TestResourceStatus status) where T : IResource 581TestNestedDto config) where T : IResource 593Func<TestResourceContext, Task<bool>> validator) where T : IResource 606IResourceBuilder<IResource> dependency) where T : IResource 659IResourceBuilder<IResourceWithConnectionString> dependency) where T : IResource 672[AspireUnion(typeof(string), typeof(IResourceBuilder<IResourceWithConnectionString>))] object dependency) where T : IResource 684IReadOnlyList<string> endpoints) where T : IResource 722Func<CancellationToken, Task> operation) where T : IResource 842string label) where T : IResource 855string category) where T : IResource 869int port) where T : IResource 883string scheme) where T : IResource 898int? maxFiles = null) where T : IResource 913int? maxFiles = null) where T : IResource 929int priority) where T : IResource 946string middleware) where T : IResource
Aspire.Hosting.CodeGeneration.Java.Tests (24)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (24)
158bool enabled = true) where T : IResource 171double multiplier = 1.5) where T : IResource 463TestConfigDto config) where T : IResource 520DateTime createdAt) where T : IResource 532DateTimeOffset modifiedAt) where T : IResource 544Guid correlationId) where T : IResource 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 569TestResourceStatus status) where T : IResource 581TestNestedDto config) where T : IResource 593Func<TestResourceContext, Task<bool>> validator) where T : IResource 606IResourceBuilder<IResource> dependency) where T : IResource 659IResourceBuilder<IResourceWithConnectionString> dependency) where T : IResource 672[AspireUnion(typeof(string), typeof(IResourceBuilder<IResourceWithConnectionString>))] object dependency) where T : IResource 684IReadOnlyList<string> endpoints) where T : IResource 722Func<CancellationToken, Task> operation) where T : IResource 842string label) where T : IResource 855string category) where T : IResource 869int port) where T : IResource 883string scheme) where T : IResource 898int? maxFiles = null) where T : IResource 913int? maxFiles = null) where T : IResource 929int priority) where T : IResource 946string middleware) where T : IResource
Aspire.Hosting.CodeGeneration.Python.Tests (24)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (24)
158bool enabled = true) where T : IResource 171double multiplier = 1.5) where T : IResource 463TestConfigDto config) where T : IResource 520DateTime createdAt) where T : IResource 532DateTimeOffset modifiedAt) where T : IResource 544Guid correlationId) where T : IResource 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 569TestResourceStatus status) where T : IResource 581TestNestedDto config) where T : IResource 593Func<TestResourceContext, Task<bool>> validator) where T : IResource 606IResourceBuilder<IResource> dependency) where T : IResource 659IResourceBuilder<IResourceWithConnectionString> dependency) where T : IResource 672[AspireUnion(typeof(string), typeof(IResourceBuilder<IResourceWithConnectionString>))] object dependency) where T : IResource 684IReadOnlyList<string> endpoints) where T : IResource 722Func<CancellationToken, Task> operation) where T : IResource 842string label) where T : IResource 855string category) where T : IResource 869int port) where T : IResource 883string scheme) where T : IResource 898int? maxFiles = null) where T : IResource 913int? maxFiles = null) where T : IResource 929int priority) where T : IResource 946string middleware) where T : IResource
Aspire.Hosting.CodeGeneration.Rust.Tests (24)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (24)
158bool enabled = true) where T : IResource 171double multiplier = 1.5) where T : IResource 463TestConfigDto config) where T : IResource 520DateTime createdAt) where T : IResource 532DateTimeOffset modifiedAt) where T : IResource 544Guid correlationId) where T : IResource 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 569TestResourceStatus status) where T : IResource 581TestNestedDto config) where T : IResource 593Func<TestResourceContext, Task<bool>> validator) where T : IResource 606IResourceBuilder<IResource> dependency) where T : IResource 659IResourceBuilder<IResourceWithConnectionString> dependency) where T : IResource 672[AspireUnion(typeof(string), typeof(IResourceBuilder<IResourceWithConnectionString>))] object dependency) where T : IResource 684IReadOnlyList<string> endpoints) where T : IResource 722Func<CancellationToken, Task> operation) where T : IResource 842string label) where T : IResource 855string category) where T : IResource 869int port) where T : IResource 883string scheme) where T : IResource 898int? maxFiles = null) where T : IResource 913int? maxFiles = null) where T : IResource 929int priority) where T : IResource 946string middleware) where T : IResource
Aspire.Hosting.CodeGeneration.TypeScript.Tests (26)
AtsTypeScriptCodeGeneratorTests.cs (2)
1815where TResource : IResource 2101private static AtsTypeRef CreateResourceTypeRef<TResource>() where TResource : IResource =>
TestTypes\TestExtensions.cs (24)
158bool enabled = true) where T : IResource 171double multiplier = 1.5) where T : IResource 463TestConfigDto config) where T : IResource 520DateTime createdAt) where T : IResource 532DateTimeOffset modifiedAt) where T : IResource 544Guid correlationId) where T : IResource 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 569TestResourceStatus status) where T : IResource 581TestNestedDto config) where T : IResource 593Func<TestResourceContext, Task<bool>> validator) where T : IResource 606IResourceBuilder<IResource> dependency) where T : IResource 659IResourceBuilder<IResourceWithConnectionString> dependency) where T : IResource 672[AspireUnion(typeof(string), typeof(IResourceBuilder<IResourceWithConnectionString>))] object dependency) where T : IResource 684IReadOnlyList<string> endpoints) where T : IResource 722Func<CancellationToken, Task> operation) where T : IResource 842string label) where T : IResource 855string category) where T : IResource 869int port) where T : IResource 883string scheme) where T : IResource 898int? maxFiles = null) where T : IResource 913int? maxFiles = null) where T : IResource 929int priority) where T : IResource 946string middleware) where T : IResource
Aspire.Hosting.Containers.Tests (14)
ContainerResourceBuilderTests.cs (1)
218where T: IResource
ContainerResourceTests.cs (10)
24var containerResource = Assert.Single(containerResources); 43var containerResource = Assert.Single(containerResources); 62var containerResource = Assert.Single(containerResources); 82var containerResource = Assert.Single(containerResources); 174var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 208var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 236var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 255var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 304var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 351var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources());
ResourceFailureLoggingTests.cs (1)
116where T : IResource
WithDockerfileTests.cs (2)
960var resource = Assert.Single(containerResources); 1005var resource1 = Assert.Single(containerResources1);
Aspire.Hosting.DevTunnels (7)
DevTunnelResourceBuilderExtensions.cs (3)
404/// This method is not available in polyglot app hosts. Use <see cref="GetEndpoint(IResourceBuilder{DevTunnelResource}, IResource, string)"/> instead. 434public static EndpointReference GetEndpoint(this IResourceBuilder<DevTunnelResource> tunnelBuilder, IResource resource, string endpointName) 475private static EndpointReference CreateEndpointReferenceWithError(DevTunnelResource tunnelResource, IResource targetResource, string endpointName)
src\Shared\ResourceNameComparer.cs (4)
8internal sealed class ResourceNameComparer : IEqualityComparer<IResource?> 10public bool Equals(IResource? x, IResource? y) 20public int GetHashCode(IResource obj) =>
Aspire.Hosting.DevTunnels.Tests (3)
DevTunnelResourceBuilderExtensionsTests.cs (1)
953public Task<RequiredCommandValidationResult> ValidateAsync(IResource resource, RequiredCommandAnnotation annotation, CancellationToken cancellationToken)
TestDevTunnelMonitor.cs (2)
92public CustomResourceSnapshot Snapshot(IResource resource) 98public async Task<IReadOnlyList<LogLine>> LogsAsync(IResource? resource = null)
Aspire.Hosting.Docker (32)
CapturedEnvironmentVariable.cs (1)
46public IResource? Resource { get; set; }
DockerComposeEnvironmentContext.cs (1)
12public async Task<DockerComposeServiceResource> CreateDockerComposeServiceResourceAsync(IResource resource, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken)
DockerComposeEnvironmentExtensions.cs (1)
42foreach (var r in ctx.Model.GetComputeResources())
DockerComposeEnvironmentResource.cs (13)
58internal Dictionary<IResource, DockerComposeServiceResource> ResourceMapping { get; } = new(new ResourceNameComparer()); 94foreach (var resource in resources) 96var deploymentTarget = resource.GetDeploymentTargetAnnotation(this)?.DeploymentTarget; 219foreach (var resource in resources) 221var deploymentTarget = resource.GetDeploymentTargetAnnotation(this)?.DeploymentTarget; 244foreach (var computeResource in context.Model.GetBuildResources()) 254foreach (var pushResource in context.Model.GetBuildAndPushResources()) 325foreach (var r in appModel.GetComputeResources()) 367private bool IsAlreadyTargeted(IResource resource) => 389private static void ConfigureOtlp(IResource resource, DockerComposeAspireDashboardResource dashboard) 416IResource resource, 430private static OtlpExporterAnnotation? GetEffectiveOtlpExporterAnnotation(IResource resource) 585internal string AddEnvironmentVariable(string name, string? description = null, string? defaultValue = null, object? source = null, IResource? resource = null)
DockerComposePublishingContext.cs (3)
77IEnumerable<IResource> resources = environment.Dashboard?.Resource is IResource r 81foreach (var resource in resources)
DockerComposeServiceExtensions.cs (2)
117var resourceInstance = dockerComposeService.TargetResource; 131var resourceInstance = dockerComposeService.TargetResource;
DockerComposeServiceResource.cs (5)
29private readonly IResource _targetResource; 38public DockerComposeServiceResource(string name, IResource resource, DockerComposeEnvironmentResource composeEnvironmentResource) : base(name) 80IResource Resource, 91internal IResource TargetResource => _targetResource; 138private bool TryGetContainerImageName(IResource resourceInstance, out string? containerImageName)
src\Shared\EndpointPropertyInputCache.cs (2)
18public void ReserveModelNames(IEnumerable<IResource> resources) 20foreach (var resource in resources)
src\Shared\ResourceNameComparer.cs (4)
8internal sealed class ResourceNameComparer : IEqualityComparer<IResource?> 10public bool Equals(IResource? x, IResource? y) 20public int GetHashCode(IResource obj) =>
Aspire.Hosting.Docker.Tests (14)
DockerComposePublisherTests.cs (3)
1532public Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 1538public Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 1544public Task PushImageAsync(IResource resource, CancellationToken cancellationToken)
DockerComposeTests.cs (11)
294public Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 300public Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 306public Task PushImageAsync(IResource resource, CancellationToken cancellationToken) 747public Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 750public Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 753public Task PushImageAsync(IResource resource, CancellationToken cancellationToken) 894var containerDockerResource = model.Resources.First(r => r.Name == "containerdocker"); 900var containerK8sResource = model.Resources.First(r => r.Name == "containerk8s"); 906var projectDockerResource = model.Resources.First(r => r.Name == "projectdocker"); 912var projectK8sResource = model.Resources.First(r => r.Name == "projectk8s"); 945var containerDockerResource = model.Resources.First(r => r.Name == "containerdocker");
Aspire.Hosting.Dotnet (33)
DotnetProjectBuildCoordinator.cs (23)
28private static readonly ConditionalWeakTable<IResource, BuildFailureState> s_buildFailures = new(); 203IResource buildResource, 239private static Action BeginBuildAttemptOnResourceStart(IDistributedApplicationBuilder builder, IResource resource) 253private static void ReportBuildFailureOnResourceStopped(IDistributedApplicationBuilder builder, IResource resource) 279IResource buildResource, 298IResource buildResource) 928IResource?[] launchResources = [entry.Registration.Resource, FindRebuilder(model, entry.Registration.Resource)]; 929foreach (var resource in launchResources) 1045private static Action ApplyBuildEnvironment(IResource target, SharedBuildEnvironment sharedBuildEnvironment) 1053IResource target, 1066IResource target, 1078private static Action ApplyBuildProperties(IResource target, SharedBuildEnvironment sharedBuildEnvironment) 1093IResource target, 1125private static IResource? FindRebuilder( 1131candidate is IResourceWithParent<IResource> parent && 1176private readonly Dictionary<IResource, MsBuildResponseFile> _responseFiles = 1205IResource resource, 1322public void ReleaseResponseFile(IResource resource) 1517IResource resource, 1549IResource resource, 1592private void ReleaseResponseFile(IResource resource, MsBuildResponseFile expectedResponseFile) 1608private void ReplaceResponseFile(IResource resource, MsBuildResponseFile responseFile) 1744IResource resource,
DotnetProjectHostingExtensions.cs (2)
184internal static void ValidateBuildEnvironmentSupport(IResource resource, IProjectMetadata metadata) 497List<string> GetLaunchProfileArguments(IResource resource)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (8)
16internal static LaunchSettings? GetLaunchSettings(this IResource projectResource) 33internal static NamedLaunchProfile? GetEffectiveLaunchProfile(this IResource projectResource, bool throwIfNotFound = false) 50internal static LaunchProfile? GetLaunchProfile(this IResource projectResource, string launchProfileName, bool throwIfNotFound = false) 121private static bool TrySelectLaunchProfileByOrder(IResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 145private static bool TrySelectLaunchProfileFromDefaultAnnotation(IResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 171private static bool TrySelectLaunchProfileFromAnnotation(IResource projectResource, [NotNullWhen(true)] out string? launchProfileName) 185internal static string? SelectLaunchProfileName(this IResource projectResource) 207internal delegate bool LaunchProfileSelector(IResource project, out string? launchProfile);
Aspire.Hosting.Dotnet.Tests (8)
DotnetProjectBuildCoordinatorTests.cs (7)
1721foreach (var dependent in new IResource[] { api.Resource, worker.Resource }) 2051IResource target = buildResource; 2293private static Func<int> UseBuildOutput(DistributedApplication app, IResource buildResource, params string[] lines) 2356IResource? callbackResource = null; 5142private static void ForgetCachedCallbackResults(IResource resource) 5227IResource resource,
DotnetProjectOptionsTests.cs (1)
87private static void AssertEndpointPort(IResource resource, int? expectedPort)
Aspire.Hosting.EntityFrameworkCore (4)
EFMigrationResourceBuilderExtensions.cs (4)
426Func<TAnnotation, IResource?> resourceSelector) 445private static bool IsAncestorOf(IResource candidate, IResource descendant) 449var current = descendant;
Aspire.Hosting.EntityFrameworkCore.Tests (4)
EFMigrationPipelineTests.cs (2)
307var waitedResource = waitAnnotations[0].Resource; 768Assert.Contains((IResource)database.Resource, waitedResources);
EFMigrationResourceTests.cs (1)
44Assert.Equal<IResource>(resources, builder.Resources);
TestServices\CoordinatedBuildTestHelpers.cs (1)
18foreach (var buildResource in builder.Resources.Where(
Aspire.Hosting.Foundry (17)
FoundryExtensions.cs (2)
299where T : IResource 319where T : IResource
HostedAgent\AzureHostedAgentResource.cs (7)
35public AzureHostedAgentResource([ResourceName] string name, IResource target, Action<HostedAgentConfiguration>? configure = null) : base(name) 101public IResource Target { get; } 310var target = hostedAgent.Target; 415IResource resource, 455IResource resource, 490IResource resource, 523IResource resource,
src\Shared\AzureRoleAssignmentUtils.cs (2)
11where T : IResource 19where T : IResource
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
125IResource resource,
Toolbox\FoundryToolboxResource.cs (5)
113foreach (var referencedResource in GetMcpReferencedResources(context.Model)) 490IResource resource, 504private IEnumerable<IResource> GetMcpReferencedResources(DistributedApplicationModel model) 516foreach (var referencedResource in WalkValueReferences(tool.EndpointExpression).OfType<IResource>())
Aspire.Hosting.Foundry.Tests (5)
HostedAgentExtensionTests.cs (4)
84var resource = builder.Resources.Single(r => r.Name == "agent"); 109var resource = builder.Resources.Single(r => r.Name == "agent"); 139var resource = builder.Resources.Single(r => r.Name == "agent"); 610IResource? evaluatedResource = null;
PromptAgentTests.cs (1)
117var resource = builder.Resources.Single(r => r.Name == "my-agent");
Aspire.Hosting.Go (4)
GoHostingExtensions.cs (3)
879private static string BuildDockerGoCommand(IResource resource, string packagePath = ".", string binaryName = "app") 894private static string BuildFlagsString(IResource resource) => 902private static List<string> BuildFlagParts(IResource resource, bool includeRace = true)
GoRunDebugging.cs (1)
27if (original is IResourceBuilder<IResource> resourceBuilder)
Aspire.Hosting.Go.Tests (9)
AddGoAppTests.cs (8)
1459var tidyResource = builder.Resources.First(r => r.Name == "api-mod-tidy"); 1460var vendorResource = builder.Resources.First(r => r.Name == "api-mod-vendor"); 1477var tidyResource = builder.Resources.First(r => r.Name == "api-mod-tidy"); 1478var downloadResource = builder.Resources.First(r => r.Name == "api-mod-download"); 1494var vendorResource = builder.Resources.First(r => r.Name == "api-mod-vendor"); 1495var downloadResource = builder.Resources.First(r => r.Name == "api-mod-download"); 1578foreach (var resource in toolResources) 1669private static async Task<GoLaunchConfiguration> CreateLaunchConfigurationAsync(IResource resource)
GoPublicApiTests.cs (1)
299var tidyResource = Assert.Single(builder.Resources, r => r.Name == "api-mod-tidy");
Aspire.Hosting.Java (1)
JavaHostingExtensions.cs (1)
1135internal static string ResolveOtelAgentPath(IResource resource, JavaOtelAgentAnnotation annotation)
Aspire.Hosting.Java.Tests (6)
AddJavaAppTests.cs (4)
1047var buildResource = builder.Resources.First(r => r.Name == "api-maven-build"); 1073var buildResource = builder.Resources.First(r => r.Name == "api-gradle-build"); 1152var buildResource = builder.Resources.First(r => r.Name == "api-maven-build"); 1166var buildResource = builder.Resources.First(r => r.Name == "api-gradle-build");
AddSpringBootAppTests.cs (1)
388var buildResource = Assert.Single(builder.Resources, r => r.Name == "catalog-maven-build");
TestEndpointAllocator.cs (1)
15public static void AllocateEndpoints(IResource resource)
Aspire.Hosting.JavaScript (7)
DenoHostingExtensions.cs (5)
890private static string[] BuildDenoEntrypoint(IResource resource, string command, string scriptPath) 946private static void ThrowIfUnsupportedDenoDockerfileOptions(IResource resource) 1059private static void ThrowIfDenoOptionsConflictWithPackageManager(IResource resource) 1189private static string BuildDenoCacheCommand(IResource resource, string scriptPath, string workingDirectory) 1408private static DenoServeEndpointArguments? GetDenoServeEndpointArguments(IResource resource, bool isPublishMode, bool useLiteralTargetPort = false)
JavaScriptHostingExtensions.cs (2)
376private static IEnumerable<(string Command, string? HelpLink)> ResolveRequiredCommands(IResource resource, string runtimeCommand) 2967private static void ValidateBrowserCapability<T>(IResourceBuilder<T> builder) where T : IResource
Aspire.Hosting.JavaScript.Tests (10)
AddBunAppTests.cs (1)
394private static async Task<JavaScriptLaunchConfiguration> CreateLaunchConfigurationAsync(IResource resource)
AddDenoAppTests.cs (1)
2684IResource resource,
AddNodeAppTests.cs (3)
20&& parameters[1].ParameterType == typeof(IResourceBuilder<IResource>)); 581IResourceBuilder<IResource> source, 626private static async Task<JavaScriptLaunchConfiguration> CreateLaunchConfigurationAsync(IResource resource)
IntegrationTests.cs (3)
40foreach (var installer in npmInstallers.Cast<IResource>()) 53var waitedResource = waitAnnotations.First().Resource;
PackageInstallationTests.cs (1)
67var nodeResource = Assert.Single(appModel.Resources, r => r.Name == "test-app");
RequiredCommandTests.cs (1)
229private static async Task<string[]> GetRequiredCommandsAsync(IDistributedApplicationBuilder builder, IResource resource)
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
236var kafkaUiResource = Assert.Single(builder.Resources, r => r.Name == expectedContainerName);
Aspire.Hosting.Keycloak.Tests (2)
KeycloakPublicApiTests.cs (2)
161var keycloakResource = builder.Resources.Single(r => r.Name.Equals(resourceName, StringComparison.Ordinal)); 186var keycloakResource = builder.Resources.Single(r => r.Name.Equals(resourceName, StringComparison.Ordinal));
Aspire.Hosting.Kubernetes (57)
Deployment\HelmDeploymentEngine.cs (1)
512IResource computeResource,
Extensions\ResourceExtensions.cs (7)
14internal static Deployment ToDeployment(this IResource resource, KubernetesResource context) 43internal static StatefulSet ToStatefulSet(this IResource resource, KubernetesResource context) 63internal static Secret? ToSecret(this IResource resource, KubernetesResource context) 101internal static ConfigMap? ToConfigMap(this IResource resource, KubernetesResource context) 138internal static Service? ToService(this IResource resource, KubernetesResource context) 195private static PodTemplateSpecV1 ToPodTemplateSpec(this IResource resource, KubernetesResource context) 304private static ContainerV1 ToContainerV1(this IResource resource, KubernetesResource context)
KubernetesEnvironmentContext.cs (3)
15private readonly Dictionary<IResource, KubernetesResource> _kubernetesComponents = new(new ResourceNameComparer()); 34private string? GetOriginDefault(EndpointReferenceExpression reference, IEnumerable<IResource> resources) 124public async Task<KubernetesResource> CreateKubernetesResourceAsync(IResource resource, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken)
KubernetesEnvironmentExtensions.cs (5)
52foreach (var r in ctx.Model.GetComputeResources()) 196IResource resource, 253IResource resource, 300IResource Resource, 520where T : IResource
KubernetesEnvironmentResource.cs (19)
190internal sealed record CapturedHelmImageReference(string Section, string ResourceKey, string ValueKey, IResource Resource); 212internal sealed record TlsSecretRequest(ReferenceExpression SecretName, ReferenceExpression Hostname, IResource Owner); 339foreach (var computeResource in resources) 342var deploymentTarget = computeResource.GetDeploymentTargetAnnotation(targetEnv)?.DeploymentTarget; 376foreach (var computeResource in resources) 379var deploymentTarget = computeResource.GetDeploymentTargetAnnotation(targetEnv)?.DeploymentTarget; 465var deploymentTargets = new Dictionary<IResource, KubernetesResource>(new ResourceNameComparer()); 466var pendingResources = new List<(IResource Resource, IComputeEnvironmentResource ComputeEnvironment)>(); 468foreach (var r in appModel.GetComputeResources()) 561private static void ConfigureOtlp(IResource resource, KubernetesAspireDashboardResource dashboard) 587IResource resource, 601private static OtlpExporterAnnotation? GetEffectiveOtlpExporterAnnotation(IResource resource) 735private async Task ProcessIngressResources(DistributedApplicationModel model, Dictionary<IResource, KubernetesResource> deploymentTargets, ILogger logger, CancellationToken cancellationToken) 775Dictionary<IResource, KubernetesResource> deploymentTargets, 940Dictionary<IResource, KubernetesResource> deploymentTargets, 976private async Task ProcessGatewayResources(DistributedApplicationModel model, Dictionary<IResource, KubernetesResource> deploymentTargets, ILogger logger, CancellationToken cancellationToken) 1110Dictionary<IResource, KubernetesResource> deploymentTargets, 1286Dictionary<IResource, KubernetesResource> deploymentTargets, 1371internal static bool OwnerWasMaterialized(IResource owner) => owner switch
KubernetesPublishingContext.cs (7)
73IEnumerable<IResource> resources = environment.DashboardEnabled && environment.Dashboard?.Resource is IResource dashboardResource 77foreach (var resource in resources) 185private async Task AppendResourceContextToHelmValuesAsync(IResource resource, KubernetesResource resourceContext) 211IResource resource, 255IResource resource, 386private async Task WriteKubernetesTemplatesForResource(IResource resource, IEnumerable<BaseKubernetesResource> templatedItems)
KubernetesResource.cs (6)
22public partial class KubernetesResource(string name, IResource resource, KubernetesEnvironmentResource kubernetesEnvironmentResource) : Resource(name), IResourceWithParent<KubernetesEnvironmentResource> 110internal IResource TargetResource => resource; 196internal string GetContainerImageName(IResource resourceInstance) 830private static HelmValue AllocateParameter(ParameterResource parameter, IResource resource, bool isEmbedded) 848private static HelmValue ResolveUnknownValue(IManifestExpressionProvider parameter, IResource resource) 980public IResource? ImageResource { get; init; }
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
125IResource resource,
src\Shared\EndpointPropertyInputCache.cs (2)
18public void ReserveModelNames(IEnumerable<IResource> resources) 20foreach (var resource in resources)
src\Shared\ResourceNameComparer.cs (4)
8internal sealed class ResourceNameComparer : IEqualityComparer<IResource?> 10public bool Equals(IResource? x, IResource? y) 20public int GetHashCode(IResource obj) =>
src\Shared\VolumeMountPathResolver.cs (2)
15internal static string GetOrCreateLocalPath(IAspireStore store, IResource resource, string volumeName) 22internal static string GetLocalPath(IAspireStore store, IResource resource, string volumeName)
Aspire.Hosting.Kubernetes.Tests (7)
KubernetesEnvironmentResourceTests.cs (6)
170var containerK8sResource = model.Resources.First(r => r.Name == "containerk8s"); 176var containerDockerResource = model.Resources.First(r => r.Name == "containerdocker"); 182var projectK8sResource = model.Resources.First(r => r.Name == "projectk8s"); 188var projectDockerResource = model.Resources.First(r => r.Name == "projectdocker"); 249var containerK8sResource = model.Resources.First(r => r.Name == "containerk8s"); 250var containerDockerResource = model.Resources.First(r => r.Name == "containerdocker");
PipelineStepTestHelpers.cs (1)
21public static async Task<List<PipelineStep>> CreateStepsAsync(IServiceProvider services, IResource resource)
Aspire.Hosting.Maui (13)
Lifecycle\MauiBuildQueueEventSubscriber.cs (6)
74var resource = @event.Resource; 174internal virtual async Task RunBuildAsync(IResource resource, ILogger logger, CancellationToken cancellationToken) 323IResource resource, SemaphoreSlim semaphore, string? stateAtCallTime, 401IResource resource, 428internal virtual async Task<bool> StopResourceAfterLaunchTimeoutAsync(IResource resource, Task nextStartObserved, CancellationToken cancellationToken) 502private void EnsureStopCommandReplaced(IResource resource, MauiBuildQueueAnnotation queueAnnotation)
Lifecycle\UnsupportedPlatformEventSubscriber.cs (1)
28foreach (var resource in @event.Model.Resources)
MauiOtlpExtensions.cs (2)
138var dashboardResource = appBuilder.Resources.FirstOrDefault(resource => 262IResource resource,
Utilities\MauiAndroidEnvironmentAnnotation.cs (1)
53var resource = @event.Resource;
Utilities\MauiEnvironmentHelper.cs (2)
32IResource resource, 184IResource resource,
Utilities\MauiiOSEnvironmentAnnotation.cs (1)
53var resource = @event.Resource;
Aspire.Hosting.Maui.Tests (27)
MauiBuildQueueTests.cs (13)
1133private static void AddOriginalStopCommand(IResource resource, Action? onExecute = null) 1142private static void AddOriginalStopCommand(IResource resource, Func<ExecuteCommandContext, Task<ExecuteCommandResult>> executeCommand) 1185private static Task WaitForStateAsync(BuildQueueTestEnvironment env, IResource resource, string state) => 1223public Task WaitForBuildStartedAsync(IResource resource, TimeSpan? timeout = null) 1229public void CompleteBuild(IResource resource) 1235public void CompleteBuildImmediately(IResource resource) 1240public bool GetReleaseOnRunning(IResource resource) 1245public CancellationToken GetLaunchCancellationToken(IResource resource) 1251public void FailBuild(IResource resource, string message) 1258public void FailBuildWith(IResource resource, Exception exception) 1264internal override async Task RunBuildAsync(IResource resource, ILogger logger, CancellationToken cancellationToken) 1299internal override Task ReleaseSemaphoreAfterLaunchAsync(IResource resource, SemaphoreSlim semaphore, string? stateAtCallTime, bool releaseOnRunning, ILogger logger, CancellationToken cancellationToken) 1334internal override Task ReleaseSemaphoreAfterLaunchAsync(IResource resource, SemaphoreSlim semaphore, string? stateAtCallTime, bool releaseOnRunning, ILogger logger, CancellationToken cancellationToken)
MauiPlatformExtensionsTests.cs (13)
198var resource = platform.Resource; 517IResource resource; 569var resource = platform == "android" 570? (IResource)maui.AddAndroidEmulator().Resource 612static async Task<string> EvaluateTargetsFileAsync(CommandLineArgsCallbackAnnotation callback, IResource resource) 638IResource resource; 1417private static Task<SerializedMauiLaunchConfiguration> GetSingleMauiLaunchConfigurationAsync(IResource resource) 1426private static async Task<SerializedMauiLaunchConfiguration> DeserializeLaunchConfigurationAsync(IResource resource) 1458public Func<IResourceBuilder<MauiProjectResource>, IResourceBuilder<IResource>> AddPlatformWithDefaultName { get; } 1459public Func<IResourceBuilder<MauiProjectResource>, string, IResourceBuilder<IResource>> AddPlatformWithCustomName { get; } 1460public Action<IResourceBuilder<IResource>> ApplyWithOtlpDevTunnel { get; } 1473Func<IResourceBuilder<MauiProjectResource>, IResourceBuilder<IResource>> addDefault, 1474Func<IResourceBuilder<MauiProjectResource>, string, IResourceBuilder<IResource>> addCustom,
MauiWithArgsTests.cs (1)
222var platforms = new (IResourceBuilder<IResource> Builder, string ExpectedTfm)[]
Aspire.Hosting.Milvus.Tests (2)
AddMilvusTests.cs (2)
27var containerResource = Assert.Single(appModel.GetContainerResources()); 57var containerResource = Assert.Single(appModel.GetContainerResources());
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
154/// the extension method <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
Aspire.Hosting.MySql.Tests (5)
AddMySqlTests.cs (5)
85var containerResource = Assert.Single(appModel.GetContainerResources()); 258var myAdmin = builder.Resources.Single(r => r.Name.Equals("phpmyadmin")); 264var container = builder.Resources.Single(r => r.Name == "phpmyadmin"); 290var myAdmin = builder.Resources.Single(r => r.Name.Equals("phpmyadmin")); 320var myAdmin = builder.Resources.Single(r => r.Name.Equals("phpmyadmin"));
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
44var containerResource = Assert.Single(appModel.GetContainerResources()); 83var containerResource = Assert.Single(appModel.GetContainerResources()); 165var containerResource = Assert.Single(containerResources);
Aspire.Hosting.Orleans.Tests (1)
OrleansProviderTypeTests.cs (1)
118private static async Task<Dictionary<string, object>> GetEnvironmentVariablesAsync(IResource resource, IDistributedApplicationBuilder builder)
Aspire.Hosting.PostgreSQL (3)
PostgresBuilderExtensions.cs (3)
43/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> 183/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> 435if (builder.ApplicationBuilder.Resources.TryGetByName(containerName, out var existingResource) && existingResource is PostgresMcpContainerResource existing)
Aspire.Hosting.PostgreSQL.Tests (9)
AddPostgresTests.cs (9)
55var containerResource = Assert.Single(appModel.GetContainerResources()); 109var containerResource = Assert.Single(appModel.GetContainerResources()); 225var containerResource = Assert.Single(containerResources); 405var container = builder.Resources.Single(r => r.Name == "pgadmin"); 481var container = builder.Resources.Single(r => r.Name == "pgadmin"); 515var pgadmin = builder.Resources.Single(r => r.Name.Equals("pgadmin")); 580var pgweb = builder.Resources.Single(r => r.Name.Equals("pgweb")); 761&& parameters[1].ParameterType == typeof(IResourceBuilder<IResource>)); 765IResourceBuilder<IResource> source,
Aspire.Hosting.Python.Tests (3)
AddPythonAppTests.cs (3)
1342IResource[] resources = 1350foreach (var resource in resources) 1949private static async Task<PythonLaunchConfiguration> CreateLaunchConfigurationAsync(IResource resource)
Aspire.Hosting.Qdrant (1)
QdrantServerResource.cs (1)
110IResourceBuilder<IResource> source,
Aspire.Hosting.Qdrant.Tests (6)
AddQdrantTests.cs (5)
22&& parameters[1].ParameterType == typeof(IResourceBuilder<IResource>)); 54var containerResource = Assert.Single(appModel.GetContainerResources()); 93var containerResource = Assert.Single(appModel.GetContainerResources()); 126var containerResource = Assert.Single(appModel.GetContainerResources()); 449IResourceBuilder<IResource> source,
QdrantFunctionalTests.cs (1)
234var qdrantResource = builder.Resources.Single(r => r.Name.Equals("qdrant"));
Aspire.Hosting.Radius (87)
Annotations\RadiusCloudProvidersAnnotation.cs (1)
29internal static RadiusCloudProvidersAnnotation GetOrAdd(IResource resource)
Annotations\RadiusRecipeParametersAnnotation.cs (1)
35internal static RadiusRecipeParametersAnnotation GetOrAdd(IResource resource)
Annotations\RadiusSecretStoresAnnotation.cs (1)
27internal static RadiusSecretStoresAnnotation GetOrAdd(IResource resource)
Publishing\RadiusInfrastructureBuilder.cs (64)
64private readonly Dictionary<ParameterResource, List<IResource>> _rabbitMqUserNames = new(ReferenceEqualityComparer.Instance); 107private readonly Dictionary<ParameterResource, (IResource Owner, bool IsProjectionSubstitution)> _recipeCredentialOwners = []; 111private readonly HashSet<(IResource Resource, ParameterResource Parameter)> _warnedUnrelatedSubstitutions = []; 126private readonly List<(IResource Resource, string RadiusType)> _databasesNotCreatedByTheRecipe = []; 140private readonly List<(IResource Resource, string SelectedDatabaseName)> _recipeDatabaseSelections = []; 260foreach (var resource in radiusResources) 384foreach (var resource in radiusResources) 418foreach (var resource in computeResources) 608private Dictionary<ParameterResource, IReadOnlyList<IResource>> BuildLiveRabbitMqUserNames(RadiusInfrastructureOptions options) 610var live = new Dictionary<ParameterResource, IReadOnlyList<IResource>>(ReferenceEqualityComparer.Instance); 1672private (string ResourceType, string ApiVersion) ResolveResourceType(IResource resource) 1676private (List<IResource> radiusResources, List<IResource> computeResources, Dictionary<IResource, (string ResourceType, string ApiVersion)> resolvedTypes) ClassifyResources() 1678var radiusTypes = new List<IResource>(); 1679var compute = new List<IResource>(); 1680var resolved = new Dictionary<IResource, (string ResourceType, string ApiVersion)>(); 1683foreach (var resource in _model.Resources) 1699var resolvedResource = ResolveToParent(resource); 1736private bool IsTargetedToThisEnvironment(IResource resource) 1755private static IResource ResolveToParent(IResource resource) 2052private static string GetContainerImage(IResource resource) 2118List<IResource> radiusResources, 2125foreach (var resource in radiusResources) 2215IResource resource, 2302private void RecordIfDatabaseIsNotCreatedByTheRecipe(IResource resource, string radiusType) 2393IResource resource, 2456IResource resource, 2665IResource resource, 2867internal static RadiusBackingResourceProjectionException CreateRabbitMqGuestUserNameException(IResource resource) => 2927foreach (var resource in _model.Resources) 2956private void WarnIfUserSuppliedCredentialIsReplaced(IResource resource, ParameterResource parameter, string credentialKind) 2988private void WarnIfUnrelatedUseOfSubstitutedParameter(ParameterResource parameter, IResource resource) 3049private IResource ResolveEnvValueProvenance( 3052IResource resource, 3053Dictionary<IResource, HashSet<string>> referencePrefixes) 3112private static Dictionary<IResource, HashSet<string>> BuildReferencePrefixes(IResource resource, Dictionary<string, object> environmentVariables) 3114var prefixes = new Dictionary<IResource, HashSet<string>>(); 3139void Add(IResource target, string connectionName) 3179private bool ModelHasPotentialConsumer(IResource resource, List<IResourceWithConnectionString> databaseChildren) => 3190private List<IResourceWithConnectionString> FindDatabaseChildren(IResource resource) => 3343var resource = ResolveToParent(endpointReference.Resource); 3413IResource resource, 3425IResource resource, 3465IResource resource, 3500private static void ThrowIfNotPrimaryEndpoint(EndpointReference endpointReference, IResource resource, string radiusType) 3520IResource resource, 3521List<IResource> radiusResources, 3533var referencedResource = reference.Resource; 3594private static Dictionary<string, ContainerPortConstruct> ResolvePorts(IResource resource) 3646IResource resource, 3830private static string ToSecretKey(IResource resource, string envVarName) 3859IResource resource, 4129private async Task ResolveEnvPartsAsync(object? value, IResource owner, List<EnvPart> parts, IResource referencedResource, bool allowRecipeSubstitutions = true) 4263private void RecordConnectionStringConsumption(IResourceWithConnectionString consumed, IResource owner) 4295private void RecordConnectionStringExpressionConsumption(ReferenceExpression expression, IResource owner) 4348private static void ThrowIfEndpointMissing(EndpointReference endpointReference, IResource owner) 4366private async Task ResolveReferenceExpressionPartsAsync(ReferenceExpression expression, IResource owner, List<EnvPart> parts, IResource referencedResource, bool allowRecipeSubstitutions = true) 4613private void RegisterRecipeCredential(ParameterResource parameter, IResource owner, bool isProjectionSubstitution) 4761private EnvPart ResolveParameterPart(ParameterResource parameter, IResource owner, bool allowRecipeSubstitutions)
Publishing\RadiusPublishAnnotations.cs (2)
32IReadOnlyDictionary<ParameterResource, IReadOnlyList<IResource>> rabbitMqUserNames) : IResourceAnnotation 41public IReadOnlyDictionary<ParameterResource, IReadOnlyList<IResource>> RabbitMqUserNames { get; } = rabbitMqUserNames;
Publishing\RadiusServiceDiscovery.cs (2)
46public static string GetServiceName(IResource resource) => GetServiceName(resource.Name); 91public static int? ResolveServicePort(IResource resource, string endpointName)
Publishing\RadiusUnresolvableValueException.cs (2)
48public RadiusUnresolvableValueException(IResource owner, string reason, Exception? innerException = null) 55public IResource Owner { get; }
RadiusBackingResourceProjectionException.cs (3)
60public RadiusBackingResourceProjectionException(IResource resource, string message) 80public RadiusBackingResourceProjectionException(IResource resource, string message, Exception? innerException) 91public IResource Resource { get; }
RadiusEnvironmentResource.cs (2)
251var resource = endpointReference.Resource is IResourceWithParent child ? child.Parent : endpointReference.Resource; 286private static void ThrowIfBackingResource(IResource resource)
RadiusExtensions.cs (1)
177where T : IResource
RadiusInfrastructure.cs (1)
69foreach (var resource in context.Model.GetComputeResources())
ResourceMapping\ResourceTypeMapper.cs (4)
142public (string ResourceType, string ApiVersion) MapResource(IResource resource) 191internal static bool IsBackingResource(IResource resource) 207internal static string? TryGetEmittedBackingType(IResource resource) 241private static string GetMappingKey(IResource resource)
Secrets\RadiusSecretStoreValidation.cs (1)
225foreach (var resource in model.Resources)
src\Shared\EndpointPropertyInputCache.cs (2)
18public void ReserveModelNames(IEnumerable<IResource> resources) 20foreach (var resource in resources)
Aspire.Hosting.Radius.Tests (15)
InnerLoop\GracefulDegradationTests.cs (3)
35var apiResource = model.Resources.First(r => r.Name == "api"); 68foreach (var resource in model.GetComputeResources()) 90var apiResource = model.Resources.First(r => r.Name == "api");
InnerLoop\MultiEnvironmentTests.cs (2)
67var apiResource = model.Resources.First(r => r.Name == "api"); 96var apiResource = model.Resources.First(r => r.Name == "api");
InnerLoop\RadiusInfrastructureInitializationTests.cs (5)
29var apiResource = model.Resources.First(r => r.Name == "api"); 49foreach (var resource in model.GetComputeResources()) 68var paramResource = model.Resources.First(r => r.Name == "my-param"); 86var apiResource = model.Resources.First(r => r.Name == "api"); 114var projectResource = model.Resources.First(r => r.Name == "webapp");
Publishing\RadCredentialArgumentTests.cs (1)
105private static async Task<IReadOnlyList<string>> ResolveSingleAsync(IResource resource)
Publishing\RadiusDeployParametersTests.cs (2)
252new Dictionary<ParameterResource, IReadOnlyList<IResource>> { [userName.Resource] = new[] { (IResource)rabbit.Resource } }));
RadiusEnvironmentResourceTests.cs (1)
71Assert.IsAssignableFrom<IResource>(resource);
RadiusTestHelper.cs (1)
39foreach (var resource in model.GetComputeResources())
Aspire.Hosting.Redis (2)
RedisBuilderExtensions.cs (2)
33/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> 57/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
Aspire.Hosting.Redis.Tests (5)
AddRedisTests.cs (5)
267var redisinsight = builder.Resources.Single(r => r.Name.Equals("redisinsight")); 563var commander = builder.Resources.Single(r => r.Name.Equals("rediscommander")); 589var commander = builder.Resources.Single(r => r.Name.Equals("rediscommander")); 610var commander = builder.Resources.Single(r => r.Name.Equals("rediscommander")); 1109private static async Task<ResourceUrlAnnotation> GetManagementUrlAsync(IResource resource, string displayText)
Aspire.Hosting.RemoteHost.Tests (9)
AtsContextFilterTests.cs (1)
392ClrType = typeof(IResourceBuilder<IResource>),
AtsMarshallerTests.cs (1)
199new AtsTypeRef { TypeId = "test/IResource", ClrType = typeof(IResource), Category = AtsTypeCategory.Handle }
AttributeDataReaderTests.cs (5)
241public static void OfficialExportMethod(IResource resource) 247public static void OverriddenNameMethod(IResource resource) 260public static void ObsoleteExportMethod(IResource resource) 267public static void ExperimentalExportMethod(IResource resource) 355[typeof(IResource)]);
CapabilityDispatcherTests.cs (2)
49Assert.Same(resource.Resource, Assert.IsAssignableFrom<IResourceBuilder<IResource>>(returnedBuilder).Resource); 3041internal sealed class TestResourceBuilder<T> : IResourceBuilder<T> where T : IResource
Aspire.Hosting.Rust.Tests (1)
AddRustAppPublishTests.cs (1)
338private static PipelineStep CreateBuildComputeStep(string name, IResource resource)
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
216/// the extension method <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
Aspire.Hosting.Testing (11)
DistributedApplicationHostingTestingExtensions.cs (5)
92if (!applicationModel.Resources.TryGetByName(DashboardResourceName, out var resource) || 176var resource = GetResource(app, resourceName); 252static IResource GetResource(DistributedApplication app, string resourceName) 257if (!applicationModel.Resources.TryGetByName(resourceName, out var resource)) 267var resource = GetResource(app, resourceName);
DistributedApplicationTestingBuilder.cs (6)
534public IResourceBuilder<T> AddResource<T>(T resource) where T : IResource => innerBuilder.AddResource(resource); 544public IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource => innerBuilder.CreateResourceBuilder(resource); 699public IResourceBuilder<T> AddResource<T>(T resource) where T : IResource => _innerBuilder.AddResource(resource); 713public IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource => _innerBuilder.CreateResourceBuilder(resource); 796new IResourceBuilder<T> AddResource<T>(T resource) where T : IResource => ((IDistributedApplicationBuilder)this).AddResource(resource); 799new IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource => ((IDistributedApplicationBuilder)this).CreateResourceBuilder(resource);
Aspire.Hosting.Testing.Tests (3)
TestingBuilderTests.cs (1)
126foreach (var resource in appModel.GetContainerResources())
tests\Aspire.Hosting.TestUtilities\Utils\LoggerNotificationExtensions.cs (1)
31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T : IResource
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (1)
33public static Task<IReadOnlyList<LogLine>> WatchForLogsAsync(ResourceLoggerService service, int targetLogCount, IResource resource)
Aspire.Hosting.Tests (145)
ApplicationModel\Docker\DockerfileBuilderCallbackContextTests.cs (1)
133Assert.IsAssignableFrom<IResource>(context.Resource);
ApplicationModel\ResourceCollectionTests.cs (13)
17var found = collection.TryGetByName("myResource", out var result); 30var found = collection.TryGetByName("MYRESOURCE", out var result); 42var found = collection.TryGetByName("missing", out var result); 53var found = collection.TryGetByName("anything", out var result); 122Assert.True(collection.TryGetByName("res2", out var result)); 136Assert.True(collection.TryGetByName("new", out var result)); 190Assert.True(collection.TryGetByName("res", out var result)); 197var resources = new IResource[] 209var resources = new IResource[] 216Assert.True(collection.TryGetByName("res1", out var r1)); 219Assert.True(collection.TryGetByName("res2", out var r2)); 232Assert.True(collection.TryGetByName("test", out var result)); 248private sealed class SimpleResourceCollection : Collection<IResource>, IResourceCollection
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (2)
1246private static async Task PrimeEnvironmentCallbackCacheAsync(IResource resource, IServiceProvider services) 2211var dashboard = Assert.Single(model.Resources, r => r.Name == KnownResourceNames.AspireDashboard);
ContainerRegistryResourceTests.cs (1)
441where TResource : class, IResource
Dashboard\DashboardEventHandlersTests.cs (10)
55var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName)); 104var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName)); 196var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName)); 542var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName)); 625var dashboardResource = model.Resources.Single(r => string.Equals(r.Name, KnownResourceNames.AspireDashboard, StringComparisons.ResourceName)); 698var dashboardResource = Assert.Single(model.Resources); 782var dashboardResource = Assert.Single(model.Resources); 851var dashboardResource = Assert.Single(model.Resources); 918var dashboardResource = Assert.Single(model.Resources); 962var dashboardResource = Assert.Single(model.Resources);
Dashboard\DashboardResourceTests.cs (16)
126var dashboard = Assert.Single(model.Resources); 227var dashboard = Assert.Single(model.Resources); 261var dashboard = Assert.Single(model.Resources); 304var dashboard = Assert.Single(model.Resources); 332var dashboard = Assert.Single(model.Resources); 401var dashboard = Assert.Single(model.Resources); 441var dashboard = Assert.Single(model.Resources); 477var dashboard = Assert.Single(model.Resources); 516var container = Assert.Single(model.Resources, r => r.Name == "my-container"); 520var dashboard = Assert.Single(model.Resources, r => r.Name == "aspire-dashboard"); 562var container = Assert.Single(model.Resources, r => r.Name == "my-container"); 566var dashboard = Assert.Single(model.Resources, r => r.Name == "aspire-dashboard"); 610var dashboard = Assert.Single(model.Resources, r => r.Name == "aspire-dashboard"); 642var dashboard = Assert.Single(model.Resources, r => r.Name == "aspire-dashboard"); 846var dashboard = Assert.Single(model.Resources); 878static void SetDashboardAllocatedEndpoints(IResource dashboard, int otlpGrpcPort, int otlpHttpPort, int httpPort, int httpsPort)
Dcp\DcpExecutorTests.cs (18)
4956var connectionStringAvailableChannel = Channel.CreateUnbounded<IResource>(); 5005var connectionStringAvailableResource = await connectionStringAvailableChannel.Reader.ReadAsync().AsTask().DefaultTimeout(); 5035var connectionStringAvailableChannel = Channel.CreateUnbounded<IResource>(); 5053var connectionStringAvailableResource = await connectionStringAvailableChannel.Reader.ReadAsync().AsTask().DefaultTimeout(); 6433var failedResources = new List<IResource>(); 8012var failedResources = new ConcurrentQueue<IResource>(); 8934var failedResources = new List<IResource>(); 9450var failedResources = new List<IResource>(); 9782var failedResources = new List<IResource>(); 9952var failedResources = new List<(IResource Resource, string? ErrorMessage)>(); 10028var failedResources = new ConcurrentQueue<(IResource Resource, string? ErrorMessage)>(); 10223var failedResources = new List<(IResource Resource, string? ErrorMessage)>(); 11575private static void HasKnownCommandAnnotations(IResource resource) 11584private static void HasKnownProjectCommandAnnotations(IResource resource) 11636var failedResources = new List<IResource>(); 11727var failedResources = new List<IResource>(); 12468private sealed class CustomChildResource(string name, IResource parent) : Resource(name), IResourceWithParent 12470public IResource Parent => parent;
Dcp\ExecutableLaunchPlanTests.cs (1)
297IResource resource,
Dcp\ResourceSnapshotBuilderTests.cs (19)
77var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 106var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 145var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 197var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 242var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 288var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 350var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 397var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 440var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 472var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 501var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 535var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 558var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 582var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 605var snapshotBuilder = CreateSnapshotBuilder(new Dictionary<string, IResource> 646CreateSnapshotBuilder(new Dictionary<string, IResource> 674var snapshotBuilder = CreateSnapshotBuilder(new Dictionary<string, IResource> 793private static DcpResourceSnapshotBuilder CreateSnapshotBuilder(IDictionary<string, IResource>? applicationModel = null) 795return new(new DcpResourceState(applicationModel ?? new Dictionary<string, IResource>(), []));
DebugSupportExtensionsTests.cs (5)
49parameters[0].ParameterType == typeof(IResource) && 60parameters[0].ParameterType == typeof(IResource) && 72[typeof(IResource), typeof(string), typeof(CancellationToken)]); 517private static string GetProjectPath(IResource resource) => resource.Annotations.OfType<IProjectMetadata>().Last().ProjectPath; 520IResource resource,
DistributedApplicationBuilderTests.cs (1)
83var resource = Assert.Single(appModel.Resources);
DistributedApplicationTests.cs (1)
1434var aspireDashboard = model.Resources.Single(r => r.Name == KnownResourceNames.AspireDashboard);
Eventing\DistributedApplicationBuilderEventingTests.cs (2)
333var resourceStopped = default(IResource);
Lifecycle\TerminalHostFailureDiagnosticServiceTests.cs (4)
248private static async Task WaitForUnhideAsync(ResourceNotificationService notifications, IResource host) 259private static async Task<CustomResourceSnapshot> ReadCurrentSnapshotAsync(ResourceNotificationService notifications, IResource host) 271private static async Task<IReadOnlyList<LogLine>> ReadLogsAsync(ResourceLoggerService loggers, IResource host, int expected, int? timeoutMs = null) 295private static async Task<bool> TryReadAnyLogAsync(ResourceLoggerService loggers, IResource host)
Orchestrator\ApplicationOrchestratorTests.cs (4)
1618private static async Task PublishReplicaStatesAsync(ResourceNotificationService notificationService, IResource resource, string state) 1747private sealed class CustomChildResource(string name, IResource parent) : Resource(name), IResourceWithParent 1749public IResource Parent => parent; 1803public IResource Parent { get; } = parent;
Orchestrator\ParameterProcessorTests.cs (1)
85var updates = new List<(IResource Resource, CustomResourceSnapshot Snapshot)>();
Orchestrator\RelationshipEvaluatorTests.cs (2)
159private sealed class CustomChildResource(string name, IResource parent) : Resource(name), IResourceWithParent 161public IResource Parent => parent;
Pipelines\DistributedApplicationPipelineTests.cs (6)
1053IResource? capturedResource = null; 1601IResource? targetResource = null; 1630var resource2Instance = configContext.Model.Resources.FirstOrDefault(r => r.Name == "resource2"); 1670var resource1Instance = configContext.Model.Resources.FirstOrDefault(r => r.Name == "resource1"); 1731IResource? capturedResource = null; 2675var transient = model.Resources.Single(r => r.Name == "transient-resource");
Pipelines\PipelineOutputDiffingTests.cs (2)
1123public string GetOutputDirectory(IResource resource) 1129public string GetTempDirectory(IResource resource) => throw new InvalidOperationException("No temporary lookup during diffing.");
Publishing\ContainerRuntimeBaseTests.cs (1)
507public Task PushImageAsync(IResource resource, CancellationToken cancellationToken) => Task.CompletedTask;
Publishing\DotnetProgramArchiveTests.cs (1)
481private static Task BuildAsync(DistributedApplication app, IResource resource, bool usePipeline, CancellationToken cancellationToken)
Publishing\ResourceContainerImageManagerTests.cs (2)
2041IResource? capturedResource = null; 2327private static void AssertImageArchiveWasWritten(IResource resource, string outputPath)
RequiredCommandAnnotationTests.cs (17)
153var resource = appModel.Resources.Single(r => r.Name == "test"); 169var resource = appModel.Resources.Single(r => r.Name == "test"); 187var resource = appModel.Resources.Single(r => r.Name == "test"); 212var resource = appModel.Resources.Single(r => r.Name == "test"); 239var resource = appModel.Resources.Single(r => r.Name == "test"); 263var resource = appModel.Resources.Single(r => r.Name == "test"); 284var resource = appModel.Resources.Single(r => r.Name == "test"); 304var resource1 = appModel.Resources.Single(r => r.Name == "test1"); 305var resource2 = appModel.Resources.Single(r => r.Name == "test2"); 336var resource1 = appModel.Resources.Single(r => r.Name == "test1"); 337var resource2 = appModel.Resources.Single(r => r.Name == "test2"); 371var resource1 = appModel.Resources.Single(r => r.Name == "test1"); 372var resource2 = appModel.Resources.Single(r => r.Name == "test2"); 396var resource = appModel.Resources.Single(r => r.Name == "test"); 428var resource = appModel.Resources.Single(r => r.Name == "test"); 453var resource1 = appModel.Resources.Single(r => r.Name == "test1"); 454var resource2 = appModel.Resources.Single(r => r.Name == "test2");
ResourceDependencyTests.cs (2)
832Array.Empty<IResource>(), executionContext); 1019foreach (var dep in singleDeps)
ResourceFailureLoggingTests.cs (1)
102where T : IResource
ResourceNotificationTests.cs (2)
62IResource resource = resourceType.Name switch 1870int? exitCode = default) where T : IResource
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
125IResource resource,
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (1)
33public static Task<IReadOnlyList<LogLine>> WatchForLogsAsync(ResourceLoggerService service, int targetLogCount, IResource resource)
WaitForTests.cs (2)
829foreach (var dependency in new IResource[] { parentResource.Resource, child1.Resource, child2.Resource })
WithEnvironmentTests.cs (2)
499private readonly IResource _referencedResource; 501public TestValueWithReferences(string value, IResource referencedResource)
WithHttpCommandTests.cs (1)
1057private static async Task MoveResourceToRunningStateAsync(DistributedApplication app, IResource resource, string commandName = "mycommand")
WithOtlpExporterTests.cs (1)
299foreach (var resource in appModel.Resources)
WithReferenceTests.cs (2)
530ResourceBuilderExtensions.WithReference(projectB, (IResourceBuilder<IResource>)resource, connectionName: "db", name: "api"); 552ResourceBuilderExtensions.WithReference(projectB, (IResourceBuilder<IResource>)resource, connectionName: "db");
Aspire.Hosting.TestUtilities (21)
MockImageBuilder.cs (6)
19public ConcurrentBag<IResource> BuildImageResources { get; } = []; 21public ConcurrentBag<IResource> PushImageCalls { get; } = []; 23public Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 30public Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 33foreach (var resource in resources) 40public Task PushImageAsync(IResource resource, CancellationToken cancellationToken)
Publishing\FakeContainerRuntime.cs (2)
34public ConcurrentBag<IResource> PushImageCalls { get; } = []; 80public Task PushImageAsync(IResource resource, CancellationToken cancellationToken)
Utils\ArgumentEvaluator.cs (1)
11public static async ValueTask<List<string>> GetArgumentListAsync(IResource resource, IServiceProvider? serviceProvider = null)
Utils\EnvironmentVariableEvaluator.cs (1)
12IResource resource,
Utils\LaunchConfigurationTestHelpers.cs (2)
11IResource resource, 26IResource resource,
Utils\LoggerNotificationExtensions.cs (1)
31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T : IResource
Utils\ManifestUtils.cs (4)
13public static async Task<JsonNode> GetManifest(IResource resource, string? manifestDirectory = null) 20public static async Task<JsonNode?> GetManifestOrNull(IResource resource, string? manifestDirectory = null) 66public static async Task<JsonNode[]> GetManifests(IResource[] resources) 79foreach (var r in resources)
Utils\TerminalCommandTestHelpers.cs (1)
15IResource resource,
Utils\TestDcpExecutor.cs (3)
28public void AddResource(IResource modelResource, string dcpResourceName) 52private sealed class TestResourceReference(IResource modelResource, string dcpResourceName) : IResourceReference 54public IResource ModelResource { get; } = modelResource;
Aspire.Hosting.Yarp (1)
YarpResourceExtensions.cs (1)
261private static string GetYarpImageName(IResource resource)
Aspire.Playground.Tests (3)
Infrastructure\DistributedApplicationExtensions.cs (2)
72var resource = resourceVolume.Resource; 144static bool ShouldAssertErrorsForResource(IResource resource)
tests\Aspire.Hosting.TestUtilities\Utils\LoggerNotificationExtensions.cs (1)
31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T : IResource
Pipelines.Library (2)
DistributedApplicationPipelineExtensions.cs (2)
29foreach (var resource in context.Model.GetComputeResources()) 66IResource projectResource,
Stress.AppHost (13)
AppHost.cs (2)
45IResource parent = rb.Resource; 133IResourceBuilder<IResource>? previousResourceBuilder = null;
CommandResources.cs (1)
1491foreach (var r in resources)
InteractionCommands.cs (1)
15public static IResourceBuilder<T> AddInteractionCommands<T>(this IResourceBuilder<T> resource) where T : IResource
TestResource.cs (9)
33public static IResourceBuilder<TestNestedResource> AddNestedResource(this IDistributedApplicationBuilder builder, string name, IResource parent) 52public static IResourceBuilder<CommandGroupResource> AddCommandGroup(this IDistributedApplicationBuilder builder, string name, IResource parent) 69public static IResourceBuilder<HttpCommandGroupResource> AddHttpCommandGroup(this IDistributedApplicationBuilder builder, string name, IResource parent) 211sealed class TestNestedResource(string name, IResource parent) : Resource(name), IResourceWithParent 213public IResource Parent { get; } = parent; 216sealed class CommandGroupResource(string name, IResource parent) : Resource(name), IResourceWithParent 218public IResource Parent { get; } = parent; 221sealed class HttpCommandGroupResource(string name, IResource parent) : Resource(name), IResourceWithParent, IResourceWithEndpoints 223public IResource Parent { get; } = parent;
Terminals.AppHost (3)
TerminalInteractionCommands.cs (3)
42public static IResourceBuilder<T> WithAppHostShellCommand<T>(this IResourceBuilder<T> resource) where T : IResource 283public static IResourceBuilder<T> WithNumberGuessCommand<T>(this IResourceBuilder<T> resource) where T : IResource 399public static IResourceBuilder<T> WithAutomateResourceTerminalCommand<T>(this IResourceBuilder<T> resource, string targetResourceName) where T : IResource