private static bool TryGetInt16Key(IReadOnlyKeyValueCollection parameters, out Int16Key key) { if (parameters.TryGet("Type", out string type) && parameters.TryGet("ID", out short id)) { key = Int16Key.Create(id, type); return(true); } key = null; return(false); }
public static Int16Key FindInt16KeyWithoutType(this KeyToParametersConverter converter, IReadOnlyKeyValueCollection parameters, string keyType) { Ensure.NotNull(converter, "converter"); Int16Key key; if (converter.TryGetWithoutType(parameters, keyType, out key)) { return(key); } return(Int16Key.Empty(keyType)); }