예제 #1
0
        public async Task <IActionResult> UpdateCategory(int id, CategoryDto categoryDto)
        {
            Category category = await _repo.Find <Category>(id);

            if (category == null)
            {
                return(BadRequest("Category not found"));
            }

            category.Icon = categoryDto.Icon;

            await _repo.UpdateComponents(id, categoryDto);

            await _repo.SaveAllChangesAsync();

            return(Ok(category));
        }
예제 #2
0
        public async Task <IActionResult> GetComponent(int id)
        {
            var component = await _repo.Find <Component>(id);

            return(Ok(component));
        }
        public async Task <IActionResult> GetKind(int id)
        {
            var kind = await _repo.Find <Kind>(id);

            return(Ok(kind));
        }