Esempio n. 1
0
        public KeyValueEntry GetKeyValueEntry(string type, string key)
        {
            var entry = conn.QueryFirstOrDefault <KeyValueEntry>("SELECT * FROM kvstore WHERE type=@Type AND key=@Key", new { Type = type, Key = key });

            if (entry != null)
            {
                entry.ExistedInDatabase = true;
                return(entry);
            }

            entry = new KeyValueEntry(type, key, null);
            entry.ExistedInDatabase = false;
            return(entry);
        }
Esempio n. 2
0
 public KeyValueEntry PutKeyValueEntry(KeyValueEntry entry)
 => PutKeyValueEntry(entry.Type, entry.Key, entry.Value);