FetchUserInfoList() static private method

static private FetchUserInfoList ( UserDataCriteria criteria ) : UserInfoList
criteria UserDataCriteria
return UserInfoList
Ejemplo n.º 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.");
            }
        }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 3
0
 public static UserInfoList UserFetchInfoList(UserDataCriteria criteria)
 {
     return(UserInfoList.FetchUserInfoList(criteria));
 }