예제 #1
0
        private bool SetUser(IUser user, string mainKey)
        {
            var lookupByUserName = String.Format(keyPattern, user.UserName);

            return(db.StoreJson(StoreMode.Set, lookupByUserName, mainKey) &&
                   db.StoreJson(StoreMode.Set, mainKey, user));
        }
예제 #2
0
        public IProduct Set(IProduct product)
        {
            if (db.StoreJson(StoreMode.Set, String.Format(keyPattern, product.Uid), product))
            {
                return(Get(product.Uid));
            }

            throw new Exception(locale.ProductSetFailure);
        }