top-level main programs

This commit is contained in:
Oli Sturm
2026-04-22 13:48:24 +01:00
parent 1b5239566a
commit 1f24bea336
5 changed files with 51 additions and 84 deletions
+10 -20
View File
@@ -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.");