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.

Referece:
CreateExtrusion:
http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_BrepFace_CreateExtrusion.htm
Boss command:
http://docs.mcneel.com/rhino/5/help/en-us/commands/boss.htm

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 ?