An elegant way to write XML with Linq

While writing out some XML to a file I found a lot nicer way to write out XML while using Linq and the XStreamingElement. The key is to use the XStreamingElement with data from a Linq datasource like so :

The above code will create the xml below (if the data is formatted correctly).:

As an added bonus … Read More

Mike GriffithAn elegant way to write XML with Linq

Optimizing linq queries with .Any() instead of .Count()

If you have any linq code that looks like this:

Replace it with code that looks like this:

Basically you save time since linq doesn’t need to count each and every record in the collection.

Mike GriffithOptimizing linq queries with .Any() instead of .Count()