public async Task <DeleteBlogOutput> DeleteBlogAsync(DeleteBlogInput input)
        {
            if (input.Id == 0)
            {
                throw new UserFriendlyException("خطا در دریافت اطلاعات");
            }

            var pc = _blogRepo.GetAll()
                     .SingleOrDefault(p => p.Id == input.Id);

            if (pc == null)
            {
                throw new UserFriendlyException("آیتم مورد نظر وجود ندارد ویا حذف شده است !!!");
            }


            _blogRepo.Delete(pc);

            return(new DeleteBlogOutput());
        }
예제 #2
0
 public async Task Delete(DeleteBlogInput input)
 {
     await _manager.Delete(input.Id);
 }
예제 #3
0
 public async Task DeleteBlog(DeleteBlogInput input)
 {
     var blog = _blogRepository.Get(input.Id.Value);
     await _blogRepository.DeleteAsync(blog);
 }