namespace LucienBao.Common
{
public static class ToStringHelper
{
public static string ToString(object obj)
{
Type t = obj.GetType();
FieldInfo[] fis = t.GetFields();
return string.Join(Environment.NewLine,
fis.Select<FieldInfo, string>
(p => p.Name + ":" + p.GetValue(obj).ToString()).ToArray()
);
}
}
}
新闻热点
疑难解答