/// <summary>
 /// Get Previous and Next posts, if they exist, for the specified query options
 /// </summary>
 /// <param name="db">IWpDb</param>
 /// <param name="w">IUnitOfWork</param>
 /// <param name="currentId">Current Post ID</param>
 /// <param name="opt">Function to return query options</param>
 internal static Task <Maybe <(WpPostId?prev, WpPostId?next)> > GetPreviousAndNextAsync(
     IWpDb db,
     IUnitOfWork w,
     WpPostId currentId,
     GetPostsOptions opt
     ) =>
Пример #2
0
 /// <inheritdoc/>
 public async Task <Maybe <string> > AttachmentFilePathAsync(WpPostId fileId)
 {
     using var w = Db.UnitOfWork;
     return(await QueryAttachmentsF.GetFilePathAsync(Db, w, fileId).ConfigureAwait(false));
 }
Пример #3
0
 /// <inheritdoc/>
 public async Task <Maybe <(WpPostId?prev, WpPostId?next)> > PreviousAndNextPostsAsync(WpPostId id, Query.GetPostsOptions opt)
 {
     using var w = Db.UnitOfWork;
     return(await QueryPostsF.GetPreviousAndNextAsync(Db, w, id, opt).ConfigureAwait(false));
 }
Пример #4
0
 /// <summary>
 /// Get the filesystem path to the specified Attachment
 /// </summary>
 /// <param name="db">IWpDb</param>
 /// <param name="w">IUnitOfWork</param>
 /// <param name="fileId">File (Post) ID</param>
 internal static Task <Maybe <string> > GetFilePathAsync(IWpDb db, IUnitOfWork w, WpPostId fileId) =>
 ExecuteAsync <Attachment>(
     db, w, opt => opt with {