Convert IEnumerable<X> to List<Y>
i have, (in Linq), an IEnumerable of type Client.
Now i have to return a Generic List of type ClientVM.
ClientVM is a subset of Client (not a subtype or anything), and i can't get it to work.

Below is the code i have so far, but it doesn't work this way.
But maybe this code can give you an addition to my post to specify what i want to do:

    clientVMs = clients.ToList().ConvertAll(new ClientVM( z => z.Reference, z=>z.Fullname ));


clientVMs is a generic `List<ClientVM>,` class ClientWM has a constructor that takes the two properties, clients is the `IEnumerable<Client>`

And, offtopic, the compiler messages when you're dealing with Generics aren't readible for humans, imho.


Convert IEnumerable<X> to List<Y>
===

i have, (in Linq), an IEnumerable of type Client.
Now i have to return a Generic List of type ClientVM.
ClientVM is a subset of Client (not a subtype or anything), and i can't get it to work.

Below is the code i have so far, but it doesn't work this way.
But maybe this code can give you an addition to my post to specify what i want to do:

    clientVMs = clients.ToList().ConvertAll(new ClientVM( z => z.Reference, z=>z.Fullname ));


clientVMs is a generic `List<ClientVM>,` class ClientWM has a constructor that takes the two properties, clients is the `IEnumerable<Client>`

And, offtopic, the compiler messages when you're dealing with Generics aren't readible for humans, imho.

