コード例 #1
0
        public async Task AddCategoryToBlog(BlogCategoryDto blogCategoryDto)
        {
            var categoryToAddToBlog = await blogCategoryDal.GetByFilter(I => I.CategoryId == blogCategoryDto.CategoryId &&
                                                                        I.BlogId == blogCategoryDto.BlogId);

            if (categoryToAddToBlog == null)
            {
                await blogCategoryDal.Create(new BlogCategory { BlogId = blogCategoryDto.BlogId, CategoryId = blogCategoryDto.CategoryId });
            }
        }
コード例 #2
0
 public void Create(T entity)
 {
     _genericDal.Create(entity);
 }
コード例 #3
0
 public async Task Create(T entity)
 {
     await genericDal.Create(entity);
 }