Suppose I want to fetch data into an anonymous object (i.e. fetch data from two or more tables and store it in a variable) at some part of my application development with a Linq to Entity query. Later I need a Razor View to access this fetched/anonymous data. What should I do here?
What I think is to design another ViewModel that holds corresponding properties of the anonymous type properties and make view/razor which is strongly typed to that ViewModel? Is this the right way to work with anonymous types in EF 4.1? i.e for each anonymous type make an ViewModel and store Fetched data into object of it.