Skip to content

Compiled Query and Clean Architecture #846

Answered by crazyfx1
gokujax asked this question in Q&A
Discussion options

You must be logged in to vote

You could either create a Get method in the IApplicationDbContext which fetches the data using a compiled query in the ApplicationDbContext implementation.

Or you could create a method / property in the IApplicationDbContext which returns the already instantiated compiled query enumerable.
In ApplicationDbContext:

public IEnumerable<TodoItem> TodoItemQuery => CompiledQuery(this);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gokujax
Comment options

Answer selected by gokujax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants