Table of Contents

Class HttpEntityTagHeaderOptions

Namespace
Cuemon.AspNetCore.Mvc.Filters.Cacheable
Assembly
Cuemon.AspNetCore.Mvc.dll

Specifies options that is related to the HttpEntityTagHeaderFilter.

public class HttpEntityTagHeaderOptions : IParameterObject
Inheritance
Object
HttpEntityTagHeaderOptions
Implements

Constructors

HttpEntityTagHeaderOptions()

Initializes a new instance of the HttpEntityTagHeaderOptions class.

public HttpEntityTagHeaderOptions()

Remarks

The following table shows the initial property values for an instance of HttpEntityTagHeaderOptions.

PropertyInitial Value
EntityTagProvider
           (integrity, context) =>
           {
                var builder = new ChecksumBuilder(integrity.Checksum.GetBytes(), () => HashFactory.CreateFnv128());
                Decorator.Enclose(context.Response).TryAddOrUpdateEntityTagHeader(context.Request, builder, integrity.Validation == EntityDataIntegrityValidation.Weak);
           };
EntityTagResponseParser
    (body, request, response) =>
    {
        var ms = new MemoryStream();
        Decorator.Enclose(body).CopyStream(ms);
        var builder = new ChecksumBuilder(ms.ToArray(), () => UnkeyedHashFactory.CreateCryptoMd5());
        Decorator.Enclose(response).TryAddOrUpdateEntityTagHeader(request, builder);
    };
UseEntityTagResponseParserfalse

Properties

EntityTagProvider

Gets or sets the delegate that is invoked when a result of a Microsoft.AspNetCore.Mvc.Filters.ResultExecutingContext is an Microsoft.AspNetCore.Mvc.ObjectResult and the value is an IEntityDataIntegrity implementation.

public Action<IEntityDataIntegrity, HttpContext> EntityTagProvider { get; set; }

Property Value

Action<IEntityDataIntegrity, HttpContext>

The delegate that provides an HTTP ETag header.

EntityTagResponseParser

Gets or sets the delegate that is invoked as a fallback from the EntityTagProvider when UseEntityTagResponseParser is set to true.

public Action<Stream, HttpRequest, HttpResponse> EntityTagResponseParser { get; set; }

Property Value

Action<Stream, HttpRequest, HttpResponse>

The delegate that computes a HTTP ETag from the Microsoft.AspNetCore.Http.HttpResponse.Body.

HasEntityTagProvider

Gets a value indicating whether this instance has an EntityTagProvider.

public bool HasEntityTagProvider { get; }

Property Value

Boolean

true if this instance has an EntityTagProvider; otherwise, false.

HasEntityTagResponseParser

Gets a value indicating whether this instance has an EntityTagResponseParser.

public bool HasEntityTagResponseParser { get; }

Property Value

Boolean

true if this instance has an EntityTagResponseParser; otherwise, false.

UseEntityTagResponseParser

Gets or sets a value indicating whether to use computation of the HTTP ETag header reading and copying the Microsoft.AspNetCore.Http.HttpResponse.Body.

public bool UseEntityTagResponseParser { get; set; }

Property Value

Boolean

true to compute the HTTP ETag header from reading and copying the Microsoft.AspNetCore.Http.HttpResponse.Body; otherwise, false.

See Also