DCSIMG

 Subscribe in a reader

LINQ To XSD - Alpha 0.2 - Guy kolbis
Sunday, August 10, 2008 1:33 PM kolbis

LINQ To XSD - Alpha 0.2

Microsoft had released an Alpha 0.2 for supporting LINQ To XSD.

The LINQ to XSD technology provides .NET developers with support for typed XML programming.

LINQ to XSD contributes to the LINQ project (.NET Language Integrated Query).

What does it look like?

To get an idea, consider the following C#3.0 fragment for a LINQ to XML query that computes the total over the items in a XML tree for a purchase order:

(
    from   item in purchaseOrder.Elements("Item")
    select (double)item.Element("Price")
    *      (int)item.Element("Quantity")
).Sum();

Using LINQ to XSD, .NET developers may instead write `typed’ code as follows:

(
    from item in purchaseOrder.Item
    select item.Price * item.Quantity
 ).Sum();

Hit me with more info please...

LINQ to XSD is the code name of an incubation project that aims to provide .NET developers with support for typed XML programming on top of LINQ to XML. While the LINQ to XML programmer operates on generic XML trees, the LINQ to XSD programmer operates on typed XML trees -- instances of .NET types that model the XML types of a specific XML schema (XSD).

LINQ to XSD can be used whenever you have an XML schema available, or you are willing to infer a schema from the XML data at hand.

LINQ to XSD is integrated into Visual Studio; so you just tag an XML schema as an ‘LINQ to XSD schema’, build your project, and the automatically derived object model is then part of your solution -- just as if XML schemas were .NET types. The derived object model enforces various validation constraints imposed by the underlying XML schema.

Let me try it...

You can download the Alpha 0.2 here.

תגים:,

תוכן התגובה

אין תגובות

שלח תגובה

(שדה חובה) 
(שדה חובה) 
(אופציונלי)
(שדה חובה) 

Enter the numbers above: