将列映射到 EF Core 3 中的子对象

Map column to child object in EF Core 3

给出下面的示例,有没有什么方法可以让 Address 与 User 具有相同的 table 而无需使用 table 拆分或拥有的类型(例如像 EF6 复杂类型)?生成的 SQL 阻止我使用它,并且 EF Core 3 似乎不支持复杂类型:

    public class User
    {
        public int Id { get; set; }

        public Address Address { get; set; }

        public string UserName { get; set; }
    }


    public class Address
    {
        public string StreetAddress { get; set; }

        public string City { get; set; }

        public string State { get; set; }

        public string ZipCode { get; set; }
    }

我看到的唯一其他选项是将地址映射到它自己的 table。

我将使用 1 对 0..1 关系或直接在 User 中包含属性。

然而,像在 EF 6 中那样使用自有类型来替代 ComplexTypes 是很糟糕的,如果从 SQL 的角度来看不是完全无用的话,我也看不出加入的任何理由。也许有人可以澄清完整性的适当理由