Fabrice's weblog

Tools and Source

News


Read sample chapters or buy LINQ in Action now!
Our LINQ book is also available on AMAZON

.NET jobs

Emplois .NET

The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer. The content of this weblog is independent from Microsoft or any other company. transatlantys hot news

Contact

Me

Others

Selected content

Browse by Tags

All Tags » Source (RSS)
Great fluent interface sample: the fluent repeater
I'm not that much a fan of fluent interfaces , but in some cases they are well fit. A great example is the fluent repeater created by Adrian Aisemberg. It's also a good example if you don't know what a fluent interface is. Here is sample code that uses...
To var or not to var
C# 3.0 and VB.NET 9.0 introduced implicit typing. When you use anonymous types, it's required. The rest of the time, it's mostly a judgment call to decide whether to use implicitly-typed local variables or not. An interesting discussion is going on about...
LINQ in Action is for VB developers too
A frequent question we get about our LINQ book is whether it's been written for C# developers only. If you think so, you're making a mistake. We cover both C# and VB.NET in the book. This is one big difference with competing books. Even if not all code...
Randomizing LINQ to SQL queries
Yesterday, a developer asked in the LINQ in Action forum and in Microsoft's official LINQ forum how to write a LINQ to SQL query that would return random records from the database. It's not something built-in. There is no Random query operator provided...
Rethrowing exceptions and preserving the full call stack trace
Did you know that depending on the way you rethrow exceptions you may lose important information? There are already several blog posts that explain and demonstrate the difference between throw and throw ex . I'm realizing only now that none of the two...
Hunting down bad try..catch blocks
Way too often developers take the easy solution to use try..catch blocks to silence and ignore exceptions. There are two things to do when you see this happening: Explain the developers why it's a bad practice (exceptions are costly and their use should...
ISBN-13 to ISBN-10
If for some reason you need to convert an ISBN-13 to ISBN-10 (one being that Amazon doesn't support ISBN-13 in product affiliate links) then you need not only to remove the first three characters. You also need to recompute the checksum. Here is a piece...
Use the power of let in your LINQ queries
Often, when you try to find out how to write the correct LINQ query you need, you end up being confused because it becomes too complex. In such situations, you should remember that the let clause is here to help you. Let's see is an example from the official...
PageMethods is now open source
I've been quiet lately about PageMethods because other projects kept me busy and contrarily to what I wished, I haven't been able to create PageMethods Pro last year. Considering the facts that other important projects will continue to keep me...
Exception handling and resource protection with try..finally
Paul Sheriff has just published an example he uses to recommend the use of try..finally blocks. Here is his example: private void CreateLogFile() { try { StreamWriter sw = new StreamWriter(@"D:\Samples\Test.txt", true, System.Text.UTF8Encoding...
More Posts Next page »