diff options
Diffstat (limited to 'HBContext.cs')
| -rw-r--r-- | HBContext.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/HBContext.cs b/HBContext.cs index 15dad6d..415b745 100644 --- a/HBContext.cs +++ b/HBContext.cs @@ -55,10 +55,15 @@ public class HBContext : DbContext { } }); - // Implicit tags need some special attention to make many<->many - // navigations work for the same object type. + // Some complex relationships cannot be inferred and require + // additional configuration, as seen below. modelBuilder.Entity<TagDefinition>() .HasMany(e => e.ImplicitTags) .WithMany(); + + modelBuilder.Entity<Media>() + .HasOne(m => m.CurrentUploadedFile) + .WithOne() + .HasForeignKey<Media>("CurrentUploadedFileId"); } }
\ No newline at end of file |
