Created
March 15, 2015 20:25
-
-
Save TimMurphy/d6f74fdac670470f92d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sb = new StringBuilder(); | |
var properties = error.GetType().GetProperties(); | |
foreach (var propertyInfo in properties) | |
{ | |
sb.AppendLine(string.Format("public {0} {1} {{ get; set; }}", propertyInfo.PropertyType.Name, propertyInfo.Name)); | |
} | |
foreach (var propertyInfo in properties) | |
{ | |
sb.AppendLine(string.Format("{0} = error.{1};", propertyInfo.Name, propertyInfo.Name)); | |
} | |
var format = sb.ToString(); | |
LogTo.Info(format.Replace("{", "{{").Replace("}", "}}")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment