public async Task <ActionResult <Voter> > DeleteVoter(int?id) { if (id == null) { return(BadRequest()); } try { await _voterRepository.DeleteVoter(id); return(Ok("Voter User Deleted Successfully.")); } catch (Exception) { return(BadRequest()); } }
public void DeleteVoter(int id) { _voterRepository.DeleteVoter(id); }