コード例 #1
0
        public async Task AddToCategoryAsync(CategoryBlogDto categoryBlogDto)
        {
            var control = await _categoryDal.GetAsync(I => I.BlogId == categoryBlogDto.BlogId && I.CategoryId == categoryBlogDto.CategoryId);

            if (control == null)
            {
                await _categoryDal.AddAsync(new CategoryBlog { BlogId = categoryBlogDto.BlogId, CategoryId = categoryBlogDto.CategoryId });
            }
        }
コード例 #2
0
        public Task <AppUser> CheckUserAsync(AppUserLoginDto appUserLoginDto)
        {
            var appUser = _genericDal.GetAsync(p => p.UserName == appUserLoginDto.UserName && p.Password == appUserLoginDto.Password);

            if (appUser != null)
            {
                return(appUser);
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
        public async Task AddToCategoryAsync(CategoryBlogDto categoryBlogDto)
        {
            var addToCategory = await _categoryBlogDal.GetAsync(i => i.BlogId == categoryBlogDto.BlogId && i.CategoryId == categoryBlogDto.CategoryId);

            if (addToCategory == null)
            {
                await _categoryBlogDal.AddAsync(new CategoryBlog
                {
                    BlogId     = categoryBlogDto.BlogId,
                    CategoryId = categoryBlogDto.CategoryId
                });
            }
        }
コード例 #4
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
                });
            }
        }
コード例 #5
0
ファイル: TopicManager.cs プロジェクト: kemalyuksel/Blog-App
        public async Task AddToCategoryAsync(CategoryTopicDto categoryTopicDto)
        {
            var controlAddCategory = await _categoryTopicService.GetAsync
                                         (x => x.CategoryId == categoryTopicDto.CategoryId &&
                                         x.TopicId == categoryTopicDto.TopicId);

            if (controlAddCategory == null)
            {
                await _categoryTopicService.AddAsync(new CategoryTopic
                {
                    TopicId    = categoryTopicDto.TopicId,
                    CategoryId = categoryTopicDto.CategoryId
                });
            }
        }
コード例 #6
0
        public async Task AddToCategoryAsync(CategoryBlogDto categoryBlogDto)
        {
            var control = await _categoryBlogService.GetAsync(p => p.CategoryId == categoryBlogDto.CategoryId && p.BlogId == categoryBlogDto.BlogId);

            if (control == null)
            {
                await _categoryBlogService.AddAsync(
                    new CategoryBlog
                {
                    BlogId     = categoryBlogDto.BlogId,
                    CategoryId = categoryBlogDto.CategoryId
                }
                    );
            }
        }
コード例 #7
0
 public async Task <TEntity> GetAsync(Expression <Func <TEntity, bool> > filter)
 {
     return(await _genericDal.GetAsync(filter));
 }
コード例 #8
0
 public async Task <AppUser> CheckUserAsync(AppUserLoginDto appUserLoginDto)
 {
     return(await _genericDal.GetAsync(x => x.UserName == appUserLoginDto.UserName && x.Password == appUserLoginDto.Password));
 }
コード例 #9
0
 public async Task <AppUser> CheckUserAsync(AppUserSignInDto appUserSignInDto)
 {
     return(await _genericDal.GetAsync(I => I.UserName == appUserSignInDto.UserName && I.Password == appUserSignInDto.Password));
 }
コード例 #10
0
 public virtual Task <TEntity> GetAsync(Expression <Func <TEntity, bool> > expression)
 {
     return(_genericDal.GetAsync(expression));
 }