The primary function of the county attorney is to provide legal advice to, and to represent the county. The county attorney's duties shall include advising and representing the commissioner, sheriff, tax commissioner, clerk of superior court, probate court judge, officials and employees of the county. The county attorney's duties also include advising the commissioner and other county officers and employees of their powers and duties under the law, preparing ordinances and legal documents, reviewing proposed contracts and representing the county and its officers in legal proceedings.