//插入返回自增列 (实体除ORACLE外实体要配置自增,Oracle需要配置序列) int idPk = db.Insertable(student).ExecuteReturnIdentity();
2 插入返回返回雪花ID
1 2 3 4 5 6 7 8
//返回雪花ID 看文档3.0具体用法(在最底部) Snowflake snowflakeModel = new Snowflake() { Name = "返回雪花ID", SchoolId = 1 }; db.Deleteable<Snowflake>().ExecuteCommand(); long id = db.Insertable(snowflakeModel).ExecuteReturnSnowflakeId();
db.Deleteable<Student>().ExecuteCommand(); //忽略 name SchoolId int id = db.Insertable(student).IgnoreColumns(it => new { it.Name }).ExecuteReturnIdentity();
db.Deleteable<Student>().ExecuteCommand(); //忽略 name testid int id = db.Insertable(student).InsertColumns(it => new { it.Name }).ExecuteReturnIdentity();
db.Updateable(new UnitInsertMethod() { Name = "1" }).CallEntityMethod(it => it.modify("admint")).ExecuteCommand();
11 插入临时表
1 2 3
db.Ado.OpenAlways();//长连接 db.Queryable<UserInfo>().Select(" * into #temp").ToList();//插入临时表 var tempList = db.Queryable<dynamic>().AS("#temp").ToList();//查询临时表