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

C#

 
GeneralRe: Printing two panels on a card back and front Pin
Luc Pattyn20-Jan-22 9:05
sitebuilderLuc Pattyn20-Jan-22 9:05 
GeneralRe: Printing two panels on a card back and front Pin
RobertSF20-Jan-22 11:09
professionalRobertSF20-Jan-22 11:09 
Generalbtn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Member 1356965020-Jan-22 4:31
Member 1356965020-Jan-22 4:31 
GeneralRe: btn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Dave Kreskowiak20-Jan-22 5:09
mveDave Kreskowiak20-Jan-22 5:09 
GeneralRe: btn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Member 1356965020-Jan-22 5:20
Member 1356965020-Jan-22 5:20 
GeneralRe: btn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Dave Kreskowiak20-Jan-22 9:42
mveDave Kreskowiak20-Jan-22 9:42 
GeneralRe: btn event async await rtb and tb overlap and switch between them by tb.show and tb.hide Pin
Member 1356965020-Jan-22 10:00
Member 1356965020-Jan-22 10:00 
QuestionExceptions Pin
Simon_Whale17-Jan-22 2:30
Simon_Whale17-Jan-22 2:30 
AnswerRe: Exceptions Pin
CHill6017-Jan-22 3:08
mveCHill6017-Jan-22 3:08 
GeneralRe: Exceptions Pin
Simon_Whale17-Jan-22 3:53
Simon_Whale17-Jan-22 3:53 
AnswerRe: Exceptions Pin
OriginalGriff17-Jan-22 3:41
mveOriginalGriff17-Jan-22 3:41 
GeneralRe: Exceptions Pin
Simon_Whale17-Jan-22 3:53
Simon_Whale17-Jan-22 3:53 
AnswerRe: Exceptions Pin
Luc Pattyn17-Jan-22 3:59
sitebuilderLuc Pattyn17-Jan-22 3:59 
QuestionRe: Exceptions Pin
Simon_Whale18-Jan-22 5:05
Simon_Whale18-Jan-22 5:05 
AnswerRe: Exceptions Pin
Gerry Schmitz17-Jan-22 6:07
mveGerry Schmitz17-Jan-22 6:07 
GeneralRe: Exceptions Pin
Simon_Whale18-Jan-22 5:06
Simon_Whale18-Jan-22 5:06 
AnswerRe: Exceptions Pin
lmoelleb18-Jan-22 4:55
lmoelleb18-Jan-22 4:55 
QuestionRe: Exceptions Pin
Eddy Vluggen18-Jan-22 19:32
professionalEddy Vluggen18-Jan-22 19:32 
AnswerRe: Exceptions Pin
lmoelleb18-Jan-22 20:40
lmoelleb18-Jan-22 20:40 
GeneralRe: Exceptions Pin
Eddy Vluggen19-Jan-22 0:40
professionalEddy Vluggen19-Jan-22 0:40 
GeneralRe: Exceptions Pin
lmoelleb19-Jan-22 0:48
lmoelleb19-Jan-22 0:48 
GeneralRe: Exceptions Pin
Eddy Vluggen19-Jan-22 1:12
professionalEddy Vluggen19-Jan-22 1:12 
AnswerRe: Exceptions Pin
Eddy Vluggen18-Jan-22 18:02
professionalEddy Vluggen18-Jan-22 18:02 
AnswerRe: Exceptions Pin
jschell23-Jan-22 7:32
jschell23-Jan-22 7:32 
Questionnecessity to use .Any() to check if an IEnumerable<T> result has no items without iterating over it ? Pin
BillWoodruff16-Jan-22 2:39
professionalBillWoodruff16-Jan-22 2:39 
C# >= 4

Curious to know if you've had to deal with the issues described here.

1) assume you have a generic method of Type T

2) in that method a Func<IEnumerable<T>, IEnumerable<T>> is called on an IEnumerable of T

3) the result of calling the func is in a variable 'temp ... when you examine 'temp in the Command Window at run-time after hitting a break-point:
> ? temp
{System.Linq.Enumerable.WhereListIterator<int>}
    Current: 0
    Results View: Expanding the Results View will enumerate the IEnumerable
> ? temp == null
false
> ? temp == default
false
> ? temp is null
false
> ? temp.Any()
false
> ? temp.Count()
0
4) in the case where the Func call results in no content (no items)

4a) you want to evaluate whether 'temp has any "items" ... i.e., has a Count of #0 (as shown above)

4b) but, you do not want to trigger iteration/enumeration of 'temp by calling Count()

I have read that .Any() will not cause iteration in this very interesting SO thread: [^].

And, on the same thread: [^]: is mention of a new C#6 Linq function 'TryGetNonEnumeratedCount
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch

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.