Enhanced C#
Language of your choice: library documentation
Classes
Loyc.Collections.MutableListExtensionMethods Namespace Reference

Contains extension methods for ICollection<T> and IList<T> that are possibly ambiguous when included in the same namespace as extension methods for IReadOnlyCollection<T> and IReadOnlyList<T>. More...

Classes

class  ICollectionExt
 Extension methods for ICollection<T>. More...
 
class  IListExt
 Extension methods and helper methods for IList<T>. More...
 
class  LCExt
 
class  LinqToLists
 

Detailed Description

Contains extension methods for ICollection<T> and IList<T> that are possibly ambiguous when included in the same namespace as extension methods for IReadOnlyCollection<T> and IReadOnlyList<T>.

This namespace exists because of Microsoft's decision to define no relationship between IReadOnlyCollection<T>/IReadOnlyList<T> on the one hand and ICollection<T>/IList<T> on the other. If one extension method accepts IReadOnlyList and another accepts List then both methods become unusable on a class that implements both, such as List<T>. For Loyc's own collections this problem is solved by implementing an interface like IListAndReadOnly<T> and a corresponding extension method that accepts that interface, but this solution can't help with List<T> or T[].

Therefore, this namespace was created for the sole purpose of holding the incompatible extension methods.

This does not contain all extension methods for mutable lists. Specifically, it does not include extension methods that don't apply to read-only collections.