Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ public interface ICachableRequest
/// <summary>
/// Configuration for local cache provider.
/// </summary>
CacheBehavior LocalCacheBehavior { get; set; }
CacheBehavior LocalCacheBehavior { get; }

/// <summary>
/// Configuration for remote cache provider.
/// </summary>
CacheBehavior RemoteCacheBehavior { get; set; }
CacheBehavior RemoteCacheBehavior { get; }

/// <summary>
/// The expire time for local cache.
/// </summary>
TimeSpan? LocalExpires { get; set; }
TimeSpan? LocalExpires { get; }

/// <summary>
/// The expire time for remote cache.
/// </summary>
TimeSpan? RemoteExpires { get; set; }
TimeSpan? RemoteExpires { get; }

/// <summary>
/// Generate key for cache group, return <c>null</c> for no group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public QueryEndpointHandler(IMediator mediator)
return query;
}

if (query is not IBaseRequest)
{
return query;
}

var response = await _mediator.Send(query);
return response;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ public PagedList(IReadOnlyCollection<T> items, int pageIndex, int pageSize, int
/// <param name="items">包含的元素。</param>
/// <param name="pagingParams">分页参数。</param>
/// <param name="totalCount">元素总数。</param>
public PagedList(IReadOnlyCollection<T> items, PagingParams pagingParams, int totalCount)
public PagedList(IReadOnlyCollection<T> items, PagingParams? pagingParams, int totalCount)
{
Items = items;
TotalCount = totalCount;
var (pageIndex, pageSize) = pagingParams;
PageIndex = pageIndex;
PageSize = pageSize;
if (pagingParams is null)
{
PageIndex = 1;
PageSize = totalCount;
}
else
{
var (pageIndex, pageSize) = pagingParams;
PageIndex = pageIndex;
PageSize = pageSize;
}
}

/// <summary>
Expand Down