dotnet-sdk/examples/Client/PublishSubscribe/PublishEventExample
Whit Waldo c0d70ff24d
Quality of Life Improvements (#1504)
* Removed unnecessary comment
* Update to use file-level namespaces
* Using target-typed new expression
* QoL improvements to code base - primary constructors on classes and records, use of collection initializers, target-typed new expressions, etc.
* Applied all manner of QoL improvements to Dapr.Client
* Fixed break in example caused by nullability annotation change
* Refactored where streaming subscription example is located in solution to align with packages
* Refactored actor example to modernize
* Modernized example

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2025-04-01 15:24:27 -05:00
..
Example.cs Quality of Life Improvements (#1504) 2025-04-01 15:24:27 -05:00
Program.cs Quality of Life Improvements (#1504) 2025-04-01 15:24:27 -05:00
PublishBytesExample.cs Quality of Life Improvements (#1504) 2025-04-01 15:24:27 -05:00
PublishEventExample.cs Quality of Life Improvements (#1504) 2025-04-01 15:24:27 -05:00
PublishEventExample.csproj Drop .NET 6 and .NET 7 support (#1482) 2025-03-16 23:49:22 -05:00
README.md Additional commits to drop .NET 6 and 7 (#1486) 2025-03-17 02:49:49 -05:00

README.md

Dapr .NET SDK pub/sub 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

Publishing Pub/Sub Events

See PublishEventExample.cs for an example using the DaprClient to publish a pub/sub event.