Which will be the better approach either use expando object or viewbag/viewdata ?
Current code :
Viewbag.List1 = context.getlist1();
Viewbag.List2 = context.getlist2();
Viewbag.List3 = context.getlist3();
Viewbag.List4 = context.getlist4();
ViewBag.string1 = string1;
ViewBag.string2 = string 2;
ViewBag.string2 = string 2;
I am trying to change code like
dynamic tempModel = new ExpandoObject();
tempModel .List1 = context.getlist1();
tempModel .List2 = context.getlist2();
tempModel .List3 = context.getlist3();
tempModel .List4 = context.getlist4();
tempModel .string1 = string1;
tempModel .string2 = string 2;
And pass tempModel to View.
tempModel .string2 = string 2;
And pass tempModel to View.

Sreekanth ReddyRank #726 · 3.2K reputationPosted Nov 12, 2018, 9:11 PM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Nov 12, 2018, 8:19 PM EST
Sunny Bhor33 reputationPosted Nov 12, 2018, 8:26 PM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Nov 12, 2018, 8:32 PM EST
Sunny Bhor33 reputationPosted Nov 12, 2018, 11:18 PM EST
In One object there can be 3 list of same model or there might be 5 list, sometimes there is empty set.
Laxmidhar SahooRank #383 · 6.6K reputationPosted Nov 13, 2018, 12:01 AM EST