当使用ASP.Net会员外加表来存储用户的信息,我应该链接其他表aspnet_Users还是我自己的表? [英] When using ASP.Net Membership plus an additional table to store user Information, should I link other tables to aspnet_Users or my own Table?

查看:133
本文介绍了当使用ASP.Net会员外加表来存储用户的信息,我应该链接其他表aspnet_Users还是我自己的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ASP.Net成员资格,以确保我的网站,我有一个关于如何存储额外的用户信息的问题。谷歌搜索和阅读其他问题我想了3公认的方法来存储更多的数据。

I'm using ASP.Net membership to secure my site and I have a question about how to store extra user information. By googling and reading other questions I think the 3 accepted approaches to storing additional data


  1. 简介框架 - 通常被视为过于限制

  2. 自定义配置文件提供者 - 一点点大于我想此刻尝试

  3. 使用与用户信息的另一个表 - 选择我下面

我除了命名User_Information的ASP.Net会员表,有一个一到一个外键来创建aspnet_Users一个新表。当我创建一个新表来存储链接到用户的信息(例如评论,投票等)我应该设置外键指向aspnet_User还是我User_information表?

I've created a new table in addition to the ASP.Net membership tables named User_Information that has a one-to-one foreign key to aspnet_Users. When I create a new table to store information linked to a user (e.g. comments, votes, etc) should I set the foreign key to point to aspnet_User or my User_information table?

感谢

推荐答案

这要看你的查询的性质。

It depends on the nature of your queries.

成员资格提供给你从aspnet_Users表格内轻松获得用户ID列。这将需要一个额外的查询来获得你的表中的ID。

The Membership provider will give you easy access to the user ID column from the aspnet_Users table. It will take an extra query to get the ID from your table.

然而,如果大多数的查询要求反正加入您User_Information表,那么它可能不是真正的问题。

However, if most of your queries require joining your User_Information table anyway, then it may not really matter.

这篇关于当使用ASP.Net会员外加表来存储用户的信息,我应该链接其他表aspnet_Users还是我自己的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆