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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              flukefan Richard Brown added a comment -

              Fixed as part of NH-2850

              Show
              flukefan Richard Brown added a comment - Fixed as part of NH-2850
              Hide
              oskar.berggren Oskar Berggren added a comment -

              Closing issues fixed in 3.3.1.CR1.

              Show
              oskar.berggren Oskar Berggren added a comment - Closing issues fixed in 3.3.1.CR1.

                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?