score:1

Accepted answer

As far as I get your table schema you should start your query from user table while you are filtering your data by SearchUserId so, first get data with User table relations

Note: As I don't know your tables schema UserId considered as User table primary key and Transactions and Items tables foreign key in this sample code

    var result = (from usr in ctx.User
                 where  usr.UserId == firstRequest.SearchedUserID
                 select new {
                    UserId = usr.UserId,
                    Transactions = usr.Transactions,
                    Items = usr.Items
                 })

Then try to filter,Group,... on data. But if you want to select what you mentioned in your question, you should have a relation between Items and Transactions tables.


Related Articles