BaseEntityInfo Readonly Fields Setting During Hydration
Add an Answer
Your question has been submitted and is awaiting moderation.
Thank you for reporting this content, moderators have been notified of your submission.
Background:
Hi, due to the company for which I am employed's needs, I have needed to create a membership system which ties into our CMS. We have a list of customers with Web-access accounts and would like to have DNN use this information for login. This is important because any changes a user will make should be reflected immediately in our CMS so our members services department has up-to-date information on our members.
The Issue:
In creating a customer MembershipProvider and RoleProvider, I've noticed that a lot of the CBOs that need filling contain read-only fields. Usually, these fields are provided by the BaseEntityInfo class (such as CreatedByUserID and CreatedOnDate). I need to set these fields. This would seem trivial, and I've read a lot about the IHydratable and BaseEntityInfo, but since I need to be returning UserInfo and UserRoleInfo objects instead of user-defined objects, the information seems to have limited application. I've even attempted to roll my own derivatives for UserInfo and UserRoleInfo classes, but since the readonly fields are non-virtual and the underlying fields are private, I can't see any way to set this data. How would one properly set these fields for future retrieval?
Additional Question/Note:
I'm reluctant to just call FillInternal because I can't guarantee that the information source will contain the same column names as DNN would expect (for instance, our database uses WEBUSERID as the UserName). It would be much better if I could simply get the data and hand it to DNN rather than have DNN pull it from the IDataReader. Is this the way it is expected to be done, or is there some way to define my column bindings for DNN?