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
I guess the select statement is (or was) used to get the return value, but it's not needed (as we can see with the async version). This can lead to problems because the query stops being completely parametrized: insert into [FooTable] ([Id], [BarValue]) values (@Id, @BarValue);select 'some-explicit-guid' as id
I suggest to completely remove the select statement. Should I create a PR?
The text was updated successfully, but these errors were encountered:
When executing an Insert with a Guid as a key, a select statement is appended to the query:
sb.Append(";select '" + idProps.First().GetValue(entityToInsert, null) + "' as id");
(https://github.com/ericdc1/Dapper.SimpleCRUD/blob/master/Dapper.SimpleCRUD/SimpleCRUD.cs#L403). The corresponding line is missing in the async code (https://github.com/ericdc1/Dapper.SimpleCRUD/blob/master/Dapper.SimpleCRUD/SimpleCRUDAsync.cs#L282).I guess the select statement is (or was) used to get the return value, but it's not needed (as we can see with the async version). This can lead to problems because the query stops being completely parametrized:
insert into [FooTable] ([Id], [BarValue]) values (@Id, @BarValue);select 'some-explicit-guid' as id
I suggest to completely remove the select statement. Should I create a PR?
The text was updated successfully, but these errors were encountered: