@Znowman, thanks a lot for the reference to UserPersonalInformation - I've already done the same work for my module :)
I don't fully understand your desire to have 'a normal user with extra fields and is still managable like a normal user'. As far as I understand a module like UserPersonalInformation will inevitably add new fields to standard user implementation - for all
users without exception. If you mind having several sets of users with different sets of fields, this should be carried as a fully separate module with all own tables, imho..
As for me, I see here another big problem:
say, I have 4 users within my DB, and my User content type includes my own part (RmsUserPart), that extends standard implementation with Skype field. I'm querying all users in order to show them at the UI:
var userQuery = OrchardServices.ContentManager.Query().ForType("User");
var users = userQuery.List();
var viewModel = new RmsUserIndexViewModel();
viewModel.Users = users.Select(x => new RmsUserItem
UserPart = x.Parts.OfType<UserPart>().First(),
RmsUserPart = x.Parts.OfType<RmsUserPart>().First()
return View("Users", viewModel);
And when I look through the SQL Profiler's output, there are about N * M requests, where N = number of users, M = number of content parts the user consists of and I use to show info at the UI.
So consider the case when I'm going to handle 1000 or more Users, Products or some another complex content type - I'll get a huge bunch of SQL queries.
I'm not aware if there any mechanisms in Orchard that will let me tell the ContentManager to load users 'eagerly'..
I know there is an option to access underlying tables directly via LINQ queries, but that would be wonderful if ContentManager took all this job.