So in my class I have this private readonly member ICollection<IMusicItem> playlist
. I would prefer to use the interface ICollection<T>
.
I would like to use the List<T>.AddRange(IEnumerable<T> items)
. In my method would it be dangerous to cast the ICollection
to a List<T>
even if I instantiate the ICollection<T>
as a new List<T>()
in the constructor.
Is this bad practice, is there a better way of doing this?
Or is it just better to have a List<T>