0
データベースに物事を追加するモデルを作りたいと思います。例hereは、このクラスを使用しています。配列メンバーを含むモデルを作成する
public class Movie
{
public int ID { get; set; }
public string Title { get; set; }
public DateTime ReleaseDate { get; set; }
public string Genre { get; set; }
public decimal Price { get; set; }
}
しかし、私は配列であることを何人かのメンバーを望んでいた場合、私は何をしますか?私は1つのジャンルの代わりにジャンルの配列がほしいと思っていたように。 私はこれが見なぜか、それを正しく行う方法を知っているためにC#に新しすぎる間違っしかしイム知っている:
public class Movie
{
public int ID { get; set; }
public string Title { get; set; }
public DateTime ReleaseDate { get; set; }
public string[] Genres { get; set; }
public decimal Price { get; set; }
}
配列の代わりにリストを使用することをおすすめします。 – RomCoo