我有一个带有 json 列“Extras”的 sql 表
[{"Key":"Part Number","Value":123},{"Key":"Batch Number","Value":321},{"Key":"Quantity","Value":"3"}]
Run Code Online (Sandbox Code Playgroud)
我正在尝试将其映射到我的班 LinerReceiptLog。我添加了一个名为 tag 的新类,它具有 Key 和 Value 属性
public partial class LinerReceiptLog
{
public long LinerReceiptLogId { get; set; }
public int EmployeeId { get; set; }
public DateTime LogDate { get; set; }
public int TotalQty { get; set; }
public string Ncrnumber { get; set; }
public List<Tag> Extras { get; set; }
public virtual Employee Employee { get; set; }
}
public class Tag
{
public string Key { …Run Code Online (Sandbox Code Playgroud)