Exemple #1
0
 public Entry(EntryCreationDto entry)
 {
     Title     = entry.Title;
     Tags      = entry.Tags;
     Body      = entry.Body;
     JournalId = entry.JournalId;
 }
Exemple #2
0
        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));
        }