I have two objects ( Foo and Bar ) that have a one to zero or one relationship between them. Thus, Foo has a link to a NULL reference to Bar.ID and a unique ( nullbusted ) unique index to force the use of side "1". Bar.ID is an int, and therefore Foo.BarID is a null int.
The problem occurs when matching DBML LINQ-to-SQL .NET types with SQL data types. Since int not a null type in .NET, it terminates in a Nullable<int> . However, this is not the same type as int , so Visual Studio gives me this error message when I try to create the OneToOne Association between them:
Unable to create association "Bar_Foo". Properties do not have the appropriate types: "ID", "BarID".
Is there any way around this?
source share