Add method BaseToCode