<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dapr actors .NET SDK on Dapr Docs</title><link>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/</link><description>Recent content in Dapr actors .NET SDK on Dapr Docs</description><generator>Hugo</generator><language>en</language><atom:link href="https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/index.xml" rel="self" type="application/rss+xml"/><item><title>The IActorProxyFactory interface</title><link>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-client/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-client/</guid><description>&lt;p>Inside of an &lt;code>Actor&lt;/code> class or an ASP.NET Core project, the &lt;code>IActorProxyFactory&lt;/code> interface is recommended to create actor clients.&lt;/p>
&lt;p>The &lt;code>AddActors(...)&lt;/code> method will register actor services with ASP.NET Core dependency injection.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Outside of an actor instance:&lt;/strong> The &lt;code>IActorProxyFactory&lt;/code> instance is available through dependency injection as a singleton service.&lt;/li>
&lt;li>&lt;strong>Inside an actor instance:&lt;/strong> The &lt;code>IActorProxyFactory&lt;/code> instance is available as a property (&lt;code>this.ProxyFactory&lt;/code>).&lt;/li>
&lt;/ul>
&lt;p>The following is an example of creating a proxy inside an actor:&lt;/p></description></item><item><title>Author &amp; run actors</title><link>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-usage/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-usage/</guid><description>&lt;h2 id="author-actors">Author actors&lt;/h2>
&lt;h3 id="actorhost">ActorHost&lt;/h3>
&lt;p>The &lt;code>ActorHost&lt;/code>:&lt;/p>
&lt;ul>
&lt;li>Is a required constructor parameter of all actors&lt;/li>
&lt;li>Is provided by the runtime&lt;/li>
&lt;li>Must be passed to the base class constructor&lt;/li>
&lt;li>Contains all of the state that allows that actor instance to communicate with the runtime&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-csharp" data-lang="csharp">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">internal&lt;/span> &lt;span style="color:#204a87;font-weight:bold">class&lt;/span> &lt;span style="color:#000">MyActor&lt;/span> &lt;span style="color:#000;font-weight:bold">:&lt;/span> &lt;span style="color:#000">Actor&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#000">IMyActor&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#000">IRemindable&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">public&lt;/span> &lt;span style="color:#000">MyActor&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#000">ActorHost&lt;/span> &lt;span style="color:#000">host&lt;/span>&lt;span style="color:#000;font-weight:bold">)&lt;/span> &lt;span style="color:#8f5902;font-style:italic">// Accept ActorHost in the constructor&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#000;font-weight:bold">:&lt;/span> &lt;span style="color:#204a87;font-weight:bold">base&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#000">host&lt;/span>&lt;span style="color:#000;font-weight:bold">)&lt;/span> &lt;span style="color:#8f5902;font-style:italic">// Pass ActorHost to the base class constructor&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#000;font-weight:bold">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#000;font-weight:bold">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Since the &lt;code>ActorHost&lt;/code> contains state unique to the actor, you don&amp;rsquo;t need to pass the instance into other parts of your code. It&amp;rsquo;s recommended only create your own instances of &lt;code>ActorHost&lt;/code> in tests.&lt;/p></description></item><item><title>Actor serialization in the .NET SDK</title><link>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-serialization/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-serialization/</guid><description>&lt;h1 id="actor-serialization">Actor Serialization&lt;/h1>
&lt;p>The Dapr actor package enables you to use Dapr virtual actors within a .NET application with either a weakly- or strongly-typed client. Each utilizes a different serialization approach. This document will review the differences and convey a few key ground rules to understand in either scenario.&lt;/p>
&lt;p>Please be advised that it is not a supported scenario to use the weakly- or strongly typed actor clients interchangeably because of these different serialization approaches. The data persisted using one Actor client will not be accessible using the other Actor client, so it is important to pick one and use it consistently throughout your application.&lt;/p></description></item><item><title>How to: Run and use virtual actors in the .NET SDK</title><link>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-howto/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v1-18.docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-howto/</guid><description>&lt;p>The Dapr actor package allows you to interact with Dapr virtual actors from a .NET application. In this guide, you learn how to:&lt;/p>
&lt;ul>
&lt;li>Create an Actor (&lt;code>MyActor&lt;/code>).&lt;/li>
&lt;li>Invoke its methods on the client application.&lt;/li>
&lt;/ul>
&lt;pre tabindex="0">&lt;code>MyActor --- MyActor.Interfaces
 |
 +- MyActorService
 |
 +- MyActorClient
&lt;/code>&lt;/pre>&lt;p>&lt;strong>The interface project (\MyActor\MyActor.Interfaces)&lt;/strong>&lt;/p>
&lt;p>This project contains the interface definition for the actor. Actor interfaces can be defined in any project with any name. The interface defines the actor contract shared by:&lt;/p></description></item></channel></rss>