3 Date Created: 08/24/2016
4 ---------------------------------------------------
10 namespace CPE.App.NotifyConsole.Models.Partials {
12 /// This base class is used to override the ToString() method.
13 /// ToString() will output all properties and their values.
15 public class PartialBaseClass {
16 public override string ToString() {
17 var output = new StringBuilder();
19 var currentType = GetType();
20 var properties = currentType.GetProperties()
21 .Where(x => !x.PropertyType.IsClass)
22 .OrderBy(x => x.Name);
23 foreach (var property in properties) {
24 output.AppendFormat("{0}={1}, ", property.Name, property.GetValue(this, null));
27 return output.ToString();