📜  asp.net mvc 5 codefirst 下拉列表 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:40.750000             🧑  作者: Mango

代码示例1
public class Product
 {
    public int Id { get; set; }
    public string Name { get; set; }      
    public string Description { get; set; }

    public int CategoryId { get; set; }
    public Category Category { get; set; }
 }

 public class Category
 {
    public int Id { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }

    public virtual ICollection Products { get; set; }
 }