you should create a ViewModel class, for example:
public class viewmodel
{
public ChildModel1 childModel1 { get; set; }
public ChildModel2 childModel2 { get; set; }
public ChildModel3 childModel3 { get; set; }
public ChildModel4 childModel4 { get; set; }
}
then create a view model object:
viewmodel v = new viewmodel();
Now you can add your child model to the view model:
v.childModel1 = yourchildmodel1;
v.childModel2 = yourchildmodel2;
v.childModel3 = yourchildmodel3;
v.childModel4 = yourchildmodel4;
Now you can transfer this model.
source
share