Store User Settings in ASP.NET Core Identity AspNetUsers Table or Not

Etienne Charland

I'm setting up a web application using ASP.NET Core with authentication through Identity Framework. Quick question. I'm storing all kinds of data about the user like their address, account settings, subscription status and expiration date, etc. Am I better to store all that in the AspNetUsers table by creating ApplicationUser class inheriting IdentityUser, or should I keep that table for login/security information and create another table to store data only related to my application, and have a 1-to-1 relationship between the 2 tables?

Andez

Always a separate table/class.

Complexity grows with the application. The table will become too large then you would spend time moving away from this. We have similar in our legacy application with an Organisation that has grown to 70+ columns. I've heard stories on Twitter about people with similar experiences.

Also alongside this you can think about Single Responsibility. Given a single reason for change - or more to Uncle Bobs updated definition "A module should be responsible to one, and only one, actor".

You could end up having settings per module - and the more you add, this is just going to get bigger. Sure, just leave it till later to change things - but this never happens.

For me the Identity is its own system. Not your system. It provides a mechanism to authenticate. It uses most columns in the able or fields in the user class to do this.

Your settings is about your application - this is your domain. If you replace Identity, you might replace that user table/user class. Then where will your settings end up?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

ASP.NET Core Identity - get current user

What is the purpose of the ConcurrencyStamp column in the AspNetUsers table in the new ASP.NET MVC 6 identity?

ASP.NET Identity remove column from AspNetUsers table

InvalidOperationException when registering a new user with ASP .NET Core Identity and EntityFrameworkCore

Asp.net core - no such table: AspNetUsers

How to sign out other user in ASP.NET Core Identity

Refresh user cookie ticket in ASP.Net Core Identity

ASP.NET Core Identity Role, Claim and User

ASP.NET Core Identity impersonate specific user

Mock User.Identity in ASP.NET Core for Unit Testing

How to Rename AspNetUsers table for a class inherited from IdentityUser in ASP .NET Core 2.1?

asp.net core 2.0 identity entity framework user not saved

How to get Asp.net Core Identity User in View

ASP.NET core Identity seed only creates the last user

Log IP of signed in user with ASP.net core Identity MVC

IdentityServer4 can't add asp net core identity with custom user store

asp.net identity 2.0 unity not resolving default user store

Entity Framework using Identity - Trying to update a user in the AspNetUsers table

ASP.NET Core 1.1 User Impersonation with Identity

ASP.NET Core Identity Settings Not Working

ASP.NET - Display all Users from AspNetUsers table into Dropdown List in Identity?

Showing User Names (stored in ASP.Net Core Identity system), instead of IDs When loading a table

How to customize table names for Asp.Net Identity (ex. change from AspNetUsers to a custom name)

Asp.net core role based access identity / roles make user table self referencing

ASP.NET Core Identity user groups

ASP .NET Core Where to store application custom settings

Adding name to the user model in Asp.Net Core Identity

How to ask for password when user open settings page in ASP.NET Core Identity?

ASP.NET Core Identity use different user table