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

DI Should inject a factory not an instance #3

Open
misha130 opened this issue Mar 11, 2020 · 0 comments
Open

DI Should inject a factory not an instance #3

misha130 opened this issue Mar 11, 2020 · 0 comments

Comments

@misha130
Copy link
Owner

The problem:

Each time a user injects the instance and reuses it, it creates a build that continues to the second query.
For instance:
qb.Where(d => d.id == 1).ExecuteSingleAsync();
qb.ExecuteSingleAsync();

Both of these will return the same value because the where is carried on to the second query as well.

Possible solution:
qb should be a factory that only offers one Instance option which then can be manipulated.
Like so:

qb.Builder.Where(d => d.id == 1).ExecuteSingleAsync();
qb.Builder.ExecuteSingleAsync();

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