View Source
Assembly: Umbraco.Web.Common.dll
public static class FormCollectionExtensions
Methods
View Source
Returns the value of a mandatory item in the FormCollection
Declaration
public static string? GetRequiredString(this FormCollection items, string key)
Parameters
| Type |
Name |
Description |
| FormCollection |
items |
|
| string |
key |
|
Returns
View Source
Returns the object based in the collection based on it's key. This does this with a conversion so if it doesn't
convert or the query string is no there an exception is thrown
Declaration
public static T GetRequiredValue<T>(this FormCollection items, string key)
Parameters
| Type |
Name |
Description |
| FormCollection |
items |
|
| string |
key |
|
Returns
Type Parameters
View Source
Returns the object based in the collection based on it's key. This does this with a conversion so if it doesn't
convert a null object is returned.
Declaration
public static T? GetValue<T>(this FormCollection items, string key)
Parameters
| Type |
Name |
Description |
| FormCollection |
items |
|
| string |
key |
|
Returns
Type Parameters
View Source
Checks if the collection contains the key
Declaration
public static bool HasKey(this FormCollection items, string key)
Parameters
| Type |
Name |
Description |
| FormCollection |
items |
|
| string |
key |
|
Returns
View Source
Converts the FormCollection to a dictionary
Declaration
public static IDictionary<string, object> ToDictionary(this FormCollection items)
Parameters
| Type |
Name |
Description |
| FormCollection |
items |
|
Returns
| Type |
Description |
| IDictionary<string, object> |
|
View Source
Converts a dictionary object to a query string representation such as:
firstname=shannon&lastname=deminick
Declaration
public static string ToQueryString(this FormCollection? items, params string[] keysToIgnore)
Parameters
| Type |
Name |
Description |
| FormCollection |
items |
|
| string[] |
keysToIgnore |
Any keys found in this collection will be removed from the output
|
Returns