# DaprComponentResource Constructors

- Package: [CommunityToolkit.Aspire.Hosting.Dapr](/reference/api/csharp/communitytoolkit.aspire.hosting.dapr.md)
- Type: [DaprComponentResource](/reference/api/csharp/communitytoolkit.aspire.hosting.dapr/daprcomponentresource.md)
- Kind: `Constructors`
- Members: `1`

Represents a Dapr component resource.

## DaprComponentResource(string, string)

- Name: `Constructor(string, string)`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/30a4b632065206d447183d2baabf6dfb3678d4af/src/CommunityToolkit.Aspire.Hosting.Dapr/DaprComponentResource.cs#L18-L21)

Initializes a new instance of [DaprComponentResource](/reference/api/csharp/communitytoolkit.aspire.hosting.dapr/daprcomponentresource.md).

```csharp
public sealed class DaprComponentResource
{
    public DaprComponentResource(
        string name,
        string type)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The resource name.
- `type` (`string`)
  The Dapr component type. This may be a generic "state" or "pubsub" if Aspire should choose an appropriate type when running or deploying.
