Using base class as relationship definition in model ASP.net WEB API
So I've written this model that I used to save my credentials to authenticate my users with:
Now as you can see I have a
BaseProfile
here, each credential has its connected profile attached. It is a one to one relationship. However, I have multiple types of profiles, that have a few things in common so I wrote a base class like this:
and then I have different profiles that inherit from this, would this relationship still work as intended when using Baseprofile
? Or do I need to have a field for each profile and have them as nullable/have some enum to decide the profile type and use that as a way to differentiate1 Reply
I would assume I'd need all my profiles inside
UserCredentialsModel
, make them nullable and define the relation in OnModelCreate accordingly?
is what I did now, is this a decent solution or am I looking at it the wrong way?