Foreign Key Duplicate Entry Linqconnect MYSQL
Posted: Tue 11 Jan 2011 17:08
Hello,
I have recently purchased Linqconnect for mysql. The problem I am having is when I have a table with a foreign key relationship. And I insert an item on the first table, it inserts on the second table as well.
for instance.
In this scenario, the catagory is inserted along with the product. I just want the product inserted and the catagory just a reference for the foreign key id.
Can anyone help me with this?
Thank you!
I have recently purchased Linqconnect for mysql. The problem I am having is when I have a table with a foreign key relationship. And I insert an item on the first table, it inserts on the second table as well.
for instance.
Code: Select all
var query = from c in db.catagories
select c;
Catagory someCatagory = query.First();
Product p = new Product();
p.catagory = someCatagory;
db.Products.InsertOnSubmit(p);
db.SubmitChanges();
Can anyone help me with this?
Thank you!