# ResourceEvent Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ResourceEvent](/reference/api/csharp/aspire.hosting/resourceevent.md)
- Kind: `Constructors`
- Members: `1`

Represents a change in the state of a resource.

## ResourceEvent(IResource, string, CustomResourceSnapshot)

- Name: `Constructor(IResource, string, CustomResourceSnapshot)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs#L986-L1001)

Represents a change in the state of a resource.

```csharp
public class ResourceEvent
{
    public ResourceEvent(
        IResource resource,
        string resourceId,
        CustomResourceSnapshot snapshot)
    {
        // ...
    }
}
```

## Parameters

- `resource` ([IResource](/reference/api/csharp/aspire.hosting/iresource.md))
  The resource associated with the event.
- `resourceId` (`string`)
  The unique id of the resource.
- `snapshot` ([CustomResourceSnapshot](/reference/api/csharp/aspire.hosting/customresourcesnapshot.md))
  The snapshot of the resource state.
