Closed mcflie1994 closed 9 months ago
Hi @mcflie1994 Can you provide an example of what you're trying to achieve? Did you check the Static Command examples?
var cmd = cn.CommandBuilder($"DELETE FROM Orders WHERE OrderId = {orderId};");
int deletedRows = cmd.Execute();
var cmd = cn.CommandBuilder();
cmd += $"DELETE FROM Orders WHERE OrderId = {orderId}; ";
cmd += $"INSERT INTO Logs (Action, UserId, Description) VALUES ({action}, {orderId}, {description}); ";
cmd.Execute();
PS: DapperQueryBuilder is being deprecated and this repo will be archived soon. The replacement library is InterpolatedSql.Dapper. I'll move this issue to that new repo.
In the new library the aforementioned examples are here: https://github.com/Drizin/InterpolatedSql/blob/main/Builders.md#static-command
And you should use .SqlBuilder()
instead of .CommandBuilder()
.
There's a new InsertUpdateBuilder. Sample usage here
Thank you very much for this wonderfully simple library. Are there any plans to implement functions for keywords like UPDATE, SET, INSERT INTO etc? I would love to be able to use this library on more than just a reading level. Am I just missing this or is there a reason it is not provided?