Toggle navigation
LINQPad
Categories
Discussions
Activity
Best Of...
Sign In
Home
Any queries duplicate 1st row for all rows
tjcst25
July 2017
Using latest LINQPad4, registered version. All queries are returning the first row for all rows. Verified data in SSMS.
0
·
Share on Facebook
Share on Twitter
Comments
tjcst25
July 2017
Forgot to mention, using EF dbContext connection...
0
·
Share on Facebook
Share on Twitter
JoeAlbahari
July 2017
If you use a standard LINQPad connection (automatic, LINQ-to-SQL) - does it work correctly?
0
·
Share on Facebook
Share on Twitter
tjcst25
July 2017
LINQ-to-SQL does work correctly.
0
·
Share on Facebook
Share on Twitter
tjcst25
July 2017
Looks to be a bug with my EF connection. Vistual Studio is giving me the same issue when I use the default return object (i.e. if I select a specific column value, it returns a valid list of results, but * returns the same result for all).
0
·
Share on Facebook
Share on Twitter
tjcst25
July 2017
So I learned that EF has a "feature" that when you don't have a key defined (in this case it was in a view) that queries will exhibit this behavior.
Fixed it by defining a key in the EDMX design for the view.
0
·
Share on Facebook
Share on Twitter
Sign In
or
Register
to comment.
Comments
Fixed it by defining a key in the EDMX design for the view.