1.
Create two table. Items and Category.
The table Items has a foreign-key to Category that can be nullable.
Example: Item.CategoryId that maps to Category.Id
The association is one-to-many. DataType: Int32
2.
Create the relative DBML file with the association:
Table Items
<Association Name="Category_Item" Member="Category" ThisKey="CategoryId"
OtherKey="Id" Type="Category" IsForeignKey="true" />
Table Category
<Association Name="Category_Item" Member="Items" ThisKey="Id"
OtherKey="CategoryId" Type="Item" />
and generate the source code file.
3. Execute a simple query like this:
var items = from i in db.Items
select new
{
i.Id,
i.Category
};
When the query is executed i get a InvalidOperationException: "nullable
object must have a value".
I'm using DbLinq-0.20.1.
Original issue reported on code.google.com by Bon...@gmail.com on 28 Apr 2010 at 10:42
Original issue reported on code.google.com by
Bon...@gmail.com
on 28 Apr 2010 at 10:42