コード例 #1
0
ファイル: TagService.cs プロジェクト: Ngvanphong/Shop-online
        public void DeleteMultiNotUse()
        {
            var listProductTag = _productTagRepository.GetAll().Select(x => x.TagID);
            var listPostTag    = _postTagRepository.GetAll().Select(x => x.TagID);
            var listTag        = _tagRepository.GetAll().Select(x => x.ID);
            var listTagUse     = listProductTag.Union(listPostTag);
            var listTagNotUse  = listTag.Except(listTagUse);

            foreach (var item in listTagNotUse)
            {
                _tagRepository.DeleteMulti(x => x.ID == item);
            }
        }
コード例 #2
0
 public IEnumerable <PostTag> GetAll()
 {
     return(_postTagRepository.GetAll());
 }
コード例 #3
0
ファイル: PostTagService.cs プロジェクト: war-man/SmartPhone
 public IEnumerable <PostTag> GetAll()
 {
     return(_postTagRepository.GetAll(new string[] { "Tags", "Posts" }));
 }