问题
Is there any way to prefix the new .NET 4.5 DefaultMembershipProvider table names in the database? They used to be named aspnet_Users, aspnet_Roles etc. and they are now named just Users, Roles, etc. which is conflicting with my application schema that has a table User.
Is my only option to use a separate database for membership if I want to use the new universal providers and avoid this naming issue?
回答1:
Unfortunately there is no way to customize the table names for the Universal Providers currently, I'll make sure we consider adding support for this in the future.
回答2:
It may be possible to have DefaultMembershipProvider use tables under a different schema by having it connect to SQL with a login which maps to a non-default schema (e.g. "membership") in the target database. In SSMS, look at the Login Properties, User Mapping, Default Schema. That way, the application's [dbo].[Users]
would not conflict with [membership].[Users]
.
来源:https://stackoverflow.com/questions/11455676/net-4-5-universal-membership-provider-table-names