using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.Data.SqlClient;
public static void Main()
DapperPlusManager.Entity<Product>()
.Identity(x => x.ProductID);
var products = new List<Product>();
products.Add(new Product() { ProductID = 13, Name = "Dapper Plus", Description = @"Use <a href=""https://dapper-plus.net/"" target=""_blank"">Dapper Plus</a> to extend your IDbConnection with high-performance bulk operations." });
products.Add(new Product() { ProductID = 66, Name = "C# Eval Expression", Description = @"Use <a href=""https://eval-expression.net/"" target=""_blank"">C# Eval Expression</a> to compile and execute C# code at runtime." });
products.Add(new Product() { ProductID = 99, Name = "Entity Framework Extensions", Description = @"Use <a href=""https://entityframework-extensions.net/"" target=""_blank"">Entity Framework Extensions</a> to extend your DbContext with high-performance bulk operations." });
var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServer());
connection.CreateTable<Product>();
connection.UseBulkOptions(options => options.InsertKeepIdentity = true)
FiddleHelper.WriteTable(connection.Query<Product>("SELECT * FROM Product"));
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ProductID { get; set; }
public string Name { get; set; }
public string Description { get; set; }