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

Attachments

1

Activity

Show:

Laurent NL March 24, 2016 at 9:05 AM

Dorian Rudolph March 16, 2016 at 9:03 AM

Calling OrderBy on a GroupBy query yields yet another exception:

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created March 15, 2016 at 2:26 PM
Updated March 24, 2016 at 9:05 AM
Who's Looking?