Small ASP.NET Core MVC sample demonstrating basic Dapper usage with SQLite and a simple CRUD UI using Razor views.
- Simple
Personmodel with validation attributes PersonRepositorydemonstrating Dapper queries (GetAll, GetById, Create, Update, Delete)PeopleControllerand Razor views for list/create/edit/delete- SQLite database file
people.db(created automatically on startup)
- .NET 8 SDK: https://dotnet.microsoft.com/download
- Restore and run:
dotnet restore dotnet run
- Open a browser to
https://localhost:5001(or the URL shown in the console). - Use the
Peoplelink in the navigation to view and manage people.
- Connection string: by default the app uses
Data Source=people.db. To change it, add a connection string namedConnectionStrings:Defaultinappsettings.json.
- The project uses Dapper for lightweight data access and
Microsoft.Data.Sqlitefor the database. - Model validation is implemented using data annotations; client-side validation uses the existing validation partial.
This repository does not include a license file. Add one if you plan to publish with an open-source license.