public ActionResult Edit(int id)
        {
            var model = new CreatePostViewModel();
            var post = _service.GetPost(id);
            model.Author = post.Author;
            model.Content = post.Content;
            model.Title = post.Title;
            model.UpdateMe = true;

            return View("Create", model);
        }
        public ActionResult Create(CreatePostViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (model.UpdateMe)
                    _service.EditPost(new Post { Author = model.Author, Title = model.Title, Content = model.Content });
                else
                    _service.CreatePost(new Post { Author = model.Author, Title = model.Title, Content = model.Content, CreatedOn = DateTime.UtcNow });
                return RedirectToAction("Index");
            }

            return View(model);
        }
 public ActionResult Create()
 {
     var model = new CreatePostViewModel();
     return View(model);
 }