public async Task <UserProfileResponse> DeleteById(int?id) { if (id.IsNotPositiveInt()) { _logger.Warning("null " + nameof(id)); return(new UserProfileResponse(HttpBadRequest, BadRequestMsg)); } try { Debug.Assert(id != null, nameof(id) + " != null"); var result = await _profileDataService.DeleteById(id.Value); return(new UserProfileResponse(result)); } catch (Exception e) { _logger.Error(e, FailedToDeleteId, nameof(UserProfile), id); return(new UserProfileResponse(HttpInternalServerError, InternalServerErrorMsg)); } }