mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 07:40:13 +01:00
Fix relation Manga -> Tags and Manga -> Authors with many-many
This commit is contained in:
parent
03e89913e3
commit
729f018712
@ -55,10 +55,8 @@ public class Manga(
|
||||
[ForeignKey("MangaConnectorId")]
|
||||
public MangaConnector MangaConnector { get; private set; } = mangaConnector;
|
||||
|
||||
[ForeignKey("AuthorIds")]
|
||||
public ICollection<Author> Authors { get; internal set; } = authors;
|
||||
|
||||
[ForeignKey("TagIds")]
|
||||
public ICollection<MangaTag> Tags { get; private set; } = tags;
|
||||
|
||||
[ForeignKey("LinkIds")]
|
||||
|
@ -57,12 +57,14 @@ public class PgsqlContext(DbContextOptions<PgsqlContext> options) : DbContext(op
|
||||
.Navigation(m => m.MangaConnector)
|
||||
.AutoInclude();
|
||||
modelBuilder.Entity<Manga>()
|
||||
.HasMany<Author>(m => m.Authors);
|
||||
.HasMany<Author>(m => m.Authors)
|
||||
.WithMany();
|
||||
modelBuilder.Entity<Manga>()
|
||||
.Navigation(m => m.Authors)
|
||||
.AutoInclude();
|
||||
modelBuilder.Entity<Manga>()
|
||||
.HasMany<MangaTag>(m => m.Tags);
|
||||
.HasMany<MangaTag>(m => m.Tags)
|
||||
.WithMany();
|
||||
modelBuilder.Entity<Manga>()
|
||||
.Navigation(m => m.Tags)
|
||||
.AutoInclude();
|
||||
|
Loading…
x
Reference in New Issue
Block a user