Uploaded image for project: 'NHibernate'
  1. NHibernate
  2. NH-2763

queryover fails where referencing enum in VB.NET

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.3.0.CR1
    • Component/s: QueryOver
    • Labels:
      None

      Description

      Prior issue NH-2407 Closed dealt with what was probably the same issue for the LINQ provider.

      The following fails in VB.NET

      Public Enum States
      Open = 1
      Closed = 2
      Held = 3
      End Enum

      results = session.QueryOver(of foo)().Where(Function(f) f.State = States.Open)

      Stack dump looks like:

      Exception: Cannot interpret member from ConvertChecked(ConvertChecked(value(MyNamespace.MyRepository+Closure$_32).$VB$Local_criteria.State))]
      NHibernate.Impl.ExpressionProcessor.IsMemberExpression(Expression expression) +318
      NHibernate.Impl.ExpressionProcessor.ProcessBinaryExpression(BinaryExpression expression) +95
      NHibernate.Impl.ExpressionProcessor.ProcessExpression(Expression expression) +57
      NHibernate.Criterion.QueryOver`2.Add(Expression`1 expression) +28
      NHibernate.Criterion.QueryOver`2.NHibernate.IQueryOver<TRoot,TSubType>.Where(Expression`1 expression) +5

      Note: database stores value as a string

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                flukefan Richard Brown
                Reporter:
                mnbeer Matthew Beer
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Who's Looking?