Class AssemblyCacheBustingOptions
- Namespace
- Cuemon.Extensions.AspNetCore.Configuration
- Assembly
- Cuemon.Extensions.AspNetCore.dll
Specifies options that is related to AssemblyCacheBustingOptions operations.
public class AssemblyCacheBustingOptions : CacheBustingOptions, IParameterObject
- Inheritance
-
AssemblyCacheBustingOptions
- Implements
- Inherited Members
- Extension Methods
Examples
The following example demonstrates how to configure AssemblyCacheBustingOptions for a reproducible cache-busting version that is derived from a known assembly and hash algorithm.
using System;
using Cuemon;
using Cuemon.Extensions.AspNetCore.Configuration;
using Cuemon.Security.Cryptography;
using Microsoft.Extensions.Options;
namespace DocfxExamples;
public class AssemblyCacheBustingOptionsExample
{
public static void Demonstrate()
{
var options = Options.Create(new AssemblyCacheBustingOptions
{
Assembly = typeof(AssemblyCacheBustingOptionsExample).Assembly,
Algorithm = UnkeyedCryptoAlgorithm.Sha256,
PreferredCasing = CasingMethod.UpperCase,
ReadByteForByteChecksum = true
});
var cacheBusting = new AssemblyCacheBusting(options);
Console.WriteLine(cacheBusting.Version);
}
}
Constructors
AssemblyCacheBustingOptions()
Initializes a new instance of the AssemblyCacheBustingOptions class.
public AssemblyCacheBustingOptions()
Remarks
The following table shows the initial property values for an instance of DynamicCacheBustingOptions.
| Property | Initial Value |
|---|---|
| Assembly | GetEntryAssembly() |
| Algorithm | Md5 |
| ReadByteForByteChecksum | false |
Properties
Algorithm
Gets or sets the hash algorithm to use for the computation of Assembly.
public UnkeyedCryptoAlgorithm Algorithm { get; set; }
Property Value
- UnkeyedCryptoAlgorithm
The hash algorithm to use for the computation of Assembly.
Assembly
Gets or sets the assembly that should be used as reference for the cache-busting.
public Assembly Assembly { get; set; }
Property Value
- Assembly
The assembly that should be used as reference for the cache-busting.
ReadByteForByteChecksum
Gets or sets a value indicating whether the Assembly will be read byte-for-byte when computing the checksum.
public bool ReadByteForByteChecksum { get; set; }