Skip to content

Commit

Permalink
Merge pull request #3434 from snakefoot/TypeConvertUsingInterface
Browse files Browse the repository at this point in the history
ObjectReflectionCache - Skip property-reflection for IFormattable
  • Loading branch information
304NotModified committed May 26, 2019
2 parents 5535ead + 63c856a commit b83d37f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/NLog/Internal/ObjectReflectionCache.cs
Expand Up @@ -177,10 +177,7 @@ private static ObjectPropertyInfos BuildObjectPropertyInfos(object value, Type o

private static bool ConvertToString(Type objectType)
{
if (objectType == typeof(Guid))
return true;

if (objectType == typeof(TimeSpan))
if (typeof(IFormattable).IsAssignableFrom(objectType))
return true;

if (typeof(Uri).IsAssignableFrom(objectType))
Expand Down

0 comments on commit b83d37f

Please sign in to comment.