public void UpdateFromDto(EntryDto dto) { Title = dto.Title; Tags = dto.Tags; Body = dto.Body; Update(); }
public async Task <IActionResult> UpdateEntry(int id, [FromBody] EntryDto dto) { if (ModelState.IsValid) { var result = await _service.Update(id, dto); if (result != null) { return(Ok(result)); } return(BadRequest(new { Message = "Unable to update entry" })); } return(BadRequest(ModelState)); }