I am trying to map my model with the view model and I guess this isn't the most efficient way. Here is the code:
List<hall> allHalls = db.halls.Take(30).ToList();
List<HallViewModel> HVMLIST = new List<HallViewModel>();
int process = 0;
foreach(var hall in allHalls)
{
havvViewModel HVM = new havvViewModel();
HVM.name = hall.name;
...
}
Is there a more efficient way to do this? Will calling havvViewModel HVM = new havvViewModel();
in a for loop create a performance issue since I'm making a new object every time?
Please Advise...