Add and remove reaction from a content
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
namespace Hutopy.Web.Features.Contents.Data;
|
||||
using Humanizer;
|
||||
|
||||
namespace Hutopy.Web.Features.Contents.Data;
|
||||
|
||||
public class ContentDbContext(
|
||||
DbContextOptions<ContentDbContext> options)
|
||||
@@ -25,6 +27,11 @@ public class ContentDbContext(
|
||||
.HasOne(c => c.Creator)
|
||||
.WithMany()
|
||||
.HasForeignKey(c => c.CreatedBy);
|
||||
|
||||
modelBuilder
|
||||
.Entity<Content>()
|
||||
.OwnsMany(c => c.Reactions)
|
||||
.ToTable(nameof(ContentReaction).Pluralize());
|
||||
|
||||
modelBuilder
|
||||
.Entity<Subscription>()
|
||||
|
||||
Reference in New Issue
Block a user