4
I’m trying to do the entity
map two classes to the same table this is possible?
Setting:
Man identity
this decoupled (Eduardo Pires' Master) from my domain and the presentation layer in the domain layer I have a class usuario
that I would like to represent the table AspNetUsers
, but when I refer the class usuario
in the context (DBSet<usuario>
) and send the migrations
update all it shows me the following error:
The entity types 'Usuario' and 'IdentityUser' cannot share table 'AspNetUsers' because they are not in the same type hierarchy or do not have a valid one to one foreign key relationship with matching primary keys between them.
I’ve circled all over, but, I haven’t succeeded, someone can shed some light?
What you’re trying to do, it doesn’t work, and the error says that there’s a hierarchy of relationship between them.
– novic
Opa... Vlw by the speed.... And by chance I can convert the applicationUser to be received by my user class????
– Bruno Dias
Also no, what you need to do?
– novic
Implement an interface with some specific methods to handle user data.
– Bruno Dias
So, I implemented making direct reference to the context of Identity... I know q is not very elegant but it worked... vlw by the willingness to help...
– Bruno Dias