方法为:
public static object InsertWithIdentity<T>(this IDataContext dataContext, T obj);
例:
var rowId = db.InsertWithIdentity(newRow); newRow.Id = (long)rowId;
对应的SQL语句为:
SELECT last_insert_rowid()
方法为:
public static object InsertWithIdentity<T>(this IDataContext dataContext, T obj);
例:
var rowId = db.InsertWithIdentity(newRow); newRow.Id = (long)rowId;
对应的SQL语句为:
SELECT last_insert_rowid()
转载于:https://www.cnblogs.com/shanon/p/7127459.html