KeyValue AsKeyValue(MemberInfo member, object value) { var propertyDescription = _typeDescription.KeyByName(member.Name); var keyInfo = new KeyInfo(propertyDescription.KeyDataType, propertyDescription.KeyType, propertyDescription.Name, propertyDescription.IsOrdered); if (keyInfo.KeyType == KeyType.None) { throw new NotSupportedException( $"Property {member.Name} of type {member.DeclaringType?.Name} is not an index"); } return(keyInfo.Value(value)); }