Hi,
I had a method which worked perfectly in NH 3.0.0.3001. I upgrade to
NH 3.0.0.4000 and now I'm getting the belowe-mentioned exception.
System.InvalidCastException: Unable to cast object of type
'System.Boolean' to type 'System.String'.
at NHibernate.Type.AbstractStringType.ToString(Object val)
at NHibernate.Type.NullableType.ToLoggableString(Object value,
ISessionFactoryImplementor factory)
at NHibernate.Impl.Printer.ToString(IDictionary`2 namedTypedValues)
at
NHibernate.Engine.QueryParameters.LogParameters(ISessionFactoryImplementor
factory)
at NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters
queryParameters, ISessionImplementor session, IList results)
at NHibernate.Impl.SessionImpl.List(IQueryExpression
queryExpression, QueryParameters queryParameters, IList results)
NHibernate.Util.ADOExceptionReporter System.InvalidCastException:
Unable to cast object of type 'System.Boolean' to type
'System.String'.
<snip/>
My method is:
public static Fund GetFund(int fundNumber, bool
includeCancelledFunds)
{
var results = from fund in GetAllFunds()
where fund.FundNumber == fundNumber &&
(includeCancelledFunds || fund.CancellationStatus == null)
orderby fund.Name
select fund;
return results.FirstOrDefault<Fund>();
}
public static IQueryable<Fund> GetAllFunds()
{
NHibernate.ISession session =
SessionHelper.Instance.GetCurrentSession();
return session.Query<Fund>();
}
Am I doing something wrong or what has changed in NH that this broke?
regards,
Francois
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.