mdf /dbml:
Deserts.dbml
We can also use this:
Sqlmetal /dbml:deserts.dbml c:\demo\Deserts.mdf
The same entity objects created above can also be created in XML format. The
command for that is as follows:
sqlmetal /server:.\SQLExpress /database:c:\demo\Deserts.mdf /pluralize
/namespace:Deserts /code:Deserts.xml
LINQ to SQL
[ 120 ]
This code will produce an XML file containing all the entity objects. The output of
this would look like this:
Either class file or XML which is generated by the tool may not have proper names
for the classes which we might want to rename or modify for better understanding.
This cannot be done directly while creating classes. To achieve this, we have to first
generate the XML file. In the XML file we can modify or annotate it with a class and
property attribute to modify the attributes of tables and columns. After doing this,
we can use this modified XML file to generate the object model. This can be done
using the following command:
SqlMetal /namespace:Deserts /code:Deserts.
Pages:
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200