Skip to content

A simple Book Catalog web app built with ASP.NET Core Razor Pages and Entity Framework Core. Supports adding, editing, viewing, and deleting books with validation and automatic sell price calculation. Includes multi-language support via enums (English, فارسی, العربية, Français)

Notifications You must be signed in to change notification settings

Alireza-Jafari-tech/ASP.NET-Core-Razor-Pages-Book-Catalog-CRUD-app

Repository files navigation

📚 Book Catalog (ASP.NET Core Razor Pages)

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.

.NET 8.0 Entity Framework Core SQL Server License: MIT

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.

🚀 Features

  • 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)

🛠️ Technologies

  • ASP.NET Core 8.0 (Razor Pages)

  • Entity Framework Core (Code-First + Migrations)

  • SQL Server (local DB)

  • Bootstrap 5 (basic UI styling)

  • 📸 Snapshots / Screenshots

  • Home / List of Books

    index
  • create Book Page

    add
  • Edit Book Page

edit
  • Delete Book Page

  • delete (2)
  • Show Book details Page

    details
    • ⚙️ Installation & Setup

  1. 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
  2. Update the connection string in appsettings.json:

    "ConnectionStrings": {
     "DefaultConnection": "Server=localhost;Database=BookCatalogDb;Trusted_Connection=True;TrustServerCertificate=True"}
    
  3. Apply migrations & ensure database is up to date:

dotnet ef database update
  1. Run the application:
dotnet run

Then open http://localhost:7000

📂 Project Structure

/Pages
/Books
- Index.cshtml → List of books
- Create.cshtml → Add new book
- Edit.cshtmlUpdate 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.

About

A simple Book Catalog web app built with ASP.NET Core Razor Pages and Entity Framework Core. Supports adding, editing, viewing, and deleting books with validation and automatic sell price calculation. Includes multi-language support via enums (English, فارسی, العربية, Français)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published