Error loading Dapper. "You must explain what the provider provider"

I am making a synchronization application from Firebird to SQL Server. And I use Dapper Plus's BulkInsert.

var fbClient = new FirebirdConnect();
using (var source = fbClient.GetConnection())
{

    if (source.State == ConnectionState.Closed)
        source.Open();

    var sqlClient = new AzureConnect();
    using (var target = sqlClient.GetConnection())
    {
        if (target.State == ConnectionState.Closed)
            target.Open();

        var lastUpdate = connection.Query<DateTime>($"select coalesce((select max(DateSyncTarget) from {metadados.TargetName}), getdate()-10000) LastUpdate").ToList();

        var resultSource = source.Query<MyClass>("select * from MyClass");

        target.BulkInsert(resultSource.Where(w => w.Data > lastUpdate[0]));

        var resultTargert = target.Query<MyClassSource>("select * from MyClass")

        source.BulkInsert(resultTargert.Where(w => w.Data > lastUpdate[0]));//Error here

    }
}

Everything happens well when I go to the source to insert into the target.

But when I request the target to be inserted into the source, it gives the following error:

Provider cannot be allowed. You have to explain that Provider.

Some idea what causes the error?

Edition:

Full stack:

   em ..(BulkOperation )
   em ..(BulkOperation )
   em Z.BulkOperations.BulkOperation.BulkInsert()
   em Z.Dapper.Plus.DapperPlusAction.Execute()
   em Z.Dapper.Plus.DapperPlusAction..ctor(BaseDapperPlusActionSet action, String key, DapperPlusActionKind kind, Object dataSource)
   em Z.Dapper.Plus.DapperPlusActionSet`1.AddAction(String mapperKey, DapperPlusActionKind actionKind, TEntity item)
   em Z.Dapper.Plus.DapperPlusActionSet`1.DapperPlusActionSetBuilder(IDbConnection connection, IDbTransaction transaction, String mapperKey, DapperPlusActionKind actionKind, TEntity item, Func`2[] selectors)
   em Z.Dapper.Plus.DapperPlusExtensions.BulkInsert[T](IDbConnection connection, String mapperKey, T item, Func`2[] selectors)
   em Z.Dapper.Plus.DapperPlusExtensions.BulkInsert[T](IDbConnection connection, T item, Func`2[] selectors)
   em Project.Plugins.Utils.Extensions.CommandExtensions.InsertSource[T](IDbConnection connection, IEnumerable result) na D:\Projetos\Project-API-Cloud\project-etl\Project.Plugins.Utils\Extensions\CommandExtensions.cs:linha 52
   em Autorizacoes.ERP.LIBSENHA.JobAutorizacoes.Execute(IJobExecutionContext context) na D:\Projetos\Project-API-Cloud\Project-etl\Autorizacoes\JobAutorizacoes.cs:linha 105
+4
source share
1 answer

Disclaimer : I am the owner of the Dapper Plus project

Problem

Dapper Plus :

. , Provider.

Dapper Plus .

, , , AzureConnection.

var sqlClient = new AzureConnect();
var target = sqlClient.GetConnection()
var fullName = target.GetType().FullName;

, , SqlConnection.

№1 - SqlConnection

SqlConnection.

, SqlConnection UnderlyingConnection InnerConnection.

№2 -

, / , AzureConnect.

.

+2

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


All Articles