Add helper methods for color conversion and string checksum generation
- Implemented ToColor extension method to convert predefined ColorType enums to HTML hex colors. - Added GetChecksum extension method to generate a SHA-256 checksum from a string. - Included conditional directive for .NET Framework compatibility.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Drawing;
|
||||
using DigitalData.Modules.Base;
|
||||
#if NETFRAMEWORK
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -80,11 +79,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
SignedDate == DateTime.MinValue ? "-" : SignedDate.ToString("G");
|
||||
|
||||
[NotMapped]
|
||||
public Color Color => Helpers.ColorTypeToColor(ColorType);
|
||||
public Color Color => ColorType.ToColor();
|
||||
|
||||
public string GetSignature()
|
||||
{
|
||||
return StringEx.GetChecksum(EmailAddress?.ToUpperInvariant() ?? string.Empty);
|
||||
return EmailAddress.ToUpperInvariant().GetChecksum();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user