コード例 #1
0
        public async Task <Tuple <bool, ErrorMessage> > DisableUser(int accountId)
        {
            if (!await _validationService.UserExists(accountId))
            {
                return(new Tuple <bool, ErrorMessage>(false, ErrorMessage.UserDoesNotExist));
            }
            if (!await _validationService.UserIsActive(accountId))
            {
                return(new Tuple <bool, ErrorMessage>(false, ErrorMessage.UserIsNotActive));
            }

            await _userAccessService.ChangeAccountStatus(accountId, AccountStatus.Disabled);

            return(new Tuple <bool, ErrorMessage>(true, ErrorMessage.None));
        }