More confusion about custom Membership and Profile providers

OK, so help me out here. I was looking at the default system-generated database, and it stores the membership user reference for the profile table as uniqueidentifier. How can it do that if the current Membership provider uses some other data type? As I mentioned in my last post, I don't understand how this can be. MembershipUser.ProviderUserKey is an object, so it can take anything. It's not limited to guid's.

2 Comments

  • Hey Jeff:



    I suppose the question is whether or not you are going to use the default membership provider or not. If you are then you are also going to use the default database schema, in which case your key will be a guid. On the other hand, if you choose to implement your own custom membership provider then you are probably also going to be using your own custom database schema -- which may or may not use guid as your key.



    As for your other post, I suppose it comes down to whether or not you choose to keep everything generic or not. What I mean here is that just because ASP.NET has created a generic provider model where the membership key can be any type does not in any way force you to assume everything is generic. Sure you want to try to keep your dependencies as few as possible, but at the same time you do most likely have a very specific schema that must be "hard-coded", so don't fall into the trap and believe there should be no dependencies at all.



    Later, Paul

  • I guess with regards to both of your points, it's not really up to me at all. I mean, I'm not going to force anyone to use any particular providers or scheme (although why should I care, since they aren't paying for it ;)). Grrrr. Maybe I am worrying too much about dependencies.



    Another flaw I've found in the Membership and Profile system is that the interface doesn't absolutely require that you have unique user names, even though they're frequently used as parameters and/or foreign keys. Interesting.

Comments have been disabled for this content.