C
C#9mo ago
ZML

ASP Identity - additional properties

Hello, I'm working on a hotel management program in ASP.NET. I've implemented Identity to manage users. In the program, I anticipate at least 2 types of users: Customer and Employee. Here comes my question. Should I create a new class ApplicationUser : IdentityUser and add all the properties of Customer (e.g., FirstName, LastName) and Employee (FirstName, LastName, EmployeeNumber) there, or should I create classes CustomerProfile and EmployeeProfile, and store only the ProfileId or CustomerProfileId and EmployeeProfileId in ApplicationUser?
1 Reply
Angius
Angius9mo ago
If those two types of users really have different properties, I'd probably go the profile path CustomerProfile with an FK to the IdentityUser, and EmployeeProfile with an FK to the IdentityUser You could still put the shared properties into a class that derives from IdentityUser too, and have FKs to that in your profiles
Want results from more Discord servers?
Add your server