I am Robert C. Martin (Uncle Bob). Ask me anything.

View original thread
Jairo's photo

Hello, I'm new at developing with C#. it is a good practice to always return IEnumerable<T> and receive IList<T> in my methods when dealing with collections or should I favor the use if IEnumerable<T> for both, in and out?

Robert Martin's photo

The best practice is to use the smallest interface that provides the methods that your callers need to call.