How would I go about getting a pulumi `Output` tha...
# dotnet
v
How would I go about getting a pulumi
Output
that is point to a
InputList
something like this.
Copy code
[Output("UserIds")]
public Output<string> UserIds { get; private set; } 

var userIds = new InputList<string>();

UserIds = userIds
This 👆 results in an error.
Copy code
UserIds = userIds.ToOutput()
I see that I can do this ; would this be the right direction?
b
check out the cast implementions on
InputList<T>
here: https://www.pulumi.com/docs/reference/pkg/dotnet/Pulumi/Pulumi.InputList-1.html You'll see that
InputList<T>
can be cast to
Output<List<T>>
or
Output<T>[]
or
Output<IEnumerable<T>>
. But simply casting it to
Output<T>
doesn't work, you're losing the collection part of the type
Actually it's a different issue, you can't go
Input -> Output
you can only cast
Output -> Input
. So yes in this case
.ToOutput()
is what you want and it should give you
Output<ImmutableArray<string>>
👍 1
v
Nice, thank you for the confirmation!