So I wanted to do:
private TTo Identity<TFrom,TTo>(TFrom I)
{
return (TTo)I;
}
Well, actually I didn't. I wanted C# to be smart enough to realize that if S is a subtype of T then List<S> can safely be assumed to be a subtype of List<T>. But anyway, that's not the case, and you have to call ConvertAll on the List to get it to be a List<T> rather than a List<S>. Joy. Anyway, turns out the above fails to compile. Thankfully, this works:
private TTo Identity<TFrom,TTo>(TFrom I)
{
return (TTo)(object)I;
}
But, argh.