Hooking up create BlogPost and some other service changes to make sure getting posts is scoped to Blog.

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042128
This commit is contained in:
ErikPorter
2009-11-25 01:34:23 +00:00
parent 8bd6e8acf4
commit 24656896da
17 changed files with 194 additions and 29 deletions

View File

@@ -4,6 +4,7 @@ using Orchard.Blogs.Extensions;
using Orchard.Blogs.Models;
using Orchard.Blogs.Services;
using Orchard.Blogs.ViewModels;
using Orchard.Core.Common.Models;
using Orchard.Data;
using Orchard.Localization;
using Orchard.Models;
@@ -56,13 +57,13 @@ namespace Orchard.Blogs.Controllers {
if (!ModelState.IsValid)
return View(model);
Blog blog = _blogService.CreateBlog(model.ToCreateBlogParams());
Blog blog = _blogService.Create(model.ToCreateBlogParams());
//TEMP: (erikpo) ensure information has committed for this record
var session = _sessionLocator.For(typeof(BlogRecord));
session.Flush();
return Redirect(Url.BlogEdit(model.Slug));
return Redirect(Url.BlogEdit(blog.As<RoutableAspect>().Slug));
}
public ActionResult Edit(string blogSlug) {