Important note: There is a chance this API could be breaking. People who are already calling Append on some Queryable will be calling into the Enumerable version, which returns an IEnumerable<T>. Meanwhile, the proposed overloads return an IQueryable<T>. However, these APIs have been out for less than a year and people seem to agree that keeping symmetry with Enumerable is more valuable.
Per discussion at dotnet/corefx#14186 (comment) We should add Queryable.Append and Prepend extension methods since they already exist on Enumerable.
Proposal
namespace System.Linq
{
public static class Queryable
{
public static IQueryable<TSource> Append<TSource>(this IQueryable<TSource> source, TSource element);
public static IQueryable<TSource> Prepend<TSource>(this IQueryable<TSource> source, TSource element);
}
}
cc @JonHanna @bartdesmet
Important note: There is a chance this API could be breaking. People who are already calling
Appendon some Queryable will be calling into the Enumerable version, which returns anIEnumerable<T>. Meanwhile, the proposed overloads return anIQueryable<T>. However, these APIs have been out for less than a year and people seem to agree that keeping symmetry with Enumerable is more valuable.Per discussion at dotnet/corefx#14186 (comment) We should add
Queryable.AppendandPrependextension methods since they already exist onEnumerable.Proposal
cc @JonHanna @bartdesmet