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

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

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

原文地址:https://www.cnblogs.com/shaoming01/p/3625634.html