0

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?

Illidan
  • 4,047
  • 3
  • 39
  • 49
  • 1
    Well, you could just project to a slimmed down version of the entity, but then you lose some nice features such as change tracking and the fact that it's an entity – Vlad274 Nov 06 '15 at 18:26
  • if you're willing to do some work to change the database, [this answer](http://stackoverflow.com/questions/3274241/entity-framework-4-selective-lazy-loading-properties) describes how to use two tables for the same entity – DrewJordan Nov 06 '15 at 19:05

1 Answers1

2

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

Illidan
  • 4,047
  • 3
  • 39
  • 49