List<实体> 转字符串常用写法
var List<entity> enitylist = getEnitylist(); // 获取实体list List<string> strList= new List<string>(); enitylist .ForEach(x => sorts.Add(string.Format("{0} {1}", x.field1, x.field2))); var result = string.Join(",", strList.ToArray());
var List<entity> enitylist = getEnitylist(); // 获取实体list List<string> strList= new List<string>(); enitylist .ForEach(x => sorts.Add(string.Format("{0} {1}", x.field1, x.field2))); var result = string.Join(",", strList.ToArray());