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

Ignore specific property in a query #20747

Closed
steven62f opened this issue Apr 24, 2020 · 1 comment
Closed

Ignore specific property in a query #20747

steven62f opened this issue Apr 24, 2020 · 1 comment

Comments

@steven62f
Copy link

I have an entity with a byte[] property to store photo. This entity is referenced by many others entities. When I request these other entities, I often have to include the entity that contains the photo, but in the end, I don't care about this photo. It is only used in very specific cases.

On one of my requests, I recover more than 4 MB of data. I added the "NoMapped" attribute on the photo property and the data volume went down to 200 KB. Unfortunately, the "NotMapped" attribute is not suitable. In some cases, I have to recover the photo data.

It would be very useful, during a request, to be able to ignore the retrieval of specific properties.

Ex - Retrieve all persons, all properties excepts Photo :
_context.Persons.Ignore(p => p.Photo).ToListAsync()

Ex - Retrieve all persons and associated Invoices, excepts photo inside :
_context.Persons.Include(p => p.Invoices.Ignore(i => i.Photo)).ToListAsync()

@smitpatel
Copy link
Contributor

Duplicate of #1387

@smitpatel smitpatel marked this as a duplicate of #1387 Apr 24, 2020
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants