App.Core.Controllers.PostsController.Create C# (CSharp) Method

Create() public method

public Create ( Post post, int authorId ) : System.Web.Mvc.ActionResult
post Post
authorId int
return System.Web.Mvc.ActionResult
        public ActionResult Create(Post post, int authorId)
        {
            if (ModelState.IsValid) {
                post.Author = repository.Find<Account>(x => x.Id == authorId);
                repository.Save(post);
                return RedirectToAction("Index");
            }
            return RedirectToAction("New");
        }