我有下面的代码片段到C#列表使用LINQ
public class Client
{
public string ID { get; set; }
public string Name { get; set; }
public string Address { get; set; }
}
var liste = new List<Dictionary<string, string>>();
var dictionary = new Dictionary<string, string>();
dictionary["Id"] = "111";
dictionary["Name"] = "XYZ";
dictionary["Address"] = "Addd";
liste.Add(dictionary);
var result = liste.SelectMany(x => x);
//Code for Converting result into List<Client>
现在我想使用LINQ
嗯,我_was_要发布,但不知何故,我觉得乔恩斯基特将有一个更好的解决方案。 ; p – 2011-04-19 15:29:56
当然可以这样做,但是如果你能告诉我们为什么数据已经这样结束了,它会有所帮助。例如,你为什么要压扁字典列表?这只会让它更难。 – Ani 2011-04-19 15:31:26
@Ani:我错误地粘贴了该代码。我的要求是隐藏列表到类型列表 –
2011-04-19 16:00:07