Uploaded image for project: 'Visual Studio'
  1. Visual Studio
  2. VS-114

A lambda expression for sorting makes MongoDB.Analyzer not work as expected

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Dotnet Drivers

    Description

      Summary

      MongoDB.Analyzer doesn't show ... annotation when the source file contains the following code:

      Func<IFindFluent<User, User>, IOrderedFindFluent<User, User>> sort = x => x.SortBy(u => u.Address);

      The version of MongoDB.Analyzer is 1.3.0.

      How to Reproduce

      Adding the following code in BuildersSample.cs in MongoDB.Analyzer.Samples.sln:

      public void Test()
      {
          Func<IFindFluent<Movie, Movie>, IOrderedFindFluent<Movie, Movie>> sort = x => x.SortBy(x => x.Score);
      }

      Additional Background

      The following error was logged by MongoDB.Analyzer:

      Compilation failed with: (65,38): error CS0103: The name 'x' does not exist in the current context

      Attachments

        Activity

          People

            Unassigned Unassigned
            alanliu90@gmail.com AlanLiu90 N/A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              PagerDuty