Clients for CommandQuery APIs
Create a CommandClient
and invoke PostAsync
:
var commandClient = new CommandClient("https://commandquerysampleaspnetcore.azurewebsites.net/api/command/");
await commandClient.PostAsync(new FooCommand { Value = "en-GB" });
Commands with result:
var result = await commandClient.PostAsync(new BazCommand { Value = "en-GB" });
Create a QueryClient
and invoke PostAsync
or GetAsync
:
var queryClient = new QueryClient("https://commandquerysampleaspnetcore.azurewebsites.net/api/query/");
var result = await queryClient.PostAsync(new BarQuery { Id = 1 });
result = await queryClient.GetAsync(new BarQuery { Id = 1 });