❔ EF core large field slows the entire query down
I have some entities with some large json strings in them. The problem now is that they always get loaded, even if i don't use them. So my endpoint that is just supposed to return some basic information about like 50 objects now takes 300ms on average. Is there a way to mark a property as "not included with normal queries unless specifically requested"?
7 Replies
don't return the entity, and return a dto that doesn't contain that property if the endpoint doesn't need it?
That's what i am doing already
But the field is still in the query string for some reason
well what does the code look like that is retrieving the entity.
It's calling
myIqueryable.Select(x => MyDto.FromDb(x))
And the fromdb method maps the entity to the dtothats probably the issue, EF isn't going to translate that method, it will just call it once it comes back
hm well i want to avoid redundancy and i definitely wont map 15 props manually
automapper maybe then
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.