my application has 2 classes: PaymentMethod
& Currency
(Currency
is property of PaymentMethod
). When my app does upda
This issue is because of foreign key relation in not defined in PaymentMethod class. That need to be specify so specific column will be used to update and in case currency is new then that will be inserted and same code will be saved against currencycode.
public class PaymentMethod : BaseEntity
{
public enum MethodTypeEnum
{
Creditcard,
Virtualcard,
Wallet
};
public MethodTypeEnum MethodType { get; set; }
public int VendorId { get; set; }
public virtual Address BillingAddress { get; set; }
public string CurrencyCode {get;set;} //Replace with actual column name
[ForeignKey("CurrencyCode ")]
public virtual Currency Currency { get; set; }
}