deleteallonsubmit

Linq and DeleteAllOnSubmit pain

The following code loads a gig, clears out the gigs acts collection and then adds a new act. Data.LinqToSQL.Gig dbGig = DBContext.Gigs.Where(x => x.ID == myGigID).SingleOrDefault(); //Remove all references to the current acts if(dbGig.Acts!=null) { DBContext.Acts.DeleteAllOnSubmit(dbG...

C# Linq Delete over Join

Hello, I have a Question table which joins to a Solution table. The solutions are linked to the questions but in order to delete a question, i must delete the solutions for that question first and then delete the question itself. I have a linq query that retrieves all solutions for a specified question however i am unsure how to proceed...

Linq2SQL: DeleteAllOnSubmit discriminates entities being re-added?

Hi All, Encountering some weird behaviour with Linq: Situation: I have a many to many relationship between two entities: UserProfile and BusinessUnit (joined in UserProfile_BusinessUnit table). Using a ListBox, a user can multi-select BusinessUnits a UserProfile belongs to. When UPDATING the record, I call: dataContext.UserProfile_B...