Elegant method to access part on the User Content Type?

Topics: Customizing Orchard, Writing modules
Nov 28, 2011 at 10:02 PM

Currently in my MembershipService, I am grabbing any old user to acquire the part to allow me to read the settings:


 var adminUser = _orchardServices.ContentManager.Query<UserPart, UserPartRecord>().Where(u => u.NormalizedUserName != "xxx").List().FirstOrDefault();

 dynamic contentItem = adminUser.ContentItem;

 var part = contentItem.OasisProfilePart;

string url = part.Settings["OasisSiteTypePartSettings.Uri"];

Please let me know if there is a more direct way to accomplish this.

Thank you