/// <summary> /// Удаление категории /// </summary> /// <param name="dto"></param> /// <returns></returns> public async Task RemoveCategoryAsync(RemoveCategoryDto dto) { var cat = await _categoryRepository.GetAsync(dto.Id); await _categoryRepository.RemoveAsync(cat); await _categoryRepository.SaveChangesAsync(); }
public async Task <IActionResult> DeleteCategory(RemoveCategoryDto dto) { await _solutionApiClient.RemoveCategoryAsync(dto); return(Redirect("addCategory")); }
public Task <ApiResponse> RemoveCategoryAsync(RemoveCategoryDto dto) { return(DeleteAsync <RemoveCategoryDto, ApiResponse>(_clientOptions.DeleteCategoryUrl, dto)); }
public async Task <IActionResult> DeleteCategoryAsync([FromBody] RemoveCategoryDto category) { await _solutionService.RemoveCategoryAsync(category); return(ApiResult("Deleted.")); }