Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

System.Linq.Enumerable TakeLast and SkipLast don't have XML docs #2267

Open
Labels
🏁 Release: .NET Core 2.xIdentifies work items for the .NET Core 2.x releasesPri3Indicates issues/PRs that are low priorityarea-System.Linqexample-requestIndicates issues requesting samplesnew-contentIndicates PRs that contain new articles
Milestone
@tomzorz

Description

@tomzorz

Hi dotnet-api-docs team.

As the title says System.Linq.Enumerable TakeLast and SkipLast don't have XML docs. Technically I'm opening a third issue on this after#1060 and#1061 but those two aren't really clear on the issue and as I dived in to do a PR I realized it's a tad more complex than just filling out the missing parts in this repo.

The complication dawned on me when I wanted to create the snippet samples first for the two extension methodshere. Apparently the .csproj has<TargetFrameworks>netcoreapp2.2;net472</TargetFrameworks>, and neither methods are available under thenet472 target:
image

After a little searching I've found this comment by@karelzdotnet/corefx#14186 (comment) which sheds some light on why weren't the docs added on release.

Some time has passed now,the shipping date is being announced in a month - my question is: is there a guideline for doing docs/samples for these kinds of APIs now?

If I wrap the samples in#if NETCOREAPP conditionals that solves the build issue, but I'd definitely add some sort of warning in there as well for those who'd just blindly copy the sample.

        #region SkipLaststaticvoidSkipLast(){// <Snippet203>            #ifNETCOREAPPint[]grades={59,82,70,56,92,98,85};IEnumerable<int>topGrades=grades.OrderByDescending(g=>g).SkipLast(3);Console.WriteLine("All grades except the bottom three are:");foreach(intgradeintopGrades){Console.WriteLine(grade);}            #endif/*             This code produces the following output:             All grades except the bottom three are:             98             92             85             82            */// </Snippet203>}        #endregion        #region TakeLaststaticvoidTakeLast(){// <Snippet204>            #ifNETCOREAPPint[]grades={59,82,70,56,92,98,85};IEnumerable<int>bottomThreeGrades=grades.OrderByDescending(grade=>grade).TakeLast(3);Console.WriteLine("The bottom three grades are:");foreach(intgradeinbottomThreeGrades){Console.WriteLine(grade);}            #endif/*             This code produces the following output:             The bottom three grades are:             70             59             56            */// </Snippet204>}        #endregion

Metadata

Metadata

Assignees

No one assigned

    Labels

    🏁 Release: .NET Core 2.xIdentifies work items for the .NET Core 2.x releasesPri3Indicates issues/PRs that are low priorityarea-System.Linqexample-requestIndicates issues requesting samplesnew-contentIndicates PRs that contain new articles

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp