问题
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