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
+13 -21
View File
@@ -2,28 +2,20 @@
using CsharpFp1.Domain;
using CsharpFp1.Infrastructure;
namespace CsharpFp1;
Console.WriteLine("[csharp-oop-simplified2] Starting withdraw money demo...");
public class Program
{
public static void Main()
{
Console.WriteLine("[csharp-oop-simplified2] Starting withdraw money demo...");
var repository = new InMemoryAccountRepository();
var repository = new InMemoryAccountRepository();
var accountId = Guid.NewGuid();
Console.WriteLine(
$"[csharp-oop-simplified2] Seeding account {accountId} with opening balance 200.00"
);
repository.Save(new Account(accountId, new Money(200m)));
var accountId = Guid.NewGuid();
Console.WriteLine(
$"[csharp-oop-simplified2] Seeding account {accountId} with opening balance 200.00"
);
repository.Save(new Account(accountId, new Money(200m)));
decimal amount = 100m;
Console.WriteLine(
$"[csharp-oop-simplified2] Executing withdrawal {amount:0.00} from account {accountId}"
);
AccountApplicationService.WithdrawMoney(repository, accountId, amount);
decimal amount = 100m;
Console.WriteLine(
$"[csharp-oop-simplified2] Executing withdrawal {amount:0.00} from account {accountId}"
);
AccountApplicationService.WithdrawMoney(repository, accountId, amount);
Console.WriteLine("[csharp-oop-simplified2] Demo completed.");
}
}
Console.WriteLine("[csharp-oop-simplified2] Demo completed.");