ListEnterPRise epList = ViewBag.epList; foreach (var item in epList){ //todo ... } When ListEnterprise epList = ViewBag.epList; becomes ListEnterpriseInfo epList = ViewBag.epList;, the following foreach statement is not used at all Change will speed up the encoding. That is, you can simply
List
foreach (var item in epList){
//todo...
}
When List
The following foreach statement does not need to be changed at all, which will speed up coding. In other words, it can be simply understood that var is a type variable (essentially type inference).