Click here to Skip to main content
15,914,111 members
Home / Discussions / C#
   

C#

 
QuestionEager loading question Pin
Member 93644551-Aug-16 21:53
Member 93644551-Aug-16 21:53 
AnswerRe: Eager loading question Pin
Nathan Minier2-Aug-16 2:58
professionalNathan Minier2-Aug-16 2:58 
A lot of the time this is based on the serializer that you're using. JSON.NET, for instance, will do this automatically when serializing an IQueryable. Depending on your serialization strategy, you may need to roll your own.

If you need to work with it in intermediate logic, any queryable references will be resolved automatically as long as is not disposed when you attempt to call them. Just don't force enumeration on the collection until you actually need the data item.

Something like
C#
var b = context.As.SelectMany(a => a.Bs); //flattens our multi-dimensional array
var c = PerformSomeLogicOnEnumerable(b);
return c.ToArray();
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli

AnswerRe: Eager loading question Pin
Agent__0073-Aug-16 18:52
professionalAgent__0073-Aug-16 18:52 
Question.. Pin
Daniyaltjm1-Aug-16 20:49
Daniyaltjm1-Aug-16 20:49 
AnswerRe: check the password wi-fi in c# Pin
Richard MacCutchan1-Aug-16 22:11
mveRichard MacCutchan1-Aug-16 22:11 
General... Pin
Daniyaltjm1-Aug-16 22:14
Daniyaltjm1-Aug-16 22:14 
GeneralRe: check the password wi-fi in c# Pin
OriginalGriff1-Aug-16 22:41
mveOriginalGriff1-Aug-16 22:41 
GeneralMessage Closed Pin
1-Aug-16 22:46
Daniyaltjm1-Aug-16 22:46 
GeneralRe: check the password wi-fi in c# Pin
OriginalGriff1-Aug-16 22:50
mveOriginalGriff1-Aug-16 22:50 
GeneralMessage Closed Pin
1-Aug-16 23:05
Daniyaltjm1-Aug-16 23:05 
GeneralRe: check the password wi-fi in c# Pin
Pete O'Hanlon2-Aug-16 0:34
mvePete O'Hanlon2-Aug-16 0:34 
GeneralRe: check the password wi-fi in c# Pin
Richard MacCutchan1-Aug-16 23:03
mveRichard MacCutchan1-Aug-16 23:03 
GeneralMessage Closed Pin
1-Aug-16 23:11
Daniyaltjm1-Aug-16 23:11 
GeneralRe: check the password wi-fi in c# Pin
Richard MacCutchan1-Aug-16 23:19
mveRichard MacCutchan1-Aug-16 23:19 
GeneralRe: check the password wi-fi in c# Pin
Daniyaltjm1-Aug-16 23:38
Daniyaltjm1-Aug-16 23:38 
GeneralRe: check the password wi-fi in c# Pin
Richard MacCutchan2-Aug-16 0:36
mveRichard MacCutchan2-Aug-16 0:36 
GeneralRe: check the password wi-fi in c# Pin
Daniyaltjm2-Aug-16 1:04
Daniyaltjm2-Aug-16 1:04 
JokeRe: check the password wi-fi in c# Pin
Richard MacCutchan2-Aug-16 1:09
mveRichard MacCutchan2-Aug-16 1:09 
GeneralRe: check the password wi-fi in c# Pin
Daniyaltjm2-Aug-16 3:21
Daniyaltjm2-Aug-16 3:21 
GeneralRe: check the password wi-fi in c# Pin
Pete O'Hanlon2-Aug-16 1:44
mvePete O'Hanlon2-Aug-16 1:44 
Generalhow to group the controls in to single component. Pin
Member 126599261-Aug-16 18:42
Member 126599261-Aug-16 18:42 
GeneralRe: how to group the controls in to single component. Pin
OriginalGriff1-Aug-16 20:23
mveOriginalGriff1-Aug-16 20:23 
GeneralRe: how to group the controls in to single component. Pin
BillWoodruff2-Aug-16 2:18
professionalBillWoodruff2-Aug-16 2:18 
GeneralRe: how to group the controls in to single component. Pin
Member 126599262-Aug-16 2:22
Member 126599262-Aug-16 2:22 
QuestionOffice 2016-Like Help for .NET application Pin
Jassim Rahma1-Aug-16 11:18
Jassim Rahma1-Aug-16 11:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.