# GrainReminderExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.reminders/orleans.grainreminderextensions/)

## GetReminder(Grain, string) {#getreminder-this-orleans-grain-string-7f2d49f0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders/orleans.grainreminderextensions/methods/getreminder-this-orleans-grain-string-7f2d49f0/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Reminders/GrainReminderExtensions.cs)

```csharp
public static Task<IGrainReminder?> GetReminder(this Grain grain, string reminderName)
```

Returns a previously registered reminder.

### Parameters

- `grain` (`Grain`): The grain instance.
- `reminderName` (`string`): Reminder to return

### Returns

Promise for Reminder handle.

## GetReminder(IGrainBase, string) {#getreminder-this-orleans-igrainbase-string-d8e34efe}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders/orleans.grainreminderextensions/methods/getreminder-this-orleans-igrainbase-string-d8e34efe/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Reminders/GrainReminderExtensions.cs)

```csharp
public static Task<IGrainReminder?> GetReminder(this IGrainBase grain, string reminderName)
```

Returns a previously registered reminder.

### Parameters

- `grain` (`IGrainBase`): A grain.
- `reminderName` (`string`): Reminder to return

### Returns

Promise for Reminder handle.

## GetReminders(Grain) {#getreminders-this-orleans-grain-38acda5a}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders/orleans.grainreminderextensions/methods/getreminders-this-orleans-grain-38acda5a/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Reminders/GrainReminderExtensions.cs)

```csharp
public static Task<List<IGrainReminder>> GetReminders(this Grain grain)
```

Returns a list of all reminders registered by the grain.

### Parameters

- `grain` (`Grain`)

### Returns

Promise for list of Reminders registered for this grain.

## GetReminders(IGrainBase) {#getreminders-this-orleans-igrainbase-472ff948}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders/orleans.grainreminderextensions/methods/getreminders-this-orleans-igrainbase-472ff948/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Reminders/GrainReminderExtensions.cs)

```csharp
public static Task<List<IGrainReminder>> GetReminders(this IGrainBase grain)
```

Returns a list of all reminders registered by the grain.

### Parameters

- `grain` (`IGrainBase`)

### Returns

Promise for list of Reminders registered for this grain.

## RegisterOrUpdateReminder(Grain, string, TimeSpan, TimeSpan) {#registerorupdatereminder-this-orleans-grain-string-system-timespan-system-timesp-d11e0c96}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders/orleans.grainreminderextensions/methods/registerorupdatereminder-this-orleans-grain-string-system-timespan-system-timesp-d11e0c96/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Reminders/GrainReminderExtensions.cs)

```csharp
public static Task<IGrainReminder> RegisterOrUpdateReminder(this Grain grain, string reminderName, TimeSpan dueTime, TimeSpan period)
```

Registers a persistent, reliable reminder to send regular notifications (reminders) to the grain. The grain must implement the `Orleans.IRemindable` interface, and reminders for this grain will be sent to the `ReceiveReminder` callback method. If the current grain is deactivated when the timer fires, a new activation of this grain will be created to receive this reminder. If an existing reminder with the same name already exists, that reminder will be overwritten with this new reminder. Reminders will always be received by one activation of this grain, even if multiple activations exist for this grain.

### Parameters

- `grain` (`Grain`): The grain instance.
- `reminderName` (`string`): Name of this reminder
- `dueTime` (`TimeSpan`): Due time for this reminder
- `period` (`TimeSpan`): Frequency period for this reminder

### Returns

Promise for Reminder handle.

## RegisterOrUpdateReminder(IGrainBase, string, TimeSpan, TimeSpan) {#registerorupdatereminder-this-orleans-igrainbase-string-system-timespan-system-t-d8a6f830}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders/orleans.grainreminderextensions/methods/registerorupdatereminder-this-orleans-igrainbase-string-system-timespan-system-t-d8a6f830/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Reminders/GrainReminderExtensions.cs)

```csharp
public static Task<IGrainReminder> RegisterOrUpdateReminder(this IGrainBase grain, string reminderName, TimeSpan dueTime, TimeSpan period)
```

Registers a persistent, reliable reminder to send regular notifications (reminders) to the grain. The grain must implement the `Orleans.IRemindable` interface, and reminders for this grain will be sent to the `ReceiveReminder` callback method. If the current grain is deactivated when the timer fires, a new activation of this grain will be created to receive this reminder. If an existing reminder with the same name already exists, that reminder will be overwritten with this new reminder. Reminders will always be received by one activation of this grain, even if multiple activations exist for this grain.

### Parameters

- `grain` (`IGrainBase`): The grain instance.
- `reminderName` (`string`): Name of this reminder
- `dueTime` (`TimeSpan`): Due time for this reminder
- `period` (`TimeSpan`): Frequency period for this reminder

### Returns

Promise for Reminder handle.

## UnregisterReminder(Grain, IGrainReminder) {#unregisterreminder-this-orleans-grain-orleans-runtime-igrainreminder-a7f3ee2f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders/orleans.grainreminderextensions/methods/unregisterreminder-this-orleans-grain-orleans-runtime-igrainreminder-a7f3ee2f/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Reminders/GrainReminderExtensions.cs)

```csharp
public static Task UnregisterReminder(this Grain grain, IGrainReminder reminder)
```

Unregisters a previously registered reminder.

### Parameters

- `grain` (`Grain`): The grain instance.
- `reminder` (`IGrainReminder`): Reminder to unregister.

### Returns

Completion promise for this operation.

## UnregisterReminder(IGrainBase, IGrainReminder) {#unregisterreminder-this-orleans-igrainbase-orleans-runtime-igrainreminder-524a7a67}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders/orleans.grainreminderextensions/methods/unregisterreminder-this-orleans-igrainbase-orleans-runtime-igrainreminder-524a7a67/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Reminders/GrainReminderExtensions.cs)

```csharp
public static Task UnregisterReminder(this IGrainBase grain, IGrainReminder reminder)
```

Unregisters a previously registered reminder.

### Parameters

- `grain` (`IGrainBase`): The grain instance.
- `reminder` (`IGrainReminder`): Reminder to unregister.

### Returns

Completion promise for this operation.
