I've done this before, but for some reason NHibernate can't set the returned objects into a generic list, it fails here:
In SessionImpl.cs:
Code:
#line 1758
bool success = false;
try
{
for (int i = q.Length - 1; i >= 0; i--)
{
ArrayHelper.AddAll(results, q[i].List(this, parameters));
}
success = true;
}
catch (HibernateException)
{
// Do not call Convert on HibernateExceptions
throw;
}
catch (Exception e)
{
throw Convert(e, "Could not execute query");
}
the actual error occurs in ArrayHelper.AddAll:
[ArrayHelper.cs, line 152]
Code:
// NH-specific
public static void AddAll(IList to, IList from)
{
foreach (object obj in from)
{
to.Add(obj);
}
}
for reference,
to.GetType().ToString() = "System.Collections.Generic.List`1[LightsCore.prf_ProfileItemTitle]"
It just seems like this function shouldn't even be running, and instead a generic-aware one should (somehow via reflection?)
I'm stuck! Please help... and thanks in advance! I have a feeling its something very silly on my part.