Пример #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);
        }