tags:

views:

113

answers:

1

I'm planning to write an tool which would import dbml file and spit out an MDL file for migration purposes and such. To do this, I obviously have to read this dbml file into some kind of semantic model to do transformations.

I tried to use XmlMappingSource, but first it failed because it expects the XML namespace of a file to be http://schemas.microsoft.com/linqtosql/mapping/2007, whereas I had http://schemas.microsoft.com/linqtosql/dbml/2007. After I changed the namespace to read .../mapping/2007, XmlMappingSource started to complain about all kinds of unrecognized attributes.

Is there any object model to represent the structure of a dbml file?

A: 

Being no expert, but having had somewhat of the same problem...

When validating dbml files, XmlMappingSource uses (I think...at least close ;-)
DbmlSchema.xsd, so perhaps either tamper with the existing one, or make you own mappingsource?

This article may help (or may not...not quite sure I get your question)

Morten Bergfall