Beispiel #1
0
 public UsersFindByEMailReply FindUsersByEmail(UsersFindByEMailRequest request)
 {
     try
     {
         UsersFindByEMailReply response = new UsersFindByEMailReply();
         int totalRecords = 0;
         response.UserList     = _membership.FindUsersByEmail(request.EMailPattern, request.PageIndex, request.PageSize, out totalRecords);
         response.TotalRecords = totalRecords;
         return(response);
     }
     catch (ArgumentException ex)
     {
         throw new FaultException <WcfFault>(new WcfFault(ex));
     }
 }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="emailToMatch"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecords"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="emailToMatch"/> is null</exception>
        /// <exception cref="ArgumentException">Throw if <paramref name="pageIndex"/> or <paramref name="pageSize"/> is &lt; 0</exception>
        public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
        {
            using (_log.NewTrace())
            {
                WcfClientUtils.VerifyParameter("emailToMatch", emailToMatch);

                try
                {
                    UsersFindByEMailRequest request = new UsersFindByEMailRequest();
                    request.EMailPattern        = emailToMatch;
                    request.PageIndex           = pageIndex;
                    request.PageSize            = pageSize;
                    request.ServiceSessionToken = WcfClientUtils.SessionToken;
                    UsersFindByEMailReply response = _membershipService.FindUsersByEmail(request);
                    totalRecords = response.TotalRecords;
                    return(response.UserList);
                }
                catch (FaultException <WcfFault> ex)
                {
                    throw WcfUtils.Extract(ex);
                }
            }
        }