
Fear not, there's a solution to that, starting C# 4, IEnumerable is covariant to IList, we can just substitute IEnumerable for IList if we don't need to add elements to the collection.

Think of OOP generics papercuts prior to C# 4
Happy Coding! ツ
"Simplicity can't be bought later, it must be earned from the start" -- DB
No comments:
Post a Comment