protected bool Set <TObject>(string uniqueKey, TObject @object) where TObject : class { if (string.IsNullOrWhiteSpace(uniqueKey) || uniqueKey.Length > UniqueKeyMaxLength) { return(false); } var value = new Value { JsonValue = JsonConvert.SerializeObject(@object) }; bool result = _values.Set(value); if (result) { result = _keyIdPairs.Set(uniqueKey, value.Id); } return(result); }
public void Execute(SetValueCommandContext commandContext) { _repository.Set(commandContext.Key, commandContext.Value); }