Fixes HasNextPage default implementation in older compiler versions
This commit is contained in:
parent
4d3a8002a8
commit
adc051ff48
|
@ -25,6 +25,13 @@ public class EnumerableApiResponse<T> : IApiResponse<IEnumerable<T>>,
|
||||||
|
|
||||||
int IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>.Count { get; set; }
|
int IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>.Count { get; set; }
|
||||||
|
|
||||||
|
#if !(NETCOREAPP3_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER)
|
||||||
|
bool IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>.HasNextPage()
|
||||||
|
{
|
||||||
|
return ((IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>)this).Page < ((IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>)this).TotalCount;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>.TotalCount { get; set; }
|
int IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>.TotalCount { get; set; }
|
||||||
|
|
||||||
async Task<EnumerableApiResponse<T>> IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>.
|
async Task<EnumerableApiResponse<T>> IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>.
|
||||||
|
|
|
@ -15,10 +15,14 @@ public interface IPageableApiResponse<TResponseType, TResponseGeneric>
|
||||||
|
|
||||||
int TotalCount { get; set; }
|
int TotalCount { get; set; }
|
||||||
|
|
||||||
|
#if NETCOREAPP3_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
|
||||||
bool HasNextPage()
|
bool HasNextPage()
|
||||||
{
|
{
|
||||||
return Page < TotalCount;
|
return Page < TotalCount;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
bool HasNextPage();
|
||||||
|
#endif
|
||||||
|
|
||||||
void RememberRequestUri(string requestUri);
|
void RememberRequestUri(string requestUri);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue