-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET Core provider: Selecting only empty label key-values is unclear. #6
Comments
This is because we load everything by default and while we put them in a dictionary, the last one wins. Don't Yes, we should have predefined Do we like to have a helper function below too? public AzconfigOptions UseLabel(string labelFilter, DateTimeOffset? preferredDateTime = null) |
@yijiamicrosoft probably can help on this. |
I think the helper function might just overpopulate the code. I would opt for the LabelFilter.Empty and a mention in the method's documentation of when to use that constant. |
Sounds good. And |
@zhenlan I like that idea. |
We have a weird behavior currently
I think this partially contributes to the unexpected results @jimmyca15 described at the beginning of this thread. From users' perspective, it's not very useful to let different labels just step on each other and have an underminstic result. Therefore, I think we should change our default behavior to only load empty label when |
@jimmyca15 @zhenlan I'll send out a PR to change default behavior (user doesn't call |
I'm not opposed to that. We can also describe that behavior in the method summary. Another concern is that we currently don't allow "*" in label filters. We throw an |
Talked with @zhenlan, if we put |
This is fixed. |
Some of the key-values in my configuration store's have multiple labels. For example I have the key-value "abc" which exists with an empty label and also with a label named "someLabel".
I wanted to use the .NET Core config provider to query the key-values with an empty label. For some reason I was expecting key-values with a null label to always take priority. What I found was that when I accessed configuration["abc"] it returned the value of the abc key-value in the "someLabel" label.
Then I tried to figure out how to query only empty label key-values with the provider but it wasn't as easy as I would have liked. I need to call
I believe we need to make the empty label filter a constant within the provider and perhaps add documentation to the method which describes that this constant should be used to select only key-values that have the empty label.
The text was updated successfully, but these errors were encountered: