This project is read-only.

Converting from IEnumerable<T> to List<T>

Aug 10, 2013 at 2:35 AM
Hello!

I have such classes:
public class ComplexA
{
    public IEnumerable<A> Field;
}
public class A
{
    public string Field;
}
public class ComplexB
{
    public List<B> Field;
}
public class B
{
    public string Field;
}
How can I convert from ComplexA to ComplexB without using ConvertUsing<IEnumerable<A>, List<B>> in config?

Now I always have error:
Unable to cast object of type 'ConsoleApplication1.A' to type 'System.Collections.Generic.IEnumerable`1[ConsoleApplication1.A]'.

Thank you!