Skip to content

Add NameValueCollection extension methods #2

@jamiepollock

Description

@jamiepollock

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions