Click here to Skip to main content
15,891,607 members

Comments by Riz Thon (Top 5 by date)

Riz Thon 24-Oct-11 20:47pm View    
Deleted
In case some don't know, the result will not be 100% the same:
- in the 1st case you end up with a List<Student> which is created at once
- in the 2nd case you end up with a IEnumerable<Student> which will be evaluated once you iterate it.
As for me I don't like the SQL way of writing, I prefer students.Where(...).
Also if you do students.Where(s => s.Grade > 9).ToList() you'll end up with exactly the same as in the 1st case.
Riz Thon 22-Aug-11 23:12pm View    
Deleted
Why is getting a IEnumerable<t> removing the limitations? Does it mean that calling AsEnumerable makes it not using Linq2WMI afterwards but Linq To Object? (sorry if my question sounds stupid, I never really thought of how a Linq provider is implemented).
Riz Thon 20-Jun-11 22:18pm View    
Deleted
Interesting extension method, especially for simple things like updating some text. You can write the call like this:
txtOutput.ThreadSafeCall(() => txtOutput.Text = "Updated");
Riz Thon 13-Jun-11 21:08pm View    
Deleted
Compute once and for all which "string" and "string[]" you'll have to use before the "foreach", then inside your "foreach" you'll just have
int index = CharsToReplace.IndexOf(c);
if (index < 0)
sb.Append(c);
else
sb.Append(NewStrings[index]);
Riz Thon 24-May-11 2:22am View    
Deleted
It's true that it'll be slower as you're creating a delegate. As for me I'd just declare a local variable like you (maybe it's because I haven't use VB.Net so I'm not used to have the "with" keyword).