This question already has an answer here:
- Why is it considered bad to expose List<T>? [duplicate] 6 answers
I am using FxCop tool for code analysis and it shows an critical errors like "Don't expose generice list" and it suggests that instead of using a list object try to use ICollection.
I tried to replace the List with ICollection but so many places i have insert and Add range methods, i need them anyhow for fulfilling my business logic
"So How I can use Insert,AddRange and other list methods on Icollection without type casting or using ToList() method because if i had to use these methods, then why i should replace the list wiht ICollection"
Please don't mark anything redundantly duplicate if you don't understand what is my issue.