Convert dictionary to list collection in C#

前端 未结 6 1362
余生分开走
余生分开走 2021-01-30 09:54

I have a problem when trying to convert a dictionary to list.

Example if I have a dictionary with template string as key and string as value. Then I wish to convert the

6条回答
  •  天涯浪人
    2021-01-30 10:19

    If you want to pass the Dictionary keys collection into one method argument.

    List lstKeys = Dict.Keys;
    Methodname(lstKeys);
    -------------------
    void MethodName(List lstkeys)
    {
        `enter code here`
        //Do ur task
    }
    

提交回复
热议问题