Archive for the ‘basics’ Category

XElement and friends

System.Linq.Xml - The XML object model for Linq
XElement is the basic building block (or element) of an XML document in the System.Linq.Xml world. It is, after all, just an XML element. Using XElement, the most basic XML document can be formed with this:
PLAIN TEXT

XElement doc = new XElement("DocumentRoot");

This will give you a document that [...]

Immediate Window - A forgotten tool

A tool that is integrated into Visual Studio that people often forget about is the Immediate Window. The Immediate Window will allow you to evaluate expressions while debugging. For example, rather than using the visual tool to examine the item within a collection, you can just issue a command in the Immediate Window. Such as:

Intellisense [...]

Basics - Anonymous Types outside the scope of Linq

Some basics.
Anonymous types are an important new feature that allow, at compile time, for the type information for a variable be dropped by the developer. For example:

1: var x = 128;

Line 1 declares the variable x as a variable having an anonymous type using the var keyword. At this point, nothing [...]

The most basic Xml reader using Linq and XElement

So, Linq is supposed to be the future. At least that's what they say. I'll admit, I like it. Right now, I care about how to do stuff with it. There is a lot of great theory out there on the net about it so I really encourage anyone who wants to use Linq [...]