Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Entity framework core 实体框架未更新foregin密钥_Entity Framework Core - Fatal编程技术网

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不会更新。其他一切都更新了。有什么建议吗