public void Create<T>(T request,SqlExpressionVisitor<T> visitor=null) where T: IHasId<System.Int32>, new() { Execute(dbCmd=>{ if(visitor==null) dbCmd.Insert<T>(request); else dbCmd.InsertOnly<T>(request,visitor); dbCmd.AssertId(request); }); }
internal static void InsertAndAssertId <T>(this IDbCommand dbCmd, T request, SqlExpressionVisitor <T> visitor = null) where T : IHasId <Int32>, new() { if (visitor == null) { dbCmd.Insert <T>(request); } else { dbCmd.InsertOnly <T>(request, visitor); } dbCmd.AssertId(request); }