Hi,
the ObjectMapper .NET offers the posibility to establish backlinks to
the object which is referencing the child object.
That's the way to prevent two link tables. You don't need it, only if
you want to have distinct references.
Have a look at the attribute [BackLink]. In your example you can add a
property to the employee which links back to the ID of the customer
that references the employee. So you only have 1 link table
(CustomerEmployee)
Cheers
Gerhard
/// <summary>
/// Gets or sets the name of the company.
/// </summary>
/// <value>The name of the company.</value>
[BackLink(typeof(Company_With_Employees), "LegalName",
"Employees")]
public string CompanyName
{
get { return companyName; }
set { companyName = value;}
}
/// <summary>
/// Gets or sets the id of the company.
/// </summary>
/// <value>The name of the company.</value>
[BackLink(typeof(Company_With_Employees), "Id", "Employees")]
public string CompanyId
{
get { return companyId; }
set { companyId = value;}
}
On 28 Dez., 09:48, "qhaut" <guenther.scha...@rs-software.atwrote:
Dave,
Thank you for your answer. Yes, you are right - the main thing is, thatObjectMapper.NET translates (as I think) an M:N Relation into two 1:N
Relations.
Company
Employee
CompanyEmployee
EmployeeCustomer
That is the behavior out of the box. But I am not sure if that is the
only way...
I want a solution you have shown in your answer above.
Probabely there is another solution out there.
Thanks again, Günther