feat: add post redirect schema

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

View File

@ -23,12 +23,24 @@ public sealed class BlogPost : IEquatable<BlogPost>
/// <value>The ID.</value>
public int Id { get; private set; }
/// <summary>
/// Gets or sets a value indicating whether the blog post is a redirect.
/// </summary>
/// <value><see langword="true" /> if the blog post is a redirect; otherwise, <see langword="false" />.</value>
public bool IsRedirect { get; set; }
/// <summary>
/// Gets or sets the date and time at which the blog post was published.
/// </summary>
/// <value>The publish timestamp.</value>
public DateTimeOffset Published { get; set; }
/// <summary>
/// Gets or sets the redirect URL of the blog post.
/// </summary>
/// <value>The redirect URL.</value>
public string? RedirectUrl { get; set; }
/// <summary>
/// Gets or sets the URL slug of the blog post.
/// </summary>

View File

@ -22,5 +22,7 @@ internal sealed class BlogPostConfiguration : IEntityTypeConfiguration<BlogPost>
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);
}
}