Entity Framework Code First Match 0 to 1

I want to create a map of these two models, how to do this at the beginning of the code?

public class Payment { public int PaymentId { get; set; } } public class PaymentBank { public int PaymentId { get; set; } } public class PaymentCheque { public int PaymentId { get; set; } } 

Payment can be any type of PaymentBank or PaymentCheque . I am trying to execute a scenario like. I would like if I could inherit this, if possible, for example:

 public class PaymentCheque : Payment { public int RoutingNumber {get; set;} } 
+6
source share

Source: https://habr.com/ru/post/886114/


All Articles