A REST API for managing bank account operations built with .NET 9.0 and ASP.NET Core.
Manage account balances with three simple operations:
- Deposit - Add money to an account
- Withdraw - Remove money from an account
- Transfer - Move money between accounts
- .NET 9.0
- ASP.NET Core
- xUnit (testing)
- In-memory data storage
-
Install .NET 9.0 SDK
-
Run the API:
cd src/BalanceApi.Api
dotnet run- Access at: http://localhost:5140
Get account balance.
curl "http://localhost:5140/balance?account_id=100"Process a financial event.
Deposit:
{
"type": "deposit",
"destination": "100",
"amount": 10
}Withdraw:
{
"type": "withdraw",
"origin": "100",
"amount": 5
}Transfer:
{
"type": "transfer",
"origin": "100",
"destination": "200",
"amount": 15
}Clear all data.
dotnet test- Clean architecture with layered separation
- Repository pattern for data access
- Dependency injection
- Comprehensive unit testing