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); } }
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); } }
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); } }
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); } }
public async Task RemoveAsync(TEntity entity) { await _genericDal.RemoveAsync(entity); }
public async Task <IActionResult> Delete(int id) { await _genericDal.RemoveAsync(new Category { Id = id }); return(RedirectToAction("Index")); }