AutoMapper and loosly coupled tables

28 Views Asked by At

Imagine this scenario.

  • I store documents references and paths in a table.
  • Multiple different entities and store documents in this table
  • This table has no foreign keys except for DocumentType
  • Documents are identified by the SourceType and SourceId columns e.g. SourceType = "People", SourceId = 1 or SourceType = "Company", SourceId = 23 etc. etc.

My question is how do I map from People to Document to DocumentType in order to get a list of all document types associated with a person?

enter image description here

0

There are 0 best solutions below