A simple CRUD web application built with ASP.NET Core Razor Pages, featuring:
- User Authentication (Login / Logout)
- SQLite Database Integration
- Toast Notifications using Bootstrap
- Entity Framework Core (EF Core) with Code-First Migrations
- 🧑💼 User Authentication with Cookie-based login/logout
- 📦 SQLite database
- 📝 CRUD operations on User Model (or any other data model)
- 💬 Bootstrap Toast Notifications
- 📄 Razor Pages + Layout + Partial Integration
- .NET 6 or later SDK
- (Optional) Visual Studio 2022+ / VS Code
- SQLite Explorer (like DB Browser for SQLite)
-
Clone the Repository
git clone https://github.com/yourusername/RazorCrudApp.git cd RazorCrudApp
-
Restore Dependencies
dotnet restore
-
Add EF Core Tools (if not already installed)
dotnet tool install --global dotnet-ef
-
Apply Migrations and Create the Database
dotnet ef migrations add InitialCreate dotnet ef database update
-
Run the Application
dotnet run
- Visit:
https://localhost:5001
- Use the Login form to authenticate.
- Use navigation bar to perform CRUD actions.
- Use Toasts for visual feedback on actions.
/Pages
/Auth # Login, Logout pages
/Users # CRUD pages for users
/Models
User.cs # User model
/Data
AppDbContext.cs
- ASP.NET Core Razor Pages
- Microsoft.EntityFrameworkCore.Sqlite
- Microsoft.AspNetCore.Authentication.Cookies
- Bootstrap 5
- jQuery
Run migrations and update database:
dotnet ef migrations add InitialCreate
dotnet ef database update
Close the app or watcher, then run:
taskkill /f /im RazorCrudApp.exe
dotnet clean
dotnet build
MIT License. Feel free to use and contribute!
Pull requests are welcome. For major changes, open an issue first to discuss what you'd like to change.
Dunith Munasingha Sri Lanka Software Engineer