私はそのようなクラスを持っています:
public class book
{
public string Author {get; set;}
public string Genre {get; set;}
}
Genre
たとえば、はDictionary
、IDを持つさまざまなジャンルのリストを持つになっているので、新しい本を作成するときに、をアイテムGenre
の1つとして設定しますDictionary
。
これをどのように設定しますか?それぞれを定義する個別Genre
のクラスがあるのでしょうか、それとも...どのようにアプローチすればよいのかわからないと思います。