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