Git Repository Public Repository

CPE_learningsite

URLs

Copy to Clipboard

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
Developer: Tyler Allen
Date Created: 08/24/2016
---------------------------------------------------
*/

using System.Linq;
using System.Text;

namespace CPE.App.Notify.Models.Partials {
    /// <summary>
    ///     This base class is used to override the ToString() method.
    ///     ToString() will output all properties and their values.
    /// </summary>
    public class PartialBaseClass {
        public override string ToString() {
            var output = new StringBuilder();

            var currentType = GetType();
            var properties = currentType.GetProperties()
                                        .Where(x => !x.PropertyType.IsClass)
                                        .OrderBy(x => x.Name);
            foreach (var property in properties) {
                output.AppendFormat("{0}={1}, ", property.Name, property.GetValue(this, null));
            }

            return output.ToString();
        }
    }
}

Commits for CPE_learningsiteCPE/CPE.App/CPE.App.Notify/Models/Partials/PartialClass.cs

Diff revisions: vs.
Revision Author Commited Message
4cd176 ... v.shishlov Fri 27 Aug, 2021 14:33:17 +0000

initial commit