Hi all, I've just started using LINQ to SQL on a project with SQL CE and I have a fairly simple entity model with an inheritance hierarchy to deal with. I realise this has to follow the 'table per class hierarchy' approach and I've used SqlMetal to generate the DBML file which contains a single type for my inheritance hierarchy that corresponds to the single table in the database.
I've also used VS2010's designer to modify the DBML file to suit my desired hierarchy and this all works well. The main benefit I can see with this approach is that the DBML file can be easily regenerated if I make changes to the database schema, but doing so loses the customisations I've made in the designer - i.e. the class hierarchy, some renaming and access modifier changes. I don't like the idea of having to re-do this stuff manually if I regenerate the DBML file in the future. Is there a simple way to handle this that I've missed? Should I just manage the DBML file manually without regenerating it? - Maybe generate a new DBML file and diff this against the modified one and propagate the changes manually? Should I get SqlMetal to generate code (or an external mapping file) instead of the DBML file? Cheers, Matt.
