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

Add "AsNoTracking" feature. (#71) #72

Merged
merged 1 commit into from
Jan 24, 2021
Merged

Add "AsNoTracking" feature. (#71) #72

merged 1 commit into from
Jan 24, 2021

Conversation

Clivar
Copy link
Contributor

@Clivar Clivar commented Jan 23, 2021

This PR provides AsNoTracking() as an extension for Query in a Specification.

The test itself is a bit tricky. Initially dbcontext tracks all entities as they are seeded. This requires me to fetch the record and detach it from the context first.

On EFCore5 this would be more easily done with dbcontext.ChangeTracker.Clear();

@fiseni
Copy link
Collaborator

fiseni commented Jan 24, 2021

Thanks @Clivar.
It looks nice and it can be merged.

@ardalis ardalis merged commit 46d4903 into ardalis:master Jan 24, 2021
@ardalis
Copy link
Owner

ardalis commented Jan 24, 2021

Thanks! I'll try and get a new release out soon. Maybe add an issue for a later release that depends on EF core 5 to add your different way of implementing it?

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.

None yet

3 participants