0

I would like to map an object, containing an aggregated instance of another object, to a single table.

I have two POCOs like:

[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; }
}

I would like to map this, without repeating all the properties of class B in class A just for the purpose of mapping.

| ID | PropA | PropB |

Is there any way to achieve this with linq2db?

I'm using an MySQL database.

Saeid Babaei
  • 481
  • 2
  • 16
Marcus
  • 30
  • 1
  • 9

1 Answers1

0

I just found the solution...

Annotating class A with

[Column("PropB", "TheOtherObject.PropB")]

gives the desired behaviour.

Marcus
  • 30
  • 1
  • 9