How to use OpCodes.Call to generate this code
问题 This question is related to: Casting items of a collection with code generation Since the previous question was not clear enough, here is what I need help with precisely. How to use OpCodes.Call to generate this code: return Enumerable.ToList<Potato>(Eumerable.Cast<Potato>(_proxyPotatoes)); Here is an example of what I'm trying to do: public class Potato { } public class ProxyPotato : Potato { } public class Stew { private ICollection<ProxyPotato> _proxyPotatoes; //This is the code I would