microsoft / dotnet

This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.
https://devblogs.microsoft.com/dotnet/
MIT License
14.34k stars 2.21k forks source link

Would be nice to have AddRange(IEnumerable<T> collection) in IList<T> interface (or better to ICollection<T>) #1302

Open flamaniac opened 3 years ago

flamaniac commented 3 years ago

Luck of many methods or extansions for the IList i forcing to pass list implementation everywhere. Thats why IList interface is not flexible.

List allApplicableVariants = new List(); IEnumerable filteredVariants = ...; allApplicableVariants .AddRange(filteredVariants)

is posibble but this is not:

IList allApplicableVariants = new List(); IEnumerable filteredVariants = ...; allApplicableVariants .AddRange(filteredVariants); // ;(

svick commented 3 years ago

Suggestions for new APIs belong to the dotnet/runtime repo, so you should close the issue here and reopen it there.