public async Task <IActionResult> DeleteGender(int id)
 {
     if (await _service.DeleteAsync(id))
     {
         return(NoContent());
     }
     else
     {
         return(NotFound());
     }
 }
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var entity = _service.DeleteAsync(id);

                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Exemple #3
0
 public async Task <IActionResult> Delete(int id)
 {
     return(await DeleteAsync(
                async() => await _genderService.GenderExistsAsync(id),
                async() => await _genderService.DeleteAsync(id)));
 }