A personal expense tracking app built with ASP.NET Core MVC. Add, view, and manage expense reports through a web interface. Uses Entity Framework Core with SQL Server for persistence and follows a clean layered architecture with dependency injection.
Built this to practice proper separation of concerns in .NET — controller, service, and repository layers all wired through DI, with antiforgery token middleware and async/await throughout.
Controllers (ExpenseController, HomeController)
↓
Services (IExpenseService → ExpenseService)
↓
Repositories (IExpenseRepository → ExpenseRepository → BaseRepository)
↓
EF Core (ExpenseDBContext → SQL Server LocalDB)
- ASP.NET Core 2.1 MVC
- Entity Framework Core 2.2 — Code-First with migrations
- SQL Server LocalDB — development database
- Dependency Injection — service and repository interfaces
- Antiforgery Token Middleware — CSRF protection on all state-changing requests
ExpenseManager/
├── Controllers/ # MVC controllers (Expense, Home)
├── Services/ # Business logic layer (IExpenseService)
├── Repositories/ # Data access (IExpenseRepository, BaseRepository)
├── Persistence/
│ └── Contexts/ # EF Core DbContext
├── Models/ # ExpenseReport, ErrorViewModel
├── Extensions/ # Antiforgery token middleware
├── Views/ # Razor templates
├── Migrations/ # EF Core migrations
└── wwwroot/ # Static assets (CSS, JS)
- Open
ExpenseManager.slnin Visual Studio - Restore NuGet packages
- Run migrations:
Update-Databasein Package Manager Console - F5 to run (launches on https://localhost)
Requires SQL Server LocalDB.
Built in 2020 as a learning project for ASP.NET Core MVC patterns — DI, repository pattern, EF Core migrations, middleware pipeline.