Class SubjectResolver

Namespace
Cratis.Chronicle
Assembly
Cratis.Chronicle.dll

Resolves a Subject from an event instance by looking for a property or constructor parameter decorated with SubjectAttribute.

public static class SubjectResolver
Inheritance
SubjectResolver
Inherited Members

Methods

ResolveFrom(object)

Attempt to derive a Subject from event by reading the value of the first property or constructor parameter decorated with SubjectAttribute.

public static Subject? ResolveFrom(object @event)

Parameters

event object

The event instance to inspect.

Returns

Subject

The resolved Subject when a marked property or constructor parameter is found and its value is non-null; otherwise null.