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

Count() throws InvalidOperationException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: Linq
    • Labels:
      None
    • Environment:
      Window 8 64 bit
    • Sprint:
      C# Sprint 27

      Description

      The attached code throws an InvalidOperationException() Sequence contains no elements.

      var items = collection.AsQueryable().Where(o => o.Id.Length>100).ToList();
      var count = collection.AsQueryable().Where(o => o.Id.Length>100).Count(); // exception thrown here

      The items value is 0. I want see count value is 0, but have exception.

        Attachments

          Activity

            People

            Assignee:
            craiggwilson Craig Wilson
            Reporter:
            IlyaK Ilya
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: