From 4ebaeff3eac637aa54067063c1f7ee9f3121617d Mon Sep 17 00:00:00 2001 From: Eddie Date: Tue, 26 Nov 2024 20:14:25 +0330 Subject: [PATCH] Moving data annotations to the dto record --- EWallet.Api/Currencies/EndPoints/CurrencyDto.cs | 5 ++++- EWallet.Api/Wallets/EndPoints/WalletDto.cs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/EWallet.Api/Currencies/EndPoints/CurrencyDto.cs b/EWallet.Api/Currencies/EndPoints/CurrencyDto.cs index 18d1a70..dee5156 100644 --- a/EWallet.Api/Currencies/EndPoints/CurrencyDto.cs +++ b/EWallet.Api/Currencies/EndPoints/CurrencyDto.cs @@ -1,3 +1,6 @@ namespace EWallet.Api.Currencies.EndPoints; -public record CurrencyDto(string Name, string Code, decimal Ratio); \ No newline at end of file +public record CurrencyDto( + [Required] [StringLength(100)] string Name, + [Required] [StringLength(100)] string Code, + [Required] decimal Ratio); \ No newline at end of file diff --git a/EWallet.Api/Wallets/EndPoints/WalletDto.cs b/EWallet.Api/Wallets/EndPoints/WalletDto.cs index bd7b7ae..bc48cc5 100644 --- a/EWallet.Api/Wallets/EndPoints/WalletDto.cs +++ b/EWallet.Api/Wallets/EndPoints/WalletDto.cs @@ -1,3 +1,5 @@ namespace EWallet.Api.Wallets.EndPoints; -public record WalletDto(decimal Balance, Guid CurrencyId); \ No newline at end of file +public record WalletDto( + [Required] decimal Balance, + [Required] Guid CurrencyId); \ No newline at end of file