参考资料:Cooper Liu 毒逆天
一、Dapper安装
添加引用-->NuGet管理-->搜索Dapper-->安装
二、新建表
--创建一个员工表 create table Employee ( Em_Id int identity(1,1) primary key, Em_Name varchar(50) not null, Em_Age int default(18) not null ) --部门表 Create Table Department ( Depart_Id int identity(1,1) primary key, Depart_Name varchar(20) not null, ) --员工所属部门关系表 Create table EmployeePartment ( EP_Id int identity(1,1) primary key, Em_Id int not null, Depart_Id int not null )