Setting List items in C# without automatic setter/getter

后端 未结 6 2059
难免孤独
难免孤独 2021-01-16 09:46

I\'m trying to make a manual setter/getter method in C#, but i\'m getting the following error from the \"set\"-line: Error: The best overloaded method match for \'System.Col

6条回答
  •  执念已碎
    2021-01-16 10:32

    If you really want to add value, which is a List, to packages you should use

    set { packages.AddRange(value); }
    

    Otherwise,

    set { packages = value; }
    

提交回复
热议问题