Closed filippo closed 1 year ago
I found the solution, but if someone has any suggestion they are welcome. I'm a newbie in FSharp. I changed the select like this passing the transaction as an argument to SelectAsync:
let q = select {
for u in user do
where (u.Id = userId)
}
conn.SelectAsync<UserDto.UserDBRecord>(q, trans=tr)
Hi Filippo (and welcome to the best community ever! 😄), yup, that's the right way of doing it. All methods accept transaction as second parameter, so you can use it.
Thanks :-) I close the issue then
Hello, I'm using Dapper.FSharp to develop an assembly that's going to be used from C# The C# code passes to the assembly a DbConnection and DbTransaction (just to give some context)
When I use the DbConnection in fsharp after opening the BeginTransaction I get the following error:
A simple example to reproduce the problem:
If I remove the call to BeginTransaction() everything works. What am I doing wrong? How do I perform queries in a transaction?