I have this data model that I cant make it work.
One User can be associated to a Company AND multiple at the same time.
However a Company has multiple Users
Image example below:
I have tried to set relations on the modelBuilder like this:
builder
.HasMany(c => c.Users)
.WithOne(u => u.CurrentAssociatedCompany)
.HasForeignKey(u => u.CurrentAssociatedCompanyId)
.IsRequired();
But i get an error in the migration
Value cannot be null. (Parameter 'key')
Even researched about InverseProperty but no luck there either.
My question, is it possible to achieve this or should I try a different approach?
