10 interfaces inheriting from IResource
Aspire.Hosting (6)
ApplicationModel\IResourceWithArgs.cs (1)
9public interface IResourceWithArgs : IResource
ApplicationModel\IResourceWithConnectionString.cs (1)
9public interface IResourceWithConnectionString : IResource, IManifestExpressionProvider, IValueProvider, IValueWithReferences
ApplicationModel\IResourceWithEndpoints.cs (1)
9public interface IResourceWithEndpoints : IResource
ApplicationModel\IResourceWithEnvironment.cs (1)
9public interface IResourceWithEnvironment : IResource
ApplicationModel\IResourceWithParentOfT.cs (1)
23public interface IResourceWithParent : IResource
ApplicationModel\IResourceWithWaitSupport.cs (1)
9public interface IResourceWithWaitSupport : IResource
Aspire.Hosting.Azure (2)
IAzureResource.cs (1)
10public interface IAzureResource : IResource
IResourceWithAzureFunctionsConfig.cs (1)
11public interface IResourceWithAzureFunctionsConfig : IResource
Aspire.Hosting.Dapr (2)
IDaprComponentResource.cs (1)
11public interface IDaprComponentResource : IResource, IResourceWithWaitSupport
IDaprSidecarResource.cs (1)
11public interface IDaprSidecarResource : IResource
2 implementations of IResource
Aspire.Hosting (1)
ApplicationModel\Resource.cs (1)
12public abstract class Resource : IResource
Aspire.Hosting.Tests (1)
DistributedApplicationBuilderTests.cs (1)
172private sealed class TestResource : IResource
278 references to IResource
Aspire.Hosting (144)
ApplicationModel\BeforeResourceStartedEvent.cs (2)
16public class BeforeResourceStartedEvent(IResource resource, IServiceProvider services) : IDistributedApplicationResourceEvent 19public IResource Resource { get; } = resource;
ApplicationModel\CommandsConfigurationExtensions.cs (1)
15internal static void AddLifeCycleCommands(this IResource resource)
ApplicationModel\ConnectionStringAvailableEvent.cs (3)
11/// <param name="resource">The <see cref="IResource"/> for the event.</param> 13public class ConnectionStringAvailableEvent(IResource resource, IServiceProvider services) : IDistributedApplicationResourceEvent 16public IResource Resource => resource;
ApplicationModel\CustomResourceSnapshot.cs (1)
331public static ImmutableArray<RelationshipSnapshot> BuildRelationships(IResource resource)
ApplicationModel\DeploymentTargetAnnotation.cs (2)
9public sealed class DeploymentTargetAnnotation(IResource target) : IResourceAnnotation 14public IResource DeploymentTarget { get; } = target;
ApplicationModel\ExpressionResolver.cs (1)
57var target = endpointReference.Resource.GetRootResource();
ApplicationModel\IResourceBuilder.cs (1)
10public interface IResourceBuilder<out T> where T : IResource
ApplicationModel\IResourceCollection.cs (1)
9public interface IResourceCollection : IList<IResource>
ApplicationModel\IResourceWithParentOfT.cs (3)
10public interface IResourceWithParent<out T> : IResourceWithParent where T : IResource 17IResource IResourceWithParent.Parent => Parent; 28IResource Parent { get; }
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 (10)
13private readonly List<IResource> _resources = []; 15public IResource this[int index] { get => _resources[index]; set => _resources[index] = value; } 18public void Add(IResource item) => _resources.Add(item); 20public bool Contains(IResource item) => _resources.Contains(item); 21public void CopyTo(IResource[] array, int arrayIndex) => _resources.CopyTo(array, arrayIndex); 22public IEnumerator<IResource> GetEnumerator() => _resources.GetEnumerator(); 23public int IndexOf(IResource item) => _resources.IndexOf(item); 24public void Insert(int index, IResource item) => _resources.Insert(index, item); 25public bool Remove(IResource item) => _resources.Remove(item); 32public IResource[] Items => collection.ToArray();
ApplicationModel\ResourceExtensions.cs (16)
9/// Provides extension methods for the <see cref="IResource"/> interface. 20public static bool TryGetLastAnnotation<T>(this IResource resource, [NotNullWhen(true)] out T? annotation) where T : IResourceAnnotation 41public static bool TryGetAnnotationsOfType<T>(this IResource resource, [NotNullWhen(true)] out IEnumerable<T>? result) where T : IResourceAnnotation 63public static bool HasAnnotationOfType<T>(this IResource resource) where T : IResourceAnnotation 75public static bool TryGetAnnotationsIncludingAncestorsOfType<T>(this IResource resource, [NotNullWhen(true)] out IEnumerable<T>? result) where T : IResourceAnnotation 112public static bool HasAnnotationIncludingAncestorsOfType<T>(this IResource resource) where T : IResourceAnnotation 145public static bool TryGetEnvironmentVariables(this IResource resource, [NotNullWhen(true)] out IEnumerable<EnvironmentCallbackAnnotation>? environmentVariables) 228public static bool TryGetContainerMounts(this IResource resource, [NotNullWhen(true)] out IEnumerable<ContainerMountAnnotation>? volumeMounts) 239public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 248/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 277public static bool TryGetContainerImageName(this IResource resource, [NotNullWhen(true)] out string? imageName) 307public static int GetReplicaCount(this IResource resource) 328internal static ContainerLifetime GetContainerLifetimeType(this IResource resource) 342internal static IResource GetRootResource(this IResource resource) => 354internal static string[] GetResolvedResourceNames(this IResource resource)
ApplicationModel\ResourceHealthyEvent.cs (2)
16public class ResourceReadyEvent(IResource resource, IServiceProvider services) : IDistributedApplicationResourceEvent 21public IResource Resource => resource;
ApplicationModel\ResourceLoggerService.cs (1)
46public ILogger GetLogger(IResource resource)
ApplicationModel\ResourceNotificationService.cs (13)
20private readonly ConcurrentDictionary<(IResource, string), ResourceNotificationState> _resourceNotificationStates = new(); 123private async Task WaitUntilHealthyAsync(IResource resource, IResource dependency, CancellationToken cancellationToken) 186private async Task WaitUntilCompletionAsync(IResource resource, IResource dependency, int exitCode, CancellationToken cancellationToken) 238public async Task WaitForDependenciesAsync(IResource resource, CancellationToken cancellationToken) 344public Task PublishUpdateAsync(IResource resource, string resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 394private CustomResourceSnapshot UpdateCommands(IResource resource, CustomResourceSnapshot previousState) 470public async Task PublishUpdateAsync(IResource resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 479private static CustomResourceSnapshot GetCurrentSnapshot(IResource resource, ResourceNotificationState notificationState) 502private ResourceNotificationState GetResourceNotificationState(IResource resource, string resourceId) => 520public class ResourceEvent(IResource resource, string resourceId, CustomResourceSnapshot snapshot) 525public IResource Resource { get; } = resource;
ApplicationModel\ResourceRelationshipAnnotation.cs (2)
12public sealed class ResourceRelationshipAnnotation(IResource resource, string type) : IResourceAnnotation 17public IResource Resource { get; } = resource;
ApplicationModel\WaitAnnotation.cs (2)
18public sealed class WaitAnnotation(IResource resource, WaitType waitType, int exitCode = 0) : IResourceAnnotation 23public IResource Resource { get; } = resource;
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (1)
18foreach (var container in beforeStartEvent.Model.GetContainerResources())
ContainerResourceExtensions.cs (2)
18public static IEnumerable<IResource> GetContainerResources(this DistributedApplicationModel model) 36public static bool IsContainer(this IResource resource)
CustomResourceExtensions.cs (1)
21where TResource : IResource
Dashboard\DashboardLifecycleHook.cs (1)
129private void ConfigureAspireDashboardResource(IResource dashboardResource)
Dashboard\DashboardServiceData.cs (1)
35static 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\ApplicationExecutor.cs (23)
37public IResource ModelResource { get; } 42public AppResource(IResource modelResource, CustomResource dcpResource) 63public ServiceAppResource(IResource modelResource, Service service, EndpointAnnotation sba) : base(modelResource, service) 98private readonly Dictionary<string, IResource> _applicationModel = model.Resources.ToDictionary(r => r.Name); 99private readonly ILookup<IResource?, IResourceWithParent> _parentChildLookup = GetParentChildLookup(model); 195private static ILookup<IResource?, IResourceWithParent> GetParentChildLookup(DistributedApplicationModel model) 197static IResource? SelectParentContainerResource(IResource resource) => resource switch 200IResource r when r.IsContainer() => r, 212async Task SetChildResourceAsync(IResource resource, string parentName, string? state, DateTime? startTimeStamp, DateTime? stopTimeStamp) 240static ImmutableArray<HealthReportSnapshot> GetInitialHealthReports(IResource resource) 674IResource? appModelResource = null; 1194private void EnsureRequiredAnnotations(IResource resource) 1202private static void SetInitialResourceState(IResource resource, IAnnotationHolder annotationHolder) 1218async Task CreateResourceExecutablesAsyncCore(IResource resource, IEnumerable<AppResource> executables, CancellationToken cancellationToken) 1285private async Task PublishConnectionStringAvailableEvent(IResource resource, CancellationToken cancellationToken) 1419if (valueProvider is IResource resource) 1454foreach (var container in modelContainerResources) 1517private static DcpInstance GetDcpInstance(IResource resource, int instanceIndex) 1608var modelContainerResource = cr.ModelResource; 1771private static async Task ApplyBuildArgumentsAsync(Container dcpContainerResource, IResource modelContainerResource, CancellationToken cancellationToken) 1848private void AddServicesProducedInfo(IResource modelResource, IAnnotationHolder dcpResource, AppResource appResource) 1942private string GetObjectNameForResource(IResource resource, string suffix = "")
Dcp\DcpNameGenerator.cs (5)
28public void EnsureDcpInstancesPopulated(IResource resource) 58private static void AddInstancesAnnotation(IResource resource, ImmutableArray<DcpInstance> instances) 63public (string Name, string Suffix) GetContainerName(IResource container) 75public (string Name, string Suffix) GetExecutableName(IResource project) 88private static string GetObjectNameForResource(IResource resource, DcpOptions options, string suffix = "")
DistributedApplicationBuilder.cs (2)
428public IResourceBuilder<T> AddResource<T>(T resource) where T : IResource 442public IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource
DistributedApplicationResourceBuilder.cs (1)
8internal sealed class DistributedApplicationResourceBuilder<T>(IDistributedApplicationBuilder applicationBuilder, T resource) : IResourceBuilder<T> where T : IResource
Eventing\DistributedApplicationEventing.cs (1)
106public DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent
Eventing\DistributedApplicationEventSubscription.cs (2)
23public class DistributedApplicationResourceEventSubscription(IResource? resource, Func<IDistributedApplicationResourceEvent, CancellationToken, Task> callback) 29public IResource? Resource { get; } = resource;
Eventing\IDistributedApplicationEvent.cs (1)
23IResource Resource { get; }
Eventing\IDistributedApplicationEventing.cs (1)
28DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent;
IDistributedApplicationBuilder.cs (4)
143/// constructs a resource derived from <see cref="IResource"/> and adds it to the application model using the <see cref="AddResource{T}(T)"/> 155IResourceBuilder<T> AddResource<T>(T resource) where T : IResource; 175/// Calling extension methods on the <see cref="IResourceBuilder{T}"/> typically results in modifications to the <see cref="IResource.Annotations"/> 211IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource;
OtlpConfigurationExtensions.cs (1)
28public static void AddOtlpEnvironment(IResource resource, IConfiguration configuration, IHostEnvironment environment)
Publishing\ManifestPublishingContext.cs (16)
42private readonly Dictionary<string, IResource> _referencedResources = []; 88internal async Task WriteResourceAsync(IResource resource) 124async Task WriteResourceObjectAsync<T>(T resource, Func<Task> action) where T : IResource 375/// <param name="resource">The <see cref="IResource"/>.</param> 376public void WriteConnectionString(IResource resource) 387/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 390/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 391public void WriteBindings(IResource resource) 480/// Writes environment variables to the manifest base on the <see cref="IResource"/> resource's <see cref="EnvironmentCallbackAnnotation"/> annotations."/> 482/// <param name="resource">The <see cref="IResource"/> which contains <see cref="EnvironmentCallbackAnnotation"/> annotations.</param> 483public async Task WriteEnvironmentVariablesAsync(IResource resource) 516/// Writes command line arguments to the manifest based on the <see cref="IResource"/> resource's <see cref="CommandLineArgsCallbackAnnotation"/> annotations. 518/// <param name="resource">The <see cref="IResource"/> that contains <see cref="CommandLineArgsCallbackAnnotation"/> annotations.</param> 520public async Task WriteCommandLineArgumentsAsync(IResource resource) 646/// Ensures that any <see cref="IResource"/> instances referenced by <paramref name="value"/> are 652if (value is IResource resource)
ResourceBuilderExtensions.cs (13)
263public static IResourceBuilder<T> WithManifestPublishingCallback<T>(this IResourceBuilder<T> builder, Action<ManifestPublishingContext> callback) where T : IResource 279public static IResourceBuilder<T> WithManifestPublishingCallback<T>(this IResourceBuilder<T> builder, Func<ManifestPublishingContext, Task> callback) where T : IResource 651public static IResourceBuilder<T> ExcludeFromManifest<T>(this IResourceBuilder<T> builder) where T : IResource 669/// resources, calling <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> also results 685public static IResourceBuilder<T> WaitFor<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency) where T : IResourceWithWaitSupport 690if (builder.Resource as IResource == dependency.Resource) 740public static IResourceBuilder<T> WaitForCompletion<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, int exitCode = 0) where T : IResourceWithWaitSupport 745if (builder.Resource as IResource == dependency.Resource) 770/// the <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> to associate a resource 796public static IResourceBuilder<T> WithHealthCheck<T>(this IResourceBuilder<T> builder, string key) where T : IResource 994bool isHighlighted = false) where T : IResource 1036IResource resource, 1037string type) where T : IResource
Utils\ImageNameGenerator.cs (1)
12public static string GenerateImageName<T>(this IResourceBuilder<T> builder) where T: IResource
Utils\VolumeNameGenerator.cs (1)
21public static string Generate<T>(IResourceBuilder<T> builder, string suffix) where T : IResource
Aspire.Hosting.Azure (12)
BicepResourceAnnotation.cs (1)
16/// that can be added to any <see cref="IResource"/> will be detected by the <see cref="AzureProvisioner"/> and used to
IAzureResource.cs (1)
7/// Represents an Azure resource, as a marker interface for <see cref="IResource"/>'s
Provisioning\Provisioners\AzureProvisioner.cs (10)
46private static List<(IResource Resource, IAzureResource AzureResource)> GetAzureResourcesFromAppModel(DistributedApplicationModel appModel) 53var azureResources = new List<(IResource, IAzureResource)>(); 54foreach (var resource in appModel.Resources) 76private ILookup<IResource, IResourceWithParent>? _parentChildLookup; 102static IResource? SelectParentResource(IResource resource) => resource switch 113async Task UpdateStateAsync((IResource Resource, IAzureResource AzureResource) resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 139async Task AfterProvisionAsync((IResource Resource, IAzureResource AzureResource) resource) 203IList<(IResource Resource, IAzureResource AzureResource)> azureResources, 260private async Task ProcessResourceAsync(IConfiguration configuration, Lazy<Task<ProvisioningContext>> provisioningContextLazy, (IResource Resource, IAzureResource AzureResource) resource, CancellationToken cancellationToken)
Aspire.Hosting.Azure.AppContainers (12)
AzureContainerAppsInfrastructure.cs (12)
43foreach (var r in appModel.Resources) 79private readonly Dictionary<IResource, ContainerAppContext> _containerApps = []; 81public async Task<AzureBicepResource> CreateContainerAppAsync(IResource resource, AzureProvisioningOptions provisioningOptions, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 93private async Task<ContainerAppContext> ProcessResourceAsync(IResource resource, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 104private sealed class ContainerAppContext(IResource resource, ContainerAppEnvironmentContext containerAppEnvironmentContext) 121public IResource Resource => resource; 231private static bool TryGetContainerImageName(IResource resource, out string? containerImageName) 966private sealed class ResourceExpression(IResource resource, string propertyExpression) : IManifestExpressionProvider 970public static IManifestExpressionProvider GetContainerImageExpression(IResource p) => 973public static IManifestExpressionProvider GetContainerPortExpression(IResource p) => 980private sealed class VolumeStorageExpression(IResource resource, ContainerMountType type, string index) : IManifestExpressionProvider 989public static IManifestExpressionProvider GetVolumeStorage(IResource resource, ContainerMountType type, string index) =>
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBEmulatorResource.cs (1)
12public class AzureCosmosDBEmulatorResource(AzureCosmosDBResource innerResource) : ContainerResource(innerResource.Name), IResource
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsEmulatorResource.cs (1)
12public class AzureEventHubsEmulatorResource(AzureEventHubsResource 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.Tests (22)
AzureBicepResourceTests.cs (6)
40public static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> AzureExtensions => 43private static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> CreateAllAzureExtensions(string resourceName) 82public void AzureExtensionsAutomaticallyAddAzureProvisioning(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource) 94public void BicepResourcesAreIdempotent(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource) 110public static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> AzureExtensionsWithHyphen => 115public void AzureResourcesProduceValidBicep(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource)
AzureContainerAppsTests.cs (11)
35var container = Assert.Single(model.GetContainerResources()); 131var container = Assert.Single(model.GetContainerResources()); 379var container = Assert.Single(model.GetContainerResources()); 775var container = Assert.Single(model.GetContainerResources()); 873var container = Assert.Single(model.GetContainerResources()); 985var container = Assert.Single(model.GetContainerResources()); 1136var container = Assert.Single(model.GetContainerResources()); 1294var container = Assert.Single(model.GetContainerResources()); 1383var container = Assert.Single(model.GetContainerResources()); 1481var container = Assert.Single(model.GetContainerResources()); 1586var container = Assert.Single(model.GetContainerResources());
AzurePostgresExtensionsTests.cs (2)
372var postgresResourceInModel = builder.Resources.Single(r => r.Name == "postgres-data"); 373var dbResourceInModel = builder.Resources.Single(r => r.Name == "db1");
AzureRedisExtensionsTests.cs (1)
181var cacheInModel = builder.Resources.Single(r => r.Name == "cache");
AzureSqlExtensionsTests.cs (2)
220var sqlResourceInModel = builder.Resources.Single(r => r.Name == "sql"); 221var dbResourceInModel = builder.Resources.Single(r => r.Name == "db1");
Aspire.Hosting.Containers.Tests (8)
ContainerResourceTests.cs (7)
25var containerResource = Assert.Single(containerResources); 44var containerResource = Assert.Single(containerResources); 111var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 145var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 173var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 192var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources()); 241var containerResource = Assert.Single(app.Services.GetRequiredService<DistributedApplicationModel>().GetContainerResources());
src\Aspire.Hosting.Testing\ResourceLoggerForwarderService.cs (1)
61private async Task WatchResourceLogs(IResource resource, string resourceId, CancellationToken cancellationToken)
Aspire.Hosting.Dapr (6)
DaprDistributedApplicationLifecycleHook.cs (2)
47foreach (var resource in appModel.Resources) 284static (EndpointReference appEndpoint, string protocol)? GetEndpointReference(DaprSidecarOptions? sidecarOptions, IResource resource)
IDistributedApplicationComponentBuilderExtensions.cs (4)
21public static IResourceBuilder<T> WithDaprSidecar<T>(this IResourceBuilder<T> builder, string appId) where T : IResource 33public static IResourceBuilder<T> WithDaprSidecar<T>(this IResourceBuilder<T> builder, DaprSidecarOptions? options = null) where T : IResource 52public static IResourceBuilder<T> WithDaprSidecar<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<IDaprSidecarResource>> configureSidecar) where T : IResource 87public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, IResourceBuilder<IDaprComponentResource> component) where TDestination : IResource
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
174var kafkaUiResource = Assert.Single(builder.Resources, r => r.Name == expectedContainerName);
Aspire.Hosting.Milvus.Tests (2)
AddMilvusTests.cs (2)
29var containerResource = Assert.Single(appModel.GetContainerResources()); 60var containerResource = Assert.Single(appModel.GetContainerResources());
Aspire.Hosting.MySql.Tests (4)
AddMySqlTests.cs (4)
86var containerResource = Assert.Single(appModel.GetContainerResources()); 245var myAdmin = builder.Resources.Single(r => r.Name.EndsWith("-phpmyadmin")); 260var container = builder.Resources.Single(r => r.Name == "mySql-phpmyadmin"); 278var myAdmin = builder.Resources.Single(r => r.Name.EndsWith("-phpmyadmin"));
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
45var containerResource = Assert.Single(appModel.GetContainerResources()); 85var containerResource = Assert.Single(appModel.GetContainerResources()); 168var containerResource = Assert.Single(containerResources);
Aspire.Hosting.PostgreSQL (3)
PostgresBuilderExtensions.cs (3)
34/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> 101/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> 107/// will create the database. As a result if <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
Aspire.Hosting.PostgreSQL.Tests (7)
AddPostgresTests.cs (7)
55var containerResource = Assert.Single(appModel.GetContainerResources()); 110var containerResource = Assert.Single(appModel.GetContainerResources()); 202var containerResource = Assert.Single(containerResources); 380var container = builder.Resources.Single(r => r.Name == "mypostgres-pgadmin"); 435var container = builder.Resources.Single(r => r.Name == "mypostgres-pgadmin"); 463var pgadmin = builder.Resources.Single(r => r.Name.EndsWith("-pgadmin")); 510var pgadmin = builder.Resources.Single(r => r.Name.EndsWith("-pgweb"));
Aspire.Hosting.Qdrant.Tests (3)
AddQdrantTests.cs (3)
48var containerResource = Assert.Single(appModel.GetContainerResources()); 87var containerResource = Assert.Single(appModel.GetContainerResources()); 121var containerResource = Assert.Single(appModel.GetContainerResources());
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
33/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
218var commander = builder.Resources.Single(r => r.Name.EndsWith("-commander")); 242var commander = builder.Resources.Single(r => r.Name.EndsWith("-commander"));
Aspire.Hosting.Testing (9)
DistributedApplicationHostingTestingExtensions.cs (4)
43var resource = GetResource(app, resourceName); 63static IResource GetResource(DistributedApplication app, string resourceName) 69var resource = resources.SingleOrDefault(r => string.Equals(r.Name, resourceName, StringComparison.OrdinalIgnoreCase)); 81var resource = GetResource(app, resourceName);
DistributedApplicationTestingBuilder.cs (4)
176public IResourceBuilder<T> AddResource<T>(T resource) where T : IResource => innerBuilder.AddResource(resource); 184public IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource => innerBuilder.CreateResourceBuilder(resource); 287IResourceBuilder<T> AddResource<T>(T resource) where T : IResource; 295IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource;
ResourceLoggerForwarderService.cs (1)
61private async Task WatchResourceLogs(IResource resource, string resourceId, CancellationToken cancellationToken)
Aspire.Hosting.Testing.Tests (3)
TestingBuilderTests.cs (1)
95foreach (var resource in appModel.GetContainerResources())
tests\Aspire.Hosting.Tests\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)
8public static Task<IReadOnlyList<LogLine>> WatchForLogsAsync(ResourceLoggerService service, int targetLogCount, IResource resource)
Aspire.Hosting.Tests (25)
Dashboard\DashboardResourceTests.cs (7)
103var dashboard = Assert.Single(model.Resources); 209var dashboard = Assert.Single(model.Resources); 244var dashboard = Assert.Single(model.Resources); 276var dashboard = Assert.Single(model.Resources); 313var container = Assert.Single(model.Resources.Where(r => r.Name == "my-container")); 317var dashboard = Assert.Single(model.Resources.Where(r => r.Name == "aspire-dashboard")); 355var dashboard = Assert.Single(model.Resources.Where(r => r.Name == "aspire-dashboard"));
Dcp\ApplicationExecutorTests.cs (3)
1035private static void HasKnownCommandAnnotations(IResource resource) 1100private sealed class CustomChildResource(string name, IResource parent) : Resource(name), IResourceWithParent 1102public IResource Parent => parent;
DistributedApplicationBuilderTests.cs (1)
65var resource = Assert.Single(appModel.Resources);
DistributedApplicationTests.cs (1)
160foreach (var item in appModel.Resources)
src\Aspire.Hosting.Testing\ResourceLoggerForwarderService.cs (1)
61private async Task WatchResourceLogs(IResource resource, string resourceId, CancellationToken cancellationToken)
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (1)
8public static Task<IReadOnlyList<LogLine>> WatchForLogsAsync(ResourceLoggerService service, int targetLogCount, IResource resource)
Utils\ArgumentEvaluator.cs (1)
8public static async ValueTask<List<string>> GetArgumentListAsync(IResource resource)
Utils\EnvironmentVariableEvaluator.cs (1)
8public static async ValueTask<Dictionary<string, string>> GetEnvironmentVariablesAsync(IResource 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 (5)
13public static async Task<JsonNode> GetManifest(IResource resource, string? manifestDirectory = null) 20public static async Task<JsonNode?> GetManifestOrNull(IResource resource, string? manifestDirectory = null) 39public static async Task<JsonNode[]> GetManifests(IResource[] resources) 48foreach (var r in resources) 68public static async Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource)
Utils\TestDistributedApplicationBuilder.cs (2)
136public IResourceBuilder<T> AddResource<T>(T resource) where T : IResource => _innerBuilder.AddResource(resource); 143public IResourceBuilder<T> CreateResourceBuilder<T>(T resource) where T : IResource
Utils\VolumeNameGeneratorTests.cs (1)
45private sealed class TestResource(string name) : IResource
Aspire.Playground.Tests (3)
Infrastructure\DistributedApplicationExtensions.cs (2)
71var resource = resourceVolume.Resource; 142static bool ShouldAssertErrorsForResource(IResource resource)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T: IResource
Stress.AppHost (4)
Program.cs (1)
13IResource parent = rb.Resource;
TestResource.cs (3)
30public static IResourceBuilder<TestNestedResource> AddNestedResource(this IDistributedApplicationBuilder builder, string name, IResource parent) 104sealed class TestNestedResource(string name, IResource parent) : Resource(name), IResourceWithParent 106public IResource Parent { get; } = parent;
TestProject.AppHost (1)
src\Aspire.Hosting.Testing\ResourceLoggerForwarderService.cs (1)
61private async Task WatchResourceLogs(IResource resource, string resourceId, CancellationToken cancellationToken)