Class NameValueCollectionExtensions
Provides extension methods for
Inherited Members
Namespace: EmbedIO.Utilities
Syntax
public static class NameValueCollectionExtensions
Methods
Contains(NameValueCollection, String, String)
Determines whether a name, at least one of which is equal to the specified
value. Value comparisons are carried out using the
Declaration
public static bool Contains(this NameValueCollection this, string name, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| NameValueCollection | this | The |
| String | name | The name to look for. |
| String | value | The value to look for. |
Returns
| Type | Description |
|---|---|
| Boolean | true if at least one of the values for |
Remarks
White space is trimmed from the start and end of each value before comparison.
See Also
Contains(NameValueCollection, String, String, StringComparison)
Determines whether a name, at least one of which is equal to the specified
value. Value comparisons are carried out using the specified
comparisonType.
Declaration
public static bool Contains(this NameValueCollection this, string name, string value, StringComparison comparisonType)
Parameters
| Type | Name | Description |
|---|---|---|
| NameValueCollection | this | The |
| String | name | The name to look for. |
| String | value | The value to look for. |
| StringComparison | comparisonType | One of the |
Returns
| Type | Description |
|---|---|
| Boolean | true if at least one of the values for |
Remarks
White space is trimmed from the start and end of each value before comparison.
See Also
ContainsKey(NameValueCollection, String)
Determines whether a key.
Declaration
public static bool ContainsKey(this NameValueCollection this, string key)
Parameters
| Type | Name | Description |
|---|---|---|
| NameValueCollection | this | The |
| String | key | The key to look for. |
Returns
| Type | Description |
|---|---|
| Boolean | true if at least one value for |
ToArrayDictionary(NameValueCollection)
Converts a
Declaration
public static Dictionary<string, string[]> ToArrayDictionary(this NameValueCollection this)
Parameters
| Type | Name | Description |
|---|---|---|
| NameValueCollection | this | The |
Returns
| Type | Description |
|---|---|
| Dictionary<String, String[]> | A |
ToDictionary(NameValueCollection)
Converts a
Values in the returned dictionary will wither be strings, or arrays of strings, depending on the presence of multiple values for the same key in the collection.
Declaration
public static Dictionary<string, object> ToDictionary(this NameValueCollection this)
Parameters
| Type | Name | Description |
|---|---|---|
| NameValueCollection | this | The |
Returns
| Type | Description |
|---|---|
| Dictionary<String, Object> | A |
ToStringDictionary(NameValueCollection)
Converts a
Declaration
public static Dictionary<string, string> ToStringDictionary(this NameValueCollection this)
Parameters
| Type | Name | Description |
|---|---|---|
| NameValueCollection | this | The |
Returns
| Type | Description |
|---|---|
| Dictionary<String, String> | A |