dotnet-sdk/examples/Client/StateManagement
Divya Perumal 3a930c26d2
#906 -Added methods in status API supports for saving and reading binary data (#1116)
* Added methods in status API supports for direct storage and reading of byte arrays #906

Signed-off-by: Divya Perumal <divzi.perumal@gmail.com>
Signed-off-by: Divya Perumal <diperuma@microsoft.com>
2024-12-11 14:41:14 -06:00
..
BulkStateExample.cs Add support for Bulk State, i.e. SaveBulkStateAsync(...) method (#962) 2022-10-31 11:06:27 -07:00
Example.cs replaced license headers (#802) 2021-12-10 13:39:06 -08:00
Program.cs #906 -Added methods in status API supports for saving and reading binary data (#1116) 2024-12-11 14:41:14 -06:00
README.md Remove .NET Core 3.1 support and standardize on .NET 6 (#1045) 2023-08-24 11:04:02 -07:00
StateManagement.csproj Fixed security advisory updates across dependencies (transitive and direct) (#1366) 2024-10-15 18:09:53 -05:00
StateStoreBinaryExample.cs #906 -Added methods in status API supports for saving and reading binary data (#1116) 2024-12-11 14:41:14 -06:00
StateStoreETagsExample.cs replaced license headers (#802) 2021-12-10 13:39:06 -08:00
StateStoreExample.cs replaced license headers (#802) 2021-12-10 13:39:06 -08:00
StateStoreTransactionsExample.cs replaced license headers (#802) 2021-12-10 13:39:06 -08:00

README.md

Dapr .NET SDK state management example

Prerequisites

Running the example

To run the sample locally run this command in the DaprClient directory:

dapr run --app-id DaprClient -- dotnet run <sample number>

Running the following command will output a list of the samples included:

dapr run --app-id DaprClient -- dotnet run

Press Ctrl+C to exit, and then run the command again and provide a sample number to run the samples.

For example run this command to run the 0th sample from the list produced earlier.

dapr run --app-id DaprClient -- dotnet run 0

State operations

See StateStoreExample.cs for an example of using DaprClient for basic state store operations like get, set, and delete.

State transactions

See: StateStoreTransactionsExample.cs for an example of using DaprClient for transactional state store operations that affect multiple keys.

ETags

See StateStoreETagsExample.cs for an example of using DaprClient for optimistic concurrency control with the state store.

Bulk State

See BulkStateExample.cs for an example of using DaprClient for Bulk State, i.e. sending multiple key value pairs to the state store.