I am trying to convert the typedListClass resultset to List< class>.
OrderLinqTypedList orderCustomerEmpShip = new OrderLinqTypedList();
orderCustomerEmpShip.Fill(0, sorter, true, filter);
List<Temp> myClass = orderCustomer.ToList();
Getting error:
Cannot implicitly convert type 'System.Collections.Generic.List<NorthwindDAL.TypedListClasses.OrderLinqRow>' to 'System.Collections.Generic.List<WinApp.Temp>'
Please let me know is there any easy way put the data from typed list class to generic list<class>.
I tried with linq to entities like this as well.
IEnumerable<string> records = from entity in orderCustomerEmpShip
select new
{
Prop1 = entity.CustomerId,
Prop2 = entity.FirstName
};
And The error message is:
Cannot implicitly convert type 'System.Collections.Generic.List<AnonymousType#1>' to 'System.Collections.Generic.List<string>'
Please share a code snippet for me. Thanks!