0
ウェブショッププロジェクトで購入の履歴を作成しようとしていますが、クラス履歴にカートの商品を持たせたいと思います。一人(私は最も執行猶予を受けていると思います)、どう思いますか?MVC-5のリレーション1対多
public class Clothes
{
[Key]
public int Id { get; set; }
public ClothesType Type { get; set; }
public int Amount { get; set; }
[Range(10, 150)]
public double Price { get; set; }
public string ImagePath { get; set; }
public virtual History historyID { get; set; }
}
public class History
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int historyID { get; set; }
public string Email { get; set; }
public string Address { get; set; }
public string City { get; set; }
public DateTime ShipDate { get; set; }
public int Price { get; set; }
public virtual ICollection<Clothes> HistClothes { get; set; }
}
あなたの名前は混乱しているようです。 1つの「歴史」(それは何ですか)には多くの「衣服」がありますか?複数の名前を持つ単一のクラスは奇妙に見えます... – oerkelens