this is a simple example implementation of Dapper using netcore 6, hope you enjoy it!
NuGet Package requirements :
- Dapper 2.1.15
- System.Data.SqlClient 6.0.16
General Information
- Theme installed: AdminLTE 3.2.0
- Database: Microsoft SQL Server
Open query editor connected to your database, copy this query below then execute each query
Book tableCREATE TABLE [dbo].[book](
[id] [int] IDENTITY(1,1) NOT NULL,
[title] [text] NULL,
[author] [varchar](150) NULL,
[publisher] [varchar](150) NULL,
[year] [int] NULL,
[ref_genre_id] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
Genre reference table
CREATE TABLE [dbo].[ref_genre](
[id] [int] IDENTITY(1,1) NOT NULL,
[genre] [varchar](50) NULL
) ON [PRIMARY]
Manually seeding the database
INSERT INTO ref_genre (genre) VALUES
('Fantasy'),('Science Fiction'), ('Adventure'),
('Romance'),('Horor'), ('Biography')
Congratulations! This is the final step. Clone the repository, install Nuget Package requirement then configure the database connection. Then, run it!