I'm using a lot of SqlDataRecord for mass insert/update/delete on multiple tables and when reading the documentation about SqlDataRecord i don't see any guideline on how to reuse these SqlDataRecord objects. The only thing mentioned on the docs is:
you should re-use existing SqlDataRecord objects instead of creating new ones every time
I have looked into ObjectPool class to reuse these objects, but in my use case it won't work because ObjectPool when used in DI is singleton and i would need an ObjectPool per "table" (like the HttpClientFactory named client pattern)
I'm using a lot of SqlDataRecord for mass insert/update/delete on multiple tables and when reading the documentation about SqlDataRecord i don't see any guideline on how to reuse these SqlDataRecord objects. The only thing mentioned on the docs is:
I have looked into ObjectPool class to reuse these objects, but in my use case it won't work because ObjectPool when used in DI is singleton and i would need an ObjectPool per "table" (like the HttpClientFactory named client pattern)