c# 의 컨테이너(컬렉션) 중의 하나인 dictionary 에는 deep copy가 없다!

적어도 list 에는 add 나 addrange 가 있는데.

 

뭐 이건 나보다 한참 똑똑한 분들이 만든거니 이유가 있겠지.

하지만 구글링. 특히 스택오버플로우는 역시 대단해.

 

https://stackoverflow.com/questions/6050633/why-doesnt-dictionary-have-addrange

 

Why doesn't Dictionary have AddRange?

Title is basic enough, why can't I: Dictionary<string, string=""> dic = new Dictionary<string, string="">(); dic.AddRange(MethodThatReturnAnotherDic());</string,></string,>

stackoverflow.com

foreach 란걸 만들어서 복사가 되는 커스텀 연산을 만들어쓴다.

응용하면 재미난 것들을 잔뜩 만들 수 있을 것 같다.

 

아주아주 잘 돌아가는거 확인 하였고. 구글신이여 감사합니다!