The following example is based on LINQ to XSD,
Preview Alpha 2.0 with Visual Studio Beta 1.
LINQ to XSD
[ 160 ]
Using the New Project option, create a LINQ to XSD Console Application.
Using the Add New Item dialog, select the option to create an XML file under the
project. If you have an XML file already, add it to the project using Add Existing
Item option or copy-paste the contents of the available XML into the new XML file
that is added to the project.
Chapter 6
[ 161 ]
Similarly add the XML schema file to the project. After adding the schema file, copy
the schema content given in the typed XML section into the file.
Now we have an XML file and an XML schema file, but we need a tool to generate
an object model for the schema. Open the Properties window of the XML schema
file and select LinqToXsdSchema under Build Action. This is to instruct the tool to
consider the schema file in its build process.
LINQ to XSD
[ 162 ]
The object model for the XML schema will get generated only after the build process.
Pages:
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251