using System.Collections.Generic;
using System.Data.SqlClient;
public static void Main()
DapperPlusManager.Entity<Customer>().Table("Customers")
.Identity(x => x.CustomerID);
var list = GenerateListCustomer();
using(var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServer()))
connection.BulkMerge(list);
var reader = connection.ExecuteReader("SELECT * FROM Customers");
DataTable table = new DataTable();
FiddleHelper.WriteTable(table);
public int CustomerID { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public Boolean IsActive { get; set; }
public static List<Customer> GenerateListCustomer()
var customers = new List<Customer>();
for (int i = 0; i < 3; i++)
customers.Add(new Customer() { Name ="Customer_" + i, Description = "Description", IsActive = true });
public static void CreateDatabase()
using (var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServer()))
using (var command = connection.CreateCommand())
CREATE TABLE [dbo].[Customers] (
[CustomerID] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (MAX) NULL,
[Description] NVARCHAR (MAX) NULL,
CONSTRAINT [PK_dbo.Customers] PRIMARY KEY CLUSTERED ([CustomerID] ASC)
command.ExecuteNonQuery();