How can we pass default value to a data type of New Dictionary(Of String, List(Of String))()

How can we pass default value to a data type of New Dictionary(Of String, List(Of String))().I only want to pass default value for List(Of String) for this dictionary type.

Any help on this please

@HappyCoding,

You can assign default value design time like this.

new Dictionary(Of String, List(Of String)) From {{"Key1", new List(Of String) From {}}}

Runtime it will look like this.
image

Thanks,
Ashok :slight_smile:

Hi @ashokkarale ,

Thanks for your response. What If we need to pass “currentitem” variable as a key and “TEST” as a value.

FYI : The key is string and the value is list of string

@HappyCoding

you can use liek this

new Dictionary(Of String, List(Of String)) From {{currentItem, new List(Of String) From {"Test"}}}

to be done in assign and not in default value field

cheers

@HappyCoding,

What’s you are trying to do here exactly could you please elaborate more?

It is done using your syntax , Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.