title: Linq Delete over Join
body: <p>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.</p>
  
  <p>I have a linq query that retrieves all solutions for a specific question however I'm not sure how to proceed with the deletion of the solutions and then consequently proceed to delete the question.</p>
  
  <p>Here is the code, it recieves overload error messages:</p>
  
  <pre><code>public static void DeleteSol(string qTextInput)
  {
      ExamineDataContext dc = new ExamineDataContext();
      var matchedSol = from q in dc.Questions
                            where q.QuestionText.Contains(qTextInput)
                            join s in dc.Solutions
                            on q.QuestionID equals s.QuestionID
                            into qs // note grouping        
                            select new
                            {
                                solution = qs
                            };
      try
      {
          dc.Solutions.DeleteOnSubmit(matchedSol);
          dc.SubmitChanges();
      }
      catch (Exception ex)
      {
          throw ex;
      }
  }
  </code></pre>