feat: add comment toggle schema

This commit is contained in:
Oliver Booth 2023-08-08 00:20:38 +01:00
parent 8b2f0fb454
commit 6f3961901e
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
2 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
namespace OliverBooth.Data.Blog;
namespace OliverBooth.Data.Blog;
/// <summary>
/// Represents a blog post.
@ -17,6 +17,12 @@ public sealed class BlogPost : IEquatable<BlogPost>
/// <value>The body.</value>
public string Body { get; set; } = string.Empty;
/// <summary>
/// Gets or sets a value indicating whether comments are enabled for the blog post.
/// </summary>
/// <value><see langword="true" /> if comments are enabled; otherwise, <see langword="false" />.</value>
public bool EnableComments { get; set; } = true;
/// <summary>
/// Gets the ID of the blog post.
/// </summary>

View File

@ -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<BlogPost>
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();
}
}