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); }
public KeyValueEntry PutKeyValueEntry(KeyValueEntry entry) => PutKeyValueEntry(entry.Type, entry.Key, entry.Value);