There are two tables: aspnet_users and aspnet_membership. Can anyone elaborate on the reasons why they don't use a single table for this?
有两个表:aspnet_users和aspnet_membership。任何人都可以详细说明他们为什么不使用单一表格的原因?
6 个解决方案
#1
12
The membership table holds information related to the MembershipProvider API interface. The users table stores usernames and user ids, which are referenced from many providers.
成员资格表包含与MembershipProvider API接口相关的信息。 users表存储用户名和用户ID,这些用户名和用户ID是从许多提供程序引用的。
- Users
- Membership (MembershipProvider)
- 会员资格(MembershipProvider)
- Profile (ProfileProvider)
- 个人资料(ProfileProvider)
- Roles (RoleManager)
- 角色(RoleManager)
- etc
- 等等
- 用户成员资格(MembershipProvider)配置文件(ProfileProvider)角色(RoleManager)等
The aspnetdb system is very modular and each piece can be customized through the various providers. The tables need to be separated so each interface can be rewritten, redirected, etc.
aspnetdb系统非常模块化,每个部分都可以通过各种提供商进行定制。这些表需要分开,以便可以重写,重定向等每个接口。
#2
0
Honestly it doesn't make much sense to me either. It seems as though the aspnet_Membership table was set up to house user/Application level information but UserID is a PK. Very strange. Perhaps there were setting themselves up for a situation where you do have multiple applications per user in some later release.
老实说,这对我来说也没什么意义。似乎aspnet_Membership表设置为容纳用户/应用程序级别信息,但UserID是PK。很奇怪。也许在某些情况下,您可能会在以后的版本中为每个用户提供多个应用程序。
Dave mentions that there are other tables like aspnet_Profile that hold user specific info. It could be that the ASP.NET 2.0 folks were just trying to separate out different groupings of fields into more easily digestible chunks.
戴夫提到有一些像aspnet_Profile这样的表可以保存用户特定的信息。可能是ASP.NET 2.0人员只是试图将不同的字段分组分成更易消化的块。
I know it's just a bunch of conjecture. Hopefully someone with some actual knowledge will chime in.
我知道这只是一堆猜想。希望有一些实际知识的人会参与其中。
#3
0
I found this explination from this page:
我从这个页面找到了这个探索:
The SqlMembershipProvider stores user account information in two related tables:
SqlMembershipProvider将用户帐户信息存储在两个相关表中:
-
aspnet_Users - has a record for each user account, storing the bare essentials. The UserId column uniquely identifies each user in the system, and is stored as a uniqueidentifier (a GUID).
aspnet_Users - 拥有每个用户帐户的记录,存储最基本的要素。 UserId列唯一标识系统中的每个用户,并存储为uniqueidentifier(GUID)。
-
aspnet_Membership - has a UserId column that ties each record back to a particular record in aspnet_Users. The aspnet_Membership table stores core data associated with every user account: Email, Password, the security question and answer, and so on.
aspnet_Membership - 有一个UserId列,它将每条记录绑定回aspnet_Users中的特定记录。 aspnet_Membership表存储与每个用户帐户关联的核心数据:电子邮件,密码,安全问题和答案等。
#4
0
Some of the other providers in ASP.NET (other than the Membership provider) also store user-specific information. e.g. Profile.
ASP.NET中的一些其他提供程序(成员资格提供程序除外)也存储特定于用户的信息。例如简介。
More information about this:
更多相关信息:
Several of the shipped ASP.NET providers store/use information in the context of a user name. One of these is MembershipProvider, which provides an authentication store and set of services.
一些提供的ASP.NET提供程序在用户名的上下文中存储/使用信息。其中之一是MembershipProvider,它提供身份验证存储和一组服务。
Another is ProfileProvider, which allows user-specific data to be held against each user.
另一个是ProfileProvider,它允许针对每个用户保存用户特定的数据。
You can still use ProfileProvider regardless of whether or not you have chosen to use MembershipProvider. Because ProfileProvider must store data against a user name (i.e. as exposed by the Context.User.Identity.Name
property), it will go ahead and add a user record into aspnet_Users.
无论您是否选择使用MembershipProvider,您仍然可以使用ProfileProvider。因为ProfileProvider必须存储针对用户名的数据(即由Context.User.Identity.Name属性公开),所以它将继续并将用户记录添加到aspnet_Users中。
Hopefully this clarifies the reason for the separation.
希望这澄清了分离的原因。
#5
0
The aspnet_users
contains the users you create (authentication FORMS) ... NOTE THET when your authentication is set to WINDOWS, the users are WINDOWS users e.g. domain\firstname.lastname
aspnet_users包含您创建的用户(身份验证FORMS)...注意当您的身份验证设置为WINDOWS时,用户是WINDOWS用户,例如域\ firstname.lastname
The aspnet_membership
contains membership preference information used in stuff like WebPart
s and user settings
aspnet_membership包含在WebParts和用户设置等内容中使用的成员资格首选项信息
#6
0
The aspnet_users table contains information for all users : anonymous and not anonymous. The aspnet_membership table contains information about register users (no anonymous).
aspnet_users表包含所有用户的信息:匿名而非匿名。 aspnet_membership表包含有关注册用户的信息(无匿名)。
#1
12
The membership table holds information related to the MembershipProvider API interface. The users table stores usernames and user ids, which are referenced from many providers.
成员资格表包含与MembershipProvider API接口相关的信息。 users表存储用户名和用户ID,这些用户名和用户ID是从许多提供程序引用的。
- Users
- Membership (MembershipProvider)
- 会员资格(MembershipProvider)
- Profile (ProfileProvider)
- 个人资料(ProfileProvider)
- Roles (RoleManager)
- 角色(RoleManager)
- etc
- 等等
- 用户成员资格(MembershipProvider)配置文件(ProfileProvider)角色(RoleManager)等
The aspnetdb system is very modular and each piece can be customized through the various providers. The tables need to be separated so each interface can be rewritten, redirected, etc.
aspnetdb系统非常模块化,每个部分都可以通过各种提供商进行定制。这些表需要分开,以便可以重写,重定向等每个接口。
#2
0
Honestly it doesn't make much sense to me either. It seems as though the aspnet_Membership table was set up to house user/Application level information but UserID is a PK. Very strange. Perhaps there were setting themselves up for a situation where you do have multiple applications per user in some later release.
老实说,这对我来说也没什么意义。似乎aspnet_Membership表设置为容纳用户/应用程序级别信息,但UserID是PK。很奇怪。也许在某些情况下,您可能会在以后的版本中为每个用户提供多个应用程序。
Dave mentions that there are other tables like aspnet_Profile that hold user specific info. It could be that the ASP.NET 2.0 folks were just trying to separate out different groupings of fields into more easily digestible chunks.
戴夫提到有一些像aspnet_Profile这样的表可以保存用户特定的信息。可能是ASP.NET 2.0人员只是试图将不同的字段分组分成更易消化的块。
I know it's just a bunch of conjecture. Hopefully someone with some actual knowledge will chime in.
我知道这只是一堆猜想。希望有一些实际知识的人会参与其中。
#3
0
I found this explination from this page:
我从这个页面找到了这个探索:
The SqlMembershipProvider stores user account information in two related tables:
SqlMembershipProvider将用户帐户信息存储在两个相关表中:
-
aspnet_Users - has a record for each user account, storing the bare essentials. The UserId column uniquely identifies each user in the system, and is stored as a uniqueidentifier (a GUID).
aspnet_Users - 拥有每个用户帐户的记录,存储最基本的要素。 UserId列唯一标识系统中的每个用户,并存储为uniqueidentifier(GUID)。
-
aspnet_Membership - has a UserId column that ties each record back to a particular record in aspnet_Users. The aspnet_Membership table stores core data associated with every user account: Email, Password, the security question and answer, and so on.
aspnet_Membership - 有一个UserId列,它将每条记录绑定回aspnet_Users中的特定记录。 aspnet_Membership表存储与每个用户帐户关联的核心数据:电子邮件,密码,安全问题和答案等。
#4
0
Some of the other providers in ASP.NET (other than the Membership provider) also store user-specific information. e.g. Profile.
ASP.NET中的一些其他提供程序(成员资格提供程序除外)也存储特定于用户的信息。例如简介。
More information about this:
更多相关信息:
Several of the shipped ASP.NET providers store/use information in the context of a user name. One of these is MembershipProvider, which provides an authentication store and set of services.
一些提供的ASP.NET提供程序在用户名的上下文中存储/使用信息。其中之一是MembershipProvider,它提供身份验证存储和一组服务。
Another is ProfileProvider, which allows user-specific data to be held against each user.
另一个是ProfileProvider,它允许针对每个用户保存用户特定的数据。
You can still use ProfileProvider regardless of whether or not you have chosen to use MembershipProvider. Because ProfileProvider must store data against a user name (i.e. as exposed by the Context.User.Identity.Name
property), it will go ahead and add a user record into aspnet_Users.
无论您是否选择使用MembershipProvider,您仍然可以使用ProfileProvider。因为ProfileProvider必须存储针对用户名的数据(即由Context.User.Identity.Name属性公开),所以它将继续并将用户记录添加到aspnet_Users中。
Hopefully this clarifies the reason for the separation.
希望这澄清了分离的原因。
#5
0
The aspnet_users
contains the users you create (authentication FORMS) ... NOTE THET when your authentication is set to WINDOWS, the users are WINDOWS users e.g. domain\firstname.lastname
aspnet_users包含您创建的用户(身份验证FORMS)...注意当您的身份验证设置为WINDOWS时,用户是WINDOWS用户,例如域\ firstname.lastname
The aspnet_membership
contains membership preference information used in stuff like WebPart
s and user settings
aspnet_membership包含在WebParts和用户设置等内容中使用的成员资格首选项信息
#6
0
The aspnet_users table contains information for all users : anonymous and not anonymous. The aspnet_membership table contains information about register users (no anonymous).
aspnet_users表包含所有用户的信息:匿名而非匿名。 aspnet_membership表包含有关注册用户的信息(无匿名)。