Skip to content

Commit

Permalink
Creating walletId
Browse files Browse the repository at this point in the history
  • Loading branch information
Edrisym committed Nov 21, 2024
1 parent 5380b93 commit 4267021
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions EWallet.Api/Common/Models/WalletId.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace EWallet.Api.Common.Models;

public class WalletId(Guid value)
{
public Guid Value { get; set; } = value;

/// <summary>
/// Generates a new unique CurrencyId.
/// </summary>
/// <returns>A new CurrencyId instance with a unique GUID.</returns>
public static WalletId NewId() => new WalletId(Guid.NewGuid());

/// <summary>
/// Creates a CurrencyId from an existing GUID.
/// </summary>
/// <param name="value">The GUID value.</param>
/// <returns>A CurrencyId instance.</returns>
public static WalletId From(Guid value) => new WalletId(value);

/// <summary>
/// Overrides ToString to return the GUID as a string.
/// </summary>
public override string ToString() => Value.ToString();
}

0 comments on commit 4267021

Please sign in to comment.