Skip to content

Commit

Permalink
remove some debug statements from sample (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayada1 authored Sep 28, 2020
1 parent b3aef53 commit a55a2cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
16 changes: 5 additions & 11 deletions samples/Client/DaprClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static async Task Main(string[] args)
// State Transaction
await ExecuteStateTransaction(client);

// Read State
await GetStateAfterTransactionAsync(client);

#region Service Invoke - Required RoutingService
Expand Down Expand Up @@ -119,12 +120,13 @@ internal static async Task ExecuteStateTransaction(DaprClient client)
{
var value = new Widget() { Size = "small", Color = "yellow", };
var request1 = new Dapr.StateTransactionRequest("mystate", JsonSerializer.SerializeToUtf8Bytes(value), StateOperationType.Upsert);
// var request2 = new Dapr.StateTransactionRequest("mystate", null, StateOperationType.Delete);
var request2 = new Dapr.StateTransactionRequest("mystate", null, StateOperationType.Delete);
var requests = new List<Dapr.StateTransactionRequest>();
requests.Add(request1);
// requests.Add(request2);
requests.Add(request2);
Console.WriteLine("Executing transaction - save state and delete state");
await client.ExecuteStateTransactionAsync(storeName, requests);
Console.WriteLine("Deleted State!");
Console.WriteLine("Executed State Transaction!");
}

internal static async Task GetStateAfterTransactionAsync(DaprClient client)
Expand All @@ -138,14 +140,6 @@ internal static async Task GetStateAfterTransactionAsync(DaprClient client)
{
Console.WriteLine($"Got Transaction State: {state.Size} {state.Color}");
}
if(state.Equals("my transaction"))
{
Console.WriteLine("Strings match");
}
else
{
Console.WriteLine("Strings dont match");
}
}

internal static async Task DepositUsingServiceInvocation(DaprClient client)
Expand Down
14 changes: 9 additions & 5 deletions samples/Client/DaprClient/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ The client sample shows how to make Dapr calls to publish events, save state, ge
```

Above command will run Dapr runtime and launch the app and will show logs both form Dapr runtime and the application. The client app will make calls to Dapr runtime to publish events, save state, get state and delete state using the gRPC client.
Logs form application will show following in the command window:
Logs from application will show following in the command window:
```sh
Published Event!
Saved State!
Got State: my data
Deleted State!
Published Event!
Saved State!
Got State: small yellow
Deleted State!
Executing transaction - save state and delete state
Executed State Transaction!
State not found in store
Done
```

## Invoking Services
Expand Down

0 comments on commit a55a2cd

Please sign in to comment.