我想将一个包含另一个对象的聚合实例的对象映射到单个表。
我有两个POCO,例如:
[Table(Name = "Thetable")]
class A
{
[Column(Name = "PropA"),NotNull]
public string PropA { get; set; }
public B TheOtherObject { get; set; }
}
class B
{
public string PropB { get; set; }
}
我想对此进行映射,而不只是为了映射而在A类中重复B类的所有属性。
| ID | PropA | PropB |
有什么方法可以用linq2db实现吗?
我正在使用MySQL数据库。