Table of Contents

Class DateTimeExtensions

Namespace
Cuemon.Extensions.Data.Integrity
Assembly
Cuemon.Extensions.Data.Integrity.dll

Extension methods for the System.DateTime struct.

public static class DateTimeExtensions
Inheritance
Object
DateTimeExtensions

Methods

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 System.DateTime value for when data this CacheValidator represents was first created.

modified DateTime

A System.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.

GetCacheValidator(DateTime, Nullable<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 System.DateTime value for when data this CacheValidator represents was first created.

modified Nullable<DateTime>

A System.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.