Docs: C# support for LINQ article improvements

Created on 28 Aug 2018  Â·  7Comments  Â·  Source: dotnet/docs

The page title is "C# Features That Support LINQ". However looking at some of the sections in the page, I am puzzled as to how they relate to the topic.

For example:

  1. Object and Collection Initializers
    I can't think of any way in which the section relates to LINQ. It doesn't explain that either.
  1. Auto-Implemented Properties
    Again, I'm not sure how this section is relevant to LINQ, and there is no mention of how it is relevant.

I have refrained from touching on these points in my PR. In case, those sections are actually relevant, could you explain how?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - C# Guide P2 up-for-grabs

All 7 comments

Thank, @Shah-Nisarg, for your comment (as well as for submitting your PR). Object and collection initializers, as the documentation notes, can project the data returned by a query into a new data type; the example included just doesn't provide an illustration, as it should.

In terms of auto-implemented properties, I can't think of how they might be relevant to LINQ queries.

So the example for object and collection initializers needs to be replaced and the auto-implemented properties section probably needs to be deleted. I'll rename this issue, add it to the backlog, and add it to the community contributors' project.

Hi, I'd like to take a look at working on this issue.

That would be great, @jmarkman. We'll look forward to reviewing your PR. And in the meantime, if you have any questions, please do not hesitate to ask.

Would it be going overboard/against style to add a method syntax version of a query? It might be out of scope since it would be the only section with a method syntax version of the query, but I think having both is important for novice dev readers and those with experience but who are unfamiliar with LINQ (either because they've got history in another language or haven't knowingly used LINQ with frequency).

It's not going overboard. That is useful information.

This article covers the mapping now. But, it's not obvious that it's about the mapping from query syntax to method calls.

I'd propose making that more clear rather than duplicating the information. (And, that might be a separate PR, depending on the scope).

@BillWagner

I'd propose making that more clear rather than duplicating the information.

This is in regards to the article you linked? Just want to make sure. If not, one thought I have is that I'd include a link to that page, but I'm not sure where it would go. Would it be best to modify the "For more information, see" area at the end of the section and add a link to that page like the following?

For more information, see:

  • [Anonymous Types] //(path)
  • [Query Expression Syntax for Standard Query Operators] //(path)

@jmarkman Yes, I should have been more clear.

The "features that support LINQ" article should link to the "query expression syntax for standard query operators" article. Your suggestion to add it to "For more information see..." is correct.

The "query expression syntax for standard query operators" does explain the mapping. It could be improved, and that may be best handled in another PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stanuku picture stanuku  Â·  3Comments

stjepan picture stjepan  Â·  3Comments

JagathPrasad picture JagathPrasad  Â·  3Comments

tswett picture tswett  Â·  3Comments

LJ9999 picture LJ9999  Â·  3Comments