beratuslu
beratuslu

Reputation: 1119

should i use asp.net membership system or not?

I developing a network that uses membership. I have a couple of stories that i have to implement. and i want to use to entity framework with MVC 2 to build this site. asp.net membership system has really really nice features. but is it hard to extend? i dont know.

one of these: i want to give each users to a uniq name that users can use it to "www.somesite.com/someuser" like this. i want to optionally users can generate these unique names from first name and last name(James Hetfield= jameshetfield). so i have to extend my membership table structure. but i dont know that how to save my users first name and last name in my data base to interact with my membership and forms authentication methods. how do i do this?

where i getting confused is: when i change the data on membership tables.. what if there is any field to i have to change with my changes.

Upvotes: 0

Views: 488

Answers (2)

Laramie
Laramie

Reputation: 5587

One quick question, since your concatenated first/last name identifier needs to be unique for URL purposes, why not just make that the username, then add their first and last names to the profile service?

Membership is very convenient and turnkey for the most part. No sense in re-inventing the wheel, especially with the built in objects and support in the Membership and Roles objects. If DB storage is a concern, I'd suggest designing early on to add a new key to the membership table to do joins on. It will really help your performance and space requirements. I recently had to refactor mine and wished I'd done it early on.

Another word of caution is that it is possible to use Membership with MySQL if you have any plans to support that DB, but it is by no means straigh forward.

Upvotes: 0

Rob
Rob

Reputation: 5603

It's easy to extend from a data perspective, just define your own EF Person table and store a ProviderUserKey guid column to serve as a foreign key to the ASP.NET Membership tables.

The larger difficulty occurs when you want to do everything programmatically instead of via the design surface controls (for login, password recovery, etc.). It's all do-able and straightforward once you find the documentation, but you end up doing a lot of googling. You'll need to do this in order to hook the proper events that allow you to create and drop membership and person simultaneously, etc.

All in all, it makes sense to use and extend versus roll your own. There's a lot that's taken care of for you.

Upvotes: 1

Related Questions