I have a ViewModel with a number of different properties (ie string, int, etc) that I need to iterate through in the controller. What is the best way to do this? Here is the ViewModel's defintion:
public class BankListViewModel
{
public int ID { get; set; }
public string BankName { get; set; }
public string EPURL { get; set; }
public string AssociatedTPMBD { get; set; }
public string Tier { get; set; }
public List<BankListAgentId> BankListAgentId { get; set; }
public List<BankListStateCode> BankListStateCode { get; set; }
}
I need to omit the two lists, however. Any ideas?
EDIT
The purpose of this process is to pass specific items of the view model into three separate objects. The view model was created to combine properties of three separate SQL tables/Models. I am now trying to divide them up appropriately and add the information to the relevant tables. Right now I'm simply going one by one like so:
BankListMaster banklistmaster = new BankListMaster();
banklistmaster.AssociatedTPMBD = viewmodel.AssociatedTPMBD;
banklistmaster.BankName = viewmodel.BankName;