Dapr SDK for .NET
Go to file
Ryan Nowak a6ef7e451d Add middleware for unwrapping cloud events
Fixes: #74

note: This relies on the fix for dapr/dapr#574 which has been merged.

This change introduces a middleware that can upwrap a *structured* cloud
event. This is the format used by dapr by default now for pub/sub
messaging. Adding the middleware makes it transparent to the developer
whether the data can from a cloud event or was a basic RPC call.

We're adding the middleware for this first since it's the most general
approach. It has a drawback compared with other approaches, performance.

Users could alternatively use the SDK from CloudEvents to read their
data without the middleware.

We might also want to add an MVC formatter in the future, which could do
the unwrapping and deserialization to a user-type in a single operation.
2019-10-12 20:25:38 -07:00
.github add templates 2019-10-11 10:23:01 -07:00
docs Changing to Dapr.* (#89) 2019-10-11 13:42:30 -07:00
properties Merge pull request #83 from dapr/release-0.6 2019-10-08 19:08:10 -07:00
samples Changing to Dapr.* (#89) 2019-10-11 13:42:30 -07:00
src Add middleware for unwrapping cloud events 2019-10-12 20:25:38 -07:00
test Add middleware for unwrapping cloud events 2019-10-12 20:25:38 -07:00
.gitignore Add Actions Client and ASP.NET Core integration (#61) 2019-10-04 22:11:59 -07:00
LICENSE Updating license to MIT in all .cs files. (#81) 2019-10-08 14:54:46 -07:00
README.md Changing to Dapr.* (#89) 2019-10-11 13:42:30 -07:00
azure-pipelines.yml Changing to Dapr.* (#89) 2019-10-11 13:42:30 -07:00
code.sln Changing to Dapr.* (#89) 2019-10-11 13:42:30 -07:00

README.md

Dapr SDK for .NET

Dapr is a programming model for writing cloud-native applications which are distributed, dynamically scaled, and loosely coupled in nature.

Dapr SDK for .NET allows you to 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.

This repo builds the following packages:

  • Dapr.Actors
  • Dapr.Actors.AspNetCore

Getting Started

Prerequesites

Each project is a normal C# Visual Studio 2019 project. At minimum, you need .NET Core SDK 3.0 to build and generate NuGet packages.

We recommend installing Visual Studio 2019 v16.3 or later 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. To find a version of .NET Core that can be used with earlier versions of Visual Studio, see .NET SDKs for Visual Studio.

Build

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

# Build SDK
dotnet build -c Debug  # for release, -c Release

# Run unit-test
dotnet test

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

Each project can also be built individually directly through Visual Studio.

Releases

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

Using nugets built locally in your project

is the path where you cloned this repository.

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

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

Documentation

These articles will help get you started with Dapr runtime and Dapr Actors: