NHibernate
  1. NHibernate
  2. NH-2763

queryover fails where referencing enum in VB.NET

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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

        Activity

        Hide
        Richard Brown added a comment -

        Fixed as part of NH-2850

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

        Closing issues fixed in 3.3.1.CR1.

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Who's Looking?