diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-05 17:46:59 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-05 17:46:59 +0200 |
| commit | a0a048d1fc6672a6478169f3c9139d9e5a6ff474 (patch) | |
| tree | 441ae3b35e2f6b55c9912e70f8a0f304ba26bc83 /src/DevHive.Data/DevHiveContext.cs | |
| parent | 60ed435203f0c60d4c6fabe77aa4e87656aaf8c1 (diff) | |
| download | DevHive-a0a048d1fc6672a6478169f3c9139d9e5a6ff474.tar DevHive-a0a048d1fc6672a6478169f3c9139d9e5a6ff474.tar.gz DevHive-a0a048d1fc6672a6478169f3c9139d9e5a6ff474.zip | |
Implemented post attachments, which move post file urls to their own table; updated post repository and post service to work with them (but didn't update service or web models)
Diffstat (limited to 'src/DevHive.Data/DevHiveContext.cs')
| -rw-r--r-- | src/DevHive.Data/DevHiveContext.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/DevHive.Data/DevHiveContext.cs b/src/DevHive.Data/DevHiveContext.cs index 0cc28bb..0b81f92 100644 --- a/src/DevHive.Data/DevHiveContext.cs +++ b/src/DevHive.Data/DevHiveContext.cs @@ -14,6 +14,7 @@ namespace DevHive.Data public DbSet<Technology> Technologies { get; set; } public DbSet<Language> Languages { get; set; } public DbSet<Post> Posts { get; set; } + public DbSet<PostAttachments> PostAttachments { get; set; } public DbSet<Comment> Comments { get; set; } public DbSet<UserFriend> UserFriends { get; set; } public DbSet<Rating> Rating { get; set; } @@ -82,6 +83,11 @@ namespace DevHive.Data .HasMany(x => x.Comments) .WithOne(x => x.Post); + /* Post attachments */ + builder.Entity<PostAttachments>() + .HasOne(x => x.Post) + .WithMany(x => x.Attachments); + /* Comment */ builder.Entity<Comment>() .HasOne(x => x.Post) |
