LINQ 101 question

M

Mike P

I am working through the LINQ 101 examples and have found another bug,
on SelectMany From Assignment. Can anybody tell me what the correct
syntax should be :

var orders =
from c in customers
from o in c.Orders
total = o.Total
where total >= 2000.0M
select new {c.CustomerID, o.OrderID, total};
 
M

Martin Honnen

Mike said:
I am working through the LINQ 101 examples and have found another bug,
on SelectMany From Assignment. Can anybody tell me what the correct
syntax should be :

var orders =
from c in customers
from o in c.Orders
total = o.Total
where total >= 2000.0M
select new {c.CustomerID, o.OrderID, total};

I am not familiar with that sample but it is likely that it should be
let total = o.Total
instead of the
total = o.Total
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

linq queries 5
LINQ 101 error 2
How to implement multiple joins with LINQ? 5
Linq Style 4
Another LINQ 101 question 1
[html-post] Where the Demo ends... 14
quite easy question about linq 1
LINQ 101 syntax error 1

Top