Can anybody help out with the syntax of something like this:
Dictionary<string,string> dict = new Dictionary<string,string>()
{
foreach(var i in collection<Items>)
-----add i to dictionary
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not really clear to me what you mean, but the
ToDictionaryLINQ extension method may help you. For example:(Obviously you can vary how the key and value are obtained from the item.)