feat: add Updated property to BlogPost

This commit is contained in:
Oliver Booth 2023-08-07 23:42:59 +01:00
parent 2aa218d105
commit 0c594ac306
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.
@ -41,6 +41,12 @@ public sealed class BlogPost : IEquatable<BlogPost>
/// <value>The title.</value>
public string Title { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the date and time at which the blog post was updated.
/// </summary>
/// <value>The update timestamp.</value>
public DateTimeOffset? Updated { get; set; }
/// <summary>
/// Gets or sets the legacy WordPress 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;
@ -19,6 +19,7 @@ internal sealed class BlogPostConfiguration : IEntityTypeConfiguration<BlogPost>
builder.Property(e => e.Slug).HasMaxLength(100).IsRequired();
builder.Property(e => e.AuthorId).IsRequired();
builder.Property(e => e.Published).IsRequired();
builder.Property(e => e.Updated).IsRequired(false);
builder.Property(e => e.Title).HasMaxLength(255).IsRequired();
builder.Property(e => e.Body).IsRequired();
}