Skip to main content

Posts

Showing posts with the label .Net

CRUD Operation with Dapper Using ASP.NET Core

  Introduction Using Dapper for CRUD operations in ASP.NET Core is straightforward and efficient. Dapper is a micro ORM that provides simple methods to execute SQL queries and map results to objects. Here's a basic example of how you can perform CRUD operations with Dapper in ASP.NET Core: Prerequisites Visual Studio is the latest version with the ASP.NET and web development workload. .NET SDK latest version (.NET 8.0) SQL SERVER latest Creating database table Launch SQL Server, select Database, and New Database. CREATE TABLE [ dbo ] . [ Products ] ( [ ProductId ] UNIQUEIDENTIFIER NOT NULL , [ ProductName ] NVARCHAR ( 100 ) NULL , [ Price ] DECIMAL ( 18 ) NULL , [ ProdcutDescription ] NVARCHAR ( MAX ) NULL , [ CreatedOn ] DATETIME NULL , [ UpdateOn ] DATETIME NULL , CONSTRAINT [ PK_Products ] PRIMARY KEY CLUSTERED ( [ ProductId ] ASC ) ) ; Creating a New...