我等了这么久的实体框架 JSON 支持,最后在他们的EF Core 6文档中,他们添加了 JSON 列支持。但我找不到任何示例或文档?
假设我有两节课
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public DateOnly JoiningDate { get; set; }
public Address Address { get; set; }
}
public class Address
{
public string City { get; set; }
public string Region { get; set; }
public string PostalCode { get; set; }
public string Country { get; set; }
public string Phone { get; set; }
}
在 Employee 类上,我需要 JSON 类型的 Address 属性,如何实现?