J
Jakob Lithner
I have a SQL-2005 database with 50 tables that I map to C# code with a
Linq-to-SQL dbml file. I have done it many times and it always work fine.
But this time I was surprised to to find out that some of the database
relations failed to turn up as code associations!!!
All tables in database have proper relations defined with foreign key.
They all turn up nicely in the dbml GUI.
But two of them are NOT implemented in code generation .....!!
I have compared them in detail with all other relations in database and dbml
GUI but find no strange difference anywhere.
- They are defined on int columns on both ends
- Cardinality OneToMany
- Child Property=True, Access=Public, Name defined
- Parent Property Access=Public, Name defined
- Unique= False
Tables are named: Person, Role and Person_Role
I have stumbled on situations where table names in database were identical
with reserved names in code. On those occassions I have changed entity names
in dbml. Just to be sure I switched names this time also but with no
difference.
I use VS2008 SP1 with Framework 3.5 SP1.
Linq-to-SQL dbml file. I have done it many times and it always work fine.
But this time I was surprised to to find out that some of the database
relations failed to turn up as code associations!!!
All tables in database have proper relations defined with foreign key.
They all turn up nicely in the dbml GUI.
But two of them are NOT implemented in code generation .....!!
I have compared them in detail with all other relations in database and dbml
GUI but find no strange difference anywhere.
- They are defined on int columns on both ends
- Cardinality OneToMany
- Child Property=True, Access=Public, Name defined
- Parent Property Access=Public, Name defined
- Unique= False
Tables are named: Person, Role and Person_Role
I have stumbled on situations where table names in database were identical
with reserved names in code. On those occassions I have changed entity names
in dbml. Just to be sure I switched names this time also but with no
difference.
I use VS2008 SP1 with Framework 3.5 SP1.