I ran both the below queries using the same params and stored proc. Example A takes over a minute, whereas example B takes under 20 seconds. If I call this same proc using EF, then I'm down to about 10 seconds (there is just over 50000 records returned). ...
In case of this method:...public void Delete(int id)
{
using (var connection = GetOpenConnection())
{
connection.Execute($"DELETE FROM MyTable WHERE Id = {id}");
}
}
...Or just:...GetOpenConnection().Execute($"DELETE FROM MyTable WHERE...