ServiceStack.Ormlit 使用Insert的时候自增列不会被赋值

 

Insert签名是这样的,将第2个参数设置为true就会返回刚插入的自增列ID了,而后能够手工赋值到对象上面去this

public static long Insert<T>(this IDbConnection dbConn, T obj, bool selectIdentity = false)
{
return dbConn.Exec(dbCmd => dbCmd.Insert(obj, selectIdentity));
}对象

相关文章
相关标签/搜索