public async Task <ActionResult <CategoryDto> > CreateCategory([FromBody] CategoryDto categoryDto) { if (categoryDto == null) { return(BadRequest("Category data must be set!")); } try { CategoryDto created = await _service.CreateCategoryAsync(categoryDto); return(Ok(created)); } catch (Exception e) { return(Conflict(e.Message)); } }