public void ProjectAproved(Project project) { string pass = string.Empty; string login = project.Responses.Find(i => i.IsVerified).InvestorEmail; var user = Repository.GetOne <Users>(u => u.Username == login); if (user == null) { pass = Guid.NewGuid().ToString().Substring(0, 5); Membership.CreateAccount(login, pass); Roles.AddUserToRole(login, "Investor"); } SendMailFromDb(project, new { Pass = pass, Login = login, Project = project }, ProjectWorkflow.Trigger.InvestorSelected, UserType.Investor); }