선택 키를 사용하여 컬렉션의 항목 목록을 보유하려고합니다. Java에서는 간단히 다음과 같이 Map을 사용합니다.
class Test {
Map<Integer,String> entities;
public String getEntity(Integer code) {
return this.entities.get(code);
}
}
C # 에서이 작업을 수행하는 동등한 방법이 있습니까?
System.Collections.Generic.Hashset해시를 사용하지 않으며 사용자 정의 유형 키를 정의 할 수 없습니다
System.Collections.Hashtable일반 클래스
System.Collections.Generic.Dictionary에는 get(Key)메소드 가 없습니다