我有ID和名称的位置列表,如
public class Dim_Location
{
public int ID{ get; set; }
public string LocationName{ get; set; }
public string ClienId{ get; set; }
}
private List<string> loadLocation(int clientIdx)
{
List<Dim_Location> LocationList = dim_Location.GetLocation(clientIdx);
//Combine here List<ID+";"+LocationName> and make List<string>
}
现在我希望从List<ID+";"+LocationName>
获取LocationList
。
答案 0 :(得分:2)
var result = LocationList.Select(x => x.ID + ";" + x.LocationName);