for example
public async Task<string> MyAction(var parameter)
{
if (condition)
{
await DbHelper.AddItem(parameter); //Dapper async query
}
else if (otherCondition)
{
await DbHelper.UpdateItem(parameter);
}
else
{
await DbHelper.RemoveItem(parameter);
}
// return string after some arbitrary logic
}In one of my views I have an interface that uses jQuery.post() to post to this Action. The user may call this action many times while at this view endpoint.
I keep running into this : InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
So basically I'm wondering what I can do to free my threads after an await call?