Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Error referencing static members in query #6

Description

@sflanker
public static class QueryableFilterThing {
    private static Int32 MagicNumber { get; } = 42;

    public static Answer AnswerUltimateQuestion(this IQueryable<Answer> allAnswers) {
        return allAnswers.Where(a => a.Id == MagicNumber).Single();
    }
}

This function raises an error indicating that the MagicNumber member is not supported. The same query works if a local variable is used instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions