I have a Linq to Sql Model generated by VS ORD, but I want to make a changes to it to work around a couple of issues. I can change the designer.cs
generated code , but if I ever need to recreate a table within the model, then I delete it and drag it back to the ORD. This however loses all of my customisations. Is there another way?
I have seen reference to sqlMetal.exe, but not sure how I would use this to get around the issue.
For information my customisations are as follows:
- I am using
Guid
's and want the db to default these values, therefore I want to change the default linqtosl behaviour to add the attribute[Column(IsDbGenerated= true)]
to the ID properties. - the Default Model Binding for MVC is not working for a collection (
EntitySet<T>
). To work around this I need to change the setter for these collections slightly.
Neither of these changes are particularly big, but my database could change considerably over time, and I need to remember to do each customisation each time.