Skip to content

A simple blog web app built with ASP.NET Core Razor Pages, Entity Framework Core, and SQL Server. It allows users to create, edit, view, and delete blog posts using a clean and minimal interface. This project demonstrates the fundamentals of Razor Pages, CRUD operations, and database integration with EF Core

Notifications You must be signed in to change notification settings

Alireza-Jafari-tech/Blog-app-with-ASP.NET-Core-Razor-Pages

Repository files navigation

📝 Blog App (ASP.NET Core Razor Pages)

A simple blog web application built with ASP.NET Core Razor Pages, Entity Framework Core, and SQL Server. This project allows users to create, edit, view, and delete blog posts. It was developed as part of my learning journey into ASP.NET Core fundamentals, focusing on Razor Pages, EF Core, and CRUD operations.

.NET 8.0 Entity Framework Core SQL Server License: MIT

🚀 Features

  • Create new blog posts
  • Edit existing blog posts
  • View post details
  • Delete posts with confirmation
  • Store data in a SQL Server database using Entity Framework Core
  • Clean and minimal Razor Pages layout

🛠️ Technologies Used

  • ASP.NET Core 8.0 (Razor Pages)
  • Entity Framework Core (Code-First + Migrations)
  • SQL Server 2022 / LocalDB
  • Bootstrap 5 for UI styling

📸 Snapshots / Screenshots

  • Home / List of Posts

    index
  • Create Post Page

    create
  • Read Post Page

    read
  • Edit Post Page

    update
  • Delete Post Page

delete

⚙️ Installation & Setup

  1. Clone the repository

    git clone https://github.com/Alireza-Jafari-tech/Blog-app-with-ASP.NET-Core-Razor-Pages.git
    cd Blog-app-with-ASP.NET-Core-Razor-Pages
  2. Update the connection string in appsettings.json:

    "ConnectionStrings": {
      "DefaultConnection": "Server=localhost;Database=BlogAppDb;Trusted_Connection=True;TrustServerCertificate=True"
    }
  3. Apply migrations and create the database

    dotnet ef database update
  4. Run the application

    dotnet run

Then open the app in your browser: 👉 http://localhost:7000

📂 Project Structure

/Pages
 ├── Index.cshtml           → List of blog posts
 ├── Create.cshtml          → Create new post
 ├── Edit.cshtml            → Edit existing post
 ├── Delete.cshtml          → Delete confirmation
 └── Details.cshtml         → View full post details

/Data
 └── AppDbContext.cs        → EF Core database context

/Models
 └── Post.cs                → Blog Post entity model

🎯 Learning Goals

  • Practice Razor Pages fundamentals
  • Understand data binding and validation
  • Implement CRUD with EF Core
  • Configure and use SQL Server database
  • Work with layouts and partials in Razor Pages

🧑‍💻 Usage

  • Use the Create page to add new posts
  • Use the Index page to browse all posts
  • Use Edit to modify existing posts
  • Use Delete to remove posts from the database

📝 License

This project is licensed under the MIT License. See the LICENSE file for more details.

🤝 Contributing

This project is for learning purposes, but contributions are always welcome! Feel free to fork the repo, open issues, or submit pull requests.

Would you like me to add some example screenshots placeholders and badges for EF, SQL, and Razor Pages like in your Book Catalog README (with matching image tags and alt texts)? I can also write a short project description paragraph for the top of the GitHub page (the one shown under the repo title).

About

A simple blog web app built with ASP.NET Core Razor Pages, Entity Framework Core, and SQL Server. It allows users to create, edit, view, and delete blog posts using a clean and minimal interface. This project demonstrates the fundamentals of Razor Pages, CRUD operations, and database integration with EF Core

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published