Why no UserID property in the Membership class?

  • Thread starter Thread starter ILaughLouder
  • Start date Start date
I

ILaughLouder

Hi all.

Does anyone know why there is no UserID in the Membership class? I
think it's because the ASP.NET team wants developers to use their own
User class in conjunction with the Membership and Profile classes. But
it's doesn't make any sense, when you already got the user name, email
address, last login etc. Is the only easy alternative to store the user
id in a session? That's not at all OO!!

I really don't get it. Everyone uses the user id for queries and yeah
anything else where you need to do something user specific. Their
should had got it right in ASP.NET 1.1, but nooooo.

Am I the only one who think this is crazy?
 
I've been studying the ASP.NET 2.0 starter kits and all of them seems
to make queries based on user name, except when they use XSD
(auto-generated code) file queries. No one thinks it's weird not to
have a GetUserId method in either the Membership, MemberShipUser,
Profile or Identity class?!?

What do you normally do?

(e-mail address removed) skrev:
 
Take a look again. If you look at the MembershipUser class you'll notice a
property called ProviderUserKey. This should return the identifier for the
user as an object. The system returns an object because, using different
providers, it could need to be different things. It could be an int, or in
the case of using a SQL Server provider, a GUID.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Thanks, I'll look into it. Have to use a firebird provider though.
Mark Fitzpatrick skrev:
 
Back
Top