-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |