Illidan
Illidan

Reputation: 4237

Entity Framework - exclude loading of specific property

I using Entity Framework 6, Code First. I have a data entity with several properties. One of this properties is string property named "Indexing".

The only use of "Indexing" property is to help find specific entities based on given keywords. I running Full Text Search query and looking for entities with specific keys in their "Indexing" property. Usually "Indexing" is a large bunch of text, describing various aspect of entity. After I find entity, I have no use of "Indexing" anymore.

Right now when I executing my "where" query, the entity is loaded and it including "Indexing" property loaded as well. This is a waste, since I really have no reason to load all this text from database and bring it to server.

Question: How I can use "Indexing" property for search, but to avoid bringing this data to server?

Upvotes: 0

Views: 579

Answers (1)

Illidan
Illidan

Reputation: 4237

Actually that was a dumb question, I realized it right after Vlad274 comment. Simple "Select" does exactly what I needed...

Upvotes: 2

Related Questions