tags:

views:

23

answers:

2

Hi,

I have a database that has primary key fields in its tables, but the FK mappings are not in place.

What are the ramifications of this when using linq-to-sql?

A: 

You won't be able to use the generator to create your LINQ-to-SQL classes - or rather you can, but they won't have any associations in them. However, I do not think that it actually cares about FK, so if you write the classes yourself, or modify the generated classes, to use EntitySet properties with [Association] attributes as described in MSDN, you shouldn't have any problems.

Pavel Minaev
+1  A: 

FK Mappings? You mean FK Constraints...

Without FK Constraints, you are allowed to create orphan'd data. You can create an Order child) for which there is no Customer (parent).

David B