I have a set of SQL server views working as abstraction layer for an underlying table structure. The views are simple abstractions of the underlying tables (renaming of columns and tables) and it is in general possible to edit data using them.
Regardless if I import them in a LINQ to SQL data context or into the ADO.NET Entity Framework, the import process ignores details such as primary keys, identities or required fields of the underlying tables and generates the wrong code for data manipulations. I can repair this by editing the related properties in the designer, but a data structure update later and my changes are gone. I’m searching for a more maintainable method of doing this. Something like adding the missing key and type information to the views, giving LINQ the information to generate the appropriate code. Any recommendations?