Have the following list
List<EmployeeTotal> totals = Context.Database.SqlQuery<EmployeeTotal>(query).ToList();
I want to transform all objects from the totals
list into a new type list
List<EmployeeTotalAdapter> totalsAdapter;
for this conversion I use the constructor of the EmployeeTotalAdapter
class to get an object of type EmployeeTotal
I was thinking of using foreach with lambda to add and generate conversions
List<EmployeeTotalAdapter> totalsAdapter = new List<EmployeeTotalAdapter>();
totalsAdapter.Add(totals.ForEach(t => new EmployeeTotalAdapter(t)));
But it does not work; Argument1: can not convert from void to EmployeeTotalAdapter
Is it possible to do something like this?