How to use CreateExtrusion or else function to finish Boss command?

I would like to implement a function like Boss command.
I have no ideal but know it belong Extrusion.

Boss command:

RhinoCommon does not have a ‘boss’ function. But all you need to do is extrude the curve thru the target surface, then do a Boolean difference…

Thanks dale.
I meet the problem how to extrude to not planar.
To set the very long length of extrusion and do Boolean operation ?