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