DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="0.9.0" />

 TypeSpecificSerializers

public IGeometryDataCollection WriteEntity(IDesignScriptEntity entity, out string typeName)

Finds the underlying interface implementation type and uses appropriate writer to serialize the given entity.