# DistributedApplicationResourceEventSubscription

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

Represents a subscription to an event that is published during the lifecycle of the AppHost for a specific resource.

## Definition

```csharp
namespace Aspire.Hosting.Eventing;

public class DistributedApplicationResourceEventSubscription
    : Aspire.Hosting.Eventing.DistributedApplicationEventSubscription
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting/DistributedApplicationResourceEventSubscription`

## Constructors

- [DistributedApplicationResourceEventSubscription(IResource?, Func<IDistributedApplicationResourceEvent, CancellationToken, Task>)](/reference/api/csharp/aspire.hosting/distributedapplicationresourceeventsubscription/constructors.md#constructor-iresource-func-idistributedapplicationresourceevent-cancellationtoken-task) -- Represents a subscription to an event that is published during the lifecycle of the AppHost for a specific resource.

## Properties

- [Resource](/reference/api/csharp/aspire.hosting/distributedapplicationresourceeventsubscription/properties.md#resource) : [IResource?](/reference/api/csharp/aspire.hosting/iresource.md) `get` -- Resource associated with this subscription.
