示例#1
0
        public void Upsert(ObjectId categoryId, ObjectId[] productIds)
        {
            var ranking = GetByCategoryId(categoryId);
            if (ranking == null) {
                ranking = new RatioRanking();
                ranking.CategoryId = categoryId;
            }
            ranking.ProductIds = productIds;
            ranking.UpdateTime = DateTime.Now;

            Collection.Save(ranking);
        }
示例#2
0
        public void Upsert(ObjectId categoryId, ObjectId[] productIds)
        {
            var ranking = GetByCategoryId(categoryId);

            if (ranking == null)
            {
                ranking            = new RatioRanking();
                ranking.CategoryId = categoryId;
            }
            ranking.ProductIds = productIds;
            ranking.UpdateTime = DateTime.Now;

            Collection.Save(ranking);
        }