4 types derived from Resource
Aspire.Hosting (1)
ApplicationModel\ParameterResource.cs (1)
9public sealed class ParameterResource : Resource, IManifestExpressionProvider, IValueProvider
Aspire.Hosting.Dapr (1)
DaprComponentResource.cs (1)
11public sealed class DaprComponentResource : Resource, IDaprComponentResource
Aspire.Hosting.MongoDB (1)
MongoDBDatabaseResource.cs (1)
9public class MongoDBDatabaseResource : Resource, IResourceWithParent<MongoDBServerResource>, IResourceWithConnectionString
Aspire.Hosting.SqlServer (1)
SqlServerDatabaseResource.cs (1)
9public class SqlServerDatabaseResource : Resource, IResourceWithParent<SqlServerServerResource>, IResourceWithConnectionString
29 references to Resource
Aspire.Hosting (8)
ApplicationModel\ConnectionStringReference.cs (3)
20string IManifestExpressionProvider.ValueExpression => Resource.ValueExpression; 26var value = await Resource.GetValueAsync(cancellationToken).ConfigureAwait(false); 30throw new DistributedApplicationException($"The connection string for the resource '{Resource.Name}' is not available.");
ApplicationModel\Resource.cs (2)
25/// Initializes a new instance of the <see cref="Resource"/> class. 30ModelName.ValidateName(nameof(Resource), name);
DistributedApplicationResourceBuilder.cs (3)
27if (behavior == ResourceAnnotationMutationBehavior.Replace && Resource.Annotations.OfType<TAnnotation>().SingleOrDefault() is { } existingAnnotation) 29Resource.Annotations.Remove(existingAnnotation); 32Resource.Annotations.Add(annotation);
Aspire.Hosting.Azure (7)
AzureBicepResource.cs (7)
274if (Resource.ProvisioningTaskCompletionSource is not null) 276await Resource.ProvisioningTaskCompletionSource.Task.WaitAsync(cancellationToken).ConfigureAwait(false); 289if (!Resource.SecretOutputs.TryGetValue(Name, out var value)) 300public string ValueExpression => $"{{{Resource.Name}.secretOutputs.{Name}}}"; 330var provisioning = Resource.ProvisioningTaskCompletionSource; 346if (!Resource.Outputs.TryGetValue(Name, out var value)) 358public string ValueExpression => $"{{{Resource.Name}.outputs.{Name}}}";
Aspire.Hosting.Tests (14)
Dashboard\DashboardServiceTests.cs (1)
20using Resource = Aspire.Hosting.ApplicationModel.Resource;
ModelNameTests.cs (10)
14var exception = Assert.Throws<ArgumentNullException>(() => ModelName.ValidateName(nameof(Resource), null!)); 24var exception = Assert.Throws<ArgumentException>(() => ModelName.ValidateName(nameof(Resource), "")); 35var exception = Assert.Throws<ArgumentException>(() => ModelName.ValidateName(nameof(Resource), name)); 45var exception = Assert.Throws<ArgumentException>(() => ModelName.ValidateName(nameof(Resource), " ")); 55var exception = Assert.Throws<ArgumentException>(() => ModelName.ValidateName(nameof(Resource), "test_name")); 65var exception = Assert.Throws<ArgumentException>(() => ModelName.ValidateName(nameof(Resource), "-abc")); 75var exception = Assert.Throws<ArgumentException>(() => ModelName.ValidateName(nameof(Resource), "test--name")); 85var exception = Assert.Throws<ArgumentException>(() => ModelName.ValidateName(nameof(Resource), "1abc")); 95var exception = Assert.Throws<ArgumentException>(() => ModelName.ValidateName(nameof(Resource), "abc-")); 111ModelName.ValidateName(nameof(Resource), name);
ResourceExtensionsTests.cs (3)
267private sealed class ChildResource(string name, Resource parent) : Resource(name), IResourceWithParent<Resource> 269public Resource Parent => parent;