Expression to add items within a list of integers obtaining this value from within a for each

Hello community, attached I’m leaving part of my flow so you can have a better idea of ​​the structure. but basically I’m using this expression int_indicesNC.Concat({int_indexSaldo}).ToList()
is it correct, does it work?

Main.xaml (7.6 KB)

int_indicesNC.Append(int_indexSaldo).ToList()
would be more adequate

You don’t add .ToList() on the end. Concat already returns a list.

no, will return IEnumerable / ConcatIterator
grafik

A list is an IEnumerable.

grafik

And the working one:
grafik

we will stop this side thread right now

Works fine. Because List inherits from IEnumerable.

works fine in your case, because the upper type from the inheritance chain is working
works not as shown in the screenshot when the datatype is set to more stricht datatype: List(Of Int32)

we already mentioned:

so if you want to add value to the discussion then help the OP on optimizing the code eg. handling the nulls returned from the FirstOrDefault, when the condition is not met

1 Like