How to generate LINQ to SQL Mapping

June 22, 2010 11:25 by bryan

You may or may not have come across the ability within LINQ to SQL to have mapping to and from your own objects.

Microsoft has a mapping builder called sqlmetal, which is a code generation tool to generate the mapping automatically.

Here is a sample command line to generate the mapping file.

1
sqlmetal /server:. /database:mydb /map:mydbMappings.xml /code:code.dbml