-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(Revit) : Use speckle newtonsoft instead of System.Text.Json for i…
…n dll conflict management project (#3317)
- Loading branch information
Showing
5 changed files
with
41 additions
and
21 deletions.
There are no files selected for viewing
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
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
14 changes: 14 additions & 0 deletions
14
ConnectorCore/DllConflictManagement/Serialization/SpeckleNewtonsoftSerializer.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Speckle.Newtonsoft.Json; | ||
|
||
namespace Speckle.DllConflictManagement.Serialization; | ||
|
||
public class SpeckleNewtonsoftSerializer : ISerializer | ||
{ | ||
public string Serialize<T>(T obj) => JsonConvert.SerializeObject(obj); | ||
|
||
public T Deserialize<T>(string serialized) => | ||
JsonConvert.DeserializeObject<T>(serialized) | ||
?? throw new InvalidOperationException( | ||
$"Unable to deserialize the provided JSON into an object of type {typeof(T)}" | ||
); | ||
} |
16 changes: 0 additions & 16 deletions
16
ConnectorCore/DllConflictManagement/Serialization/SystemTextJsonSerializer.cs
This file was deleted.
Oops, something went wrong.
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