This is a more or less general question, not a specific ORM or language in particular: this question arises regardless of your preference for ORM.
When comparing a many-to-many relationship, you can obscure the staging table or make the staging table part of your model. In case the intermediate data table has valuable data outside the relationship, how do you handle the display?
Consider the following tables:
CaseWorker (id, first_name, last_name)
CaseWorkerCases (case_worker_id, case_id, date_opened, date_closed)
Case (id, client_id, field_a, field_b)
As a programmer, I would really like to do this:
CaseWorker.Cases
than
CaseWorker.CaseWorkerCases.Cases
On the one hand, the CaseWorkerCases table contains useful data and hiding the staging table makes access to this data less convenient. On the other hand, the need to navigate the staging table makes the general task of accessing Cases inconvenient.
, , CaseWork . - :
public IEnumerable<Case> Cases
{
get{return (from caseWorkerCase in this.CaseWorkerCases
select caseWorkerCase.Case);}
}
.