示例#1
0
        protected override void Execute(RuleContext context)
        {
            var target = (IUser)context.Target;
            var users  = UserInfoList.FetchUserInfoList(new UserCriteria {
                Email = target.Email
            });

            if (users.Count(row => row.UserId != target.UserId) != 0)
            {
                context.AddErrorResult("That email address is already in use.");
            }
        }
示例#2
0
        protected override void Execute(RuleContext context)
        {
            var target = (IUser)context.Target;

            if (string.IsNullOrEmpty(target.Email))
            {
                return;
            }

            var data = UserInfoList.FetchUserInfoList(new UserDataCriteria
            {
                Email = target.Email
            });

            if (data.Count(row => row.UserId != target.UserId) != 0)
            {
                context.AddErrorResult(string.Format("The user email '{0}' is already in use.", target.Email));
            }
        }
示例#3
0
 public static UserInfoList UserFetchInfoList(UserDataCriteria criteria)
 {
     return(UserInfoList.FetchUserInfoList(criteria));
 }