Invocar uma Web API em DDD
Invocação de Web API em DDD |
Console Application
using System.Threading.Tasks;
using WebApiClient.Poc.Core.Interfaces;
using WebApiClient.Poc.Core.Entities;
using WebApiClient.PoC.HttpClientServices.Inventory;
using WebApiClient.PoC.HttpClientServices;
namespace WebApiClient.Poc.Console
{
class Program
{
static void Main(string[] args)
{
RunAsync("19072000408").GetAwaiter().GetResult();
}
private static async Task RunAsync(string authorCode)
{
IAuthorInventoryService _inventoryService = new AuthorInventoryService(new HttpClientWrapper<Author>());
await _inventoryService.GetInventoryAsync(authorCode);
}
}
}
Referência: Call a Web API From a .NET Client (C#)
Invocar uma Web API em DDD
Reviewed by Silvia Pinhão Lopes
on
24.7.19
Rating: 5