ironcev / Pragmatic

[The description is yet to come]
5 stars 3 forks source link

Missing handler registration for GetByIdQuery : IQuery<Option<object>> standard query #19

Closed mroncev closed 9 years ago

mroncev commented 9 years ago

Can you please add handler for GetByIdQuery (the option object version) to the list of standard definitions. Currently, if you try something like this:

QueryExecutor.GetById(entityType, id)

the following error is thrown:

error

Thank you!

ironcev commented 9 years ago

Marin, thanks for pointing out the bug!

The problem was in the registration of the standard handler which was missing. There is a new method added to the StandardInteractionHandlerRegistration class called RegisterStandardNonGenericGetByIdQueryHandler. Just add a call to it below the call for the RegisterStandardInteractionHandlersForEntities method and provide the typeof(GetByIdQueryHandler) as the argument.

A new NuGet package is published for the Pragmatic.StructureMap. Just download it and the method will be available.

Unfortunately, there are not real automated tests in Pragmatic right now so I cannot guarantee that this actually works :-( but I assume it should. Please let me know if you face any additional issues.

mroncev commented 9 years ago

It is working fine.

Thank you for the quick fix!