问题
I would like to ask what is difference betweeen this three membership providers from SQL Server Compact perspective. As far I as I saw first two of them can use compact server by design and third one by coincidence I guess, because of entity framework. So, is there any difference in fact?
回答1:
Difference is Universal is nearly the same as original with added support for SQL Compact and Azure. Simple membership is a bit simplified, has a few additional modern implementations like token based password resets and works great with ASP.NET Webpages. Both are written by using barebone SQL and have clunky table structures. Code-first is written in EF therefore it supports more databases, it is simplified a bit more as it can only be used on 1 site (in my current implementation) has neater tables which are easily extendable. Code-first provides a better prograiming experience.
Answer by Se3ker
回答2:
there is no difference between the providers from a sql compact perspective. they will function the same. there are some implementation differences in how simple membership works vs universal providers so if you do not care about it then you should be fine
回答3:
SimpleMembership provider has a badly designed structure -
You don't have the ability to change internal table names - when you have one database for two or more applications [backend/frontend] sometimes it is important to have separate tables for each of them.
Because table names have been developed as static variables - you can't to change their names by way of a configuration file, nor by a custom overridden class :).
Also WebMatrix.WebSecurity contains self defined DataContext, it actually isn't "Code First". Deep inside it has the same xml files (with database structure) - so it is actually "Database First", but with a structure which can't be changed - it has been embedded as a resource.
For me standard membership is a better design than what is provided by WebSecurity.
来源:https://stackoverflow.com/questions/12049841/simple-membership-provider-vs-universal-vs-code-first