mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 20:54:58 +00:00
Reducing size of Type JSON
This commit is contained in:
@@ -46,14 +46,16 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
if (extends == null)
|
if (extends == null)
|
||||||
throw new ArgumentNullException("extends");
|
throw new ArgumentNullException("extends");
|
||||||
|
|
||||||
string name;
|
|
||||||
|
|
||||||
if (type == null)
|
if (type == null)
|
||||||
name = null;
|
{
|
||||||
else if (type.IsPrimitive)
|
extends.WriteNull();
|
||||||
name = type.FullName;
|
return;
|
||||||
else
|
}
|
||||||
name = type.AssemblyQualifiedName;
|
|
||||||
|
// Find the smallest possible name representation for the type that will still resolve
|
||||||
|
string name = Type.GetType(type.FullName, false, true) == null
|
||||||
|
? type.AssemblyQualifiedName
|
||||||
|
: type.FullName;
|
||||||
|
|
||||||
extends.WriteValue(name);
|
extends.WriteValue(name);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user