You would like to write a viewmodel class class for a domain that combines all the data from one order and its OrderDetails (I assume that the relation Order> OrderDetails, not familiar with Northwind, has the relation 1-> N):
public class OrderViewModel { public Order Order {get;set;} public IEnumerable<OrderDetail> OrderDetails{get;set;} }
Create a View template that binds to this type, creating order and order data on one page.
In the controller class, write an action method that will populate one instance of the OrderViewModel class and pass it to the View template.
source share