A simple CRUD (Create, Read, Update, Delete) web application built with ASP.NET Core Razor Pages and Entity Framework Core.
This project is part of my learning journey into ASP.NET Core, focusing on data modeling, server-side validation, and Razor Pages fundamentals.
A week-long learning project focused on ASP.NET Core Razor Pages + Entity Framework Core + SQL Server.
This project captures the fundamentals: setting up the database, using migrations, and implementing CRUD operations with validation.
- Add new books with validation
- Edit book details
- View full book details
- Delete books with confirmation
- Automatic calculation of Sell Price based on discount
- Enum-based support for multiple languages (English, فارسی, العربية, Français)
-
ASP.NET Core 8.0 (Razor Pages)
-
Entity Framework Core (Code-First + Migrations)
-
SQL Server (local DB)
-
Bootstrap 5 (basic UI styling)
-
Home / List of Books
-
create Book Page
-
Edit Book Page
-
Clone the repository:
git clone https://github.com/Alireza-Jafari-tech/ASP.NET-Core-Razor-Pages-Book-Catalog-CRUD-app.git cd ASP.NET-Core-Razor-Pages-Book-Catalog-CRUD-app -
Update the connection string in appsettings.json:
"ConnectionStrings": { "DefaultConnection": "Server=localhost;Database=BookCatalogDb;Trusted_Connection=True;TrustServerCertificate=True"}
-
Apply migrations & ensure database is up to date:
dotnet ef database update- Run the application:
dotnet runThen open http://localhost:7000
📂 Project Structure
/Pages
/Books
- Index.cshtml → List of books
- Create.cshtml → Add new book
- Edit.cshtml → Update book
- Delete.cshtml → Delete confirmation
- Details.cshtml → View details
/Data
AppDbContext.cs → EF Core DbContext
/Model
Book.cs → Book entity
ELanguage.cs → Supported languages enum##🎯 Learning Goals
-
Understand Razor Pages structure
-
Practice Model Binding and Validation
-
Work with Enums in forms
-
Explore EF Core CRUD operations
-
Get hands-on with ASP.NET Core web development
🧑💻 Usage
-
Use Create page to add a Book
-
Use Index page to see the list of Books
-
Use Edit to edit a Book
-
Use Delete to remove a Book
📝 License
This project is licensed under the MIT License. See the LICENSE file for details
🤝 Contributing
This project is for learning purposes, but feel free to fork and improve it. Suggestions and pull requests are welcome.

