Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-926

LINQ queries don't work with fields/properties of type byte enum

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.1
    • 1.9
    • Linq
    • None

    Description

      To reproduce:

      enum Enum1:byte
      {
      E1,
      E2
      }
      public class C
      {
      public int _id;
      public Enum1 e;
      }

      var query =
      from x in collection.AsQueryable<C>()
      where x.e == Enum1.E1
      select x;
      which results in the following exception:
      1
      Unsupported where clause: ((Int32)x.e == 0)

      Attachments

        Activity

          People

            Unassigned Unassigned
            zephuros zephuros
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: