An approach for .NET asynchronous connection to Oracle

What is the best practice for asynchronously connecting to Oracle in .NET, namely C #. Ideally, it is compatible with Sqlserver Connectivity through the DbFactory template. Since I have to support both Oracle and Sql Server. I am currently using ADO.NET DbProviderFactory, which does not support Async Calls.

+4
source share
1 answer

you can create a delegate for your db calling methods that will give you asynchronous functionality. Of course, I have no idea what consequences this may have. You will need to check this out.

Using SqlConnection or OracleConnection as the base base type, you can create a common repository (add, receive, delete, etc.)

public Row GetByID (int id) {}

delegate void GetByIDDelegate (int id);

var dbCall = new GetByIDDelegate (GetByID);

dbCall.BeginAsync (...);

It's just on my head.

0
source

Source: https://habr.com/ru/post/1340812/


All Articles