Fixed some APIs that worked mins ago....something strange happening with EF relationships.
This commit is contained in:
parent
295e62d773
commit
14e8c3b820
10 changed files with 62 additions and 43 deletions
|
@ -39,6 +39,11 @@ namespace API.Data
|
|||
.WithOne(u => u.Role)
|
||||
.HasForeignKey(ur => ur.RoleId)
|
||||
.IsRequired();
|
||||
// AppUsers have Libraries, not other way around
|
||||
builder.Entity<Library>()
|
||||
.HasMany(p => p.AppUsers)
|
||||
.WithMany(p => p.Libraries)
|
||||
.UsingEntity(j => j.ToTable("AppUserLibrary"));
|
||||
}
|
||||
|
||||
void OnEntityTracked(object sender, EntityTrackedEventArgs e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue