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)); }
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); }