# PersistenceAnnotation

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/PersistenceAnnotation.cs)
- Implements: [IResourceAnnotation](/reference/api/csharp/aspire.hosting/iresourceannotation.md)

Annotation that controls the persistence behavior of a resource.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class PersistenceAnnotation
    : Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
    // ...
}
```

## Constructors

- [PersistenceAnnotation](/reference/api/csharp/aspire.hosting/persistenceannotation/constructors.md#constructor)

## Properties

- [Mode](/reference/api/csharp/aspire.hosting/persistenceannotation/properties.md#mode) : [PersistenceMode](/reference/api/csharp/aspire.hosting/persistencemode.md) `get; set` -- Gets or sets the persistence mode.
- [ParentProcessId](/reference/api/csharp/aspire.hosting/persistenceannotation/properties.md#parentprocessid) : `int?` `get; set` -- Gets or sets the parent process ID when [PersistenceAnnotation.Mode](/reference/api/csharp/aspire.hosting/persistenceannotation/properties.md#mode) is [PersistenceMode.ParentProcess](/reference/api/csharp/aspire.hosting/persistencemode/fields.md).
- [ParentProcessTimestamp](/reference/api/csharp/aspire.hosting/persistenceannotation/properties.md#parentprocesstimestamp) : `DateTime?` `get; set` -- Gets or sets the parent process identity timestamp when [PersistenceAnnotation.Mode](/reference/api/csharp/aspire.hosting/persistenceannotation/properties.md#mode) is [PersistenceMode.ParentProcess](/reference/api/csharp/aspire.hosting/persistencemode/fields.md).
- [SourceResource](/reference/api/csharp/aspire.hosting/persistenceannotation/properties.md#sourceresource) : [IResource?](/reference/api/csharp/aspire.hosting/iresource.md) `get; set` -- Gets or sets the source resource when [PersistenceAnnotation.Mode](/reference/api/csharp/aspire.hosting/persistenceannotation/properties.md#mode) is [PersistenceMode.Resource](/reference/api/csharp/aspire.hosting/persistencemode/fields.md).
