View Source
Inheritance
System.Object
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 |
Microsoft.AspNetCore.Http.FormCollection |
items |
|
System.String |
key |
|
Returns
Type |
Description |
System.String |
|
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 |
Microsoft.AspNetCore.Http.FormCollection |
items |
|
System.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 |
Microsoft.AspNetCore.Http.FormCollection |
items |
|
System.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 |
Microsoft.AspNetCore.Http.FormCollection |
items |
|
System.String |
key |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
Converts the FormCollection to a dictionary
Declaration
public static IDictionary<string, object> ToDictionary(this FormCollection items)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.FormCollection |
items |
|
Returns
Type |
Description |
IDictionary<System.String, System.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 |
Microsoft.AspNetCore.Http.FormCollection |
items |
|
System.String[] |
keysToIgnore |
Any keys found in this collection will be removed from the output
|
Returns
Type |
Description |
System.String |
|