Skip to content

CHR0059: Self reducer lifecycle hook signature must match allowed signatures

A self-reducing read model can declare the optional static replay hooks BeginReplay, EndReplay, BeginReplayPartition and EndReplayPartition. Each hook must be unique, public static, non-generic and return Task. Its parameters must be ordinary parameters without modifiers such as ref or out.

The two Partition hooks take Partition as the first parameter. Every other parameter is a service, so it must be a class or interface type other than the read model, Partition, EventContext or an event type.

The rule reports each hook that breaks one of these requirements, and every overload when a hook name is declared more than once.

Error

Declare each hook once as public static Task. Keep Partition as the first parameter of the partition hooks, and limit the remaining parameters to services.