public async Task <IActionResult> Delete(int id)
        {
            var currentGender = await _genderService.GetGender(id);

            if (currentGender == null)
            {
                return(NotFound());
            }

            var result = await _genderService.DeleteGender(id);

            if (!result)
            {
                return(BadRequest());
            }

            return(NoContent());
        }
        public IActionResult DeleteGender(int id)
        {
            try
            {
                Gender gender = _genderService.GetGenderById(id);
                if (gender.IsEntityNull())
                {
                    _logger.Error($"Gender with id: {id} not found in db");
                    return(NotFound());
                }

                _genderService.DeleteGender(gender);
                _genderService.Save();

                return(NoContent());
            }
            catch (Exception ex)
            {
                _logger.Error(ex, "Error in call : api/gender/DeleteGender/" + id);
                return(StatusCode(StatusCodes.Status500InternalServerError, "Internal server error"));
            }
        }