using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace SinochemPosClient.Models { public abstract class ResponseBase { public override string ToString() { PropertyInfo[] _PropertyInfos = this.GetType().GetProperties(); var sb = new StringBuilder(); foreach (var info in _PropertyInfos) { var value = info.GetValue(this, null) ?? "(null)"; sb.AppendLine(info.Name + ": " + value.ToString()); } return sb.ToString(); } } }