Expecting Devart.Data.Oracle.OracleConnection but got Devart.Data.Oracle.Entity.av when using DbConnectionInterceptor
Version used:
Used NuGet Package in .net 6 Project: Devart.Data.Oracle.EFCore 10.1.134.7
Problem:
I need to Intercept the DbConnection to set some metadata but when using Microsoft.EntityFrameworkCore.Diagnostics.DbConnectionInterceptor instead of getting a OracleConnection I got an instance of Devart.Data.Oracle.Entity.av. Here is my code:
- using Microsoft.EntityFrameworkCore.Diagnostics;
- using System.Data.Common;
- using System.Threading.Tasks;
- using System.Threading;
- using System;
- namespace Test.Db.DbContext.Interceptor
- {
- internal class ClientContextInfoInterceptor : DbConnectionInterceptor
- {
- public override Task ConnectionOpenedAsync(DbConnection connection, ConnectionEndEventData eventData, CancellationToken cancellationToken = default)
- {
- if (connection is Devart.Data.Oracle.OracleConnection devart)
- {
- devart.ClientId = _clientId;
- devart.ClientInfo = _clientInfo;
- devart.ModuleName = _moduleName;
- }
- return base.ConnectionOpenedAsync(connection, eventData, cancellationToken);
- }
- }
- }
Is there something I am doing wrong or is there a known bug?
Please help :)