Skip to content
Advertisement

Entity Framework I could not create the linq query

This is my scenario for tables

Users can transfer money to each others. There are two options when the transferring. One is the direct to users budget, other one is project budget for the user to spend.

a user can have multiple bank accounts. So, I would like to see list for transfer table according to recipter account Id. This means, To list transfers to all accounts of the user.

If transfer to project, It will be return project name.

It have to return that class

I try this code but I got stuck, It empty list is returning.

Advertisement

Answer

join will perform inner join, so if there is no Transfer or TransferProjects you will get empty list. You need to perform left outer join. Something like this (not sure that it will compile, but you should get the gist of it):

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement