Class HttpRequestDecoratorExtensions
- Namespace
- Cuemon.AspNetCore.Http
- Assembly
- Cuemon.AspNetCore.dll
Extension methods for the Microsoft.AspNetCore.Http.HttpRequest class hidden behind the IDecorator<T> interface.
public static class HttpRequestDecoratorExtensions
- Inheritance
-
HttpRequestDecoratorExtensions
Methods
IsClientSideResourceCached(IDecorator<HttpRequest>, ChecksumBuilder)
Determines whether a cached version of the enclosed Microsoft.AspNetCore.Http.HttpRequest of the decorator
is found client-side using the If-None-Match HTTP header.
public static bool IsClientSideResourceCached(this IDecorator<HttpRequest> decorator, ChecksumBuilder builder)
Parameters
decorator
IDecorator<HttpRequest>The IDecorator<T> to extend.
builder
ChecksumBuilderA ChecksumBuilder that represents the integrity of the client.
Returns
- Boolean
true
if a cached version of the enclosed Microsoft.AspNetCore.Http.HttpRequest of thedecorator
is found client-side; otherwise,false
.
Exceptions
- ArgumentNullException
decorator
cannot be null -orbuilder
cannot be null.
IsClientSideResourceCached(IDecorator<HttpRequest>, DateTime)
Determines whether a cached version of the enclosed Microsoft.AspNetCore.Http.HttpRequest of the decorator
is found client-side using the If-Modified-Since HTTP header.
public static bool IsClientSideResourceCached(this IDecorator<HttpRequest> decorator, DateTime lastModified)
Parameters
decorator
IDecorator<HttpRequest>The IDecorator<T> to extend.
lastModified
DateTimeA DateTime value that represents the modification date of the content.
Returns
- Boolean
true
if a cached version of the enclosed Microsoft.AspNetCore.Http.HttpRequest of thedecorator
is found client-side; otherwise,false
.
Exceptions
- ArgumentNullException
decorator
cannot be null.
IsGetOrHeadMethod(IDecorator<HttpRequest>)
Determines whether the enclosed Microsoft.AspNetCore.Http.HttpRequest of the decorator
is served by either a GET or a HEAD method.
public static bool IsGetOrHeadMethod(this IDecorator<HttpRequest> decorator)
Parameters
decorator
IDecorator<HttpRequest>The IDecorator<T> to extend.
Returns
- Boolean
true
if the enclosed Microsoft.AspNetCore.Http.HttpRequest of thedecorator
is served by either a GET or a HEAD method; otherwise,false
.
Exceptions
- ArgumentNullException
decorator
cannot be null.