Exception when calling First on a GroupBy Query

Description

When First is called on a GroupBy query invalid SQL code seems to be generated:

This causes the following Exception:

The same error is also causes with FirstOrDefault, SingleOrDefault, Single.

A different exception is thrown when an additional Select statement is added:

However, calling ToList does not cause an exception:

This would generate the following SQL code:

Using Take causes the same error as First:

Environment

Windows 8.1
SQL Server 2012
Visual Studio 2010

Assignee

Unassigned

Reporter

Dorian Rudolph

Labels

Components

Affects versions

Priority

Major
Configure