public IActionResult Get(int id) { if (!categoryValidator.ValidateExistence(id)) { return(new NotFoundResult()); } return(new OkObjectResult(categoryRepository.Get(id))); }
public bool ValidateAdd(NoteCreateUpdateDto note) { return(note.Text != null && note.CategoryId > 0 && categoryValidator.ValidateExistence(note.CategoryId)); }