I want to start a Linq query with Visual Basic.
The query includes Eager Loading with Filtered Includes.
Customers should be invited who have at least one order.
Furthermore, I would like to limit the number of fields with Select.
So far I have tried the following:
Dim _List = Await (From _View In ctx.Customers.Where(Function(x) x.Customers_id.Equals(1000)) _
.Include(Function(z) z.Orders.Where(Function(i) i.Order_Price > 1000) _
.Select(Function(t) t.Order_Price)).ToListAsync
With the Select clause I want to display both Customersfields and Orderfields.
Unfortunately I get an error message, the command is not correct.
What am I doing wrong?
Dirk
Select
, includes are ignored. Post your desired DTO class. I'm not sure that I can write right LINQ in VB, but in C# definetly.