top-level main programs
This commit is contained in:
@@ -2,28 +2,20 @@
|
||||
using CsharpOopSimplified1.Domain;
|
||||
using CsharpOopSimplified1.Infrastructure;
|
||||
|
||||
namespace CsharpOopSimplified1;
|
||||
Console.WriteLine("[csharp-oop-simplified1] Starting withdraw money demo...");
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Console.WriteLine("[csharp-oop-simplified1] Starting withdraw money demo...");
|
||||
var repository = new InMemoryAccountRepository();
|
||||
|
||||
var repository = new InMemoryAccountRepository();
|
||||
var accountId = Guid.NewGuid();
|
||||
Console.WriteLine(
|
||||
$"[csharp-oop-simplified1] Seeding account {accountId} with opening balance 200.00"
|
||||
);
|
||||
repository.Save(new Account(new AccountId(accountId), new Money(200m)));
|
||||
|
||||
var accountId = Guid.NewGuid();
|
||||
Console.WriteLine(
|
||||
$"[csharp-oop-simplified1] Seeding account {accountId} with opening balance 200.00"
|
||||
);
|
||||
repository.Save(new Account(new AccountId(accountId), new Money(200m)));
|
||||
decimal amount = 100m;
|
||||
Console.WriteLine(
|
||||
$"[csharp-oop-simplified1] Executing withdrawal {amount:0.00} from account {accountId}"
|
||||
);
|
||||
AccountApplicationService.WithdrawMoney(repository, accountId, amount);
|
||||
|
||||
decimal amount = 100m;
|
||||
Console.WriteLine(
|
||||
$"[csharp-oop-simplified1] Executing withdrawal {amount:0.00} from account {accountId}"
|
||||
);
|
||||
AccountApplicationService.WithdrawMoney(repository, accountId, amount);
|
||||
|
||||
Console.WriteLine("[csharp-oop-simplified1] Demo completed.");
|
||||
}
|
||||
}
|
||||
Console.WriteLine("[csharp-oop-simplified1] Demo completed.");
|
||||
|
||||
Reference in New Issue
Block a user