I have table called "Categories"
Which has a relationship with this table
How can I for a example delete the "ForumTest" category and all the threads related to it in the second table?
EDIT: This is my current code that only works with categories without relationships
[HttpPost]
public ActionResult DeleteCategory(int? id)
{
Category category = db.Categories.Find(id);
db.Threads.RemoveRange(category.Threads);
db.Categories.Remove(category);
db.SaveChanges();
return RedirectToAction("Categories");
}