You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reorder of dictionary values when loading from IConfiguration into a Dictionary<string,string> using bind #1420
Note the order of the values has changed, and this is a unexpected behavior which can cause issues; please allow options to prevent reordering of values during the binding
Hey 3GDXC I'm not a contributor or anything, so apologies if this sounds out of the blue... But why is ordered matter here?
the order is preserved as the configuration may be used for things like; menu items creation or middleware injection and doing so in the correct order would be wrong; a developer could of create a indexed object structure, but the behavior of config IMHO shouldn't introduce any ordering unless EXPLICITLY required by the developer.
Activity
rahul-s-bhatt commentedon Dec 22, 2023
Hey 3GDXC I'm not a contributor or anything, so apologies if this sounds out of the blue...
But why is ordered matter here?
3GDXC commentedon Jan 2, 2024
the order is preserved as the configuration may be used for things like; menu items creation or middleware injection and doing so in the correct order would be wrong; a developer could of create a indexed object structure, but the behavior of config IMHO shouldn't introduce any ordering unless EXPLICITLY required by the developer.
i-am-nikhil commentedon Sep 22, 2024
Have you considered using OrderedDictionary instead?
https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.ordereddictionary?view=net-8.0