-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathIBlogPostVersionService.cs
More file actions
26 lines (22 loc) · 1.07 KB
/
Copy pathIBlogPostVersionService.cs
File metadata and controls
26 lines (22 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System.Collections.Generic;
using System.Threading.Tasks;
using LinkDotNet.Blog.Domain;
namespace LinkDotNet.Blog.Web.Features.Admin.BlogPostEditor.Services;
public interface IBlogPostVersionService
{
/// <summary>
/// Snapshots the current <paramref name="currentBlogPost"/> state into the version history,
/// then applies <paramref name="updatedBlogPost"/> fields to the existing BlogPost row.
/// </summary>
ValueTask SaveNewVersionAsync(BlogPost currentBlogPost, BlogPost updatedBlogPost);
/// <summary>
/// Returns all versions for a blog post, ordered by VersionNumber descending.
/// </summary>
ValueTask<IReadOnlyList<BlogPostVersion>> GetVersionHistoryAsync(string blogPostId);
/// <summary>
/// Snapshots the current state first (as version N+1), then copies the fields from
/// <paramref name="targetVersion"/> back to <paramref name="currentBlogPost"/>.
/// ScheduledPublishDate is intentionally not restored.
/// </summary>
ValueTask RestoreVersionAsync(BlogPost currentBlogPost, BlogPostVersion targetVersion);
}