Let's say I have a list of items, which each can reference a list of documents (and other stuff).
In Entity Framework
I can get the list like that:
var items = context.Items
.Include(i => i.Documents)
.Include(i => i.OtherProperty)
.ToList()
Now this includes all columns from documents. Is it possible to exclude one of these columns (eg. the "Data"-column which stores the complete document as binary)?
Something like this:
var items = context.Items
.Include(i => i.Documents)
.ButExclude(d => d.Data)
.Include(i => i.OtherProperty)
.ToList()
I know that I could use .Select() and create an object without the data property, but since I use a lot of foreign keys I would rather like to use includes.
I also know that it is better to separate the document's metadata from the actual content, but well... I haven't...