using System; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.DependencyInjection; namespace Acme.BookStore.ConsoleApiClient { public class ApiClientDemoService : ITransientDependency { private readonly IBookAppService _bookAppService; public ApiClientDemoService(IBookAppService bookAppService) { _bookAppService = bookAppService; } public async Task RunAsync() { //While it seems like a regular method call, it actually calls a remote REST API. var output = await _bookAppService.GetListAsync(new PagedAndSortedResultRequestDto()); foreach (var bookDto in output.Items) { Console.WriteLine($"[BOOK {bookDto.Id}] Name={bookDto.Name}, Price={bookDto.Price}"); } } } }