From 6f3961901e22dac3656fa2e5da9161584ff6bd63 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Tue, 8 Aug 2023 00:20:38 +0100 Subject: [PATCH] feat: add comment toggle schema --- OliverBooth/Data/Blog/BlogPost.cs | 8 +++++++- .../Data/Blog/Configuration/BlogPostConfiguration.cs | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/OliverBooth/Data/Blog/BlogPost.cs b/OliverBooth/Data/Blog/BlogPost.cs index 6580b3b..5297521 100644 --- a/OliverBooth/Data/Blog/BlogPost.cs +++ b/OliverBooth/Data/Blog/BlogPost.cs @@ -1,4 +1,4 @@ -namespace OliverBooth.Data.Blog; +namespace OliverBooth.Data.Blog; /// /// Represents a blog post. @@ -17,6 +17,12 @@ public sealed class BlogPost : IEquatable /// The body. public string Body { get; set; } = string.Empty; + /// + /// Gets or sets a value indicating whether comments are enabled for the blog post. + /// + /// if comments are enabled; otherwise, . + public bool EnableComments { get; set; } = true; + /// /// Gets the ID of the blog post. /// diff --git a/OliverBooth/Data/Blog/Configuration/BlogPostConfiguration.cs b/OliverBooth/Data/Blog/Configuration/BlogPostConfiguration.cs index 8cca95b..c954273 100644 --- a/OliverBooth/Data/Blog/Configuration/BlogPostConfiguration.cs +++ b/OliverBooth/Data/Blog/Configuration/BlogPostConfiguration.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace OliverBooth.Data.Blog.Configuration; @@ -24,5 +24,6 @@ internal sealed class BlogPostConfiguration : IEntityTypeConfiguration builder.Property(e => e.Body).IsRequired(); builder.Property(e => e.IsRedirect).IsRequired(); builder.Property(e => e.RedirectUrl).IsRequired(false); + builder.Property(e => e.EnableComments).IsRequired(); } }