An open API service indexing awesome lists of open source software.

https://github.com/walidabazo/asp.net-core-8-razor-pages-crud---.net-8-razor-pages-crud-using-entity-framework-core-and-sql-server

ASP.NET Core 8 Razor Pages CRUD - .NET 8 Razor Pages CRUD Using Entity Framework Core and SQL Server
https://github.com/walidabazo/asp.net-core-8-razor-pages-crud---.net-8-razor-pages-crud-using-entity-framework-core-and-sql-server

asp-net-core crud-application entity-framework-core mssqlserver razor-pages

Last synced: about 1 month ago
JSON representation

ASP.NET Core 8 Razor Pages CRUD - .NET 8 Razor Pages CRUD Using Entity Framework Core and SQL Server

Awesome Lists containing this project

README

          

# ASP.NET Core 8 Razor Pages CRUD - .NET 8 Razor Pages CRUD Using Entity Framework Core and SQL Server

In this video, we are going to create an ASP.NET Razor Pages CRUD app using Entity Framework Core and SQL Server. We will use the .NET 8 Razor Pages template in Visual Studio 2022 to create this CRUD app.

[![Watch the video](https://img.youtube.com/vi/UqegTYn2aKE/0.jpg)](https://youtu.be/UqegTYn2aKE)

## Introduction
## Create Project
## Create Database MS SQL Server
## Asp.NET Core Connection Db MS SQL Server
## Install Nugets ASP.NET Core ( Entity Framework )
## Create Application Db Context Class
## Register Database Connections
## Create Product Model ASP.NET Core
## Add-Migrations ASP.NET Core
## Update-Database (Create Tables) Asp.Net Core
## Create Administration
## List Products
## Create ProductDto Model
## Create the Form Asp.Net Core
## Form Validation Asp.Net Core


Name




## Upload Image on Server
string newFilename = DateTime.Now.ToString("yyyyMMddHHmmssfff");
newFilename += Path.GetExtension(ProductDto.ImageFileName!.FileName);
string ImageFullPath = environment.WebRootPath + "/Images/" + newFilename;
using (var stream = System.IO.File.Create(ImageFullPath))
{
ProductDto.ImageFileName.CopyTo(stream);
}
## Delete Image on Server

//Delete Old Image on the server
string OldimageFullPath = environment.WebRootPath + "/images/" + product.ImageFileName;
System.IO.File.Delete(OldimageFullPath);
## Save On Database
product.Name = ProductDto.Name;
product.Brand = ProductDto.Brand;
product.Category = ProductDto.Category;
product.Price = ProductDto.Price;
product.Description = ProductDto.Description ?? "";
product.ImageFileName = newFileName;

context.SaveChanges();
Product = product;
successMessage = "Product Updated";

## Pagination(Page Size) ASP.NET Core
## Search ASP.NET Core
## Sporting ASP.NET Core

we are going to create an ASP.NET Razor Pages Full CRUD Operations application using Entity Framework Core Code First approach and SQL Server.

We will be using the Core .NET 8 Razor Pages template in Visual Studio 2022 to create this application.

Bootstrap in this ASP.NET Razor Pages website to style our pages.