public ExampleApiController(ILogger <ExampleApiController> logger, IConfiguration configuration, IExampleHttpService exampleHttpService, IWebHostEnvironment appEnvironment) { _logger = logger; _configuration = configuration; _exampleHttpService = exampleHttpService; _appEnvironment = appEnvironment; }
private static async Task AsyncMain() { IExampleHttpService service = RestServiceBuilder <IExampleHttpService> .Create() .RegisterDefaultSerializers() .RegisterDotNetHttpClient(@"http://localhost:5000") .RegisterJsonNetSerializer() .Build(); Console.WriteLine("Service built."); ResponseModel model = await service.GetPowerLevel(new RequestModel("Glader")); Console.WriteLine($"Glader's power level: {model.Power} Id: {model.Identifier}"); }