简体   繁体   中英

Approach for .NET Asynchronous Oracle Connectivity

Whats the best practice for Asynchronous Oracle Connectivity in .NET specifically C#. Ideally something that is compatible with Sqlserver Connectivity by way of a DbFactory Pattern. As I must support both oracle and Sql Server. Currently I am using the ADO.NET DbProviderFactory which does not support Async Calls.

you can create a delegate for your db call methods which will give you the async functionality. Of course, I have no idea what implications this might have. You will need to test it out.

Using either SqlConnection or OracleConnection as the generic base type, you can create your generic repository (add, get, delete, etc)

public Row GetByID(int id) {}

delegate void GetByIDDelegate(int id);

var dbCall = new GetByIDDelegate(GetByID);

dbCall.BeginAsync(...);

This is just off the top of my head.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM