public void Save()
{
using (CarrotCMSDataContext _db = CarrotCMSDataContext.GetDataContext()) {
bool bNew = false;
carrot_ContentCategory s = CompiledQueries.cqGetContentCategoryByID(_db, this.ContentCategoryID);
if (s == null || (s != null && s.ContentCategoryID == Guid.Empty)) {
s = new carrot_ContentCategory();
s.ContentCategoryID = Guid.NewGuid();
s.SiteID = this.SiteID;
bNew = true;
}
s.CategorySlug = ContentPageHelper.ScrubSlug(this.CategorySlug);
s.CategoryText = this.CategoryText;
s.IsPublic = this.IsPublic;
if (bNew) {
_db.carrot_ContentCategories.InsertOnSubmit(s);
}
_db.SubmitChanges();
this.ContentCategoryID = s.ContentCategoryID;
}
}