-
|
In the Dapr integration documentation for state stores, the following code is suggested: When I add this to my AppHost, however, I get this warning: .. but I don't know how I can do that; how would I even get a reference to the "sidecar resource"? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @godefroi, The new API expects you to move the var stateStore = builder.AddDaprStateStore("statestore");
builder.AddProject<Projects.ExampleProject>("exampleproject")
.WithDaprSidecar(sidecar =>
{
sidecar.WithReference(stateStore);
});The If you need to configure sidecar options at the same time: builder.AddProject<Projects.ExampleProject>("exampleproject")
.WithDaprSidecar(sidecar =>
{
sidecar.WithOptions(new DaprSidecarOptions { AppId = "exampleproject" })
.WithReference(stateStore);
}); |
Beta Was this translation helpful? Give feedback.
Hi @godefroi,
The new API expects you to move the
WithReferencecall inside theWithDaprSidecarcallback, so the reference is added to the sidecar resource rather than the project resource:The
WithDaprSidecaroverload that takes anAction<IResourceBuilder<IDaprSidecarResource>>callback gives you a builder scoped to the sidecar resource itself, andWithReferenceon that builder is the non-obsolete path.If you need to configure sidecar options at the same time: