├── .codecov.yml
├── .devcontainer
├── Dockerfile
├── devcontainer.json
└── localinit.sh
├── .editorconfig
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── discussion.md
│ ├── feature_request.md
│ ├── proposal.md
│ └── question.md
├── holopin.yml
├── pull_request_template.md
├── scripts
│ └── get_release_version.py
└── workflows
│ ├── dapr-bot.yml
│ ├── fossa.yml
│ ├── itests.yml
│ └── sdk_build.yml
├── .gitignore
├── CODEOWNERS
├── CONTRIBUTING.md
├── Directory.Packages.props
├── LICENSE
├── README.md
├── all.sln
├── daprdocs
├── README.md
└── content
│ └── en
│ ├── dotnet-sdk-contributing
│ └── dotnet-contributing.md
│ └── dotnet-sdk-docs
│ ├── _index.md
│ ├── dotnet-actors
│ ├── _index.md
│ ├── dotnet-actors-client.md
│ ├── dotnet-actors-howto.md
│ ├── dotnet-actors-serialization.md
│ └── dotnet-actors-usage.md
│ ├── dotnet-ai
│ ├── _index.md
│ ├── dotnet-ai-conversation-howto.md
│ └── dotnet-ai-conversation-usage.md
│ ├── dotnet-client
│ ├── _index.md
│ └── dotnet-daprclient-usage.md
│ ├── dotnet-development
│ ├── _index.md
│ ├── dotnet-development-dapr-aspire.md
│ ├── dotnet-development-dapr-cli.md
│ ├── dotnet-development-docker-compose.md
│ └── dotnet-development-tye.md
│ ├── dotnet-error-handling
│ ├── _index.md
│ └── dotnet-richer-error-model.md
│ ├── dotnet-jobs
│ ├── _index.md
│ ├── dotnet-jobs-howto.md
│ └── dotnet-jobsclient-usage.md
│ ├── dotnet-messaging
│ ├── _index.md
│ ├── dotnet-messaging-pubsub-howto.md
│ └── dotnet-messaging-pubsub-usage.md
│ ├── dotnet-troubleshooting
│ ├── _index.md
│ └── dotnet-troubleshooting-pubsub.md
│ └── dotnet-workflow
│ ├── _index.md
│ ├── dotnet-workflow-howto.md
│ └── dotnet-workflowclient-usage.md
├── docs
├── RELEASE.md
└── api-tokens.md
├── examples
├── .editorconfig
├── AI
│ └── ConversationalAI
│ │ ├── ConversationalAI.csproj
│ │ └── Program.cs
├── Actor
│ ├── ActorClient
│ │ ├── ActorClient.csproj
│ │ └── Program.cs
│ ├── DemoActor
│ │ ├── BankService.cs
│ │ ├── DemoActor.cs
│ │ ├── DemoActor.csproj
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── Startup.cs
│ │ ├── appsettings.json
│ │ └── demo-actor.yaml
│ ├── IDemoActor
│ │ ├── IBankActor.cs
│ │ ├── IDemoActor.cs
│ │ └── IDemoActor.csproj
│ └── README.md
├── AspNetCore
│ ├── ControllerSample
│ │ ├── Account.cs
│ │ ├── ControllerSample.csproj
│ │ ├── Controllers
│ │ │ └── SampleController.cs
│ │ ├── CustomTopicAttribute.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── README.md
│ │ ├── Startup.cs
│ │ ├── Transaction.cs
│ │ ├── TransactionV2.cs
│ │ ├── appsettings.json
│ │ └── sample.http
│ ├── GrpcServiceSample
│ │ ├── GrpcServiceSample.csproj
│ │ ├── Models
│ │ │ ├── Account.cs
│ │ │ ├── GetAccountInput.cs
│ │ │ └── Transaction.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── Protos
│ │ │ └── data.proto
│ │ ├── README.md
│ │ ├── Services
│ │ │ └── BankingService.cs
│ │ ├── Startup.cs
│ │ ├── appsettings.Development.json
│ │ └── appsettings.json
│ ├── README.md
│ ├── RoutingSample
│ │ ├── Account.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── README.md
│ │ ├── RoutingSample.csproj
│ │ ├── Startup.cs
│ │ ├── Transaction.cs
│ │ ├── appsettings.json
│ │ └── sample.http
│ └── SecretStoreConfigurationProviderSample
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ ├── README.md
│ │ ├── SecretStoreConfigurationProviderSample.csproj
│ │ ├── Startup.cs
│ │ ├── components
│ │ └── secretstore.yaml
│ │ └── secrets.json
├── Client
│ ├── ConfigurationApi
│ │ ├── Components
│ │ │ └── redisconfig.yaml
│ │ ├── ConfigurationApi.csproj
│ │ ├── Controllers
│ │ │ └── ConfigurationController.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── README.md
│ │ ├── Startup.cs
│ │ ├── appsettings.Development.json
│ │ └── appsettings.json
│ ├── Cryptography
│ │ ├── Components
│ │ │ └── local-storage.yaml
│ │ ├── Cryptography.csproj
│ │ ├── Example.cs
│ │ ├── Examples
│ │ │ ├── EncryptDecryptFileStreamExample.cs
│ │ │ └── EncryptDecryptStringExample.cs
│ │ ├── Program.cs
│ │ ├── README.md
│ │ ├── file.txt
│ │ └── keys
│ │ │ └── rsa-private-key.pem
│ ├── DistributedLock
│ │ ├── Components
│ │ │ ├── cronbinding.yaml
│ │ │ ├── localstorage.yaml
│ │ │ ├── redislock.yaml
│ │ │ └── redisstore.yaml
│ │ ├── Controllers
│ │ │ └── BindingController.cs
│ │ ├── DistributedLock.csproj
│ │ ├── Model
│ │ │ └── StateData.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── README.md
│ │ ├── Services
│ │ │ └── GeneratorService.cs
│ │ ├── Startup.cs
│ │ ├── appsettings.Development.json
│ │ └── appsettings.json
│ ├── PublishSubscribe
│ │ ├── BulkPublishEventExample
│ │ │ ├── BulkPublishEventExample.cs
│ │ │ ├── BulkPublishEventExample.csproj
│ │ │ ├── Example.cs
│ │ │ ├── Program.cs
│ │ │ └── README.md
│ │ ├── PublishEventExample
│ │ │ ├── Example.cs
│ │ │ ├── Program.cs
│ │ │ ├── PublishBytesExample.cs
│ │ │ ├── PublishEventExample.cs
│ │ │ ├── PublishEventExample.csproj
│ │ │ └── README.md
│ │ └── StreamingSubscriptionExample
│ │ │ ├── Program.cs
│ │ │ └── StreamingSubscriptionExample.csproj
│ ├── README.md
│ ├── ServiceInvocation
│ │ ├── Example.cs
│ │ ├── InvokeServiceGrpcExample.cs
│ │ ├── InvokeServiceHttpClientExample.cs
│ │ ├── InvokeServiceHttpExample.cs
│ │ ├── Program.cs
│ │ ├── README.md
│ │ └── ServiceInvocation.csproj
│ └── StateManagement
│ │ ├── BulkStateExample.cs
│ │ ├── Example.cs
│ │ ├── Program.cs
│ │ ├── README.md
│ │ ├── StateManagement.csproj
│ │ ├── StateStoreBinaryExample.cs
│ │ ├── StateStoreETagsExample.cs
│ │ ├── StateStoreExample.cs
│ │ └── StateStoreTransactionsExample.cs
├── Directory.Build.props
├── GeneratedActor
│ ├── ActorClient
│ │ ├── ActorClient.csproj
│ │ ├── IClientActor.cs
│ │ ├── IGenericClientActor.cs
│ │ └── Program.cs
│ ├── ActorCommon
│ │ ├── ActorCommon.csproj
│ │ └── IRemoteActor.cs
│ ├── ActorService
│ │ ├── ActorService.csproj
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── RemoteActor.cs
│ │ ├── appsettings.Development.json
│ │ └── appsettings.json
│ └── README.md
├── Jobs
│ └── JobsSample
│ │ ├── JobsSample.csproj
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── launchSettings.json
├── README.md
└── Workflow
│ ├── README.md
│ ├── WorkflowAsyncOperations
│ ├── Activities
│ │ ├── NotifyWarehouseActivity.cs
│ │ └── ProcessPaymentActivity.cs
│ ├── Models
│ │ └── Transaction.cs
│ ├── Program.cs
│ ├── WorkflowAsyncOperations.csproj
│ └── Workflows
│ │ └── DemoWorkflow.cs
│ ├── WorkflowConsoleApp
│ ├── Activities
│ │ ├── NotifyActivity.cs
│ │ ├── ProcessPaymentActivity.cs
│ │ ├── RequestApprovalActivity.cs
│ │ ├── ReserveInventoryActivity.cs
│ │ └── UpdateInventoryActivity.cs
│ ├── Models.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── WorkflowConsoleApp.csproj
│ ├── Workflows
│ │ └── OrderProcessingWorkflow.cs
│ └── demo.http
│ ├── WorkflowExternalInteraction
│ ├── Activities
│ │ ├── ApproveActivity.cs
│ │ └── RejectActivity.cs
│ ├── Program.cs
│ ├── WorkflowExternalInteraction.csproj
│ └── Workflows
│ │ └── DemoWorkflow.cs
│ ├── WorkflowFanOutFanIn
│ ├── Activities
│ │ └── NotifyActivity.cs
│ ├── Program.cs
│ ├── WorkflowFanOutFanIn.csproj
│ └── Workflows
│ │ └── DemoWorkflow.cs
│ ├── WorkflowMonitor
│ ├── Activities
│ │ └── CheckStatus.cs
│ ├── Program.cs
│ ├── WorkflowMonitor.csproj
│ └── Workflows
│ │ └── DemoWorkflow.cs
│ ├── WorkflowSubworkflow
│ ├── Program.cs
│ ├── WorkflowSubworkflow.csproj
│ └── Workflows
│ │ ├── DemoSubWorkflow.cs
│ │ └── DemoWorkflow.cs
│ ├── WorkflowTaskChaining
│ ├── Activities
│ │ ├── Step1.cs
│ │ ├── Step2.cs
│ │ └── Step3.cs
│ ├── Program.cs
│ ├── WorkflowTaskChaining.csproj
│ └── Workflows
│ │ └── DemoWorkflow.cs
│ └── WorkflowUnitTest
│ ├── OrderProcessingTests.cs
│ └── WorkflowUnitTest.csproj
├── global.json
├── properties
├── IsExternalInit.cs
├── cs_sdk.snk
├── dapr_common.props
├── dapr_managed_netcore.props
├── dapr_nuget.props
├── logo-transparent.png
└── nuget_icon_ms.png
├── src
├── Dapr.AI
│ ├── AssemblyInfo.cs
│ ├── Conversation
│ │ ├── ConversationOptions.cs
│ │ ├── DaprConversationClient.cs
│ │ ├── DaprConversationClientBuilder.cs
│ │ ├── DaprConversationInput.cs
│ │ ├── DaprConversationResponse.cs
│ │ ├── DaprConversationResult.cs
│ │ ├── DaprConversationRole.cs
│ │ └── Extensions
│ │ │ ├── DaprAiConversationBuilder.cs
│ │ │ ├── DaprAiConversationBuilderExtensions.cs
│ │ │ └── IDaprAiConversationBuilder.cs
│ ├── Dapr.AI.csproj
│ ├── DaprAIClient.cs
│ └── Extensions
│ │ └── IDaprAiServiceBuilder.cs
├── Dapr.Actors.AspNetCore
│ ├── ActorsEndpointRouteBuilderExtensions.cs
│ ├── ActorsServiceCollectionExtensions.cs
│ ├── Dapr.Actors.AspNetCore.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Runtime
│ │ ├── DependencyInjectionActorActivator.cs
│ │ └── DependencyInjectionActorActivatorFactory.cs
├── Dapr.Actors.Generators
│ ├── ActorClientGenerator.cs
│ ├── AnalyzerReleases.Shipped.md
│ ├── AnalyzerReleases.Unshipped.md
│ ├── Constants.cs
│ ├── Dapr.Actors.Generators.csproj
│ ├── Diagnostics
│ │ ├── CancellationTokensMustBeTheLastArgument.cs
│ │ └── MethodMustOnlyHaveASingleArgumentOptionallyFollowedByACancellationToken.cs
│ ├── DiagnosticsException.cs
│ ├── Extensions
│ │ └── IEnumerableExtensions.cs
│ ├── Helpers
│ │ └── SyntaxFactoryHelpers.cs
│ ├── Models
│ │ └── ActorClientDescriptor.cs
│ ├── Properties
│ │ └── launchSettings.json
│ └── Templates.cs
├── Dapr.Actors
│ ├── ActorId.cs
│ ├── ActorMethodInvocationException.cs
│ ├── ActorReentrancyConfig.cs
│ ├── ActorReentrancyContextAccessor.cs
│ ├── ActorReference.cs
│ ├── Builder
│ │ ├── ActorCodeBuilder.cs
│ │ ├── ActorCodeBuilderNames.cs
│ │ ├── ActorMethodDispatcherBase.cs
│ │ ├── ActorProxyGenerator.cs
│ │ ├── ActorProxyGeneratorBuildResult.cs
│ │ ├── ActorProxyGeneratorBuilder.cs
│ │ ├── BuildResult.cs
│ │ ├── CodeBuilderAttribute.cs
│ │ ├── CodeBuilderContext.cs
│ │ ├── CodeBuilderModule.cs
│ │ ├── CodeBuilderUtils.cs
│ │ ├── ICodeBuilder.cs
│ │ ├── ICodeBuilderNames.cs
│ │ ├── IProxyActivator.cs
│ │ ├── InterfaceDetails.cs
│ │ ├── InterfaceDetailsStore.cs
│ │ ├── MethodBodyTypes.cs
│ │ ├── MethodBodyTypesBuildResult.cs
│ │ ├── MethodBodyTypesBuilder.cs
│ │ ├── MethodDispatcherBuildResult.cs
│ │ └── MethodDispatcherBuilder.cs
│ ├── Client
│ │ ├── ActorProxy.cs
│ │ ├── ActorProxyFactory.cs
│ │ ├── ActorProxyOptions.cs
│ │ ├── IActorProxy.cs
│ │ └── IActorProxyFactory.cs
│ ├── ClientSettings.cs
│ ├── Common
│ │ ├── CRC64.cs
│ │ └── IdUtil.cs
│ ├── Communication
│ │ ├── ActorDataContractSurrogate.cs
│ │ ├── ActorInvokeException.cs
│ │ ├── ActorInvokeExceptionData.cs
│ │ ├── ActorLogicalCallContext.cs
│ │ ├── ActorMessageBodyDataContractSerializationProvider.cs
│ │ ├── ActorMessageBodyJsonConverter.cs
│ │ ├── ActorMessageBodyJsonSerializationProvider.cs
│ │ ├── ActorMessageHeaderSerializer.cs
│ │ ├── ActorMessageSerializersManager.cs
│ │ ├── ActorMethodDispatcherMap.cs
│ │ ├── ActorRequestMessage.cs
│ │ ├── ActorRequestMessageBody.cs
│ │ ├── ActorRequestMessageHeader.cs
│ │ ├── ActorResponseMessage.cs
│ │ ├── ActorResponseMessageBody.cs
│ │ ├── ActorResponseMessageHeader.cs
│ │ ├── ActorStateResponse.cs
│ │ ├── CacheEntry.cs
│ │ ├── Client
│ │ │ ├── ActorNonRemotingClient.cs
│ │ │ └── ActorRemotingClient.cs
│ │ ├── DataContractMessageFactory.cs
│ │ ├── DisposableStream.cs
│ │ ├── IActorMessageBodyFactory.cs
│ │ ├── IActorMessageBodySerializationProvider.cs
│ │ ├── IActorMessageHeaderSerializer.cs
│ │ ├── IActorRequestMessage.cs
│ │ ├── IActorRequestMessageBody.cs
│ │ ├── IActorRequestMessageBodySerializer.cs
│ │ ├── IActorRequestMessageHeader.cs
│ │ ├── IActorResponseMessage.cs
│ │ ├── IActorResponseMessageBody.cs
│ │ ├── IActorResponseMessageBodySerializer.cs
│ │ ├── IActorResponseMessageHeader.cs
│ │ ├── WrappedMessage.cs
│ │ ├── WrappedMessageBody.cs
│ │ └── WrappedRequestMessageFactory.cs
│ ├── Constants.cs
│ ├── Dapr.Actors.csproj
│ ├── DaprHttpInteractor.cs
│ ├── Description
│ │ ├── ActorInterfaceDescription.cs
│ │ ├── InterfaceDescription.cs
│ │ ├── MethodArgumentDescription.cs
│ │ ├── MethodDescription.cs
│ │ ├── MethodReturnCheck.cs
│ │ └── TypeUtility.cs
│ ├── Extensions
│ │ ├── DurationExtensions.cs
│ │ └── StringExtensions.cs
│ ├── Helper.cs
│ ├── IActor.cs
│ ├── IActorReference.cs
│ ├── IDaprInteractor.cs
│ ├── JsonSerializerDefaults.cs
│ ├── Resources
│ │ ├── SR.Designer.cs
│ │ └── SR.resx
│ ├── Runtime
│ │ ├── Actor.cs
│ │ ├── ActorActivator.cs
│ │ ├── ActorActivatorFactory.cs
│ │ ├── ActorActivatorState.cs
│ │ ├── ActorAttribute.cs
│ │ ├── ActorCallType.cs
│ │ ├── ActorHost.cs
│ │ ├── ActorManager.cs
│ │ ├── ActorMethodContext.cs
│ │ ├── ActorMethodInfoMap.cs
│ │ ├── ActorRegistration.cs
│ │ ├── ActorRegistrationCollection.cs
│ │ ├── ActorReminder.cs
│ │ ├── ActorReminderOptions.cs
│ │ ├── ActorReminderToken.cs
│ │ ├── ActorRuntime.cs
│ │ ├── ActorRuntimeOptions.cs
│ │ ├── ActorStateChange.cs
│ │ ├── ActorStateManager.cs
│ │ ├── ActorTestOptions.cs
│ │ ├── ActorTimer.cs
│ │ ├── ActorTimerManager.cs
│ │ ├── ActorTimerOptions.cs
│ │ ├── ActorTimerToken.cs
│ │ ├── ActorTypeExtensions.cs
│ │ ├── ActorTypeInformation.cs
│ │ ├── ConditionalValue.cs
│ │ ├── ConverterUtils.cs
│ │ ├── DaprStateProvider.cs
│ │ ├── DefaultActorActivator.cs
│ │ ├── DefaultActorActivatorFactory.cs
│ │ ├── DefaultActorTimerManager.cs
│ │ ├── IActorContextualState.cs
│ │ ├── IActorReminder.cs
│ │ ├── IActorStateManager.cs
│ │ ├── IActorStateSerializer.cs
│ │ ├── IRemindable.cs
│ │ ├── ReminderInfo.cs
│ │ ├── StateChangeKind.cs
│ │ └── TimerInfo.cs
│ ├── Serialization
│ │ └── ActorIdJsonConverter.cs
│ └── properties
│ │ └── AssemblyInfo.cs
├── Dapr.AspNetCore
│ ├── BulkMessageModel.cs
│ ├── BulkSubscribeAppResponse.cs
│ ├── BulkSubscribeAppResponseEntry.cs
│ ├── BulkSubscribeAppResponseStatus.cs
│ ├── BulkSubscribeAttribute.cs
│ ├── BulkSubscribeMessage.cs
│ ├── BulkSubscribeMessageEntry.cs
│ ├── BulkSubscribeTopicOptions.cs
│ ├── CloudEventPropertyNames.cs
│ ├── CloudEventsMiddleware.cs
│ ├── CloudEventsMiddlewareOptions.cs
│ ├── Dapr.AspNetCore.csproj
│ ├── DaprApplicationBuilderExtensions.cs
│ ├── DaprAuthenticationBuilderExtensions.cs
│ ├── DaprAuthenticationHandler.cs
│ ├── DaprAuthenticationOptions.cs
│ ├── DaprAuthorizationOptionsExtensions.cs
│ ├── DaprEndpointConventionBuilderExtensions.cs
│ ├── DaprEndpointRouteBuilderExtensions.cs
│ ├── DaprMvcBuilderExtensions.cs
│ ├── DaprServiceCollectionExtensions.cs
│ ├── FromStateAttribute.cs
│ ├── FromStateBindingSource.cs
│ ├── IBulkSubscribeMetadata.cs
│ ├── IDeadLetterTopicMetadata.cs
│ ├── IOriginalTopicMetadata.cs
│ ├── IOwnedOriginalTopicMetadata.cs
│ ├── IRawTopicMetadata.cs
│ ├── ITopicMetadata.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── SR.Designer.cs
│ │ └── SR.resx
│ ├── StateEntryApplicationModelProvider.cs
│ ├── StateEntryModelBinder.cs
│ ├── StateEntryModelBinderProvider.cs
│ ├── SubscribeOptions.cs
│ ├── Subscription.cs
│ ├── TopicAttribute.cs
│ ├── TopicMetadataAttribute.cs
│ └── TopicOptions.cs
├── Dapr.Client
│ ├── BindingRequest.cs
│ ├── BindingResponse.cs
│ ├── BulkPublishEntry.cs
│ ├── BulkPublishResponse.cs
│ ├── BulkPublishResponseFailedEntry.cs
│ ├── BulkStateItem.cs
│ ├── CloudEvent.cs
│ ├── ConcurrencyMode.cs
│ ├── ConfigurationItem.cs
│ ├── ConfigurationSource.cs
│ ├── ConsistencyMode.cs
│ ├── Constants.cs
│ ├── Crypto
│ │ ├── DecryptionStreamProcessor.cs
│ │ └── EncryptionStreamProcessor.cs
│ ├── CryptographyEnums.cs
│ ├── CryptographyOptions.cs
│ ├── Dapr.Client.csproj
│ ├── DaprApiException.cs
│ ├── DaprClient.cs
│ ├── DaprClientBuilder.cs
│ ├── DaprClientGrpc.cs
│ ├── DaprError.cs
│ ├── DaprMetadata.cs
│ ├── DaprSubscribeConfigurationSource.cs
│ ├── DeleteBulkStateItem.cs
│ ├── Extensions
│ │ ├── EnumExtensions.cs
│ │ ├── HttpExtensions.cs
│ │ └── ReadOnlyMemoryExtensions.cs
│ ├── GetConfigurationResponse.cs
│ ├── InvocationException.cs
│ ├── InvocationHandler.cs
│ ├── InvocationInterceptor.cs
│ ├── SaveStateItem.cs
│ ├── StartWorkflowResponse.cs
│ ├── StateEntry.cs
│ ├── StateOperationType.cs
│ ├── StateOptions.cs
│ ├── StateQueryException.cs
│ ├── StateQueryResponse.cs
│ ├── StateTransactionRequest.cs
│ ├── SubscribeConfigurationResponse.cs
│ ├── TryLockResponse.cs
│ ├── TypeConverters.cs
│ ├── UnlockResponse.cs
│ ├── UnsubscribeConfigurationResponse.cs
│ └── properties
│ │ └── AssemblyInfo.cs
├── Dapr.Common
│ ├── ArgumentVerifier.cs
│ ├── AssemblyInfo.cs
│ ├── Dapr.Common.csproj
│ ├── DaprClientUtilities.cs
│ ├── DaprDefaults.cs
│ ├── DaprException.cs
│ ├── DaprGenericClientBuilder.cs
│ ├── Exceptions
│ │ ├── DaprExceptionExtensions.cs
│ │ ├── DaprExtendedErrorConstants.cs
│ │ ├── DaprExtendedErrorDetail.cs
│ │ ├── DaprExtendedErrorInfo.cs
│ │ ├── DaprExtendedErrorType.cs
│ │ └── ExtendedErrorDetailFactory.cs
│ ├── Extensions
│ │ └── EnumExtensions.cs
│ └── JsonConverters
│ │ └── GenericEnumJsonConverter.cs
├── Dapr.Extensions.Configuration
│ ├── Dapr.Extensions.Configuration.csproj
│ ├── DaprConfigurationStoreExtension.cs
│ ├── DaprConfigurationStoreProvider.cs
│ ├── DaprConfigurationStoreSource.cs
│ ├── DaprSecretDescriptor.cs
│ ├── DaprSecretStoreConfigurationExtensions.cs
│ ├── DaprSecretStoreConfigurationProvider.cs
│ └── DaprSecretStoreConfigurationSource.cs
├── Dapr.Jobs
│ ├── AssemblyInfo.cs
│ ├── CronExpressionBuilder.cs
│ ├── Dapr.Jobs.csproj
│ ├── DaprJobsClient.cs
│ ├── DaprJobsClientBuilder.cs
│ ├── DaprJobsGrpcClient.cs
│ ├── Extensions
│ │ ├── DaprJobsServiceCollectionExtensions.cs
│ │ ├── DaprSerializationExtensions.cs
│ │ ├── EndpointRouteBuilderExtensions.cs
│ │ ├── StringExtensions.cs
│ │ └── TimeSpanExtensions.cs
│ ├── JsonConverters
│ │ ├── DaprJobScheduleConverter.cs
│ │ └── Iso8601DateTimeJsonConverter.cs
│ └── Models
│ │ ├── DaprJobSchedule.cs
│ │ └── Responses
│ │ └── DaprJobDetails.cs
├── Dapr.Messaging
│ ├── AssemblyInfo.cs
│ ├── Dapr.Messaging.csproj
│ └── PublishSubscribe
│ │ ├── DaprPublishSubscribeClient.cs
│ │ ├── DaprPublishSubscribeClientBuilder.cs
│ │ ├── DaprPublishSubscribeGrpcClient.cs
│ │ ├── DaprSubscriptionOptions.cs
│ │ ├── Extensions
│ │ └── PublishSubscribeServiceCollectionExtensions.cs
│ │ ├── MessageHandlingPolicy.cs
│ │ ├── PublishSubscribeReceiver.cs
│ │ ├── TopicMessage.cs
│ │ ├── TopicMessageHandler.cs
│ │ └── TopicResponseAction.cs
├── Dapr.Protos
│ ├── Dapr.Protos.csproj
│ └── Protos
│ │ └── dapr
│ │ └── proto
│ │ ├── common
│ │ └── v1
│ │ │ └── common.proto
│ │ └── runtime
│ │ └── v1
│ │ ├── appcallback.proto
│ │ └── dapr.proto
├── Dapr.Workflow
│ ├── Dapr.Workflow.csproj
│ ├── DaprWorkflowActivityContext.cs
│ ├── DaprWorkflowClient.cs
│ ├── DaprWorkflowClientBuilderFactory.cs
│ ├── DaprWorkflowContext.cs
│ ├── IWorkflowContext.cs
│ ├── Workflow.cs
│ ├── WorkflowActivity.cs
│ ├── WorkflowActivityContext.cs
│ ├── WorkflowContext.cs
│ ├── WorkflowLoggingService.cs
│ ├── WorkflowRetryPolicy.cs
│ ├── WorkflowRuntimeOptions.cs
│ ├── WorkflowRuntimeStatus.cs
│ ├── WorkflowServiceCollectionExtensions.cs
│ ├── WorkflowState.cs
│ ├── WorkflowTaskFailedException.cs
│ ├── WorkflowTaskFailureDetails.cs
│ └── WorkflowTaskOptions.cs
└── Directory.Build.props
└── test
├── Dapr.AI.Test
├── Conversation
│ ├── DaprConversationClientBuilderTest.cs
│ └── Extensions
│ │ └── DaprAiConversationBuilderExtensionsTest.cs
└── Dapr.AI.Test.csproj
├── Dapr.Actors.AspNetCore.IntegrationTest.App
├── ActivationTests
│ └── DependencyInjectionActor.cs
├── Dapr.Actors.AspNetCore.IntegrationTest.App.csproj
├── Program.cs
└── Startup.cs
├── Dapr.Actors.AspNetCore.IntegrationTest
├── ActivationTests.cs
├── AppWebApplicationFactory.cs
├── Dapr.Actors.AspNetCore.IntegrationTest.csproj
└── HostingTests.cs
├── Dapr.Actors.AspNetCore.Test
├── ActorHostingTest.cs
├── Dapr.Actors.AspNetCore.Test.csproj
├── DaprActorServiceCollectionExtensionsTest.cs
└── Runtime
│ ├── ActorsEndpointRouteBuilderExtensionsTests.cs
│ └── DependencyInjectionActorActivatorTests.cs
├── Dapr.Actors.Generators.Test
├── ActorClientGeneratorTests.cs
├── AdditionalMetadataReferences.cs
├── CSharpSourceGeneratorVerifier.cs
├── Dapr.Actors.Generators.Test.csproj
├── Extensions
│ └── IEnumerableExtensionsTests.cs
├── GlobalUsings.cs
└── Helpers
│ └── SyntaxFactoryHelpersTests.cs
├── Dapr.Actors.Test
├── ActorCodeBuilderTests.cs
├── ActorIdTests.cs
├── ActorMethodInvocationExceptionTests.cs
├── ActorProxyOptionsTests.cs
├── ActorProxyTests.cs
├── ActorReferenceTests.cs
├── ActorStateManagerTest.cs
├── ActorUnitTestTests.cs
├── ApiTokenTests.cs
├── ConverterUtilsTests.cs
├── Dapr.Actors.Test.csproj
├── DaprFormatTimeSpanTests.cs
├── DaprHttpInteractorTest.cs
├── DaprStateProviderTest.cs
├── Description
│ ├── ActorInterfaceDescriptionTests.cs
│ ├── InterfaceDescriptionTests.cs
│ ├── MethodArgumentDescriptionTests.cs
│ └── MethodDescriptionTests.cs
├── Extensions
│ ├── DurationExtensionsTests.cs
│ └── StringExtensionsTests.cs
├── ITestActor.cs
├── Runtime
│ ├── ActorManagerTests.cs
│ ├── ActorReminderInfoTests.cs
│ ├── ActorRuntimeOptionsTests.cs
│ ├── ActorRuntimeTests.cs
│ ├── ActorTests.cs
│ ├── ActorTypeInformationTests.cs
│ ├── DefaultActorActivatorTests.cs
│ └── DefaultActorTimerManagerTests.cs
├── Serialization
│ ├── ActorIdDataContractSerializationTest.cs
│ ├── ActorIdJsonConverterTest.cs
│ └── TimerInfoJsonConverterTest.cs
└── TestDaprInteractor.cs
├── Dapr.AspNetCore.IntegrationTest.App
├── CustomTopicAttribute.cs
├── Dapr.AspNetCore.IntegrationTest.App.csproj
├── DaprController.cs
├── Program.cs
├── Startup.cs
├── UserInfo.cs
└── Widget.cs
├── Dapr.AspNetCore.IntegrationTest
├── AppWebApplicationFactory.cs
├── AuthenticationTest.cs
├── CloudEventsIntegrationTest.cs
├── ControllerIntegrationTest.cs
├── Dapr.AspNetCore.IntegrationTest.csproj
├── RoutingIntegrationTest.cs
├── StateTestClient.cs
└── SubscribeEndpointTest.cs
├── Dapr.AspNetCore.Test
├── CloudEventsMiddlewareTest.cs
├── Dapr.AspNetCore.Test.csproj
├── DaprClientBuilderTest.cs
├── DaprMvcBuilderExtensionsTest.cs
├── DaprServiceCollectionExtensionsTest.cs
├── StateEntryApplicationModelProviderTest.cs
└── StateEntryModelBinderTest.cs
├── Dapr.Client.Test
├── ArgumentVerifierTest.cs
├── BulkPublishEventApiTest.cs
├── ConfigurationApiTest.cs
├── ConfigurationSourceTest.cs
├── CryptographyApiTest.cs
├── Dapr.Client.Test.csproj
├── DaprApiTokenTest.cs
├── DaprClientTest.CreateInvokableHttpClientTest.cs
├── DaprClientTest.InvokeMethodAsync.cs
├── DaprClientTest.InvokeMethodGrpcAsync.cs
├── DaprClientTest.cs
├── DistributedLockApiTest.cs
├── Extensions
│ ├── EnumExtensionTest.cs
│ └── HttpExtensionTest.cs
├── InvocationHandlerTests.cs
├── InvokeBindingApiTest.cs
├── MockClient.cs
├── Protos
│ └── test.proto
├── PublishEventApiTest.cs
├── SecretApiTest.cs
├── StateApiTest.cs
├── TryLockResponseTest.cs
└── TypeConvertersTest.cs
├── Dapr.Common.Test
├── Dapr.Common.Test.csproj
├── DaprDefaultTest.cs
├── DaprExtendedErrorInfoTest.cs
├── DaprGenericClientBuilderTest.cs
├── Extensions
│ └── EnumExtensionsTest.cs
└── JsonConverters
│ └── GenericEnumJsonConverterTest.cs
├── Dapr.E2E.Test.Actors.Generators
├── ActorState.cs
├── ActorWebApplicationFactory.cs
├── Clients
│ ├── GeneratedClientTests.cs
│ ├── IClientActor.cs
│ ├── IRemoteActor.cs
│ └── RemoteActor.cs
├── Dapr.E2E.Test.Actors.Generators.csproj
├── DaprSidecarFactory.cs
├── GlobalUsings.cs
├── IPingActor.cs
├── PortManager.cs
└── XUnitLoggingProvider.cs
├── Dapr.E2E.Test.Actors
├── Dapr.E2E.Test.Actors.csproj
├── ExceptionTesting
│ └── IExceptionActor.cs
├── IPingActor.cs
├── ISerializationActor.cs
├── Reentrancy
│ ├── CallRecord.cs
│ ├── IReentrantActor.cs
│ ├── ReentrantCallOptions.cs
│ └── State.cs
├── RegressionActor
│ ├── IRegression762Actor.cs
│ └── StateCall.cs
├── Reminders
│ ├── IReminderActor.cs
│ ├── StartReminderOptions.cs
│ └── State.cs
├── State
│ └── IStateActor.cs
├── Timers
│ ├── ITimerActor.cs
│ ├── StartTimerOptions.cs
│ └── State.cs
└── WeaklyTypedTesting
│ ├── DerivedResponse.cs
│ ├── IWeaklyTypedTestingActor.cs
│ └── ResponseBase.cs
├── Dapr.E2E.Test.App.Grpc
├── Dapr.E2E.Test.App.Grpc.csproj
├── MessageRepository.cs
├── Program.cs
├── Proto
│ └── message.proto
├── Services
│ └── MessagerService.cs
└── Startup.cs
├── Dapr.E2E.Test.App.ReentrantActor
├── Actors
│ └── ReentrantActor.cs
├── Dapr.E2E.Test.App.ReentrantActors.csproj
├── Program.cs
├── Startup.cs
├── appsettings.Development.json
└── appsettings.json
├── Dapr.E2E.Test.App
├── Account.cs
├── Actors
│ ├── ExceptionActor.cs
│ ├── Regression762Actor.cs
│ ├── ReminderActor.cs
│ ├── SerializationActor.cs
│ ├── StateActor.cs
│ ├── TimerActor.cs
│ └── WeaklyTypedTestingActor.cs
├── Controllers
│ └── TestController.cs
├── Dapr.E2E.Test.App.csproj
├── Program.cs
├── Startup.cs
└── Transaction.cs
├── Dapr.E2E.Test
├── AVeryCoolWorkAroundTest.cs
├── ActorRuntimeChecker.cs
├── Actors
│ ├── E2ETests.CustomSerializerTests.cs
│ ├── E2ETests.ExceptionTests.cs
│ ├── E2ETests.ReentrantTests.cs
│ ├── E2ETests.Regression762Tests.cs
│ ├── E2ETests.ReminderTests.cs
│ ├── E2ETests.StateTests.cs
│ ├── E2ETests.TimerTests.cs
│ └── E2ETests.WeaklyTypedTests.cs
├── Dapr.E2E.Test.csproj
├── DaprCommand.cs
├── DaprRunConfiguration.cs
├── DaprTestApp.cs
├── DaprTestAppFixture.cs
├── DaprTestAppLifecycle.cs
├── E2ETests.cs
├── HttpAssert.cs
├── ServiceInvocation
│ ├── E2ETests.GrpcProxyInvocationTests.cs
│ └── E2ETests.ServiceInvocationTests.cs
├── components
│ ├── pubsub.yaml
│ └── statestore.yaml
├── configuration
│ └── featureconfig.yaml
└── deploy
│ ├── local-test-kafka.yml
│ └── local-test-vault.yml
├── Dapr.Extensions.Configuration.Test
├── Dapr.Extensions.Configuration.Test.csproj
├── DaprConfigurationStoreProviderTest.cs
├── DaprSecretStoreConfigurationProviderTest.cs
└── TestHttpClient.cs
├── Dapr.Jobs.Test
├── CronExpressionBuilderTests.cs
├── Dapr.Jobs.Test.csproj
├── DaprJobsClientBuilderTests.cs
├── DaprJobsGrpcClientTests.cs
├── Extensions
│ ├── DaprJobsServiceCollectionExtensionsTests.cs
│ ├── EndpointRouteBuilderExtensionsTests.cs
│ ├── StringExtensionsTests.cs
│ └── TimeSpanExtensionsTests.cs
├── Models
│ └── DaprJobScheduleTests.cs
└── Responses
│ └── DaprJobDetailsTests.cs
├── Dapr.Messaging.Test
├── Dapr.Messaging.Test.csproj
├── Extensions
│ └── PublishSubscribeServiceCollectionExtensionsTests.cs
├── PublishSubscribe
│ ├── MessageHandlingPolicyTest.cs
│ └── PublishSubscribeReceiverTests.cs
└── protos
│ └── test.proto
├── Dapr.Workflow.Test
├── Dapr.Workflow.Test.csproj
├── WorkflowActivityTest.cs
└── WorkflowServiceCollectionExtensionsTests.cs
├── Directory.Build.props
└── Shared
├── AppCallbackClient.cs
├── GrpcUtils.cs
└── TestClient.cs
/.codecov.yml:
--------------------------------------------------------------------------------
1 | coverage:
2 | status:
3 | project:
4 | default:
5 | # basic
6 | target: auto
7 | threshold: 0%
8 |
9 | ignore:
10 | - test # - tests
11 |
--------------------------------------------------------------------------------
/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2021 The Dapr Authors
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | # http://www.apache.org/licenses/LICENSE-2.0
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 | #
13 |
14 | ARG VARIANT=bullseye
15 | FROM mcr.microsoft.com/vscode/devcontainers/dotnet:dev-7.0-bullseye
16 |
17 | # Install minikube
18 | RUN MINIKUBE_URL="https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64" \
19 | && sudo curl -sSL -o /usr/local/bin/minikube "${MINIKUBE_URL}" \
20 | && sudo chmod 0755 /usr/local/bin/minikube \
21 | && MINIKUBE_SHA256=$(curl -sSL "${MINIKUBE_URL}.sha256") \
22 | && echo "${MINIKUBE_SHA256} */usr/local/bin/minikube" | sha256sum -c -
23 |
24 |
25 | # Install Dapr CLI
26 | RUN wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash
27 |
28 | # Install Azure Dev CLI
29 | RUN curl -fsSL https://aka.ms/install-azd.sh | bash
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Azure Developer CLI",
3 | "build": {
4 | "dockerfile": "Dockerfile",
5 | "args": {
6 | "VARIANT": "bullseye"
7 | }
8 | },
9 | "features": {
10 | "ghcr.io/devcontainers/features/azure-cli:1": {
11 | "version": "2.38"
12 | },
13 | "ghcr.io/devcontainers/features/docker-in-docker": {
14 | "version": "latest"
15 | },
16 | "ghcr.io/devcontainers/features/dotnet": {
17 | "version": "8.0",
18 | "additionalVersions": [
19 | "6.0",
20 | "7.0"
21 | ]
22 | },
23 | "ghcr.io/devcontainers/features/github-cli:1": {
24 | "version": "2"
25 | },
26 | "ghcr.io/devcontainers/features/node:1": {
27 | "version": "16",
28 | "nodeGypDependencies": false
29 | }
30 | },
31 | "extensions": [
32 | "ms-azuretools.azure-dev",
33 | "ms-azuretools.vscode-bicep",
34 | "ms-azuretools.vscode-docker",
35 | "ms-vscode.vscode-node-azure-pack",
36 | "ms-dotnettools.csharp",
37 | "ms-dotnettools.vscode-dotnet-runtime",
38 | "ms-azuretools.vscode-dapr",
39 | "GitHub.copilot",
40 | "ms-dotnettools.csdevkit"
41 | ],
42 | "forwardPorts": [
43 | 3000,
44 | 3100,
45 | 3500,
46 | 3501,
47 | 5000,
48 | 5007
49 | ],
50 | "postCreateCommand": "chmod +x .devcontainer/localinit.sh && .devcontainer/localinit.sh",
51 | "remoteUser": "vscode",
52 | "hostRequirements": {
53 | "memory": "8gb"
54 | }
55 | }
--------------------------------------------------------------------------------
/.devcontainer/localinit.sh:
--------------------------------------------------------------------------------
1 | # install Azure CLI extension for Container Apps
2 | az config set extension.use_dynamic_install=yes_without_prompt
3 | az extension add --name containerapp --yes
4 |
5 | # install Node.js and NPM LTS
6 | nvm install v18.12.1
7 |
8 | # initialize Dapr
9 | dapr init --runtime-version=1.14.0
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Report a bug in Dapr
4 | title: ''
5 | labels: kind/bug
6 | assignees: ''
7 |
8 | ---
9 | ## Expected Behavior
10 |
11 |
12 |
13 |
14 | ## Actual Behavior
15 |
16 |
17 |
18 |
19 | ## Steps to Reproduce the Problem
20 |
21 |
22 |
23 | ## Release Note
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | RELEASE NOTE:
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/discussion.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Discussion
3 | about: Start a discussion for Dapr
4 | title: ''
5 | labels: kind/discussion
6 | assignees: ''
7 |
8 | ---
9 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Create a Feature Request for Dapr
4 | title: ''
5 | labels: kind/enhancement
6 | assignees: ''
7 |
8 | ---
9 | ## Describe the feature
10 |
11 | ## Release Note
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | RELEASE NOTE:
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/proposal.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Proposal
3 | about: Create a proposal for Dapr
4 | title: ''
5 | labels: kind/proposal
6 | assignees: ''
7 |
8 | ---
9 | ## Describe the proposal
10 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question
3 | about: Ask a question about Dapr
4 | title: ''
5 | labels: kind/question
6 | assignees: ''
7 |
8 | ---
9 | ## Ask your question here
10 |
--------------------------------------------------------------------------------
/.github/holopin.yml:
--------------------------------------------------------------------------------
1 | organization: dapr
2 | defaultSticker: clrqfdv4x24910fl5n4iwu5oa
3 | stickers:
4 | -
5 | id: clrqfdv4x24910fl5n4iwu5oa
6 | alias: sdk-badge
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | # Description
2 |
3 | _Please explain the changes you've made_
4 |
5 | ## Issue reference
6 |
7 | We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
8 |
9 | Please reference the issue this PR will close: #_[issue number]_
10 |
11 | ## Checklist
12 |
13 | Please make sure you've completed the relevant tasks for this PR, out of the following list:
14 |
15 | * [ ] Code compiles correctly
16 | * [ ] Created/updated tests
17 | * [ ] Extended the documentation
18 |
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # These owners are the maintainers and approvers of this repo
2 | * @dapr/maintainers-dotnet-sdk @dapr/approvers-dotnet-sdk
3 |
--------------------------------------------------------------------------------
/daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: docs
3 | title: "Dapr actors .NET SDK"
4 | linkTitle: "Actors"
5 | weight: 30000
6 | description: Get up and running with the Dapr actors .NET SDK
7 | ---
8 |
9 | With the Dapr actor package, you can interact with Dapr virtual actors from a .NET application.
10 |
11 | To get started, walk through the [Dapr actors]({{< ref dotnet-actors-howto.md >}}) how-to guide.
--------------------------------------------------------------------------------
/daprdocs/content/en/dotnet-sdk-docs/dotnet-ai/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: docs
3 | title: "Dapr AI .NET SDK"
4 | linkTitle: "AI"
5 | weight: 50000
6 | description: Get up and running with the Dapr AI .NET SDK
7 | ---
8 |
9 | With the Dapr AI package, you can interact with the Dapr AI workloads from a .NET application.
10 |
11 | Today, Dapr provides the Conversational API to engage with large language models. To get started with this workload,
12 | walk through the [Dapr Conversational AI]({{< ref dotnet-ai-conversation-howto.md >}}) how-to guide.
--------------------------------------------------------------------------------
/daprdocs/content/en/dotnet-sdk-docs/dotnet-error-handling/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: docs
3 | title: "Error Handling in the Dapr .NET SDK"
4 | linkTitle: "Error handling"
5 | weight: 90000
6 | description: Learn about error handling in the Dapr.NET SDK.
7 | ---
--------------------------------------------------------------------------------
/daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: docs
3 | title: "Dapr Jobs .NET SDK"
4 | linkTitle: "Jobs"
5 | weight: 50000
6 | description: Get up and running with Dapr Jobs and the Dapr .NET SDK
7 | ---
8 |
9 | With the Dapr Job package, you can interact with the Dapr Job APIs from a .NET application to trigger future operations
10 | to run according to a predefined schedule with an optional payload.
11 |
12 | To get started, walk through the [Dapr Jobs]({{< ref dotnet-jobs-howto.md >}}) how-to guide and refer to
13 | [best practices documentation]({{< ref dotnet-jobsclient-usage.md >}}) for additional guidance.
14 |
--------------------------------------------------------------------------------
/daprdocs/content/en/dotnet-sdk-docs/dotnet-messaging/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: docs
3 | title: "Dapr Messaging .NET SDK"
4 | linkTitle: "Messaging"
5 | weight: 60000
6 | description: Get up and running with the Dapr Messaging .NET SDK
7 | ---
8 |
9 | With the Dapr Messaging package, you can interact with the Dapr messaging APIs from a .NET application. In the
10 | v1.15 release, this package only contains the functionality corresponding to the
11 | [streaming PubSub capability](https://docs.dapr.io/developing-applications/building-blocks/pubsub/howto-publish-subscribe/#subscribe-to-topics).
12 |
13 | Future Dapr .NET SDK releases will migrate existing messaging capabilities out from Dapr.Client to this
14 | Dapr.Messaging package. This will be documented in the release notes, documentation and obsolete attributes in advance.
15 |
16 | To get started, walk through the [Dapr Messaging]({{< ref dotnet-messaging-pubsub-howto.md >}}) how-to guide and
17 | refer to [best practices documentation]({{< ref dotnet-messaging-pubsub-usage.md >}}) for additional guidance.
--------------------------------------------------------------------------------
/daprdocs/content/en/dotnet-sdk-docs/dotnet-troubleshooting/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: docs
3 | title: "How to troubleshoot and debug with the Dapr .NET SDK"
4 | linkTitle: "Troubleshooting"
5 | weight: 120000
6 | description: Tips, tricks, and guides for troubleshooting and debugging with the Dapr .NET SDKs
7 | ---
--------------------------------------------------------------------------------
/daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: docs
3 | title: "Dapr Workflow .NET SDK"
4 | linkTitle: "Workflow"
5 | weight: 40000
6 | description: Get up and running with Dapr Workflow and the Dapr .NET SDK
7 | ---
8 |
9 |
--------------------------------------------------------------------------------
/examples/.editorconfig:
--------------------------------------------------------------------------------
1 | ###############################
2 | # Samples EditorConfig Options #
3 | ###############################
4 |
5 | [*.cs]
6 | #####################################
7 | # Analayers Serverity Configuration #
8 | #####################################
9 |
10 | # CS1591: Missing XML comment for publicly visible type or member
11 | dotnet_diagnostic.CS1591.severity = warning
12 |
--------------------------------------------------------------------------------
/examples/AI/ConversationalAI/ConversationalAI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/AI/ConversationalAI/Program.cs:
--------------------------------------------------------------------------------
1 | using Dapr.AI.Conversation;
2 | using Dapr.AI.Conversation.Extensions;
3 |
4 | var builder = WebApplication.CreateBuilder(args);
5 |
6 | builder.Services.AddDaprConversationClient();
7 |
8 | var app = builder.Build();
9 |
10 | var conversationClient = app.Services.GetRequiredService();
11 | var response = await conversationClient.ConverseAsync("conversation",
12 | new List
13 | {
14 | new DaprConversationInput(
15 | "Please write a witty haiku about the Dapr distributed programming framework at dapr.io",
16 | DaprConversationRole.Generic)
17 | });
18 |
19 | Console.WriteLine("Received the following from the LLM:");
20 | foreach (var resp in response.Outputs)
21 | {
22 | Console.WriteLine($"\t{resp.Result}");
23 | }
24 |
--------------------------------------------------------------------------------
/examples/Actor/ActorClient/ActorClient.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/Actor/DemoActor/DemoActor.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6
5 |
6 |
7 |
8 | true
9 | true
10 | demo-actor
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/Actor/DemoActor/Program.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | using Microsoft.AspNetCore.Hosting;
15 | using Microsoft.Extensions.Hosting;
16 |
17 | namespace DemoActor
18 | {
19 | public class Program
20 | {
21 | public static void Main(string[] args)
22 | {
23 | CreateHostBuilder(args).Build().Run();
24 | }
25 |
26 | public static IHostBuilder CreateHostBuilder(string[] args) =>
27 | Host.CreateDefaultBuilder(args)
28 | .ConfigureWebHostDefaults(webBuilder =>
29 | {
30 | webBuilder.UseStartup();
31 | });
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/examples/Actor/DemoActor/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://127.0.0.1:5010/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "DemoActor": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "http://localhost:5010/"
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/examples/Actor/DemoActor/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/examples/Actor/IDemoActor/IDemoActor.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/AspNetCore/ControllerSample/Account.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | namespace ControllerSample
15 | {
16 | ///
17 | /// Class representing an Account for samples.
18 | ///
19 | public class Account
20 | {
21 | ///
22 | /// Gets or sets account id.
23 | ///
24 | public string Id { get; set; }
25 |
26 | ///
27 | /// Gets or sets account balance.
28 | ///
29 | public decimal Balance { get; set; }
30 | }
31 | }
--------------------------------------------------------------------------------
/examples/AspNetCore/ControllerSample/ControllerSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/AspNetCore/ControllerSample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "IIS Express": {
4 | "commandName": "IISExpress",
5 | "launchBrowser": true,
6 | "environmentVariables": {
7 | "ASPNETCORE_ENVIRONMENT": "Development",
8 | "CUSTOM_PUBSUB": "custom-pubsub",
9 | "CUSTOM_TOPIC": "custom-topic"
10 | }
11 | },
12 | "ControllerSample": {
13 | "commandName": "Project",
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development",
16 | "CUSTOM_PUBSUB": "custom-pubsub",
17 | "CUSTOM_TOPIC": "custom-topic"
18 | },
19 | "applicationUrl": "http://localhost:5000/"
20 | }
21 | },
22 | "iisSettings": {
23 | "windowsAuthentication": false,
24 | "anonymousAuthentication": true,
25 | "iisExpress": {
26 | "applicationUrl": "http://localhost:54197/",
27 | "sslPort": 44385
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/examples/AspNetCore/ControllerSample/Transaction.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | namespace ControllerSample
15 | {
16 | using System.ComponentModel.DataAnnotations;
17 |
18 | ///
19 | /// Represents a transaction used by sample code.
20 | ///
21 | public class Transaction
22 | {
23 | ///
24 | /// Gets or sets account id for the transaction.
25 | ///
26 | [Required]
27 | public string Id { get; set; }
28 |
29 | ///
30 | /// Gets or sets amount for the transaction.
31 | ///
2 |
3 |
4 | net6
5 | true
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/examples/AspNetCore/GrpcServiceSample/Models/Account.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | namespace GrpcServiceSample.Models
15 | {
16 | ///
17 | /// Class representing an Account for samples.
18 | ///
19 | public class Account
20 | {
21 | ///
22 | /// Gets or sets account id.
23 | ///
24 | public string Id { get; set; }
25 |
26 | ///
27 | /// Gets or sets account balance.
28 | ///
29 | public decimal Balance { get; set; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/examples/AspNetCore/GrpcServiceSample/Models/GetAccountInput.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | namespace GrpcServiceSample.Models
15 | {
16 | ///
17 | /// BankService GetAccount input model
18 | ///
19 | public class GetAccountInput
20 | {
21 | ///
22 | /// Id of account
23 | ///
24 | public string Id { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/examples/AspNetCore/GrpcServiceSample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "GrpcServiceSample": {
4 | "commandName": "Project",
5 | "launchBrowser": false,
6 | "applicationUrl": "https://localhost:5001",
7 | "environmentVariables": {
8 | "ASPNETCORE_ENVIRONMENT": "Development"
9 | }
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/examples/AspNetCore/GrpcServiceSample/Protos/data.proto:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | syntax = "proto3";
15 |
16 | option csharp_namespace = "GrpcServiceSample.Generated";
17 |
18 | message Account {
19 | string Id = 1;
20 | // Ideally we'd use the Money data type here, but to keep the sample simple we're using an int.
21 | int32 Balance = 2;
22 | }
23 |
24 | message GetAccountRequest {
25 | string Id = 1;
26 | }
27 |
28 | message Transaction {
29 | string Id = 1;
30 | // Ideally we'd use the Money data type here, but to keep the sample simple we're using an int.
31 | int32 Amount = 2;
32 | }
--------------------------------------------------------------------------------
/examples/AspNetCore/GrpcServiceSample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Grpc": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/AspNetCore/GrpcServiceSample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*",
10 | "Kestrel": {
11 | "EndpointDefaults": {
12 | "Protocols": "Http2"
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/examples/AspNetCore/README.md:
--------------------------------------------------------------------------------
1 | # ASP.NET Dapr integration examples
2 |
3 | - [Routing Sample](./RoutingSample): How to run Dapr with ASP.NET Core routing
4 | - [Controller Sample](./ControllerSample): How to use Dapr with ASP.NET Core controllers
5 | - [gRPC Sample](./GrpcServiceSample): How to run Dapr with the ASP.NET gRPC integration
6 | - [Secret Store Configuration](./SecretStoreConfigurationProviderSample)
7 |
--------------------------------------------------------------------------------
/examples/AspNetCore/RoutingSample/Account.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | namespace RoutingSample
15 | {
16 | ///
17 | /// Class representing an Account for samples.
18 | ///
19 | public class Account
20 | {
21 | ///
22 | /// Gets or sets account id.
23 | ///
24 | public string Id { get; set; }
25 |
26 | ///
27 | /// Gets or sets account balance.
28 | ///
29 | public decimal Balance { get; set; }
30 | }
31 | }
--------------------------------------------------------------------------------
/examples/AspNetCore/RoutingSample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://127.0.0.1:5000/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "RoutingSample": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "http://localhost:5000/"
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/examples/AspNetCore/RoutingSample/RoutingSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/AspNetCore/RoutingSample/Transaction.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | namespace RoutingSample
15 | {
16 | ///
17 | /// Represents a transaction used by sample code.
18 | ///
19 | public class Transaction
20 | {
21 | ///
22 | /// Gets or sets account id for the transaction.
23 | ///
24 | public string Id { get; set; }
25 |
26 | ///
27 | /// Gets or sets amount for the transaction.
28 | ///
29 | public decimal Amount { get; set; }
30 | }
31 | }
--------------------------------------------------------------------------------
/examples/AspNetCore/RoutingSample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/examples/AspNetCore/RoutingSample/sample.http:
--------------------------------------------------------------------------------
1 | //Deposit Money
2 |
3 | POST http://127.0.0.1:5000/deposit
4 | Content-Type: application/json
5 |
6 | { "id": "17", "amount": 12 }
7 |
8 | ###
9 |
10 | //Withdraw Money
11 |
12 | POST http://127.0.0.1:5000/withdraw
13 | Content-Type: application/json
14 |
15 | { "id": "17", "amount": 5 }
16 |
17 | ###
18 |
19 | //View Balance
20 |
21 | GET http://127.0.0.1:5000/17
22 |
--------------------------------------------------------------------------------
/examples/AspNetCore/SecretStoreConfigurationProviderSample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:65313",
7 | "sslPort": 44314
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "blq": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
22 | "environmentVariables": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/examples/AspNetCore/SecretStoreConfigurationProviderSample/README.md:
--------------------------------------------------------------------------------
1 | # Dapr secret store configuration provider in ASP.NET Core
2 |
3 | ## Prerequisites
4 |
5 | - [.NET 6+](https://dotnet.microsoft.com/download) installed
6 | - [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/)
7 | - [Initialized Dapr environment](https://docs.dapr.io/getting-started/install-dapr-selfhost/)
8 | - [Dapr .NET SDK](https://docs.dapr.io/developing-applications/sdks/dotnet/)
9 |
10 | ## Overview
11 |
12 | This document describes how to use the Dapr Secret Store Configuration Provider sample to load Secrets into ASP.NET Core Configuration.
13 |
14 | To load secrets into configuration call the _AddDaprSecretStore_ extension method with the name of the Secret Store and a list of secrets descriptors or related metadata.
15 |
16 | ## Using the Dapr Secret Store Configuration Provider ASP.NET Core example
17 |
18 | ### 1. Use Dapr to run the application
19 |
20 | Use Dapr to run the application:
21 |
22 | ```shell
23 | dapr run --app-id SecretStoreConfigurationProviderSample --resources-path ./components/ -- dotnet run
24 | ```
25 |
26 | ### 2. Test the application
27 |
28 | Run the following command in other terminal:
29 |
30 | ``` shell
31 | curl http://localhost:5000/secret
32 | ```
33 |
34 | The response should read: "This the way"
35 |
--------------------------------------------------------------------------------
/examples/AspNetCore/SecretStoreConfigurationProviderSample/SecretStoreConfigurationProviderSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/AspNetCore/SecretStoreConfigurationProviderSample/components/secretstore.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: dapr.io/v1alpha1
2 | kind: Component
3 | metadata:
4 | name: demosecrets
5 | spec:
6 | type: secretstores.local.file
7 | metadata:
8 | - name: secretsFile
9 | value: secrets.json
10 |
--------------------------------------------------------------------------------
/examples/AspNetCore/SecretStoreConfigurationProviderSample/secrets.json:
--------------------------------------------------------------------------------
1 | {
2 | "super-secret": "This the way"
3 | }
--------------------------------------------------------------------------------
/examples/Client/ConfigurationApi/Components/redisconfig.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: dapr.io/v1alpha1
2 | kind: Component
3 | metadata:
4 | name: redisconfig
5 | spec:
6 | type: configuration.redis
7 | version: v1
8 | metadata:
9 | - name: redisHost
10 | value: localhost:6379
11 | - name: redisPassword
12 | value: ""
13 |
--------------------------------------------------------------------------------
/examples/Client/ConfigurationApi/ConfigurationApi.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/Client/ConfigurationApi/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:4855",
8 | "sslPort": 0
9 | }
10 | },
11 | "profiles": {
12 | "IIS Express": {
13 | "commandName": "IISExpress",
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "ConfigurationApi": {
19 | "commandName": "Project",
20 | "applicationUrl": "http://localhost:5010",
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | }
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/examples/Client/ConfigurationApi/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/Client/ConfigurationApi/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/examples/Client/Cryptography/Components/local-storage.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: dapr.io/v1alpha1
2 | kind: Component
3 | metadata:
4 | name: localstorage
5 | spec:
6 | type: crypto.dapr.localstorage
7 | version: v1
8 | metadata:
9 | - name: path
10 | # Path is relative to the folder where the example is located
11 | value: ./keys
12 |
--------------------------------------------------------------------------------
/examples/Client/Cryptography/Cryptography.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | enable
8 | latest
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | PreserveNewest
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/Client/Cryptography/Example.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2023 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | namespace Cryptography
15 | {
16 | internal abstract class Example
17 | {
18 | public abstract string DisplayName { get; }
19 |
20 | public abstract Task RunAsync(CancellationToken cancellationToken);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/Client/Cryptography/file.txt:
--------------------------------------------------------------------------------
1 | # The Road Not Taken
2 | ## By Robert Lee Frost
3 |
4 | Two roads diverged in a yellow wood,
5 | And sorry I could not travel both
6 | And be one traveler, long I stood
7 | And looked down one as far as I could
8 | To where it bent in the undergrowth;
9 |
10 | Then took the other, as just as fair
11 | And having perhaps the better claim,
12 | Because it was grassy and wanted wear;
13 | Though as for that, the passing there
14 | Had worn them really about the same,
15 |
16 | And both that morning equally lay
17 | In leaves no step had trodden black
18 | Oh, I kept the first for another day!
19 | Yet knowing how way leads on to way,
20 | I doubted if I should ever come back.
21 |
22 | I shall be telling this with a sigh
23 | Somewhere ages and ages hence:
24 | Two roads diverged in a wood, and I,
25 | I took the one less traveled by,
26 | And that has made all the difference.
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/Components/cronbinding.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: dapr.io/v1alpha1
2 | kind: Component
3 | metadata:
4 | name: cronbinding
5 | namespace: default
6 | spec:
7 | type: bindings.cron
8 | version: v1
9 | metadata:
10 | - name: schedule
11 | value: "*/5 * * * * *"
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/Components/localstorage.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: dapr.io/v1alpha1
2 | kind: Component
3 | metadata:
4 | name: localstorage
5 | namespace: default
6 | spec:
7 | type: bindings.localstorage
8 | version: v1
9 | metadata:
10 | - name: rootPath
11 | value: ./tmp
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/Components/redislock.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: dapr.io/v1alpha1
2 | kind: Component
3 | metadata:
4 | name: redislock
5 | spec:
6 | type: lock.redis
7 | version: v1
8 | metadata:
9 | - name: redisHost
10 | value: localhost:6379
11 | - name: redisPassword
12 | value: ""
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/Components/redisstore.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: dapr.io/v1alpha1
2 | kind: Component
3 | metadata:
4 | name: redisstore
5 | spec:
6 | type: state.redis
7 | version: v1
8 | metadata:
9 | - name: redisHost
10 | value: localhost:6379
11 | - name: redisPassword
12 | value: ""
13 | - name: actorStateStore
14 | value: "true"
15 |
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/DistributedLock.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | net6
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/Model/StateData.cs:
--------------------------------------------------------------------------------
1 | namespace DistributedLock.Model
2 | {
3 | #nullable enable
4 | public class StateData
5 | {
6 | public int Number { get; }
7 | public string? Analysis { get; set; }
8 |
9 | public StateData(int number, string? analysis = null)
10 | {
11 | Number = number;
12 | Analysis = analysis;
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.AspNetCore.Hosting;
3 | using Microsoft.Extensions.Hosting;
4 |
5 | namespace DistributedLock
6 | {
7 | public class Program
8 | {
9 | static string DEFAULT_APP_PORT = "22222";
10 | public static void Main(string[] args)
11 | {
12 | CreateHostBuilder(args).Build().Run();
13 | }
14 |
15 | public static IHostBuilder CreateHostBuilder(string[] args) =>
16 | Host.CreateDefaultBuilder(args)
17 | .ConfigureWebHostDefaults(webBuilder =>
18 | {
19 | webBuilder.UseStartup()
20 | .UseUrls($"http://localhost:{Environment.GetEnvironmentVariable("APP_PORT") ?? DEFAULT_APP_PORT}");
21 | });
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:63390",
8 | "sslPort": 0
9 | }
10 | },
11 | "profiles": {
12 | "IIS Express": {
13 | "commandName": "IISExpress",
14 | "launchBrowser": true,
15 | "launchUrl": "weatherforecast",
16 | "environmentVariables": {
17 | "ASPNETCORE_ENVIRONMENT": "Development"
18 | }
19 | },
20 | "DistributedLock": {
21 | "commandName": "Project",
22 | //"applicationUrl": "http://localhost:5000",
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/Services/GeneratorService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using Dapr.Client;
4 | using DistributedLock.Model;
5 |
6 | namespace DistributedLock.Services
7 | {
8 | public class GeneratorService
9 | {
10 | Timer generateDataTimer;
11 |
12 | public GeneratorService()
13 | {
14 | // Generate some data every second.
15 | if (Environment.GetEnvironmentVariable("APP_ID") == "generator")
16 | {
17 | generateDataTimer = new Timer(GenerateData, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(10));
18 | }
19 | }
20 |
21 | public async void GenerateData(Object stateInfo)
22 | {
23 | using (var client = new DaprClientBuilder().Build())
24 | {
25 | var rand = new Random();
26 | var state = new StateData(rand.Next(100));
27 |
28 | await client.InvokeBindingAsync("localstorage", "create", state);
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/Client/DistributedLock/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/examples/Client/PublishSubscribe/BulkPublishEventExample/BulkPublishEventExample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6
6 | Samples.Client
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/Client/PublishSubscribe/BulkPublishEventExample/Example.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2023 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | using System.Threading;
15 | using System.Threading.Tasks;
16 |
17 | namespace Samples.Client
18 | {
19 | public abstract class Example
20 | {
21 | public abstract string DisplayName { get; }
22 |
23 | public abstract Task RunAsync(CancellationToken cancellationToken);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/Client/PublishSubscribe/PublishEventExample/Example.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2023 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | using System.Threading;
15 | using System.Threading.Tasks;
16 |
17 | namespace Samples.Client
18 | {
19 | public abstract class Example
20 | {
21 | protected static readonly string pubsubName = "pubsub";
22 |
23 | public abstract string DisplayName { get; }
24 |
25 | public abstract Task RunAsync(CancellationToken cancellationToken);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/examples/Client/PublishSubscribe/PublishEventExample/PublishEventExample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6
6 | Samples.Client
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/Client/PublishSubscribe/PublishEventExample/README.md:
--------------------------------------------------------------------------------
1 | # Dapr .NET SDK pub/sub example
2 |
3 | ## Prerequisites
4 |
5 | - [.NET 6+](https://dotnet.microsoft.com/download) installed
6 | - [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/)
7 | - [Initialized Dapr environment](https://docs.dapr.io/getting-started/install-dapr-selfhost/)
8 | - [Dapr .NET SDK](https://docs.dapr.io/developing-applications/sdks/dotnet/)
9 |
10 | ## Running the example
11 |
12 | To run the sample locally run this command in the DaprClient directory:
13 |
14 | ```sh
15 | dapr run --app-id DaprClient -- dotnet run
16 | ```
17 |
18 | Running the following command will output a list of the samples included:
19 |
20 | ```sh
21 | dapr run --app-id DaprClient -- dotnet run
22 | ```
23 |
24 | Press Ctrl+C to exit, and then run the command again and provide a sample number to run the samples.
25 |
26 | For example run this command to run the 0th sample from the list produced earlier.
27 |
28 | ```sh
29 | dapr run --app-id DaprClient -- dotnet run 0
30 | ```
31 |
32 | ## Publishing Pub/Sub Events
33 |
34 | See [PublishEventExample.cs](./PublishEventExample.cs) for an example using the `DaprClient` to publish a pub/sub event.
35 |
--------------------------------------------------------------------------------
/examples/Client/PublishSubscribe/StreamingSubscriptionExample/StreamingSubscriptionExample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/Client/README.md:
--------------------------------------------------------------------------------
1 | # Dapr Client examples
2 |
3 | The following examples will show you how to:
4 |
5 | - [Invoke services](./ServiceInvocation)
6 | - [Manage state](./StateManagement)
7 | - [Publish events](./PublishSubscribe)
8 | - [Configuration API](./ConfigurationApi)
9 | - [Distributed Lock](./DistributedLock)
10 |
11 | ## SDK docs
12 |
13 | For more information on the .NET Dapr client visit the [SDK docs](https://docs.dapr.io/developing-applications/sdks/dotnet/dotnet-client/).
14 |
--------------------------------------------------------------------------------
/examples/Client/ServiceInvocation/Example.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | using System.Threading;
15 | using System.Threading.Tasks;
16 |
17 | namespace Samples.Client
18 | {
19 | public abstract class Example
20 | {
21 | public abstract string DisplayName { get; }
22 |
23 | public abstract Task RunAsync(CancellationToken cancellationToken);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/Client/ServiceInvocation/ServiceInvocation.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6
6 | Samples.Client
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/Client/StateManagement/Example.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2021 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | using System.Threading;
15 | using System.Threading.Tasks;
16 |
17 | namespace Samples.Client
18 | {
19 | public abstract class Example
20 | {
21 | public abstract string DisplayName { get; }
22 |
23 | public abstract Task RunAsync(CancellationToken cancellationToken);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/Client/StateManagement/StateManagement.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6
6 | Samples.Client
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(RepoRoot)bin\$(Configuration)\examples\$(MSBuildProjectName)\
7 |
8 | false
9 |
10 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorClient/ActorClient.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6
6 | 10.0
7 | enable
8 | enable
9 |
10 |
11 | true
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorClient/IClientActor.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2023 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | using Dapr.Actors.Generators;
15 |
16 | namespace GeneratedActor;
17 |
18 | internal sealed record ClientState(string Value);
19 |
20 | [GenerateActorClient]
21 | internal interface IClientActor
22 | {
23 | [ActorMethod(Name = "GetState")]
24 | Task GetStateAsync(CancellationToken cancellationToken = default);
25 |
26 | [ActorMethod(Name = "SetState")]
27 | Task SetStateAsync(ClientState state, CancellationToken cancellationToken = default);
28 | }
29 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorClient/IGenericClientActor.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2023 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | using Dapr.Actors.Generators;
15 |
16 | namespace GeneratedActor
17 | {
18 | [GenerateActorClient]
19 | internal interface IGenericClientActor
20 | {
21 | [ActorMethod(Name = "GetState")]
22 | Task GetStateAsync(CancellationToken cancellationToken = default);
23 |
24 | [ActorMethod(Name = "SetState")]
25 | Task SetStateAsync(TGenericType2 state, CancellationToken cancellationToken = default);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorCommon/ActorCommon.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6
5 | 10.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorCommon/IRemoteActor.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2023 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | using Dapr.Actors;
15 |
16 | namespace GeneratedActor;
17 |
18 | public sealed record RemoteState(string Value);
19 |
20 | public interface IRemoteActor : IActor
21 | {
22 | Task GetState();
23 |
24 | Task SetState(RemoteState state);
25 | }
26 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorService/ActorService.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6
5 | 10.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorService/Program.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2023 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | using GeneratedActor;
15 |
16 | var builder = WebApplication.CreateBuilder(args);
17 |
18 | builder.Services.AddActors(
19 | options =>
20 | {
21 | options.UseJsonSerialization = true;
22 | options.Actors.RegisterActor();
23 | });
24 |
25 | var app = builder.Build();
26 |
27 | app.UseRouting();
28 |
29 | #pragma warning disable ASP0014
30 | app.UseEndpoints(
31 | endpoints =>
32 | {
33 | endpoints.MapActorsHandlers();
34 | });
35 |
36 | app.Run();
37 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorService/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:56372",
8 | "sslPort": 0
9 | }
10 | },
11 | "profiles": {
12 | "http": {
13 | "commandName": "Project",
14 | "dotnetRunMessages": true,
15 | "launchBrowser": true,
16 | "launchUrl": "swagger",
17 | "applicationUrl": "http://localhost:5226",
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | },
22 | "IIS Express": {
23 | "commandName": "IISExpress",
24 | "launchBrowser": true,
25 | "launchUrl": "swagger",
26 | "environmentVariables": {
27 | "ASPNETCORE_ENVIRONMENT": "Development"
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorService/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/examples/GeneratedActor/ActorService/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/examples/Jobs/JobsSample/JobsSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/Jobs/JobsSample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:6382",
8 | "sslPort": 44324
9 | }
10 | },
11 | "profiles": {
12 | "http": {
13 | "commandName": "Project",
14 | "dotnetRunMessages": true,
15 | "launchBrowser": true,
16 | "applicationUrl": "http://localhost:5140",
17 | "environmentVariables": {
18 | "ASPNETCORE_ENVIRONMENT": "Development"
19 | }
20 | },
21 | "https": {
22 | "commandName": "Project",
23 | "dotnetRunMessages": true,
24 | "launchBrowser": true,
25 | "applicationUrl": "https://localhost:7241;http://localhost:5140",
26 | "environmentVariables": {
27 | "ASPNETCORE_ENVIRONMENT": "Development"
28 | }
29 | },
30 | "IIS Express": {
31 | "commandName": "IISExpress",
32 | "launchBrowser": true,
33 | "environmentVariables": {
34 | "ASPNETCORE_ENVIRONMENT": "Development"
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/examples/README.md:
--------------------------------------------------------------------------------
1 | # Dapr .NET Core examples
2 |
3 | This repository contains a samples that highlight the Dapr .NET SDK capabilities:
4 |
5 | | Sample | Description |
6 | |----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
7 | | [1. Client](./Client) | The client example shows how to make Dapr calls to publish events, save state, get state and delete state using a Dapr client.
8 | | [2. Actor](./Actor) | Demonstrates creating virtual actors that encapsulate code and state. |
9 | | [3. ASP.NET Core](./AspNetCore) | Demonstrates ASP.NET Core integration with Dapr by creating Controllers and Routes. |
10 | | [4. Workflow](./Workflow) | Demonstrates creating durable, long-running Dapr workflows using code. |
11 |
--------------------------------------------------------------------------------
/examples/Workflow/WorkflowAsyncOperations/Models/Transaction.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------
2 | // Copyright 2024 The Dapr Authors
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | // http://www.apache.org/licenses/LICENSE-2.0
7 | // Unless required by applicable law or agreed to in writing, software
8 | // distributed under the License is distributed on an "AS IS" BASIS,
9 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | // See the License for the specific language governing permissions and
11 | // limitations under the License.
12 | // ------------------------------------------------------------------------
13 |
14 | namespace WorkflowAsyncOperations.Models;
15 |
16 | internal sealed record Transaction(decimal Value)
17 | {
18 | public Guid CustomerId { get; init; } = Guid.NewGuid();
19 | }
20 |
--------------------------------------------------------------------------------
/examples/Workflow/WorkflowAsyncOperations/WorkflowAsyncOperations.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/Workflow/WorkflowConsoleApp/Activities/NotifyActivity.cs:
--------------------------------------------------------------------------------
1 | using Dapr.Workflow;
2 | using Microsoft.Extensions.Logging;
3 |
4 | namespace WorkflowConsoleApp.Activities
5 | {
6 | public record Notification(string Message);
7 |
8 | public class NotifyActivity : WorkflowActivity
9 | {
10 | readonly ILogger logger;
11 |
12 | public NotifyActivity(ILoggerFactory loggerFactory)
13 | {
14 | this.logger = loggerFactory.CreateLogger();
15 | }
16 |
17 | public override Task