Sample code to Add Navigation Menu and vertical submenu through code

Topics: Core, General
Sep 28 at 10:02 AM
I have created a custom content type. When i create a new item of this content type, i want it to be added as submenu entry in one of the Navigation Menus.
Please provide some sample code if possible.

Thanks.