public static string ToIds<T>(this List<T> list, string filedName)
{
if (list.Count() > 0)
{
StringBuilder sBuilder = new StringBuilder();
PropertyInfo[] properties = list[0].GetType().GetProperties();
foreach (var v in list)
sBuilder.AppendFormat("'{0}',", properties.FirstOrDefault(x => x.Name == filedName).GetValue(v, null));
sBuilder.Length -= 1;
return sBuilder.ToString();
}
else return null;
}