Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET 4.5 Universal Membership Provider table names

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?

like image 432
Matt Mombrea Avatar asked Jul 12 '12 15:07

Matt Mombrea


People also ask

Which namespace contains the membership provider class?

Web. Security namespace includes a class named MembershipUser that defines the basic attributes of a membership user and that a membership provider uses to represent individual users.

What is membership provider in asp net?

The ASP.NET membership provider is a feature that enables ASP.NET developers to create Web sites that allow users to create unique user name and password combinations. With this facility, any user can establish an account with the site, and sign in for exclusive access to the site and its services.

What is membership in web config?

The membership element is a sub-element of the system. web section. You can enable ASP.NET Membership for an application by directly editing the Web. config file for that application, or you can use the Web Site Administration Tool, which provides a wizard-based interface.


2 Answers

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.

like image 62
Hao Kung Avatar answered Sep 23 '22 02:09

Hao Kung


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].

like image 26
BillVo Avatar answered Sep 19 '22 02:09

BillVo