How to delete a legal entity through code in ax 2012 R2

Hello Friends,

I am working on legal Entity that how to create a legal entity and delete it.

i want to know that how to delete a company through code which i have created earlier?

Thanx