2 implementations of AddResource
Aspire.Hosting (1)
DistributedApplicationBuilder.cs (1)
422public IResourceBuilder<T> AddResource<T>(T resource) where T : IResource
Aspire.Hosting.Tests (1)
Utils\TestDistributedApplicationBuilder.cs (1)
136public IResourceBuilder<T> AddResource<T>(T resource) where T : IResource => _innerBuilder.AddResource(resource);
25 references to AddResource
Aspire.Hosting (4)
IDistributedApplicationBuilder.cs (3)
134/// The <see cref="AddResource{T}(T)"/> method is not typically used directly by developers building 141/// method which makes use of the <see cref="AddResource{T}(T)"/> method to add a container resource to the application. In .NET Aspire 143/// constructs a resource derived from <see cref="IResource"/> and adds it to the application model using the <see cref="AddResource{T}(T)"/>
ParameterResourceBuilderExtensions.cs (1)
192return builder.AddResource(resource)
Aspire.Hosting.Azure.Sql (1)
AzureSqlExtensions.cs (1)
93var azureSqlServer = builder.AddResource(resource)
Aspire.Hosting.Dapr (1)
IDistributedApplicationBuilderExtensions.cs (1)
47.AddResource(resource)
Aspire.Hosting.Elasticsearch (1)
ElasticsearchBuilderExtensions.cs (1)
82return builder.AddResource(elasticsearch)
Aspire.Hosting.Milvus (1)
MilvusBuilderExtensions.cs (1)
53return builder.AddResource(milvus)
Aspire.Hosting.MongoDB (1)
MongoDBBuilderExtensions.cs (1)
123.AddResource(mongoDBDatabase);
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
53return builder.AddResource(resource)
Aspire.Hosting.Oracle (1)
OracleDatabaseBuilderExtensions.cs (1)
50return builder.AddResource(oracleDatabaseServer)
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
77return builder.AddResource(postgresServer)
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
68return builder.AddResource(qdrant)
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
63var rabbitmq = builder.AddResource(rabbitMq)
Aspire.Hosting.SqlServer (2)
SqlServerBuilderExtensions.cs (2)
51return builder.AddResource(sqlServer) 80return builder.ApplicationBuilder.AddResource(sqlServerDatabase);
Aspire.Hosting.Tests (9)
DistributedApplicationBuilderTests.cs (5)
56appBuilder.AddResource(new TestResource()); 126appBuilder.AddResource(new ContainerResource("Test")); 128var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("Test"))); 137appBuilder.AddResource(new ContainerResource("Test")); 139var ex = Assert.Throws<DistributedApplicationException>(() => appBuilder.AddResource(new ContainerResource("TEST")));
ExpressionResolverTests.cs (4)
35var target = builder.AddResource(new TestExpressionResolverResource(exprName)) 58var source = builder.AddResource(new ContainerResource("testSource")) 86var test = builder.AddResource(new ContainerResource("testSource")) 108var test = builder.AddResource(new ContainerResource("testSource"))