Class RequestExtensions
- Namespace
- Dynamicweb.Environment
- Assembly
- Dynamicweb.Environment.dll
Extension for IRequest that enables the return of strongly typed objects from the requests querystring or form.
public static class RequestExtensions
- Inheritance
-
RequestExtensions
- Inherited Members
Methods
GetBoolean(IRequest, string)
Gets the boolean representation of the value for the given key.
The value is parsed using the relevant helper API, so default values for the type might be returned.
public static bool GetBoolean(this IRequest request, string key)
Parameters
Returns
- bool
- The value of a valid boolean object (
key
). In all other casesfalse
.
GetDate(IRequest, string)
Gets the date representation of the value for the given key.
The value is parsed using the relevant helper API, so default values for the type might be returned.
public static DateTime GetDate(this IRequest request, string key)
Parameters
Returns
- DateTime
- DateTime.
GetDouble(IRequest, string)
Gets the double representation of the value for the given key.
The value is parsed using the relevant helper API, so default values for the type might be returned.
public static double GetDouble(this IRequest request, string key)
Parameters
Returns
- double
- System.Double.
GetFiles(IRequest)
Tries to get posted files from the
public static PostedFileCollection GetFiles(this IRequest request)
Parameters
request
IRequest
Returns
GetInt32(IRequest, string)
Gets the integer representation of the value for the given key.
The value is parsed using the relevant helper API, so default values for the type might be returned.
public static int GetInt32(this IRequest request, string key)
Parameters
Returns
- int
- System.Int32.
GetInt64(IRequest, string)
Gets the long representation of the value for the given key.
The value is parsed using the relevant helper API, so default values for the type might be returned.
public static long GetInt64(this IRequest request, string key)
Parameters
Returns
- long
- System.Int64.
GetString(IRequest, string)
Gets the string representation of the value for the given key.
The value is parsed using the relevant helper API, so default values for the type might be returned.
public static string GetString(this IRequest request, string key)
Parameters
Returns
- string
- System.Int64.
HasRequest(IRequest, string)
Determines whether the specified key exists in the request.
public static bool HasRequest(this IRequest request, string key)
Parameters
Returns
- bool
true
if the specified key has request; otherwise,false
.
RequestObject(IRequest, string, Type)
Gets the object from request and
[Obsolete("This is no longer used.")]
public static object RequestObject(this IRequest request, string key, Type type)