none
Optimizing IEnumerable Linq query RRS feed

  • Question

  • I have a query which is enumerating over and over and taking very long to run. Can somebody help me optimized it.

     public EmpListItem(IEnumerable<EmployeeTable> Emps)
        {
            IEnumerable<EmployeeTable> emptable = Emps as EmployeeTable[] ?? Emps.ToArray();
            TeamList = emptable.Select(x => x.Surname
                .Select(c => new EmployeeListItem(c.EmployeeTables.Where(emptable.Contains)))
                .Where(x => x.EmpDtos.Any())
                .ToList();
    
        }


    Ebenezer

    Monday, July 22, 2019 7:08 PM

Answers

All replies