public IActionResult Create(Post post) { if (ModelState.IsValid) return View(post); post.PostedDate = DateTime.Now; post.Author = User.Identity.Name; return View(); }
public IActionResult Post(long id) { var post = new Post(); post.Title = "My Blog Post"; post.PostedDate = DateTime.Now; post.Author = "Martin Benes"; post.Body = "This is my first post"; return View(post); }