Castle ActiveRecord 3: ActiveRecordLinq queries using Equals not work

223 views Asked by At

I decided migrate the version of Castle ActiveRecord in my project ASP.NET MVC 4 from version 2.1.2 to 3.0.0. Was also updated version of NHibernate 2.1.2 to version 3.1.0. There are several queries on my project with ActiveRecordLinq (it was necessary to update the reference to Castle.ActiveRecord.Framework) as in the example below:

public IList <City> ReturnCities()
{
    IList <City> units = (from u in ActiveRecordLinq.AsQueryable<City>()
                          where (u.Id <= 52 || u.Id.Equals(900))
                          select u).ToList<City>();
    return units;
}

What happens is that after the update started generating the following exception:

An exception of type 'System.NotSupportedException' occurred in NHibernate.dll but was not handled in user code

Additional information: Boolean Equals (Int32)

If i replace the "Equals" by "==" the query works, but in version 2.1.2 of the Castle ActiveRecord "Equals" usually works.

I need help on how to work around this problem without having to leave replacing the "Equals" project.

1

There are 1 answers

0
Slawomir Brys On

There might be a solution for that bug... see https://nhibernate.jira.com/browse/NH-3129 if it applies to your case.

The problem is that I haven't found ActiveRecord library compatible with NH 3.3.3.