I was wondering if there is a recommended approach to defining a property of a plain object that is used for data transfer, for example via a REST-API which is a list of other objects. Which C# type should one prefer for defining those?
List<T>maybe? It's short, everybody knows it, and we don't have to cast or transform it into a list to do sorting, modifying etc.
ICollection<T>maybe? It's an interface that has a clear meaning and supports other types of enumerations, which avoids transforming those into a list on the sender side.
IEnumerable<T>maybe? It's even stricter than ICollection.
Tmaybe? Even shorter, but you need to transform those from lists and vice versa. Not so nice for working with out-of-the-box (well, REST-response).