Search Results for

    Show / Hide Table of Contents

    Class QueryCollectionExtensions

    Defines a collection of extensions for objects.

    Inheritance
    System.Object
    QueryCollectionExtensions
    Namespace: MADE.Web.Extensions
    Assembly: MADE.Web.dll
    Syntax
    public static class QueryCollectionExtensions : object

    Methods

    | Improve this Doc View Source

    GetDateTimeValueOrDefault(IQueryCollection, String, DateTime)

    Gets a value from the query by the specified key.

    Declaration
    public static DateTime GetDateTimeValueOrDefault(this IQueryCollection query, string key, DateTime defaultValue)
    Parameters
    Type Name Description
    IQueryCollection query

    The query to retrieve a value from.

    System.String key

    The key associated with the parameter to retrieve.

    DateTime defaultValue

    The default value if the value does not exist.

    Returns
    Type Description
    DateTime

    The value for the specified key.

    | Improve this Doc View Source

    GetIntValueOrDefault(IQueryCollection, String, Int32, Boolean)

    Gets an integer value from the query by the specified key.

    Declaration
    public static int GetIntValueOrDefault(this IQueryCollection query, string key, int defaultValue, bool treatZeroAsEmpty = true)
    Parameters
    Type Name Description
    IQueryCollection query

    The query to retrieve an integer value from.

    System.String key

    The key associated with the parameter to retrieve.

    System.Int32 defaultValue

    The default value if the value does not exist.

    System.Boolean treatZeroAsEmpty

    A value indicating whether to treat 0 as empty. True by default.

    Returns
    Type Description
    System.Int32

    The integer value for the specified key.

    | Improve this Doc View Source

    GetStringValueOrDefault(IQueryCollection, String, String)

    Gets a string value from the query by the specified key.

    Declaration
    public static string GetStringValueOrDefault(this IQueryCollection query, string key, string defaultValue = null)
    Parameters
    Type Name Description
    IQueryCollection query

    The query to retrieve a string value from.

    System.String key

    The key associated with the parameter to retrieve.

    System.String defaultValue

    The default value if the value does not exist.

    Returns
    Type Description
    System.String

    The string value for the specified key.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps