BgEngine.Controllers.PostController.Create C# (CSharp) Method

Create() private method

private Create ( Post post, int selectedtags ) : System.Web.Mvc.ActionResult
post BgEngine.Domain.EntityModel.Post
selectedtags int
return System.Web.Mvc.ActionResult
        public ActionResult Create(Post post, int[] selectedtags)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    BlogServices.CreatePost(post, selectedtags);
                    return RedirectToAction("Index");
                }
                catch (ApplicationValidationErrorsException ex)
                {
                    foreach (string str in ex.ValidationErrors)
                    {
                        ModelState.AddModelError("", str);
                    }
                }
            }
            ViewBag.ImageId = new SelectList(ImageServices.FindAllEntities(null, null, null), "ImageId", "FileName", post.ImageId);
            ViewBag.CategoryId = new SelectList(CategoryServices.FindAllEntities(null, null, null), "CategoryId", "Name", post.CategoryId);
            ViewBag.UserId = new SelectList(UserServices.FindAllEntities(null, null, null), "UserId", "Username", post.UserId);
            ViewBag.Tags = TagServices.FindAllEntities(null, o => o.OrderBy(t => t.TagName), null).ToDictionary<Tag, int, string>(t => t.TagId, t => t.TagName);
            return View(post);
        }

Same methods

PostController::Create ( ) : System.Web.Mvc.ActionResult