I’m looking for some type of iterator/enumerator that can write to the backing collection. As I understand it c# enumerators are read-only.
I’m looking for some type of iterator/enumerator that can write to the backing collection.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s nothing already existing in C# to do such a thing.
You’re right IEnumerator’s Current property is defined as a getter only.
You’d need to write a new class and/or interface to support such a thing.