public ActionResult Edit(EditContentTypeViewModel viewModel) { //TODO: Validation, etc. //TODO: BaseContentType var module = _reflectionContentManager.LoadModule(viewModel.ModuleName); module.AddContentType(viewModel.Name); _reflectionContentManager.Store(module); _reflectionContentManager.SaveChanges(); return(Redirect("/admin/module?modulename=" + viewModel.ModuleName)); }
public ActionResult Delete(string propertyFullName) { var contentTypeFullName = _reflectionContentManager.GetContentTypeFullNameFromPropertyFullName(propertyFullName); var contentType = _reflectionContentManager.LoadContentType(contentTypeFullName); if (contentType != null) { if (contentType.RemoveProperty(propertyFullName)) { _reflectionContentManager.Store(contentType.Module); _reflectionContentManager.SaveChanges(); } return(Redirect(new StringBuilder("/admin/contenttype") .AddQueryParam("contenttypefullname", contentTypeFullName).ToString())); } return(Redirect("/admin/modules")); }
public void SaveChanges() { _reflectionContentManager.SaveChanges(); }