Table of Contents

GetCacheValidator Method

Definition

Namespace
Cuemon.Extensions.Data.Integrity
Assemblies
Cuemon.Extensions.Data.Integrity.dll
Source
src/Cuemon.Extensions.Data.Integrity/DateTimeExtensions.cs

GetCacheValidator(DateTime, DateTime?, Func<Hash>, EntityDataIntegrityMethod)

Returns a CacheValidator from the specified parameters.

public static CacheValidator GetCacheValidator(this DateTime created, DateTime? modified = null, Func<Hash> hashFactory = null, EntityDataIntegrityMethod method = EntityDataIntegrityMethod.Unaltered)

Parameters

created DateTime

A DateTime value for when data this CacheValidator represents was first created.

modified DateTime?

A DateTime value for when data this CacheValidator represents was last modified.

hashFactory Func<Hash>

The function delegate that is invoked to produce the HashResult. Default is CreateFnv128(Action<FowlerNollVoOptions>).

method EntityDataIntegrityMethod

A EntityDataIntegrityMethod enumeration value that indicates how a checksum is manipulated. Default is Unaltered.

Returns

CacheValidator

A CacheValidator that represents the integrity of the specified parameters.

GetCacheValidator(DateTime, DateTime, byte[], EntityDataIntegrityValidation, Func<Hash>, EntityDataIntegrityMethod)

Returns a CacheValidator from the specified parameters.

public static CacheValidator GetCacheValidator(this DateTime created, DateTime modified, byte[] checksum, EntityDataIntegrityValidation validation = EntityDataIntegrityValidation.Weak, Func<Hash> hashFactory = null, EntityDataIntegrityMethod method = EntityDataIntegrityMethod.Unaltered)

Parameters

created DateTime

A DateTime value for when data this CacheValidator represents was first created.

modified DateTime

A DateTime value for when data this CacheValidator represents was last modified.

checksum byte[]

An array of bytes containing a checksum of the data this CacheValidator represents.

validation EntityDataIntegrityValidation

A EntityDataIntegrityValidation enumeration value that indicates the validation strength of the specified checksum. Default is Weak.

hashFactory Func<Hash>

The function delegate that is invoked to produce the HashResult. Default is CreateFnv128(Action<FowlerNollVoOptions>).

method EntityDataIntegrityMethod

A EntityDataIntegrityMethod enumeration value that indicates how a checksum is manipulated. Default is Unaltered.

Returns

CacheValidator

A CacheValidator that represents the integrity of the specified parameters.