# PersistenceAnnotation Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [PersistenceAnnotation](/reference/api/csharp/aspire.hosting/persistenceannotation.md)
- Kind: `Properties`
- Members: `4`

Annotation that controls the persistence behavior of a resource.

## Mode

- Name: `Mode`
- Modifiers: `get; set`
- Returns: [PersistenceMode](/reference/api/csharp/aspire.hosting/persistencemode.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/PersistenceAnnotation.cs)

Gets or sets the persistence mode.

```csharp
public PersistenceMode Mode { get; set; }
```

## ParentProcessId

- Name: `ParentProcessId`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/PersistenceAnnotation.cs)

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).

```csharp
public int? ParentProcessId { get; set; }
```

## ParentProcessTimestamp

- Name: `ParentProcessTimestamp`
- Modifiers: `nullable` `get; set`
- Returns: `DateTime?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/PersistenceAnnotation.cs)

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).

```csharp
public DateTime? ParentProcessTimestamp { get; set; }
```

## SourceResource

- Name: `SourceResource`
- Modifiers: `nullable` `get; set`
- Returns: [IResource?](/reference/api/csharp/aspire.hosting/iresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/PersistenceAnnotation.cs)

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).

```csharp
public IResource? SourceResource { get; set; }
```
