NHibernate 4.0 NHibernateIntegration的城堡设施 [英] Castle Facilities NHibernateIntegration for NHibernate 4.0

查看:215
本文介绍了NHibernate 4.0 NHibernateIntegration的城堡设施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从( https://github.com/mahara/Cas​​tle。)下载了NHibernateIntegration的源代码。 )。我添加了Castle.Core(3.3.0.0),Castle.Services.Transaction(3.3.0.0),Castle.Windsor (3.3.0.0),NHibernate(4.0.0.4000)和我构建的应用程序生成Castle.Facilities.NHibernateIntegration.dll

但升级后NHibernateIntegration.dll我的应用程序我得到以下错误,

一个ISessionFactory组件未映射为指定的别名:AliasName

$ b $尝试更新NullSafeGet(IDataReader rs,字符串名称)代码

NHibernate.Type.NullSafeGet

$ b $
b

  public virtual object NullSafeGet(IDataReader rs,string name)
{
int index = 0;

尝试
{
name = name.ToUpperInvariant();
index = rs.GetOrdinal(name);

$ b catch(Exception ex)
{
throw new Exception(string.Format({0} Not Found,name));
}

...
}


I downloaded the source for NHibernateIntegration from (https://github.com/mahara/Castle.Facilities.NHibernateIntegration)

I added reference for Castle.Core (3.3.0.0), Castle.Services.Transaction (3.3.0.0), Castle.Windsor (3.3.0.0), NHibernate (4.0.0.4000) and I built the application to generate the Castle.Facilities.NHibernateIntegration.dll

But after the upgrading NHibernateIntegration.dll in my application I am getting the following error,

An ISessionFactory component was not mapped for the specified alias: AliasName

解决方案

Try to update NullSafeGet(IDataReader rs, string name) code
NHibernate.Type.NullSafeGet to

public virtual object NullSafeGet(IDataReader rs, string name)
    {
        int index = 0;

        try
        {
            name = name.ToUpperInvariant();
            index = rs.GetOrdinal(name);

        }
        catch (Exception ex)
        {
            throw new Exception(string.Format("{0} Not Found", name));
        }

... }

这篇关于NHibernate 4.0 NHibernateIntegration的城堡设施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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