Entity framework core 实体框架未更新foregin密钥
我的主模型上有以下列:Entity framework core 实体框架未更新foregin密钥,entity-framework-core,Entity Framework Core,我的主模型上有以下列: [ForeignKey("CountryId")] public int? CountryId { get; set; } public VFCountry Country { get; set; } 以及以下模型: [Table("Country", Schema = "mdm")] public class VFCountry { [Key] public int Id { get; set
[ForeignKey("CountryId")]
public int? CountryId { get; set; }
public VFCountry Country { get; set; }
以及以下模型:
[Table("Country", Schema = "mdm")]
public class VFCountry
{
[Key]
public int Id { get; set; }
public string Country { get; set; }
public string Code { get; set; }
}
当我更新主模型时,CountryId不会更新。其他一切都更新了。有什么建议吗