コード例 #1
0
ファイル: BlogManager.cs プロジェクト: erolaksoy/blog-app-mvc
        public async Task AddToCategoryAsync(CategoryBlogDto categoryBlogDto)
        {
            var control = await _categoryBlogDal.GetAsync(x => x.CategoryId == categoryBlogDto.CategoryId && x.BlogId == categoryBlogDto.BlogId);

            if (control == null)
            {
                await _categoryBlogDal.InsertAsync(new CategoryBlog
                {
                    BlogId     = categoryBlogDto.BlogId,
                    CategoryId = categoryBlogDto.CategoryId
                });
            }
        }
コード例 #2
0
 public async Task InsertAsync(T entity)
 {
     await _genericDal.InsertAsync(entity);
 }