public async Task <bool> UpdateUserCardPermission(UserCardPermission userCardPermission)
        {
            var existingUserCardPermission = await _unitOfWork.UserCardPermissionRepository.GetById(userCardPermission.Id);

            existingUserCardPermission.id_card_granted = userCardPermission.id_card_granted;
            existingUserCardPermission.id_permission   = userCardPermission.id_permission;
            _unitOfWork.UserCardPermissionRepository.Update(existingUserCardPermission);
            await _unitOfWork.SaveChangesAsync();

            return(true);
        }
        public async Task InsertUserCardPermission(UserCardPermission userCardPermission)
        {
            if (await _unitOfWork.UserCardGrantedRepository.GetById(userCardPermission.id_card_granted) == null)
            {
                throw new BusinessException("Card doesn't exist");
            }
            if (await _unitOfWork.PermissionsRepository.GetById(userCardPermission.id_permission) == null)
            {
                throw new BusinessException("Permission doesn't exist");
            }
            await _unitOfWork.UserCardPermissionRepository.Add(userCardPermission);

            await _unitOfWork.SaveChangesAsync();
        }