コード例 #1
0
        public CategoryCollection GetMainCategories()
        {
            CategoryCollection categories = new CategoryCollection();
            PredicateExpression filter = new PredicateExpression();
            filter.Add(new FieldCompareNullPredicate(CategoryFields.BaseCategoryId));
            categories.GetMulti(filter);

            return categories;
        }
コード例 #2
0
        public CategoryCollection GetMainCategories()
        {
            CategoryCollection  categories = new CategoryCollection();
            PredicateExpression filter     = new PredicateExpression();

            filter.Add(new FieldCompareNullPredicate(CategoryFields.BaseCategoryId));
            categories.GetMulti(filter);

            return(categories);
        }
コード例 #3
0
        public CategoryCollection GetSubCategories(int mainCatId)
        {
            CategoryCollection  subCategories = new CategoryCollection();
            PredicateExpression filter        = new PredicateExpression();
            IPrefetchPath       prefetchPath  = new PrefetchPath((int)EntityType.CategoryEntity);

            prefetchPath.Add(CategoryEntity.PrefetchPathCategories);
            filter.Add(CategoryFields.BaseCategoryId == mainCatId);
            subCategories.GetMulti(filter, prefetchPath);

            return(subCategories);
        }
コード例 #4
0
        public IList<Category> GetByAccount(long accountId, ref IAuctionTransaction trans)
        {
            using (var records = new CategoryCollection())
            {
                var filter = new PredicateExpression(CategoryFields.AccountId == accountId);

                if (trans != null)
                {
                    trans.Add(records);
                }
                records.GetMulti(filter, 0);
                return records.ToList().Select(c => new Category() { Id = c.Id, Name = c.Name, AccountId = c.AccountId }).ToList();
            }
        }
コード例 #5
0
        public Category Get(long Id, ref IAuctionTransaction trans)
        {
            using (var records = new CategoryCollection())
            {
                var filter = new PredicateExpression(CategoryFields.Id == Id);

                if (trans != null)
                {
                    trans.Add(records);
                }
                records.GetMulti(filter, 1);
                var c = records.ToList().FirstOrDefault();
                return new Category() { Id = c.Id, Name = c.Name, AccountId =  c.AccountId};
            }
        }
コード例 #6
0
        public CategoryCollection GetSubCategories(int mainCatId)
        {
            CategoryCollection subCategories = new CategoryCollection();
            PredicateExpression filter = new PredicateExpression();
            IPrefetchPath prefetchPath = new PrefetchPath((int)EntityType.CategoryEntity);
            prefetchPath.Add(CategoryEntity.PrefetchPathCategories);
            filter.Add(CategoryFields.BaseCategoryId == mainCatId);
            subCategories.GetMulti(filter, prefetchPath);

            return subCategories;
        }