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.
- 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
- ASP.NET Core 8.0 (Razor Pages)
- Entity Framework Core (Code-First + Migrations)
- SQL Server 2022 / LocalDB
- Bootstrap 5 for UI styling

-
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
-
Update the connection string in
appsettings.json
:"ConnectionStrings": { "DefaultConnection": "Server=localhost;Database=BlogAppDb;Trusted_Connection=True;TrustServerCertificate=True" }
-
Apply migrations and create the database
dotnet ef database update
-
Run the application
dotnet run
Then open the app in your browser: 👉 http://localhost:7000
/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
- 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
- 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
This project is licensed under the MIT License. See the LICENSE file for more details.
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).