Esempio n. 1
0
        public async Task AddToCategoryAsync(CategoryBlogDTO categoryBlogDTO)
        {
            var categoryBlog = await _categoryBlogDAL.GetAsync(x =>
                                                               x.BlogId == categoryBlogDTO.BlogId &&
                                                               x.CategoryId == categoryBlogDTO.CategoryId);

            if (categoryBlog == null)
            {
                await _categoryBlogDAL.AddAsync(
                    new CategoryBlog
                {
                    BlogId     = categoryBlogDTO.BlogId,
                    CategoryId = categoryBlogDTO.CategoryId
                });
            }
        }
Esempio n. 2
0
 public async Task AddAsync(TEntity entity)
 {
     await _genericDal.AddAsync(entity);
 }