Table of Contents

Enum EntityDataIntegrityMethod

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

Specifies ways for a checksum of data to be computed.

public enum EntityDataIntegrityMethod

Fields

Combined = 1

Indicates that a checksum is combined from all given input and hence always will be available.

Timestamp = 2

Indicates that a checksum is generated from date-time inputs.

Unaltered = 0

Indicates default behavior which is leaving the checksum unaltered.

Examples

The following example demonstrates how to use the enum to specify how a checksum should be computed for data integrity validation.

using System;
using Cuemon.Data.Integrity; // for EntityDataIntegrityMethod

namespace MyApp.Examples;

public class EntityDataIntegrityMethodExample
{
    public void Demonstrate()
    {
        // Unaltered - the checksum is left as-is (default)
        EntityDataIntegrityMethod method = EntityDataIntegrityMethod.Unaltered;
        Console.WriteLine(method); // Unaltered

        // Combined - the checksum is computed from all inputs combined
        method = EntityDataIntegrityMethod.Combined;
        Console.WriteLine(method); // Combined

        // Timestamp - the checksum is generated from date-time inputs
        method = EntityDataIntegrityMethod.Timestamp;
        Console.WriteLine(method); // Timestamp

        // Switch on the method to determine behavior
        switch (method)
        {
            case EntityDataIntegrityMethod.Unaltered:
                Console.WriteLine("Checksum unchanged.");
                break;
            case EntityDataIntegrityMethod.Combined:
                Console.WriteLine("Checksum computed from all data.");
                break;
            case EntityDataIntegrityMethod.Timestamp:
                Console.WriteLine("Checksum based on timestamp.");
                break;

}}
}