Class HttpLastModifiedHeaderFilter
- Namespace
- Cuemon.AspNetCore.Mvc.Filters.Cacheable
- Assembly
- Cuemon.AspNetCore.Mvc.dll
A filter that applies a HTTP Last-Modified header.
public class HttpLastModifiedHeaderFilter : IConfigurable<HttpLastModifiedHeaderOptions>, ICacheableAsyncResultFilter, IAsyncResultFilter, IFilterMetadata
- Inheritance
-
HttpLastModifiedHeaderFilter
- Implements
Examples
The following example shows how can be added to a cacheable pipeline and inspected directly.
using System;
using Cuemon.AspNetCore.Mvc.Filters.Cacheable;
namespace MyApp.Examples;
public static class HttpLastModifiedHeaderFilterExample
{
public static void Demonstrate()
{
var filter = new HttpLastModifiedHeaderFilter();
var options = new HttpCacheableOptions();
options.Filters.Add(filter);
Console.WriteLine(filter.Options.HasLastModifiedProvider);
Console.WriteLine(options.Filters.Count);
}
}
Constructors
HttpLastModifiedHeaderFilter(Action<HttpLastModifiedHeaderOptions>)
Initializes a new instance of the HttpLastModifiedHeaderFilter class.
public HttpLastModifiedHeaderFilter(Action<HttpLastModifiedHeaderOptions> setup = null)
Parameters
setupAction<HttpLastModifiedHeaderOptions>The HttpLastModifiedHeaderOptions which may be configured.
Properties
Options
Gets the configured options of this instance.
public HttpLastModifiedHeaderOptions Options { get; }
Property Value
- HttpLastModifiedHeaderOptions
The configured options of this instance.
Methods
OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)
Called asynchronously before the action result.
public Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
Parameters
contextResultExecutingContextnextResultExecutionDelegateThe ResultExecutionDelegate. Invoked to execute the next result filter or the result itself.