我想在PurchaseOrder表中创建外键Status
,这是表StatusCategories中名称为Id
的主键
以下是我的表格代码
public class PurchaseOrder
{
[Key]
public int Id { get; set; }
[StringLength(200)]
public string Remarks { get; set; }
public int Status { get; set; }
}
public class StatusCategory
{
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int Id { get; set; }
public bool IsActive { get; set; }
}
我该怎么做?