Included navigation fields in get queries
This commit is contained in:
@@ -8,7 +8,7 @@ public class AuthorBook : Models.AuthorBook
|
||||
{
|
||||
public virtual Author Author { get; set; } = new();
|
||||
|
||||
public virtual Product Book { get; set; } = new();
|
||||
public new virtual Product? Product { get; set; }
|
||||
|
||||
public virtual ICollection<BookPage> Pages { get; set; } = [];
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class AuthorBookConfiguration : IEntityTypeConfiguration<AuthorBook>
|
||||
.HasForeignKey(f => f.AuthorId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
builder.HasOne(f => f.Book)
|
||||
builder.HasOne(f => f.Product)
|
||||
.WithMany()
|
||||
.HasForeignKey(f => f.ProductId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
Reference in New Issue
Block a user