{"action":"closed","issue":{"url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/485","labels_url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/485/labels{/name}","comments_url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/485/comments","events_url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/485/events","html_url":"https://github.com/bleroy/OrchardImportTest/issues/485","id":65806668,"number":485,"title":"Verify User Unicity","user":{"login":"bleroy","id":1165609,"avatar_url":"https://avatars.githubusercontent.com/u/1165609?v=3","gravatar_id":"","url":"https://api.github.com/users/bleroy","html_url":"https://github.com/bleroy","followers_url":"https://api.github.com/users/bleroy/followers","following_url":"https://api.github.com/users/bleroy/following{/other_user}","gists_url":"https://api.github.com/users/bleroy/gists{/gist_id}","starred_url":"https://api.github.com/users/bleroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleroy/subscriptions","organizations_url":"https://api.github.com/users/bleroy/orgs","repos_url":"https://api.github.com/users/bleroy/repos","events_url":"https://api.github.com/users/bleroy/events{/privacy}","received_events_url":"https://api.github.com/users/bleroy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bleroy/OrchardImportTest/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/bleroy/OrchardImportTest/labels/low","name":"low","color":"5BB13D"},{"url":"https://api.github.com/repos/bleroy/OrchardImportTest/labels/perf","name":"perf","color":"000000"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/bleroy/OrchardImportTest/milestones/2","html_url":"https://github.com/bleroy/OrchardImportTest/milestones/Orchard%201.0","labels_url":"https://api.github.com/repos/bleroy/OrchardImportTest/milestones/2/labels","id":1048087,"number":2,"title":"Orchard 1.0","description":null,"creator":{"login":"bleroy","id":1165609,"avatar_url":"https://avatars.githubusercontent.com/u/1165609?v=3","gravatar_id":"","url":"https://api.github.com/users/bleroy","html_url":"https://github.com/bleroy","followers_url":"https://api.github.com/users/bleroy/followers","following_url":"https://api.github.com/users/bleroy/following{/other_user}","gists_url":"https://api.github.com/users/bleroy/gists{/gist_id}","starred_url":"https://api.github.com/users/bleroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleroy/subscriptions","organizations_url":"https://api.github.com/users/bleroy/orgs","repos_url":"https://api.github.com/users/bleroy/repos","events_url":"https://api.github.com/users/bleroy/events{/privacy}","received_events_url":"https://api.github.com/users/bleroy/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":65,"state":"open","created_at":"2015-04-01T04:10:52Z","updated_at":"2015-04-02T00:35:40Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-04-02T00:35:34Z","updated_at":"2015-04-02T00:35:40Z","closed_at":"2015-04-02T00:35:40Z","body":"hey guys  \ni just download your project and want run project but after code that i saw i\nam affraid to use your framework  \n  \n  \npublic string VerifyUserUnicity(string userName, string email) {  \n\n    \n    \n            IEnumerable<UserPart> allUsers = _contentManager.Query<UserPart, UserPartRecord>().List();\n    \n            foreach (var user in allUsers) {\n                if (String.Equals(userName.ToLower(), user.NormalizedUserName, StringComparison.OrdinalIgnoreCase)) {\n                    return \"A user with that name already exists\";\n                }\n                if (String.Equals(email, user.Email, StringComparison.OrdinalIgnoreCase)) {\n                    return \"A user with that email already exists\";\n                }\n            }\n    \n            return null;\n        }\n    \n        public string VerifyUserUnicity(int id, string userName, string email) {\n            IEnumerable<UserPart> allUsers = _contentManager.Query<UserPart, UserPartRecord>().List();\n            foreach (var user in allUsers) {\n                if (user.Id == id)\n                    continue;\n                if (String.Equals(userName.ToLower(), user.NormalizedUserName, StringComparison.OrdinalIgnoreCase)) {\n                    return \"A user with that name already exists\";\n                }\n                if (String.Equals(email, user.Email, StringComparison.OrdinalIgnoreCase)) {\n                    return \"A user with that email already exists\";\n                }\n            }\n            return null;\n        }\n    \n\nits code from UserService  \nas i understand you load all users from database and then go throw them right?  \nthen what will be if i have more than 1 million users?  \n\nWork Item Details\n--------------------\n**Original CodePlex Issue:**\t[Issue 16595](http://orchard.codeplex.com/workitem/16595)\n**Status:**\tClosed\n**Reason Closed:**\tUnassigned\n**Assigned to:**\tsuhacan\n**Reported on:**\tAug 27, 2010 at 9:47 AM\n**Reported by:**\tvovikdrg\n**Updated on:**\tNov 29, 2010 at 9:14 PM\n**Updated by:**\tsuhacan\n**Closed on:**\tNov 29, 2010 at 9:14 PM\n**Closed by:**\tsuhacan\n**Status:**\tClosed\n**Reason Closed:**\tUnassigned\n**Assigned to:**\tsuhacan\n**Reported on:**\tAug 27, 2010 at 9:47 AM\n**Reported by:**\tvovikdrg\n**Updated on:**\tNov 29, 2010 at 9:14 PM\n**Updated by:**\tsuhacan\n**Closed on:**\tNov 29, 2010 at 9:14 PM\n**Closed by:**\tsuhacan\n"}}