From 11da63c5c12c86a15f13155d781a1f4278c021af Mon Sep 17 00:00:00 2001 From: Stanislav Vysotskyi Date: Thu, 5 Dec 2024 11:43:45 +0300 Subject: [PATCH] DispenserDTO: Create method for generating `Id` without necessary creating object --- src/DispenserProvider.DataBase/Models/DispenserDTO.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/DispenserProvider.DataBase/Models/DispenserDTO.cs b/src/DispenserProvider.DataBase/Models/DispenserDTO.cs index 21e7fa0..0e79ddf 100644 --- a/src/DispenserProvider.DataBase/Models/DispenserDTO.cs +++ b/src/DispenserProvider.DataBase/Models/DispenserDTO.cs @@ -35,6 +35,11 @@ public DispenserDTO() { } public DispenserDTO(EthereumAddress userAddress, long chainId, long poolId) { - Id = $"{userAddress}-{chainId}-{poolId}".ToSha256(); + Id = GenerateId(userAddress, chainId, poolId); + } + + public static string GenerateId(EthereumAddress userAddress, long chainId, long poolId) + { + return $"{userAddress}-{chainId}-{poolId}".ToSha256(); } } \ No newline at end of file