Skip to content
DocsTry Aspire
DocsTry

EnvironmentCallbackAnnotation Constructors

ClassConstructors4 members
Represents an annotation that provides a callback to modify the environment variables of an application.
Constructor(string, Func<string>)Section titled Constructor(string, Func<string>)
Initializes a new instance of the EnvironmentCallbackAnnotation class with the specified name and callback function.
public class EnvironmentCallbackAnnotation
{
public EnvironmentCallbackAnnotation(
string name,
Func<string> callback)
{
// ...
}
}
namestringThe name of the environment variable to set.
callbackFunc<string>The callback function that returns the value to set the environment variable to.
Constructor(Action<Dictionary<string, object>>)Section titled Constructor(Action<Dictionary<string, object>>)
Initializes a new instance of the EnvironmentCallbackAnnotation class with the specified callback action.
public class EnvironmentCallbackAnnotation
{
public EnvironmentCallbackAnnotation(
Action<Dictionary<string, object>> callback)
{
// ...
}
}
callbackAction<Dictionary<string, object>>The callback action to be executed.
Constructor(Action<EnvironmentCallbackContext>)Section titled Constructor(Action<EnvironmentCallbackContext>)
Initializes a new instance of the EnvironmentCallbackAnnotation class with the specified callback.
public class EnvironmentCallbackAnnotation
{
public EnvironmentCallbackAnnotation(
Action<EnvironmentCallbackContext> callback)
{
// ...
}
}
callbackAction<EnvironmentCallbackContext>The callback to be invoked.
Constructor(Func<EnvironmentCallbackContext, Task>)Section titled Constructor(Func<EnvironmentCallbackContext, Task>)
Initializes a new instance of the EnvironmentCallbackAnnotation class with the specified callback.
public class EnvironmentCallbackAnnotation
{
public EnvironmentCallbackAnnotation(
Func<EnvironmentCallbackContext, Task> callback)
{
// ...
}
}
callbackFunc<EnvironmentCallbackContext, Task>The callback to be invoked.