How do i update a foreign key column back to null?
On insert or update i use this:
getCategory = _db.Categories.Find(id);
Events.Categories = getCategory; //add foreign key
But if the category is 0 (not selected) i want to update the relationship Category_ID back to null.
Try to do it like that:
Events.Categories = null; //add foreign key
But it doesn't seems to work
Please advise
Thanks
Loading
navePosted Oct 21, 2013, 6:43 AM
So is there a way to delete the relationship?
Please advise
Thanks
Sandeep Singh ShekhawatPosted Oct 21, 2013, 6:03 AM
Thanks,
Sandeep