-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Enable non-tracking for specific Entity #29719
Comments
Make it Keyless? |
@ErikEJ thank you for answering me!! But, If make it keyless, I lose the option to retrieve the record by its ID, using the Find methods. My entity
Generic method to check if the entity is Active
Below is the error when set entity to keyless
|
There's no particular reason to use Find if you're not going to involve change tracking (which doesn't make sense if the entities are read-only). You can simply query by the ID using |
Notes from triage: Read-only entities are tracked by #7586. We don't plan to make it possible to mark entities as no-tracking. |
Hi everyone!
I have a situation where I have an Entity that can do only ReadOnly queries against the database table... To avoid passing in all queries .AsNoTracking(), I'd like to know if is possible to configure that entity to never be tracked?
EF Core version: 6
Database provider: (e.g. Npgsql.EntityFrameworkCore.PostgreSQL)
Target framework: (e.g. .NET 6.0)
Operating system: Linux
IDE: (VsCode)
The text was updated successfully, but these errors were encountered: