コード例 #1
0
        public ActionResult GetUserByEmail(string email)
        {
            var request = new GetUserByEmailRequest { Email = email };
            var response = this.membershipService.GetUserByEmail(request);
            var result = response.ConvertToUsersInRoleViewModel();

            var jsonNetResult = new JsonNetResult
            {
                Formatting = (Formatting)Newtonsoft.Json.Formatting.Indented,
                Data = result
            };
            return jsonNetResult;
        }
コード例 #2
0
        /// <summary>
        /// The get user by email.
        /// </summary>
        /// <param name="request">
        /// The request.
        /// </param>
        /// <returns>
        /// The <see cref="GetUserByEmailResponse"/>.
        /// </returns>
        public GetUserByEmailResponse GetUserByEmail(GetUserByEmailRequest request)
        {
            var user = this.userRepository.GetUserByEmail(request.Email);
            if (user == null)
            {
                return new GetUserByEmailResponse { MessageType = MessageType.Warning, Message = CommonResources.UserNotFound };
            }

            var result = user.ConvertToGetUserByEmailResponse();
            return result;
        }