Added all the infrastructure for deleting Blogs and BlogPosts.

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043102
This commit is contained in:
ErikPorter
2009-12-03 19:50:57 +00:00
parent 9136b28f5d
commit a13df76497
9 changed files with 93 additions and 2 deletions

View File

@@ -116,6 +116,21 @@ namespace Orchard.Blogs.Controllers {
return Redirect(Url.BlogsForAdmin());
}
[HttpPost]
public ActionResult Delete(string blogSlug) {
//TODO: (erikpo) Move looking up the current blog up into a modelbinder
Blog blog = _blogService.Get(blogSlug);
if (blog == null)
return new NotFoundResult();
_blogService.Delete(blog);
_notifier.Information(T("Blog was successfully deleted"));
return Redirect(Url.Blogs());
}
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
return TryUpdateModel(model, prefix, includeProperties, excludeProperties);
}