List.Add seems to be duplicating entries. What's wrong?

前端 未结 6 1381
醉梦人生
醉梦人生 2020-12-09 23:35

I have a class like this:

public class myClass
{
  public List anewlist = new List;

  public void addToList(myOtherC         


        
6条回答
  •  执念已碎
    2020-12-10 00:23

    Well, from I've read here, I supose your problem could be in adding items in list - are you sure, you're not adding the same reference again and again? That could be reason, why you have 100 "last items" in list.

提交回复
热议问题