How do you approach this problem with ORM? This is a hypothetical (simplified) example:
I have a table of cities:
1 - New York 2 - London 3 - San Francisco 4 - New Orleans
I have a score table: (first column Unique primary key, second month code, third FK for the city, fourth account (int))
1 - 352 - 1 - 9
2 - 352 - 2 - 10
For the month of 352, only New York and London are mentioned.
When I present this to the user in the user interface, I need a grid showing all 4 cities for this month. And zeros (spaces) for the cities of San Fran and New Orleans.
What is the best approach for this with ORM? Return your business objects to a "model" view, and then convert them to a "viewmodel"? How did you deal with similar situations in ORM? I deal with this earlier in ADO.NET with my SQL statements, but have never done it in ORM, and I'm looking for tips, tricks, or an approach.
source share