Thursday, April 25, 2019

Why does my SQL query work from Postgres itself but doesnt from Entity Framework Core?

Hi all! Beginner in .net here,i am making a portfolio using .net-core and entity framework for everything data related and i hit a roadblock, i want to query data that has an inner join, a very simple one but it just wont work, here is the working SQL code:

https://i.ibb.co/9ZFLrxp/23553225.jpg

Here is the .net one:

https://i.ibb.co/f28MRKJ/663363.jpg

Its almost identical, i tried renaming the id columns so they arent the same but it didnt work (nor did it work without renaming them), with this code i have an error that the column id was not present (???) and without the renaming i get the Sequence contains more than one matching element,what do i do, i am lost, i also tried adding FirstOrDefault()at the end but that also throws an error.

Why does my SQL query work from Postgres itself but doesnt from Entity Framework Core? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team