将NHibernate 3.3迁移到5,找不到方法:System.Data.IDbCommand NHibernate.AdoNet.AbstractBatcher.get_CurrentCommand()与SqlAzure [英] Migrating NHibernate 3.3 to 5, getting Method not found: System.Data.IDbCommand NHibernate.AdoNet.AbstractBatcher.get_CurrentCommand() with SqlAzure

查看:83
本文介绍了将NHibernate 3.3迁移到5,找不到方法:System.Data.IDbCommand NHibernate.AdoNet.AbstractBatcher.get_CurrentCommand()与SqlAzure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正忙于将项目从NHibernate 3.3.3.4迁移到5.1.3.提交事务或刷新会话时出现错误.

I am busy migrating a project from NHibernate 3.3.3.4 to 5.1.3. I have picked up an error when committing a transaction or flushing the session.

我当前收到的错误如下:

The error I am currently receiving is as follows:

Method not found: 'System.Data.IDbCommand NHibernate.AdoNet.AbstractBatcher.get_CurrentCommand()'.

我已经研究了NHibernate 5.1.3代码和发行说明,并且可以看到AbstractBacther类的CurrentCommand属性getter发生了变化.在NHibernate的主要版本中,此属性已从类型IDbCommand更改为类型DbCommand.看到下面的区别:

I have looked into the NHibernate 5.1.3 code and release notes and I can see that there has been a change to the CurrentCommand property getter for the AbstractBacther class. In this major release of NHibernate, this property has changed from being of type IDbCommand to type DbCommand. See the difference below:

版本3.3.x 固定链接

protected IDbCommand CurrentCommand
{
    get { return _batchCommand; }
}

版本5.1.3 固定链接

protected DbCommand CurrentCommand
{
    get { return _batchCommand; }
}

我正在使用SqlAzureClientDriver(NHibernate.SqlAzure)进行可靠的SQL Azure连接.我注意到最新版本的 NHibernate.SqlAzure 仍在使用IDbCommand实现.

I am using the SqlAzureClientDriver (NHibernate.SqlAzure) for reliable SQL Azure connections. I have noticed that the latest version of NHibernate.SqlAzure is still using the IDbCommand implementation.

使用 SqlAzureClientDriver 的其他人是否遇到过此问题并能够解决?

Has anybody else using SqlAzureClientDriver experienced this problem and been able to resolve it?

推荐答案

使用NHibernate5版本的SqlAzureClientDriver,可以将其安装为nuget包NHibernate5.SqlAzure.

Use the NHibernate5 version of SqlAzureClientDriver which can be installed as the nuget package NHibernate5.SqlAzure.

这篇关于将NHibernate 3.3迁移到5,找不到方法:System.Data.IDbCommand NHibernate.AdoNet.AbstractBatcher.get_CurrentCommand()与SqlAzure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆