You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/MySqlConnectorDapperExample/QuerySql.cs
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ public class GetAuthorArgs
49
49
}
50
50
}
51
51
52
-
privateconststringListAuthorsSql="SELECT id, name, bio FROM authors ORDER BY name; SELECT LAST_INSERT_ID()";
52
+
privateconststringListAuthorsSql="SELECT id, name, bio FROM authors ORDER BY name; SELECT LAST_INSERT_ID ( ) ";
53
53
publicclassListAuthorsRow
54
54
{
55
55
publicrequiredlongId{get;init;}
@@ -123,7 +123,7 @@ public class GetAuthorByIdArgs
123
123
}
124
124
}
125
125
126
-
privateconststringGetAuthorByNamePatternSql="SELECT id, name, bio FROM authors WHERE name LIKE COALESCE(@name_pattern, '%'); SELECT LAST_INSERT_ID()";
126
+
privateconststringGetAuthorByNamePatternSql="SELECT id, name, bio FROM authors WHERE name LIKE COALESCE ( @name_pattern , '%' ) ; SELECT LAST_INSERT_ID ( ) ";
127
127
publicclassGetAuthorByNamePatternRow
128
128
{
129
129
publicrequiredlongId{get;init;}
@@ -145,7 +145,7 @@ public async Task<List<GetAuthorByNamePatternRow>> GetAuthorByNamePattern(GetAut
145
145
}
146
146
}
147
147
148
-
privateconststringDeleteAuthorSql="DELETE FROM authors WHERE name = @name; SELECT LAST_INSERT_ID()";
148
+
privateconststringDeleteAuthorSql="DELETE FROM authors WHERE name = @name; SELECT LAST_INSERT_ID ( ) ";
Copy file name to clipboardExpand all lines: examples/MySqlConnectorDapperLegacyExample/QuerySql.cs
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ public async Task<GetAuthorRow> GetAuthor(GetAuthorArgs args)
50
50
}
51
51
}
52
52
53
-
privateconststringListAuthorsSql="SELECT id, name, bio FROM authors ORDER BY name; SELECT LAST_INSERT_ID()";
53
+
privateconststringListAuthorsSql="SELECT id, name, bio FROM authors ORDER BY name; SELECT LAST_INSERT_ID ( ) ";
54
54
publicclassListAuthorsRow
55
55
{
56
56
publiclongId{get;set;}
@@ -124,7 +124,7 @@ public async Task<GetAuthorByIdRow> GetAuthorById(GetAuthorByIdArgs args)
124
124
}
125
125
}
126
126
127
-
privateconststringGetAuthorByNamePatternSql="SELECT id, name, bio FROM authors WHERE name LIKE COALESCE(@name_pattern, '%'); SELECT LAST_INSERT_ID()";
127
+
privateconststringGetAuthorByNamePatternSql="SELECT id, name, bio FROM authors WHERE name LIKE COALESCE ( @name_pattern , '%' ) ; SELECT LAST_INSERT_ID ( ) ";
128
128
publicclassGetAuthorByNamePatternRow
129
129
{
130
130
publiclongId{get;set;}
@@ -146,7 +146,7 @@ public async Task<List<GetAuthorByNamePatternRow>> GetAuthorByNamePattern(GetAut
146
146
}
147
147
}
148
148
149
-
privateconststringDeleteAuthorSql="DELETE FROM authors WHERE name = @name; SELECT LAST_INSERT_ID()";
149
+
privateconststringDeleteAuthorSql="DELETE FROM authors WHERE name = @name; SELECT LAST_INSERT_ID ( ) ";
0 commit comments