Mysql 如何使用linq2db将聚合映射到单个表
我希望将包含另一个对象的聚合实例的对象映射到单个表 我有两个POCO,如:Mysql 如何使用linq2db将聚合映射到单个表,mysql,linq2db,Mysql,Linq2db,我希望将包含另一个对象的聚合实例的对象映射到单个表 我有两个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; } } 我想映射它,而
[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数据库。我刚刚找到了解决方案 用注释注释A类
[Column("PropB", "TheOtherObject.PropB")]
提供所需的行为