コード例 #1
0
        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());
            }
        }
コード例 #2
0
 public void DeleteVoter(int id)
 {
     _voterRepository.DeleteVoter(id);
 }