Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# Querying With LINQ Now You're Querying Ordering and Grouping

ultan gannon
ultan gannon
5,876 Points

Im stuck on the final part of the Linq question about how to use the lambda. Can anyone help please?

In the very last set of questions, I don't even know what I'm doing wrong, I've looked at the documentation and I think I'm copying it correctly but it keeps saying I answered wrong on all the questions. I think it might be a syntax error or something

4 Answers

ultan gannon
ultan gannon
5,876 Points

Hi again Steven. Its most of them. I think it was a syntax problem for some, I had OrderBy instead of orderby in the first one

"from b in birds orderby b.Name select b;"

Steven Parker
Steven Parker
231,269 Points

So you've resolved all the issues at this point?

ultan gannon
ultan gannon
5,876 Points

Im working through them one by one looking back over the videos and teacher's notes but I'm still getting stuck.

Like question two;

I've tried

from b in birds orderby b select b.Color select b;

from b in birds orderby b => b.Color select b;

Steven Parker
Steven Parker
231,269 Points

The hint is in the question: "Fill in the blank in the following query to group by bird color."

So the answer is:

from b in birds group b by b.Color select b;

ultan gannon
ultan gannon
5,876 Points

And "from b in birds orderby b group b.Color select b;" for Fill in the blank in the following query to group by bird color. I'm not sure what I'm doing wrong here!

Steven Parker
Steven Parker
231,269 Points

I can confirm that it is possible to get "correct" on all questions. :white_check_mark:

Which question(s) in particular are you having an issue with, and what answer(s) are you giving for them?