Click here to Skip to main content
15,902,198 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to include child property of LINQ to SQL object? Pin
Mycroft Holmes15-Dec-11 18:48
professionalMycroft Holmes15-Dec-11 18:48 
QuestionCollections, plus collection of base type - concept Pin
DaveyM6915-Dec-11 9:16
professionalDaveyM6915-Dec-11 9:16 
AnswerRe: Collections, plus collection of base type - concept Pin
PIEBALDconsult15-Dec-11 9:34
mvePIEBALDconsult15-Dec-11 9:34 
GeneralRe: Collections, plus collection of base type - concept Pin
DaveyM6915-Dec-11 9:47
professionalDaveyM6915-Dec-11 9:47 
GeneralRe: Collections, plus collection of base type - concept Pin
PIEBALDconsult15-Dec-11 10:40
mvePIEBALDconsult15-Dec-11 10:40 
GeneralRe: Collections, plus collection of base type - concept Pin
DaveyM6915-Dec-11 11:27
professionalDaveyM6915-Dec-11 11:27 
GeneralRe: Collections, plus collection of base type - concept Pin
PIEBALDconsult15-Dec-11 11:51
mvePIEBALDconsult15-Dec-11 11:51 
GeneralRe: Collections, plus collection of base type - concept Pin
Luc Pattyn15-Dec-11 19:55
sitebuilderLuc Pattyn15-Dec-11 19:55 
An enumerator has a state ("where am I?") which must be saved somewhere. If its state is inside the collection itself, you probably can't have two independent iterators at once, so things like:
foreach(someType a in collection) {
    foreach (someType b in collection) {
        if (a!=b) doSomeThingTo(a,b);
    }
}

would fail. Having code accessing your collection from different threads through enumerators would fail too.

What I'm saying is, most of the time, IEnumerable (i.e. GetEnumerator) requires you to create a new enumerator each time. It is too bad they called it such, CreateEnumerator would have been the better choice.

Smile | :)

PS, FWIW: are you familiar with AsReadOnly?[^]
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: Collections, plus collection of base type - concept Pin
DaveyM6915-Dec-11 23:54
professionalDaveyM6915-Dec-11 23:54 
GeneralRe: Collections, plus collection of base type - concept Pin
BillWoodruff16-Dec-11 4:03
professionalBillWoodruff16-Dec-11 4:03 
GeneralRe: Collections, plus collection of base type - concept Pin
DaveyM6916-Dec-11 14:20
professionalDaveyM6916-Dec-11 14:20 
GeneralRe: Collections, plus collection of base type - concept Pin
BillWoodruff16-Dec-11 18:19
professionalBillWoodruff16-Dec-11 18:19 
AnswerRe: executive summary Pin
Luc Pattyn17-Dec-11 2:23
sitebuilderLuc Pattyn17-Dec-11 2:23 
GeneralRe: Collections, plus collection of base type - concept Pin
DaveyM6917-Dec-11 2:15
professionalDaveyM6917-Dec-11 2:15 
AnswerRe: Collections, plus collection of base type - concept Pin
Luc Pattyn17-Dec-11 2:32
sitebuilderLuc Pattyn17-Dec-11 2:32 
GeneralRe: Collections, plus collection of base type - concept Pin
Luc Pattyn17-Dec-11 2:42
sitebuilderLuc Pattyn17-Dec-11 2:42 
AnswerRe: Collections, plus collection of base type - concept Pin
Luc Pattyn17-Dec-11 2:48
sitebuilderLuc Pattyn17-Dec-11 2:48 
GeneralRe: Collections, plus collection of base type - concept Pin
DaveyM6917-Dec-11 3:10
professionalDaveyM6917-Dec-11 3:10 
AnswerRe: Collections, plus collection of base type - concept Pin
Luc Pattyn17-Dec-11 3:50
sitebuilderLuc Pattyn17-Dec-11 3:50 
AnswerRe: Collections, plus collection of base type - concept Pin
BillWoodruff16-Dec-11 20:48
professionalBillWoodruff16-Dec-11 20:48 
QuestionBoundColumns Not Working Pin
AmbiguousName15-Dec-11 6:45
AmbiguousName15-Dec-11 6:45 
AnswerRe: BoundColumns Not Working Pin
PIEBALDconsult15-Dec-11 7:02
mvePIEBALDconsult15-Dec-11 7:02 
AnswerRe: BoundColumns Not Working Pin
SilimSayo15-Dec-11 13:34
SilimSayo15-Dec-11 13:34 
QuestionC# help? Pin
Brian Reiber15-Dec-11 5:50
Brian Reiber15-Dec-11 5:50 
AnswerRe: C# help? Pin
Paladin200015-Dec-11 6:14
Paladin200015-Dec-11 6:14 

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.