Skip to content
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

Add NameValueCollection extension methods #2

Open
jamiepollock opened this issue Dec 26, 2019 · 0 comments
Open

Add NameValueCollection extension methods #2

jamiepollock opened this issue Dec 26, 2019 · 0 comments
Assignees

Comments

@jamiepollock
Copy link
Member

Using this ticket to suggestion adding a collection of standard extensions for NameValueCollection. The intention is to mainly use this these with ConfigurationManager.AppSettings as AppSettinhs is a NameValueCollection.

  • bool HasKey(string key)
  • bool GetBooleanValue(string key, bool fallback)
  • int GetIntegerValue(string key, int fallback)
  • string GetStringValue(string key, string fallback)

As well as:

  • IEnumerable GetIntegerValues(string key, StringSplitDelimiters delimiter)
  • IEnumerable GetIntegerValues(string key, IEnumerable fallback, StringSplitDelimiters delimiter)
  • IEnumerable GetStringValues(string key, StringSplitDelimiters delimiter)
  • IEnumerable GetStringValues(string key, IEnumerable fallback, StringSplitDelimiters delimiter)

And possibly (WIP):

  • T GetValue(string key, Func<string, T> method)

A PR will follow soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant