public Entry(EntryCreationDto entry) { Title = entry.Title; Tags = entry.Tags; Body = entry.Body; JournalId = entry.JournalId; }
public async Task <IActionResult> AddEntry(EntryCreationDto dto) { if (ModelState.IsValid) { var result = await _service.Add(dto); if (result != null) { return(Ok(result)); } return(BadRequest(new { Message = "Unable to add entry" })); } return(BadRequest(ModelState)); }