# IGrainMigrationParticipant Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igrainmigrationparticipant/)

## OnDehydrate(IDehydrationContext) {#ondehydrate-orleans-runtime-idehydrationcontext-ebadaf50}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igrainmigrationparticipant/methods/ondehydrate-orleans-runtime-idehydrationcontext-ebadaf50/)

```csharp
public abstract void OnDehydrate(IDehydrationContext dehydrationContext)
```

Called on the original activation when migration is initiated, after [IGrainBase](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.igrainbase/) completes. The participant can access and update the dehydration context.

### Parameters

- `dehydrationContext` (`IDehydrationContext`): The dehydration context.

## OnRehydrate(IRehydrationContext) {#onrehydrate-orleans-runtime-irehydrationcontext-8fe871fe}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igrainmigrationparticipant/methods/onrehydrate-orleans-runtime-irehydrationcontext-8fe871fe/)

```csharp
public abstract void OnRehydrate(IRehydrationContext rehydrationContext)
```

Called on the new activation after a migration, before [IGrainBase](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.igrainbase/) is called. The participant can restore state from the migration context.

### Parameters

- `rehydrationContext` (`IRehydrationContext`): The rehydration context.
