public IActionResult CreateMarkedPost([FromBody] MarkedPostCreateOrUpdateModel model) { if (model == null) { return(BadRequest()); } var post = Mapper.Map <MarkedPost>(model); _dataService.CreateMarkedPost(post); return(CreatedAtRoute(nameof(GetMarkedPost), new { id = post.Id, notes = post.Notes }, Mapper.Map <MarkedPostModel>(post))); }
public IActionResult UpdateMarkedPost(int id, [FromBody] MarkedPostCreateOrUpdateModel model) { if (model == null) { return(BadRequest()); } var post = _dataService.GetMarkedPost(id); if (post == null) { return(NotFound()); } Mapper.Map(model, post); _dataService.UpdateMarkedPost(post); return(NoContent()); }