public IActionResult Edit([FromForm] ThoughtEditModel model) { var thought = model.Map <ThoughtModel>(); _thoughtService.Save(thought); return(RedirectToAction("All")); }
private ThoughtModel MapToModel(ThoughtEditModel model) { return(new ThoughtModel() { Id = Guid.NewGuid(), Title = model.Title, Body = model.Body, CreationDate = DateTime.Now }); }