Is it possible to create two separate Id tables to store separate login information in Asp.Net MVC 5

I am new to Asp.net MVC framework.

Can Asp.net MVC 5 allow you to create two separate identity tables that have independent columns to store two different user data including username and password.

Save the diagram as follows

Stores table
  id
  storename
  address
  ....

      

As per requirement, I have two different types of users, namely RetailUsers and Suppliers.

1) RetailUser should only be assigned to one store and the table schema looks like this

RetailUsers table
  id
  username
  password
  name
  address
  StoreId

      

So, there will be one store assigned by RetailUser.

2) The vendor will be assigned to multiple stores and the table schema looks like this

Suppliers table
  id
  username
  password
  suppliername
  address
  payment
  ....

SupplierStores table
  SupplierId
  StoreId

      

So there will be multiple stores assigned to multiple vendors.

Association of RetailUser and Vendor Models with Store Model

RetailUser model belongs to Store model

Suppliers model has many Stores model

      

As per requirement, RetailUsers and Suppliers have two different logins. So we thought we had two different identity tables. Please help me on how to create two separate identity tables for RetailUsers and vendors with the above fields.

+3


source to share


1 answer


The answer is "Yes, you can." But this is a lot of work. Since your question does not provide enough details and reasons for this question, I recommend not doing this. Especially considering "new to Asp.net MVC" - do the easiest first.

Update There is no need to create separate tables for users. There is a table with users. Then tables for RetailUserInfo

and for SuppliersInfo

. Then go from both of these tables to the users table.



This way, you highlight issues - information about inputs is stored in one table, information about suppliers in another, information about customers in a third.

There is no need to hack the identification to pieces.

+1


source







All Articles