How could the driver surface the connection string dictionary keys and their metadata? #2196
Replies: 3 comments 6 replies
-
Why are you trying to avoid using reflection/TypeDescriptor? That would be the natural way to do something like this. |
Beta Was this translation helpful? Give feedback.
-
There's a performance overhead to invoking property getters and setters through reflection instead of just setting the values directly through IDictionary. There's no way I know of to map the C# property name to the correct dictionary key; I don't think every C# property name is a synonym for its corresponding dictionary key. If the property names are indeed all synonyms for the dictionary then it's not as bad as I thought. There's a general concern about wanting to use the least specific set of interfaces for interop between components. Some code might want to pass the |
Beta Was this translation helpful? Give feedback.
-
I'm trying to move more of our code to be runnable in JIT-free environments. I know SqlClient itself is a long way from being AoT friendly, but there's no reason to add to the debt. |
Beta Was this translation helpful? Give feedback.
-
Today, the only way to get a description of a property one can use in the connection string is from the
TypeDescriptor
associated with each public property ofSqlConnectionStringBuilder
. Is that correct?I'd like to be able to work with the connection string builder purely through its IDictionary interface, for a few reasons:
For example - If I could enumerate the set of allowed keys in the dictionary, I can wrap the dictionary with an
ObservableDictionary
instance as the basis of a view model for a XAML UI. Having the associated metadata for each key would let me show the user the description of the property and enable aDataTemplate
approach to create an editor for each value. Whenever the driver adds a new property I wouldn't have to change the code of my connection editor.I understand such a UI would still want to special case a few properties to hide them or to have a specialized editing experience for certain groups of properties, but the general concept of programmatic discovery of semantics would still be valuable.
Beta Was this translation helpful? Give feedback.
All reactions