In this post we will extend the query functionality to handle stored procedures with parameters. To do this we need to create a new query type interface with an example implementation:
Now that we have the ability to create stored procedure queries we need something to handle them. To do this we need a concrete implementation of the interface "IHandleAQuery":
Finally we update our factory to handle the new query interface and return the correct handler:
This can now be called using the following code; which should highlight the power of this repository pattern. Whilst we have implemented quite a lot of code behind the scenes the only change the consumer sees is what type of query object they are passing in.