public ActionResult Create( [Bind(Include = "Title,Body,SelectedArea,SelectedLocale,SelectedCategory,SelectedSubcategory")] PostViewModel post) { try { if (ModelState.IsValid) { var postType = PostTypesOps.GetPostTypeById(int.Parse(post.SelectedSubcategory)); var location = LocationOps.GetLocationById(int.Parse(post.SelectedLocale)); UserPost.CreatePost(User.Identity.GetUserId(), post.Title, post.Body, post.SelectedCategory, postType.SubCategory, post.SelectedArea, location.Locale); return(RedirectToAction("Index")); } return(View(post)); } catch (Exception e) { Console.WriteLine(e); throw; } }