public void Delete()
{
using (CarrotCMSDataContext _db = CarrotCMSDataContext.GetDataContext()) {
carrot_ContentCategory s = CompiledQueries.cqGetContentCategoryByID(_db, this.ContentCategoryID);
if (s != null) {
IQueryable<carrot_CategoryContentMapping> lst = (from m in _db.carrot_CategoryContentMappings
where m.ContentCategoryID == s.ContentCategoryID
select m);
_db.carrot_CategoryContentMappings.BatchDelete(lst);
_db.carrot_ContentCategories.DeleteOnSubmit(s);
_db.SubmitChanges();
}
}
}