Dapr SDK for .NET
Go to file
Tiago Alves Macambira 2aa4806c44
Workflow Authoring: initial methods (#981)
* Initial workflow sdk implementation

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Dapr Workflow initial methods for dotnet-sdk

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Handled mistake in the workflow name

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Added common license header to .cs files

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changed namespace to Dapr.Workflow

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Addressed docs related review comments

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Reverted few changes to avoid compile time error

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Examples changes

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Added readonly dictionary

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Added .csproj to sln file with few minor comments

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Change nuget dependency and update folder structure

This commit re-adds commit d5b9189da5 but with DCO.

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Update Durable Task SDK version & simplify example

Signed-off-by: Chris Gillum <cgillum@microsoft.com>

* Addresses some PR comments.

* Rename ActivityContext to WorkflowActivityContext
* Change example webapp port away from 8080x

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Addressing review comments.

* Rename workflow and activity in example to be more meangniful
* Add parameter documentation to some methods
* Use local project references when appropriate

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Adding more documentation

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Replaces custom AddSingletonIfNotPresent with std. TryAddSingleton

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Renames AddWorkflowsToRegistry to AddActivitiesToRegistry to better match what it does

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Add cancelation token overload for WorkflowContext.WaitForExternalEventAsync

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Renaming AddWorkflowsAndActivitiesToRegistry

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Defer launch URL and port to launchSettings.json

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>
Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
Signed-off-by: Chris Gillum <cgillum@microsoft.com>
Co-authored-by: Amulya Varote <amulyavarote@microsoft.com>
Co-authored-by: Chris Gillum <cgillum@microsoft.com>
2023-01-12 16:10:21 -08:00
.github Add dapr-bot support to assign issues (#951) 2022-09-19 11:04:25 -07:00
daprdocs remove version flags per docs issue (#960) 2022-10-17 10:39:16 -07:00
docs SDK Docs (#572) 2021-02-16 22:15:33 -08:00
examples Workflow Authoring: initial methods (#981) 2023-01-12 16:10:21 -08:00
properties Added dotnet methods for Distributed Lock API (#886) 2022-06-29 10:23:37 -07:00
samples/Client SDK Docs (#572) 2021-02-16 22:15:33 -08:00
src Workflow Authoring: initial methods (#981) 2023-01-12 16:10:21 -08:00
test Add support for Bulk State, i.e. SaveBulkStateAsync(...) method (#962) 2022-10-31 11:06:27 -07:00
.codecov.yml Added codecov integration (#436) 2020-10-19 19:06:21 -07:00
.editorconfig git gui, ading editor config and removing depenency on StyleCop.Analyzers (#228) 2020-02-18 13:21:12 -08:00
.gitignore Add support for Bulk State, i.e. SaveBulkStateAsync(...) method (#962) 2022-10-31 11:06:27 -07:00
CODEOWNERS Update CODEOWNERS 2021-07-13 11:30:41 -07:00
CONTRIBUTING.md Add DCO requirements and updated code of conduct (#808) 2022-01-06 10:35:50 -08:00
LICENSE replaced license headers (#802) 2021-12-10 13:39:06 -08:00
README.md Changed broken link in README (#980) 2022-11-04 13:28:19 -07:00
all.sln Workflow Authoring: initial methods (#981) 2023-01-12 16:10:21 -08:00
global.json Add .NET 5 testing (#458) 2021-01-04 11:13:35 -08:00

README.md

Dapr SDK for .NET

Build Status codecov License: Apache FOSSA Status

Dapr SDK for .NET allows you to:

  • Interact with Dapr applications through a Dapr client
  • Build routes and controllers in ASP.NET
  • Implement the Virtual Actor model, based on the actor design pattern

This SDK can run locally, in a container, and in any distributed systems environment.

Releases

We publish nuget packages to nuget.org for each release.

Using nugets built locally in your project

<RepoRoot> is the path where you cloned this repository. Nuget packages are dropped under /bin/<Debug|Release>/nugets when you build locally.

Example

# Add Dapr.Actors nuget package
dotnet add package Dapr.Actors -s <RepoRoot>/bin/<Debug|Release>/nugets

# Add Dapr.Actors.AspNetCore nuget package
dotnet add package Dapr.Actors.AspNetCore -s <RepoRoot>/bin/<Debug|Release>/nugets

Documentation

The docs for the Dapr .NET SDK can be found on the Dapr docs site.

Examples

Visit the examples folder for a variety of examples to get you up and running with the Dapr .NET SDK.

Contributing

This repo builds the following packages:

  • Dapr.Client
  • Dapr.AspNetCore
  • Dapr.Actors
  • Dapr.Actors.AspNetCore
  • Dapr.Extensions.Configuration

Prerequisites

Each project is a normal C# project. At minimum, you need .NET 5.0 SDK to build, test, and generate NuGet packages.

Also make sure to reference the .NET SDK contribution guide

macOS/Linux:

On macOS or Linux we recommend Visual Studio Code with the C# Extension. See here for a getting started guide for VS Code and .NET.

Windows:

On Windows, we recommend installing the latest Visual Studio 2019 which will set you up with all the .NET build tools and allow you to open the solution files. Community Edition is free and can be used to build everything here.

Make sure you update Visual Studio to the most recent release.

Build

To build everything and generate NuGet packages, run dotnet cli commands. Binaries and NuGet packages will be dropped in a bin directory at the repo root.

# Build sdk, samples and tests.
dotnet build -c Debug  # for release, -c Release

# Run unit-test
dotnet test

# Generate nuget packages in /bin/Debug/nugets
dotnet pack

Each project can also be built individually directly through the CLI or your editor/IDE. You can open the solution file all.sln in repo root to load all sdk, samples and test projects.