Class DateTimeExtensions
- Namespace
- Cuemon.Extensions.Data.Integrity
- Assembly
- Cuemon.Extensions.Data.Integrity.dll
Extension methods for the DateTime struct.
public static class DateTimeExtensions
- Inheritance
-
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
createdDateTimeA DateTime value for when data this CacheValidator represents was first created.
modifiedDateTimeA DateTime value for when data this CacheValidator represents was last modified.
checksumbyte[]An array of bytes containing a checksum of the data this CacheValidator represents.
validationEntityDataIntegrityValidationA EntityDataIntegrityValidation enumeration value that indicates the validation strength of the specified
checksum. Default is Weak.hashFactoryFunc<Hash>The function delegate that is invoked to produce the HashResult. Default is CreateFnv128(Action<FowlerNollVoOptions>).
methodEntityDataIntegrityMethodA 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?, 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
createdDateTimeA DateTime value for when data this CacheValidator represents was first created.
modifiedDateTime?A DateTime value for when data this CacheValidator represents was last modified.
hashFactoryFunc<Hash>The function delegate that is invoked to produce the HashResult. Default is CreateFnv128(Action<FowlerNollVoOptions>).
methodEntityDataIntegrityMethodA 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.