Skip to content

Adds QueryProcessor to separate queries from Controllers#106

Open
DevJonny wants to merge 2 commits intodevelopfrom
query_processor
Open

Adds QueryProcessor to separate queries from Controllers#106
DevJonny wants to merge 2 commits intodevelopfrom
query_processor

Conversation

@DevJonny
Copy link
Contributor

  • Adds IQueryProcessor and QueryProcessor to handle executing of all queries
  • Adds GetAllTeamsQuery and Handler to fetch Teams for the TeamsView

By separating out the queries from the controllers we should be able to start writing unit tests over the controllers and passing in a dummy query processor that we can check to see if a particular query was run when we needed it without having to run the query and set-up a KTContext etc.

I've used a simple static singleton to retrieve the QueryProcessor each time. Ideally we'd move this to an IoC container eventually. For now it serves it's possible.

Next step is to do something similar with the CommandHandlers so we don't need to pass in each one every time.

@DevJonny DevJonny requested a review from lacombet March 27, 2020 20:19
Copy link
Member

@jakemco jakemco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like it
s/gif/diff/

This is slick, I love it.

@DevJonny
Copy link
Contributor Author

Thanks @jakemco I'll fix the conflict manually later and rebase.

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

Successfully merging this pull request may close these issues.

2 participants