Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0GetUser and Hydrated profileGetUser and Hydrated profile
Previous
 
Next
New Post
8/17/2006 5:45 PM
 
Hello,

I am working on some code that uses the core profile properties (eg. the Website profile property, if it exists) and looking at this GetUser method, I am a little confused:

UserInfo userInfo = UserController.GetUser(base.PortalId, userID, false);

The 3rd paramater is whether the user shoud be hydrated or not (bool IsHydrated). To improve performace, I set it to false, but I was surprised to that the userInfo object still contained the extended profile info, like

lnkWebsite.Text = userInfo.Profile.Website;

Have I misunderstood what IsHydrated does?

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
8/18/2006 1:04 AM
 

From memory I think the IsHydrated parameter specifies whether to grab Data from the ASP memberhship tables.

So that the objUser.Membership object is populated by IsHydrated.

Either that or theres some caching going on.

 

 

 

 
New Post
9/8/2006 10:50 AM
 
Rodney,  how did go understanding isHydrated?

DotNetNuke Search Engine
ASP.Net Search Engine
Email me to add your favorite sites to the search List.
 
New Post
9/13/2006 6:21 PM
 

Actually UserInfo is progressively hydrated on demand - if you don't access the extended properties (either Profile or Membership) they will not be loaded - you will find this behavior applies separately to UserInfo.Profile and UserInfo.Membership within the get properties (member variable accessor) functions within Components/Users/UserInfo.vb.

You are correct in your thinking the way it *should* work, but in reality the IsHydrated flag is simply dropped (ignored) by the SqlDataProvider stored proc.

The hydration mechanism used in the UserInfo, UserController, UserMembership and UserProfile classes seems to work ok for reading properties, but it really doesn't work (or make sense) if you assign properties.

IMHO, the process needs a little refactoring.


Dwayne J. Baldwin
 
New Post
9/13/2006 8:58 PM
 
This is true.

In the most part it is effectively ignored. 

As soon as you go UserInfo.Profile.Anyproperty it will hydrate on demand.  So you can never really tell if it is hydrated or not.  Even stepping thru on debug will hydrate the profile if you look at the property in the Watch window :)

When I refactored the code into the new providers I kept most of the logic the same (unless I had a reason to change it) and this was the way it worked in 3.2.

However if you get all users for a drop down combo, for instance, and never access the profile property ie use UserInfo.DisplayName for instance it should not hydrate the profile for each user saving unneccessary database calls.




Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0GetUser and Hydrated profileGetUser and Hydrated profile


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out