Skip to content

Commit

Permalink
ObjectReflectionCache - Skip property-reflection for IFormattable
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot authored and 304NotModified committed May 28, 2019
1 parent 23ddbb4 commit 27fb515
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 27fb515

Please sign in to comment.