Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/proj/CommonDomain.Core/RegistrationEventRouter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace CommonDomain.Core
public class RegistrationEventRouter : IRouteEvents
{
private readonly IDictionary<Type, Action<object>> handlers = new Dictionary<Type, Action<object>>();
private IAggregate regsitered;
private IAggregate registered;

public virtual void Register<T>(Action<T> handler)
{
Expand All @@ -17,15 +17,15 @@ public virtual void Register(IAggregate aggregate)
if (aggregate == null)
throw new ArgumentNullException("aggregate");

this.regsitered = aggregate;
this.registered = aggregate;
}

public virtual void Dispatch(object eventMessage)
{
Action<object> handler;

if (!this.handlers.TryGetValue(eventMessage.GetType(), out handler))
this.regsitered.ThrowHandlerNotFound(eventMessage);
this.registered.ThrowHandlerNotFound(eventMessage);

handler(eventMessage);
}
Expand Down