Skip to content

Add polyfil for Enumerable.Prepend for net46X and net47 framework targets #543

@JR-Morgan

Description

@JR-Morgan

Feature request

Enumerable.Prepend is available natively in .NET Standard2.0, Framework 4.7.1, and .NET Core 1.0 (and greater)

But it is not available in in net461, net462, net47

A polyfil for Enumerable.Append was already added by #10, however, there isn't currently one for prepend.
Meaning this function is not available in the aforementioned targets.

Describe the solution

Code reference for System.Linq is available, and is implemented with prepend iterators:
https://github.com/dotnet/runtime/blob/main/src/libraries/System.Linq/src/System/Linq/AppendPrepend.cs

Alternatively, a simpler yield based could be used like implemented in #10. But I'm unsure how this performs compared to the native Linq implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions