public async Task ResetForgetPassword(string emailId) { var user = await this.FindFirstByEmail(emailId); if (user != null) { string newPassword = _encryptionProvider.GetRandomString(); await this.UpdatePassword(user.Id, newPassword); // Common.DataTable dt = this.ExecuteToDataTable("select u.*, p.\"FirstName\",p.\"LastName\",p.\"Phone1\",p.\"Phone2\",p.\"Address1\",p.\"Address2\",p.\"City\",p.\"State\",p.\"Zip\",p.\"Country\" FROM public.portal_users u inner join portal_profiles p on p.id=u.profile_id where u.id=" + savedEntity.Id, null); // bool isSend = this.GetDepRepository<EmailService>().SendEmail(EmailEventType.RegistrationEmailToUser, dt, savedEntity.Email); this._emailService.SendMail(emailId, "Ticket System Admin ", "*****@*****.**", "Ticket System Admin ", "", "", "Ticket Service Password is reset", "Hi " + user.UserName + " Your Password is Reset and now its " + newPassword); } else { await this.ThrowEntityException(new ValidationCodeResult(ErrorCodes[EnumErrorCode.EmailDoesNotExists])); } }