I have developed an MVC3 application based around Project Management. The data source is partly from an existing time recording database (a separate app with an unchangeable schema) and partly from a custom project management database I have created. Both of these reside on the same server.
I have created a Linq to Sql Classes model which allows cross database queries. My data model consists of multiple entities but notably a Project and Job entity that have related properties. This relationship from a Domain model point of view makes me feel they should reside in one Domain entity/class as effectively a Project is a Job just with extra properties.
My question is, at which point/layer in the application do I merge these two Data entities into one single Domain entity?
You should create a Data Access Layer that encompasses any/all data retrieval from your (two) data sources. The implementation details dealing with merging the data can then be abstracted away from your business logic at higher layers in your project. In this case, you will then no longer do LINQ-to-SQL directly to retrieve data into your code – it will be pushed down into your DAL layer.
See the diagram in this article for more reference.