From 8b2f0fb4545b5fcb2a698c51cb65bcbc24830749 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Tue, 8 Aug 2023 00:20:21 +0100 Subject: [PATCH] feat: add post redirect schema --- OliverBooth/Data/Blog/BlogPost.cs | 12 ++++++++++++ .../Data/Blog/Configuration/BlogPostConfiguration.cs | 2 ++ 2 files changed, 14 insertions(+) diff --git a/OliverBooth/Data/Blog/BlogPost.cs b/OliverBooth/Data/Blog/BlogPost.cs index effc376..6580b3b 100644 --- a/OliverBooth/Data/Blog/BlogPost.cs +++ b/OliverBooth/Data/Blog/BlogPost.cs @@ -23,12 +23,24 @@ public sealed class BlogPost : IEquatable /// The ID. public int Id { get; private set; } + /// + /// Gets or sets a value indicating whether the blog post is a redirect. + /// + /// if the blog post is a redirect; otherwise, . + public bool IsRedirect { get; set; } + /// /// Gets or sets the date and time at which the blog post was published. /// /// The publish timestamp. public DateTimeOffset Published { get; set; } + /// + /// Gets or sets the redirect URL of the blog post. + /// + /// The redirect URL. + public string? RedirectUrl { get; set; } + /// /// Gets or sets the URL slug of the blog post. /// diff --git a/OliverBooth/Data/Blog/Configuration/BlogPostConfiguration.cs b/OliverBooth/Data/Blog/Configuration/BlogPostConfiguration.cs index 3db6c2c..8cca95b 100644 --- a/OliverBooth/Data/Blog/Configuration/BlogPostConfiguration.cs +++ b/OliverBooth/Data/Blog/Configuration/BlogPostConfiguration.cs @@ -22,5 +22,7 @@ internal sealed class BlogPostConfiguration : IEntityTypeConfiguration builder.Property(e => e.Updated).IsRequired(false); builder.Property(e => e.Title).HasMaxLength(255).IsRequired(); builder.Property(e => e.Body).IsRequired(); + builder.Property(e => e.IsRedirect).IsRequired(); + builder.Property(e => e.RedirectUrl).IsRequired(false); } }