diff --git a/src/Aspire.Hosting.Azure.CosmosDB/CosmosDBContainer.cs b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBContainerResource.cs similarity index 72% rename from src/Aspire.Hosting.Azure.CosmosDB/CosmosDBContainer.cs rename to src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBContainerResource.cs index 8489e4d544..852c641af1 100644 --- a/src/Aspire.Hosting.Azure.CosmosDB/CosmosDBContainer.cs +++ b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBContainerResource.cs @@ -3,7 +3,7 @@ using Aspire.Hosting.ApplicationModel; -namespace Aspire.Hosting.Azure.CosmosDB; +namespace Aspire.Hosting.Azure; /// /// Represents an Azure Cosmos DB Database Container. @@ -11,12 +11,12 @@ namespace Aspire.Hosting.Azure.CosmosDB; /// /// Use to configure specific properties. /// -public class CosmosDBContainer : Resource, IResourceWithParent, IResourceWithConnectionString +public class AzureCosmosDBContainerResource : Resource, IResourceWithParent, IResourceWithConnectionString { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public CosmosDBContainer(string name, string containerName, string partitionKeyPath, CosmosDBDatabase parent) : base(name) + public AzureCosmosDBContainerResource(string name, string containerName, string partitionKeyPath, AzureCosmosDBDatabaseResource parent) : base(name) { ContainerName = containerName; PartitionKeyPath = partitionKeyPath; @@ -36,7 +36,7 @@ public CosmosDBContainer(string name, string containerName, string partitionKeyP /// /// Gets the parent Azure Cosmos DB database resource. /// - public CosmosDBDatabase Parent { get; } + public AzureCosmosDBDatabaseResource Parent { get; } /// /// Gets the connection string expression for the Azure Cosmos DB Database Container. diff --git a/src/Aspire.Hosting.Azure.CosmosDB/CosmosDBDatabase.cs b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBDatabaseResource.cs similarity index 72% rename from src/Aspire.Hosting.Azure.CosmosDB/CosmosDBDatabase.cs rename to src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBDatabaseResource.cs index f3cfe5534d..a87ea79fd4 100644 --- a/src/Aspire.Hosting.Azure.CosmosDB/CosmosDBDatabase.cs +++ b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBDatabaseResource.cs @@ -3,7 +3,7 @@ using Aspire.Hosting.ApplicationModel; -namespace Aspire.Hosting.Azure.CosmosDB; +namespace Aspire.Hosting.Azure; /// /// Represents an Azure Cosmos DB Database. @@ -11,12 +11,12 @@ namespace Aspire.Hosting.Azure.CosmosDB; /// /// Use to configure specific properties. /// -public class CosmosDBDatabase : Resource, IResourceWithParent, IResourceWithConnectionString +public class AzureCosmosDBDatabaseResource : Resource, IResourceWithParent, IResourceWithConnectionString { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public CosmosDBDatabase(string name, string databaseName, AzureCosmosDBResource parent) : base(name) + public AzureCosmosDBDatabaseResource(string name, string databaseName, AzureCosmosDBResource parent) : base(name) { DatabaseName = databaseName; Parent = parent; @@ -30,7 +30,7 @@ public CosmosDBDatabase(string name, string databaseName, AzureCosmosDBResource /// /// The containers for this database. /// - internal List Containers { get; } = []; + internal List Containers { get; } = []; /// /// Gets the parent Azure Cosmos DB account resource. diff --git a/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs index 1763c88f93..d3a471a0de 100644 --- a/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs +++ b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs @@ -229,7 +229,7 @@ public static IResourceBuilder AddDatabase(this IResource /// The name of the database resource. /// The name of the database. If not provided, this defaults to the same value as . /// A reference to the . - public static IResourceBuilder AddCosmosDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) + public static IResourceBuilder AddCosmosDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); ArgumentNullException.ThrowIfNull(name); @@ -237,7 +237,7 @@ public static IResourceBuilder AddCosmosDatabase(this IResourc // Use the resource name as the database name if it's not provided databaseName ??= name; - var database = new CosmosDBDatabase(name, databaseName, builder.Resource); + var database = new AzureCosmosDBDatabaseResource(name, databaseName, builder.Resource); builder.Resource.Databases.Add(database); return builder.ApplicationBuilder.AddResource(database); @@ -251,7 +251,7 @@ public static IResourceBuilder AddCosmosDatabase(this IResourc /// Partition key path for the container. /// The name of the container. If not provided, this defaults to the same value as . /// A reference to the . - public static IResourceBuilder AddContainer(this IResourceBuilder builder, [ResourceName] string name, string partitionKeyPath, string? containerName = null) + public static IResourceBuilder AddContainer(this IResourceBuilder builder, [ResourceName] string name, string partitionKeyPath, string? containerName = null) { ArgumentNullException.ThrowIfNull(builder); ArgumentNullException.ThrowIfNull(name); @@ -260,7 +260,7 @@ public static IResourceBuilder AddContainer(this IResourceBui // Use the resource name as the container name if it's not provided containerName ??= name; - var container = new CosmosDBContainer(name, containerName, partitionKeyPath, builder.Resource); + var container = new AzureCosmosDBContainerResource(name, containerName, partitionKeyPath, builder.Resource); builder.Resource.Containers.Add(container); return builder.ApplicationBuilder.AddResource(container); diff --git a/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBResource.cs b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBResource.cs index 4a8137d36a..054d03d8ef 100644 --- a/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBResource.cs +++ b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBResource.cs @@ -17,7 +17,7 @@ public class AzureCosmosDBResource(string name, Action Databases { get; } = []; + internal List Databases { get; } = []; internal EndpointReference EmulatorEndpoint => new(this, "emulator");