Search Results for

    Show / Hide Table of Contents
    View Source

    Class FormCollectionExtensions

    Inheritance
    System.Object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Web.Common.dll
    Syntax
    public static class FormCollectionExtensions

    Methods

    View Source

    GetRequiredString(FormCollection, String)

    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

    GetRequiredValue<T>(FormCollection, String)

    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 Description
    T
    Type Parameters
    Name Description
    T
    View Source

    GetValue<T>(FormCollection, String)

    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 Description
    T
    Type Parameters
    Name Description
    T
    View Source

    HasKey(FormCollection, String)

    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

    ToDictionary(FormCollection)

    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

    ToQueryString(FormCollection, String[])

    Declaration
    public static string ToQueryString(this FormCollection items, params string[] keysToIgnore)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Http.FormCollection items
    System.String[] keysToIgnore
    Returns
    Type Description
    System.String
    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • GetRequiredString(FormCollection, String)
      • GetRequiredValue<T>(FormCollection, String)
      • GetValue<T>(FormCollection, String)
      • HasKey(FormCollection, String)
      • ToDictionary(FormCollection)
      • ToQueryString(FormCollection, String[])
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX