The_Cthulhu_Kid
The_Cthulhu_Kid

Reputation: 1859

Selecting all but one property using LINQ/Entity Framework

I am using Entity Framework as part of a project that should allow students and trainers to up- and download files and directories.

In order to show the documents I make a call to the db:

public static ObjectSet<Document> doc = frmFocus._context.Documents;

But this delivers all the properties including the actual data of the files. What I would like to do is retrieve only those that are relevant to the listview until the files to download have been selected.

Is this possible? I haven't been able to find a way.

Upvotes: 1

Views: 1124

Answers (1)

StrubT
StrubT

Reputation: 1028

You can mark the content property to be loaded deferred.

You can easily achieve this using the designer.

Or you can of course directly edit the XML by adding the attribute IsDelayLoaded="true" to the column element.

Upvotes: 2

Related Questions