sql timeout using dapper
hi all, im trying to use dapper in asp net core project and register this DapperContext as Transient
im trying to make a request to GetNote endpoint, inside this GetNote endpoint there will be lots of request made to multiple tables, and after some time, i will get an exception from my api like this :
can anyone help advise what could be the possible issue (im wondering if the Transient is correct)? i increased the Connection Timeout to 1000 already..
4 Replies
1000 milli seconds?
it's in second.. i saw this microsoft article defined 30 in seconds..
maybe you can't connect to your database?
i suddenly can get the api result after i remove the parallel async (using Task.WhenAll and now i use normal for loop instead) implemented inside my GetNote api, previously i change to use parallel async because the api return a result in a long time
but im not sure why the Task.WhenAll causes the sql timeout issue..