Skip to content

Commit

Permalink
Merge pull request #156 from Quaver/revert-153-remove-binaryformatter
Browse files Browse the repository at this point in the history
Revert "Use XmlSerializer over BinaryFormatter"
  • Loading branch information
AiAe authored Apr 9, 2024
2 parents 48ba4d7 + 5c91d52 commit 783211e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Quaver.API/Helpers/Objects.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.IO;
using System.Xml.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace Quaver.API.Helpers
{
Expand All @@ -15,12 +15,12 @@ public static T DeepClone<T>(T obj)
{
using (var ms = new MemoryStream())
{
var formatter = new XmlSerializer(typeof(T));
var formatter = new BinaryFormatter();
formatter.Serialize(ms, obj);

Check warning on line 19 in Quaver.API/Helpers/Objects.cs

View workflow job for this annotation

GitHub Actions / build

'BinaryFormatter.Serialize(Stream, object)' is obsolete: 'BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.' (https://aka.ms/dotnet-warnings/SYSLIB0011)

Check warning on line 19 in Quaver.API/Helpers/Objects.cs

View workflow job for this annotation

GitHub Actions / build

'BinaryFormatter.Serialize(Stream, object)' is obsolete: 'BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.' (https://aka.ms/dotnet-warnings/SYSLIB0011)
ms.Position = 0;

return (T)formatter.Deserialize(ms);

Check warning on line 22 in Quaver.API/Helpers/Objects.cs

View workflow job for this annotation

GitHub Actions / build

'BinaryFormatter.Deserialize(Stream)' is obsolete: 'BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.' (https://aka.ms/dotnet-warnings/SYSLIB0011)

Check warning on line 22 in Quaver.API/Helpers/Objects.cs

View workflow job for this annotation

GitHub Actions / build

'BinaryFormatter.Deserialize(Stream)' is obsolete: 'BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.' (https://aka.ms/dotnet-warnings/SYSLIB0011)
}
}
}
}
}

0 comments on commit 783211e

Please sign in to comment.