This is in reference to custom membership provider we built for Oracle but the concept is similar to SQL Membership. Found that the profile table has both LastActivityDate and LastUpdatedDate getting updated. A little digging into it took me to the root cause of the problem - usage of Profile to read custom Profile properties (XML).
For example, any place we use Profile.LastName to get the last name then it's updating the LastActivityDate (as expected) and also updates LastUpdatedDate. Which is not intended. The idea is to update the latter column only when the user modifies and saves their profile.
ProfileCommon myProfile = (ProfileCommon)ProfileCommon.Create(HttpContext.Current.User.Identity.Name);
ProfileCommon myProfile = Profile.GetProfile(User.Identity.Name);
And then to get your LastName property, just use myProfile.LastName.
No comments:
Post a Comment