Remove ConnectionStrings
prefix for custom resource
#7292
Answered
by
davidfowl
atlass-dev
asked this question in
Q&A
-
I have a resource which provides JSON object with configuration instead of connection string. |
Beta Was this translation helpful? Give feedback.
Answered by
davidfowl
Jan 28, 2025
Replies: 1 comment 2 replies
-
Don't use IResourceWithConnectionString. You would write a custom overload like this: public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, IResourceBuilder<SmtpServer> source)
where TDestination : IResourceWithEnvironment
{
return builder.WithEnvironment(context =>
{
// Set environment variables here
context.EnvironmentVariables["Smtp__Host"] = source.Endpoint.Property(EnpointProperty.Host);
context.EnvironmentVariables["Smtp__Port"] = source.Endpoint.Property(EnpointProperty.Port);
});
} |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
atlass-dev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't use IResourceWithConnectionString. You would write a custom overload like this: