Castle Facilities NHibernateIntegration for NHibernate 4.0

痞子三分冷 提交于 2020-01-16 00:50:26

问题


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


回答1:


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));
        }

... }



来源:https://stackoverflow.com/questions/26094161/castle-facilities-nhibernateintegration-for-nhibernate-4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!