How to create Dynamic Block with constrains with C#?

I am quite new to Dynamic blocks.

I have idea about block creation with APIs.

Also I know how to import Dynamic block.

Can anyone help me out to create dynamic block with C-Sharp and Dot Net? Any source code?

e.g. Creating ladder and change number of steps of ladder with API.