native amount/offset handling
This commit is contained in:
@@ -12,6 +12,15 @@ public abstract class BaseClient<T>(IApiClient client) : IBaseClient<T> where T
|
||||
return (await client.SendRequest<GeneralItemMessages<T>.Items>(ApiEndpoint, HttpMethod.Get)).EnsureOk().Items;
|
||||
}
|
||||
|
||||
public virtual async Task<IEnumerable<T>> GetAll(int offset, int amount)
|
||||
{
|
||||
return (await client.SendRequest<GeneralItemMessages<T>.Items>(ApiEndpoint, HttpMethod.Get, new ApiParameterCollection
|
||||
{
|
||||
["offset"] = offset,
|
||||
["amount"] = amount,
|
||||
})).EnsureOk().Items;
|
||||
}
|
||||
|
||||
public virtual async Task<T> Get(int id)
|
||||
{
|
||||
return (await client.SendRequest<GeneralItemMessages<T>.Item>($"{ApiEndpoint}/{id}", HttpMethod.Get)).EnsureOk().Item;
|
||||
|
||||
Reference in New Issue
Block a user