//
        // GET: /Comments/Create
        public ActionResult Create()
        {
            var vm = new CreateCommentViewModel();

            // Dropdown list to choose the Post for this Comment
            vm.CreateEntire = true;
            vm.PossiblePosts = unitOfWork.PostRepository
                                            .All
                                            .ToList();

            // Comment for the form
            vm.Comment = new Comment();
            vm.Comment.Posted = DateTime.Now;
            vm.Comment.Post = new Post();

            return View(vm);
        }
        public ActionResult Create(CreateCommentViewModel vm)
        {
            if (ModelState.IsValid) {
                vm.Comment.Posted = DateTime.Now;
                unitOfWork.CommentRepository.InsertOrUpdate(vm.Comment);
                unitOfWork.CommentRepository.Save();
                string url = "/../Posts/Details/" + vm.Comment.PostId;

                return RedirectToAction(url);
            } else {
                // Dropdown list to choose the Post for this Comment
                vm.CreateEntire = true;
                vm.PossiblePosts = unitOfWork.PostRepository
                                                .All
                                                .ToList();

                // Comment for the form
                vm.Comment = new Comment();
                vm.Comment.Posted = DateTime.Now;
                vm.Comment.Post = new Post();

                return View(vm);
            }
        }