本文介绍了NHibernate 4.0 NHibernateIntegration的城堡设施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ 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的城堡设施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!