Adopting aspnet _... tables from ASP.NET MVC

I am just starting a new project on ASP.NET MVC, and this will be the first project actually using this technology. When I created my new project with Visual Studio 2010, he created a bunch of tables with the aspnet_ prefix for my SQL server. Some of them relate to built-in user accounts and permission support.

Now I want to save certain information about my users. My question is: β€œIs it good practice to restructure the aspnet_ tables to meet my user account information needs?”

And I guess the answer is no. (Why exactly?), I intend to create my own table "Users". What is a good approach for connecting entries from the aspnet_Users table and my own user user table.

I want the ratio to be 1: 1, and the design in the database should be as transparent as possible in my C # code (I use linq for sql, if that matters). Also, I don't want to replicate usernames and passwords from aspnet_ tables to the table and save the data.

I am considering using a presentation to join them. Is that a good idea?

Thanks in advance!

EDIT: From the answer, I see that I cannot be clear enough about what I want. The question is not to use the default asp.net provider, but how to accept it, for my needs.

+4
source share
3 answers

If you prefer to use the membership API for your site, then the link

+1
source

I would create a user membership provider and completely drop those aspnet_x tables. I saw what happens when one join these tables and user tables with nhibernate mappings are a pure nightmare.

+4
source

Using asp.net membership has its advantages and disadvantages. It’s easy to get started because you don’t have to worry about checking, registering users, resetting passwords. (Be careful if you plan to change table structures, you will have to change them in the created view / storage procedures

However, there are drawbacks to using membership. You will need to support 2 divided systems, because there are limitations in the membership API, for example, you cannot perform operations inside an api membership transaction. (If you are not using TransactionScope, I think, but you have no other options).

A valid alternative would be to implement your own security verification procedures and use FormsAuthentication. This way you will have full control over your user tables and remove the dependency on the membership API.

-1
source

Source: https://habr.com/ru/post/1302088/


All Articles