mirror of https://github.com/dapr/quickstarts.git
fixing Restock inventory
Signed-off-by: Paul Yuknewicz <paulyuk@Pauls-MBP-2.lan>
This commit is contained in:
parent
34eb2e3ea6
commit
159dc8b97d
|
|
@ -36,14 +36,14 @@ using var daprClient = new DaprClientBuilder().Build();
|
|||
// in a subsequent SDK release. This is a temporary workaround.
|
||||
WorkflowEngineClient workflowClient = host.Services.GetRequiredService<WorkflowEngineClient>();
|
||||
|
||||
// Populate the store with items
|
||||
RestockInventory();
|
||||
|
||||
// Generate a unique ID for the workflow
|
||||
string orderId = Guid.NewGuid().ToString()[..8];
|
||||
string itemToPurchase = "Cars";
|
||||
int ammountToPurchase = 10;
|
||||
|
||||
// Populate the store with items
|
||||
RestockInventory(itemToPurchase);
|
||||
|
||||
// Construct the order
|
||||
OrderPayload orderInfo = new OrderPayload(itemToPurchase, 15000, ammountToPurchase);
|
||||
|
||||
|
|
@ -73,8 +73,8 @@ while (!state.IsWorkflowCompleted)
|
|||
|
||||
Console.WriteLine("Workflow Status: {0}", state.RuntimeStatus);
|
||||
|
||||
void RestockInventory()
|
||||
void RestockInventory(string itemToPurchase)
|
||||
{
|
||||
daprClient.SaveStateAsync<OrderPayload>(storeName, "Cars", new OrderPayload(Name: "Cars", TotalCost: 15000, Quantity: 100));
|
||||
daprClient.SaveStateAsync<OrderPayload>(storeName, itemToPurchase, new OrderPayload(Name: itemToPurchase, TotalCost: 15000, Quantity: 100));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue