Payment model (b4 chatgpt changes)
Mon Jul 01 2024 23:11:34 GMT+0000 (Coordinated Universal Time)
Saved by
@iamkatmakhafola
public class Payment
{
[Key]
public int Payment_ID { get; set; }
[Required]
public decimal Amount { get; set; }
[Required]
public DateTime Payment_Date { get; set; }
public int Contract_ID { get; set; }
[ForeignKey(nameof(Contract_ID))]
public Contract Contract { get; set; }
public int Payment_Type_ID { get; set; }
[ForeignKey(nameof(Payment_Type_ID))]
public Payment_Type Payment_Type { get; set; }
}
//appDbContext
var Payments = new Payment[]
{
new Payment { Payment_ID = 1, Amount = 50.00m, Payment_Date = new DateTime(2024, 4, 12), Contract_ID = 1, Payment_Type_ID = 1 }
};
builder.Entity<Payment>().HasData(Payments);
content_copyCOPY
Comments