Print Page | Close Window

Membership

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2392
Printed Date: 01-Sep-2025 at 9:18pm


Topic: Membership
Posted By: merc
Subject: Membership
Date Posted: 23-Dec-2010 at 1:32am
I can not call to get list of users, and also update them in the Membership, can give the sample code. 
The examples do not have this code.
Thx.



Replies:
Posted By: DenisK
Date Posted: 27-Dec-2010 at 6:05pm
Hi merc;

I'm sorry but I don't understand your question. Could you explain again with code samples?


Posted By: merc
Date Posted: 27-Dec-2010 at 11:46pm
Example from ASPNET Membership with Registration
how can I call this code

 public IEnumerable<UserInformation> GetUsers() {
      return null;
    }



Posted By: DenisK
Date Posted: 28-Dec-2010 at 1:11pm
merc;

The UserInformation class on the sample solution is a POCO class and as such can be implemented in various ways. We left the GetUsers method to return null so as to leave the implementation up to the developers.

In summary, the UserInformation is only persisted during runtime and is stored inside the RegistrationManager cache. If you look at the properties of UserInformation, they are fields from various tables in the aspnetdb. 

UserInformation.UserName is from dbo.aspnetdb_Users table
UserInformation.Password, UserInformation.Email, UserInformation.Question, and UserInformation.Answer are from dbo.aspnetdb_Membership table

So to implement the GetUsers method, you can do the following:

1. Retrieve the UserInformation from RegistrationManager cache.

or

2. Retrieve UserInformation already stored in the database by retrieving those various properties from aspnetdb.

or

3. Do both.

You can read more about POCO support in DevForce here.

http://drc.ideablade.com/xwiki/bin/view/Documentation/POCOSupportInDevForce - http://drc.ideablade.com/xwiki/bin/view/Documentation/POCOSupportInDevForce

Hope this helps.



Print Page | Close Window