コード例 #1
0
ファイル: SolutionService.cs プロジェクト: nayutalienx/cloudj
        /// <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();
        }
コード例 #2
0
        public async Task <IActionResult> DeleteCategory(RemoveCategoryDto dto)
        {
            await _solutionApiClient.RemoveCategoryAsync(dto);

            return(Redirect("addCategory"));
        }
コード例 #3
0
 public Task <ApiResponse> RemoveCategoryAsync(RemoveCategoryDto dto)
 {
     return(DeleteAsync <RemoveCategoryDto, ApiResponse>(_clientOptions.DeleteCategoryUrl, dto));
 }
コード例 #4
0
        public async Task <IActionResult> DeleteCategoryAsync([FromBody] RemoveCategoryDto category)
        {
            await _solutionService.RemoveCategoryAsync(category);

            return(ApiResult("Deleted."));
        }