/// <summary>
        ///异步验证
        /// </summary>
        public static async Task DoValidationAsync(IRolesRespository rolesRespository, Roles roles, string validatorType)
        {
            var rolesValidator    = new RolesValidator(rolesRespository);
            var validatorReresult = await rolesValidator.DoValidateAsync(roles, validatorType);

            if (!validatorReresult.IsValid)
            {
                throw new DomainException(validatorReresult);
            }
        }
        /// <summary>
        ///异步验证
        /// </summary>
        public static async Task DoValidationAsync(IRolesRespository rolesRespository, IEnumerable <Roles> roless, string validatorType)
        {
            var rolesValidator  = new RolesValidator(rolesRespository);
            var domainException = new DomainException();

            foreach (var roles in roless)
            {
                var validatorReresult = await rolesValidator.DoValidateAsync(roles, validatorType);

                if (!validatorReresult.IsValid)
                {
                    domainException.AddErrors(validatorReresult);
                }
            }

            if (domainException.ValidationErrors.ErrorItems.Any())
            {
                throw domainException;
            }
        }