Primary Key Violation: Inheritance using EF Code First

后端 未结 3 592
时光取名叫无心
时光取名叫无心 2021-01-15 08:35

I have following EF code first code. I am getting the following exception:

\'GiftCouponPayment\' does not contain an identity column.

<
3条回答
  •  攒了一身酷
    2021-01-15 08:57

    On your PaymentComponent class decorate the ID with KeyAttribute

    [Key]
    public int PaymentComponentID { get; set; }
    

提交回复
热议问题