remove lazy loading of signature
This commit is contained in:
@@ -11,20 +11,6 @@ namespace EnvelopeGenerator.Application.Receivers.Commands;
|
|||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record CreateReceiverCommand
|
public record CreateReceiverCommand
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public CreateReceiverCommand()
|
|
||||||
{
|
|
||||||
_sha256HexOfMail = new(() =>
|
|
||||||
{
|
|
||||||
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress!.ToUpper());
|
|
||||||
var hash_arr = SHA256.HashData(bytes_arr);
|
|
||||||
var hexa_str = BitConverter.ToString(hash_arr);
|
|
||||||
return hexa_str.Replace("-", string.Empty);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -42,9 +28,16 @@ public record CreateReceiverCommand
|
|||||||
/// var hexa_str = BitConverter.ToString(hash_arr);
|
/// var hexa_str = BitConverter.ToString(hash_arr);
|
||||||
/// return hexa_str.Replace("-", string.Empty);
|
/// return hexa_str.Replace("-", string.Empty);
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Signature => _sha256HexOfMail.Value;
|
public string Signature
|
||||||
|
{
|
||||||
private readonly Lazy<string> _sha256HexOfMail;
|
get
|
||||||
|
{
|
||||||
|
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress!.ToUpper());
|
||||||
|
var hash_arr = SHA256.HashData(bytes_arr);
|
||||||
|
var hexa_str = BitConverter.ToString(hash_arr);
|
||||||
|
return hexa_str.Replace("-", string.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default value is DateTime.Now
|
/// Default value is DateTime.Now
|
||||||
|
|||||||
Reference in New Issue
Block a user