# IResourceBuilder<T>

- Kind: `interface`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/IResourceBuilder.cs)

Defines a builder for creating resources of type `T`.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public interface IResourceBuilder<T>
    where T : IResource
{
    // ...
}
```

## Type Parameters

- `T` -- The type of resource to build.

## Properties

- [ApplicationBuilder](/reference/api/csharp/aspire.hosting/iresourcebuilder-1/properties.md#applicationbuilder) : [IDistributedApplicationBuilder](/reference/api/csharp/aspire.hosting/idistributedapplicationbuilder.md) `abstract` `get` -- Gets the distributed application builder associated with this resource builder.
- [Resource](/reference/api/csharp/aspire.hosting/iresourcebuilder-1/properties.md#resource) : `T` `abstract` `get` -- Gets the resource of type `T` that is being built.

## Methods

- [WithAnnotation(ResourceAnnotationMutationBehavior)](/reference/api/csharp/aspire.hosting/iresourcebuilder-1/methods.md#withannotation-resourceannotationmutationbehavior) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `virtual` -- Adds an annotation to the resource being built.
- [WithAnnotation(TAnnotation, ResourceAnnotationMutationBehavior)](/reference/api/csharp/aspire.hosting/iresourcebuilder-1/methods.md#withannotation-tannotation-resourceannotationmutationbehavior) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `abstract` -- Adds an annotation to the resource being built.
