public ServiceResult <bool> SendSetEmailCode(SendVerifyEmailModel model)
        {
            var result = new ServiceResult <bool>();

            if (!ModelState.IsValid)
            {
                result.Code = ReasonCode.MISSING_REQUIRED_FIELDS;
                foreach (string error in ModelState.Values.SelectMany(v => v.Errors.Select(b => b.ErrorMessage)))
                {
                    result.Message += error + Environment.NewLine;
                }

                return(result);
            }
            new ProfileComponent().SendSetEmailCode(this.GetMerchantAccountId(), model.EmailAddress);
            result.Data = true;
            return(result);
        }
        public async Task <ServiceResult> SendVerifyEmail(SendVerifyEmailModel model)
        {
            var result = new ServiceResult();

            if (!ModelState.IsValid)
            {
                result.Code = ReasonCode.MISSING_REQUIRED_FIELDS;
                foreach (string error in ModelState.Values.SelectMany(v => v.Errors.Select(b => b.ErrorMessage)))
                {
                    result.Message += error + Environment.NewLine;
                }
                return(result);
            }

            var accountId = this.WorkContext.MerchantId;

            await new ProfileComponent().SendVerifyEmail(accountId, model.EmailAddress);
            return(result);
        }