File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/Cnblogs.Architecture.Ddd.Cqrs.ServiceAgent Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ public async Task<PagedList<TItem>> ListPagedItemsAsync<TItem>(
208
208
}
209
209
210
210
/// <summary>
211
- /// Get paged list of items based on url .
211
+ /// Get paged list of items.
212
212
/// </summary>
213
213
/// <param name="url">The route of the API.</param>
214
214
/// <param name="pageIndex">The page index.</param>
@@ -231,6 +231,18 @@ public async Task<PagedList<TItem>> ListPagedItemsAsync<TItem>(
231
231
return await HttpClient . GetFromJsonAsync < PagedList < TItem > > ( url ) ?? new PagedList < TItem > ( ) ;
232
232
}
233
233
234
+ /// <summary>
235
+ /// Get list of items.
236
+ /// </summary>
237
+ /// <param name="url">The url to send GET request.</param>
238
+ /// <typeparam name="TList">The type of list.</typeparam>
239
+ /// <returns>The fetched list.</returns>
240
+ public async Task < TList > ListItemsAsync < TList > ( string url )
241
+ where TList : new ( )
242
+ {
243
+ return await HttpClient . GetFromJsonAsync < TList > ( url ) ?? new TList ( ) ;
244
+ }
245
+
234
246
private static async Task < CommandResponse < TResponse , ServiceAgentError > > HandleCommandResponseAsync < TResponse > (
235
247
HttpResponseMessage httpResponseMessage )
236
248
{
You can’t perform that action at this time.
0 commit comments