asp.net - Can you help with this MVC ViewModel issue? -
i have problem mvc view cannot seem solve. here is. 1) have index view displays list of retailers data retailers table. far good. 2) want include retailer categories each retailer stored in retailerscategories table each retailer can have multiple categories i have tried few things cannot seem make work. closest came wanted using view model. have included code below. i right data of retailer records , of category records. what need 1 retailer record @ time of categories relate retailer. can show me how can achieve this? //controller public actionresult index(int? page, int country) { var viewdata = new retailersindexviewmodel(_retailerrepository.getallretailersbycountry(country), _retailerrepository.getretailercategories()); return view(viewdata); } // viewmodel public class retailersindexviewmodel { public ienumerable<retailersshipping> retailershipping { get; set; } public ienumerable<retailerscategory> retailercateg...