Exemple #1
0
        public IActionResult Get(int id)
        {
            if (!categoryValidator.ValidateExistence(id))
            {
                return(new NotFoundResult());
            }

            return(new OkObjectResult(categoryRepository.Get(id)));
        }
Exemple #2
0
 public bool ValidateAdd(NoteCreateUpdateDto note)
 {
     return(note.Text != null && note.CategoryId > 0 && categoryValidator.ValidateExistence(note.CategoryId));
 }