BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News LINQ to XSD is Back

LINQ to XSD is Back

Like LINQ to XML, LINQ to XSD is a provider for querying XML data. But unlike the former, LINQ to XSD is designed to be type safe. As the name implies, it used XSD files to generate strongly typed classes.

LINQ to XSD is especially important to C# developers who currently have to sprinkle their XML code with type casts. (VB developers can side step this with Option Strict Off.) An example of this can be seen in Fabrice's weblog:

//LINQ to XML
from item in purchaseOrder.Elements("Item")
select (double)item.Element("Price") * (int)item.Element("Quantity")

//LINQ to XSD
from item in purchaseOrder.Item
select item.Price * item.Quantity

LINQ to XSD was last available for VS 2008 Beta 1, a version that was incompatible with later betas.

Rate this Article

Adoption
Style

BT