コード例 #1
0
        public async Task RemoveFromCategoryAsync(CategoryBlogDto categoryBlogDto)
        {
            var deletedCategory = await _categoryDal.GetAsync(I => I.CategoryId == categoryBlogDto.CategoryId && I.BlogId == categoryBlogDto.BlogId);

            if (deletedCategory != null)
            {
                await _categoryDal.RemoveAsync(deletedCategory);
            }
        }
コード例 #2
0
        public async Task RemoveFromCategoryAsync(CategoryBlogDto categoryBlogDto)
        {
            var categoryBlog = await _categoryBlogService.GetAsync(p => p.CategoryId == categoryBlogDto.CategoryId && p.BlogId == categoryBlogDto.BlogId);

            if (categoryBlog != null)
            {
                await _categoryBlogService.RemoveAsync(categoryBlog);
            }
        }
コード例 #3
0
        public async Task RemoveFromCategory(CategoryActivityDto categoryActivityDto)
        {
            var check = await _categoryActivityDal.GetByFilter(I => I.CategoryId
                                                               == categoryActivityDto.CategoryId && I.ActivityId
                                                               == categoryActivityDto.ActivityId);

            if (check != null)
            {
                await _categoryActivityDal.RemoveAsync(check);
            }
        }
コード例 #4
0
ファイル: TopicManager.cs プロジェクト: kemalyuksel/Blog-App
        public async Task RemoveFromCategoryAsync(CategoryTopicDto categoryTopicDto)
        {
            var deletedCategoryTopic = await _categoryTopicService.GetAsync
                                           (x => x.CategoryId == categoryTopicDto.CategoryId &&
                                           x.TopicId == categoryTopicDto.TopicId);

            if (deletedCategoryTopic != null)
            {
                await _categoryTopicService.RemoveAsync(deletedCategoryTopic);
            }
        }
コード例 #5
0
 public async Task RemoveAsync(TEntity entity)
 {
     await _genericDal.RemoveAsync(entity);
 }
コード例 #6
0
        public async Task <IActionResult> Delete(int id)
        {
            await _genericDal.RemoveAsync(new Category { Id = id });

            return(RedirectToAction("Index"));
        }