Recently I got this question in one of my interviews.
Although I have a single answer for this, but interviewers want more ways to
return the multiple models in a single view. So I googled this after my
interview and found the following ways to do it:
- Creating a new view model that consists of all these model
classes
- Using Partial Classes
- Using ViewBag
- Using ViewData
- Using Dynamic Model
- Using Tuple
I will create small-small code snippets for these and will
publish them soon here only.