top-level main programs
This commit is contained in:
+10
-20
@@ -2,27 +2,17 @@
|
||||
using CsharpFp1.Domain;
|
||||
using CsharpFp1.Infrastructure;
|
||||
|
||||
namespace CsharpFp1;
|
||||
Console.WriteLine("[csharp-fp1] Starting withdraw money demo...");
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Console.WriteLine("[csharp-fp1] Starting withdraw money demo...");
|
||||
var (loadAccount, saveAccount) = InMemoryAccount.Create();
|
||||
var withdrawMoney = AccountApplication.CreateWithdrawMoney(loadAccount, saveAccount);
|
||||
|
||||
var (loadAccount, saveAccount) = InMemoryAccount.Create();
|
||||
var withdrawMoney = AccountApplication.CreateWithdrawMoney(loadAccount, saveAccount);
|
||||
var accountId = Guid.NewGuid();
|
||||
Console.WriteLine($"[csharp-fp1] Seeding account {accountId} with opening balance 200.00");
|
||||
saveAccount(new Account(accountId, new Money(200m)));
|
||||
|
||||
var accountId = Guid.NewGuid();
|
||||
Console.WriteLine($"[csharp-fp1] Seeding account {accountId} with opening balance 200.00");
|
||||
saveAccount(new Account(accountId, new Money(200m)));
|
||||
decimal amount = 100m;
|
||||
Console.WriteLine($"[csharp-fp1] Executing withdrawal {amount:0.00} from account {accountId}");
|
||||
withdrawMoney(accountId, amount);
|
||||
|
||||
decimal amount = 100m;
|
||||
Console.WriteLine(
|
||||
$"[csharp-fp1] Executing withdrawal {amount:0.00} from account {accountId}"
|
||||
);
|
||||
withdrawMoney(accountId, amount);
|
||||
|
||||
Console.WriteLine("[csharp-fp1] Demo completed.");
|
||||
}
|
||||
}
|
||||
Console.WriteLine("[csharp-fp1] Demo completed.");
|
||||
|
||||
Reference in New Issue
Block a user