using System.Collections.Generic;
using System.Data.SqlClient;
public int CustomerID {get;set;}
public string CustomerName {get;set;}
public string ContactName {get;set;}
public string Address {get;set;}
public string City {get;set;}
public string PostalCode {get;set;}
public string Country {get;set;}
public static void Main()
List<Customer> customers = new List<Customer>();
using (var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServerW3Schools()))
customers = connection.Query<Customer>("Select TOP 5 * FROM CUSTOMERS").ToList();
customers.Add(new Customer() { CustomerName = "ExampleBulkMerge", ContactName = "Example Name :" + i });
customers.ForEach(x => {x.Address = "DapperPlus"; x.CustomerName = "ExampleBulkMerge";});
DapperPlusManager.Entity<Customer>().Table("Customers");
using (var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServerW3Schools()))
connection.BulkMerge(customers);
using (var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServerW3Schools()))
var customer = connection.Query<Customer>("Select * FROM CUSTOMERS WHERE CustomerName = 'ExampleBulkMerge'").ToList();
Console.WriteLine("Row Merge : " + customer.Count());
FiddleHelper.WriteTable(connection.Query<Customer>("Select TOP 10 * FROM CUSTOMERS WHERE CustomerName = 'ExampleBulkMerge'").ToList());