# JournaledGrain&lt;TGrainState, TEventBase&gt;.TransitionState(TGrainState, TEventBase)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.eventsourcing/orleans.eventsourcing.journaledgrain-2/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.eventsourcing/orleans.eventsourcing.journaledgrain-2/methods/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.EventSourcing/JournaledGrain.cs#L250-L253)

```csharp
protected virtual void JournaledGrain<TGrainState, TransitionState(TGrainState state, TEventBase @event)
```

Defines how to apply events to the state. Unless it is overridden in the subclass, it calls a dynamic "Apply" function on the state, with the event as a parameter. All exceptions thrown by this method are caught and logged by the log view provider. 

Override this to customize how to transition the state for a given event.

### Parameters

- `state` (`TGrainState`): The state.
- `event` (`TEventBase`): The event.
