我有超过 4000 名员工的员工详细信息。在检索这些行时,由于循环,我面临着性能问题。那么我能做些什么来提高性能呢?
这是我提到的循环:
List<EmployeesEntityObject> lstEmployee = new List<EmployeesEntityObject>();
foreach (var item in lst)
{
EmployeesEntityObject obj = new EmployeesEntityObject();
obj.EmployeeID = item.EmployeeID;
obj.EmployeeName = item.EmployeeName;
lstEmployee.Add(obj);
}