Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (23 sloc) 1.13 KB

CommandQuery.Client

Clients for CommandQuery

NuGet NuGet

PM> Install-Package CommandQuery.Client

> dotnet add package CommandQuery.Client

Sample Code

CommandQuery.Sample.Client

Commands

Create a CommandClient and invoke Post:

var commandClient = new CommandClient("https://commandquery-sample-azurefunctions-vs2.azurewebsites.net/api/command/");

commandClient.Post(new FooCommand { Value = "sv-SE" });
await commandClient.PostAsync(new FooCommand { Value = "en-GB" });

Queries

Create a QueryClient and invoke Post or Get:

var queryClient = new QueryClient("https://commandquery-sample-azurefunctions-vs2.azurewebsites.net/api/query/");

var result = queryClient.Post(new BarQuery { Id = 1 });
result = await queryClient.PostAsync(new BarQuery { Id = 1 });

result = queryClient.Get(new BarQuery { Id = 1 });
result = await queryClient.GetAsync(new BarQuery { Id = 1 });
You can’t perform that action at this time.