dsi dsi -4 years ago 154
C# Question

How to merge dictionary entry's value to List of string

public class Field {
public string FieldName { get; set; }
}

Dictionary<String, Field> rawListDict = new Dictionary<String, Field>();


Need linq query to create
List<string>
where -
FieldName
of
Field
class for each dictionary entry.

Answer Source

Here you go

List<string> result = rawListDict.Select(x => x.Value.FieldName).ToList();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download