You can also use Custom Type Conversions if you want to cast between custom types like that:
Class2 class2Instance = (Class2)class1Instance;
So all you need is to define explicit or implicit conversion function in your child
class.
// Add it into your Child class
public static explicit operator BM(Child obj)
{
BM output = new BM()
{
title = obj.title,
type = obj.type,
url = obj.url,
children = obj.children.Select(x => BM(x)).ToList()
};
return output;
}
and then:
var result = source.Select(x => (BM)x).ToList();