Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify fails when event is cast into an interface #29

Open
patroza opened this issue May 29, 2014 · 0 comments
Open

Notify fails when event is cast into an interface #29

patroza opened this issue May 29, 2014 · 0 comments

Comments

@patroza
Copy link

patroza commented May 29, 2014

e.g:

var n = new Notification();
_mediator.Notify(n); // succeeds
_mediator.Notify((ISomeInterface) n); // fails

as it resolves to Notify<ISomeInterface>, which uses DependencyResolver.GetInstances<INotificationHandler<ISomeInterface>>()
which won't find the appropriate handlers.

I propose a similar usage through MediatorPlan instead, if I find time I will propose a pull request.

My problem is that I aggregate my IDomainEvents into an array, and then dispatch them, loosing the type info.

For now the workaround I use is_mediator.Notify((dynamic) n);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant