Skip to content

Commit

Permalink
Moving data annotations to the dto record
Browse files Browse the repository at this point in the history
  • Loading branch information
Edrisym committed Nov 26, 2024
1 parent af8980e commit 4ebaeff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion EWallet.Api/Currencies/EndPoints/CurrencyDto.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
namespace EWallet.Api.Currencies.EndPoints;

public record CurrencyDto(string Name, string Code, decimal Ratio);
public record CurrencyDto(
[Required] [StringLength(100)] string Name,
[Required] [StringLength(100)] string Code,
[Required] decimal Ratio);
4 changes: 3 additions & 1 deletion EWallet.Api/Wallets/EndPoints/WalletDto.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
namespace EWallet.Api.Wallets.EndPoints;

public record WalletDto(decimal Balance, Guid CurrencyId);
public record WalletDto(
[Required] decimal Balance,
[Required] Guid CurrencyId);

0 comments on commit 4ebaeff

Please sign in to comment.