London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Class ConfigurationReader

Helper class to read parsed values from a System.Collections.Specialized.NameValueCollection.

Inheritance
System.Object
ConfigurationReader
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Internal
Assembly: Mediachase.Commerce.dll
Version: 13.30.0
Syntax
public class ConfigurationReader

Constructors

ConfigurationReader(NameValueCollection)

Initializes a new instance of the ConfigurationReader class.

Declaration
public ConfigurationReader(NameValueCollection configValues)
Parameters
Type Name Description
System.Collections.Specialized.NameValueCollection configValues

Methods

ReadBool(String)

Reads a boolean value.

Declaration
public bool? ReadBool(string key)
Parameters
Type Name Description
System.String key

The key to read the value for.

Returns
Type Description
System.Nullable<System.Boolean>

The parsed value, or null if the key was not found.

ReadCsv(String, Char[])

Reads comma separated string.

Declaration
public IEnumerable<string> ReadCsv(string key, params char[] separator)
Parameters
Type Name Description
System.String key

The key to read the value for.

System.Char[] separator

Optional separators. If none is provided, ';' is used.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

The values, or null if the key was not found.

ReadInt(String)

Reads an integer value.

Declaration
public int? ReadInt(string key)
Parameters
Type Name Description
System.String key

The key to read the value for.

Returns
Type Description
System.Nullable<System.Int32>

The parsed value, or null if the key was not found.

ReadString(String)

Reads a string value.

Declaration
public string ReadString(string key)
Parameters
Type Name Description
System.String key

The key to read the value for.

Returns
Type Description
System.String

The value, or null if the key was not found.