Explorar o código

Removing references to Newtonsoft

Kenric Nugteren hai 1 semana
pai
achega
28550745a9

+ 0 - 3
InABox.Database/InABox.Database.csproj

@@ -8,9 +8,6 @@
 
     <ItemGroup>
         <PackageReference Include="FluentResults" Version="4.0.0" />
-        <PackageReference Include="Newtonsoft.Json">
-            <Version>13.0.3</Version>
-        </PackageReference>
         <PackageReference Include="System.Collections.Immutable" Version="9.0.7" />
     </ItemGroup>
 

+ 0 - 1
InABox.Mobile/InABox.Mobile.Shared/Components/MobileAccordion/MobileAccordion.xaml.cs

@@ -4,7 +4,6 @@ using System.Collections.ObjectModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using Newtonsoft.Json;
 using Xamarin.Forms;
 using Xamarin.Forms.Xaml;
 

+ 0 - 1
InABox.Mobile/InABox.Mobile.Shared/DataModels/QueuedUpdater/IQueuedUpdater.cs

@@ -7,7 +7,6 @@ using System.Threading;
 using System.Threading.Tasks;
 using InABox.Clients;
 using InABox.Core;
-using Newtonsoft.Json.Linq;
 
 namespace InABox.Mobile
 {

+ 0 - 1
InABox.Mobile/InABox.Mobile.Shared/InABox.Mobile.Shared.csproj

@@ -14,7 +14,6 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
         <PackageReference Include="Plugin.BLE" Version="3.1.0" />
         <PackageReference Include="Resizetizer.NT" Version="0.3.0">
           <PrivateAssets>all</PrivateAssets>

+ 1 - 1
inabox.databaseproxy/InABox.DatabaseProxy.csproj

@@ -20,7 +20,7 @@
     </ItemGroup>
 
     <ItemGroup>
-        <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
+      <ProjectReference Include="..\InABox.Core\InABox.Core.csproj" />
     </ItemGroup>
 
 </Project>

+ 3 - 4
inabox.databaseproxy/Proxy.cs

@@ -1,6 +1,6 @@
 using System.Net;
 using System.Text;
-using Newtonsoft.Json;
+using InABox.Core;
 
 namespace InABox.DatabaseProxy
 {
@@ -123,8 +123,7 @@ namespace InABox.DatabaseProxy
             request.Credentials.Password = Password;
             request.SQL = SQL;
 
-            var settings = new JsonSerializerSettings { Formatting = Formatting.Indented };
-            var sRequest = JsonConvert.SerializeObject(request, settings);
+            var sRequest = Serialization.Serialize(request, indented: true);
             var array = Encoding.ASCII.GetBytes(sRequest);
             var remoterequest = WebRequest.Create(string.Format("http://{0}/query?format=json", URL));
             remoterequest.ContentType = "application/json";
@@ -140,7 +139,7 @@ namespace InABox.DatabaseProxy
             {
                 var reader = new StreamReader(stream, Encoding.UTF8);
                 var responseString = reader.ReadToEnd();
-                var response = (Response)JsonConvert.DeserializeObject(responseString, typeof(Response));
+                var response = Serialization.Deserialize<Response>(responseString);
                 if (response.Status.Equals("OK"))
                 {
                     Data.Clear();

+ 2 - 2
inabox.databaseproxy/Query.cs

@@ -1,4 +1,4 @@
-using Newtonsoft.Json;
+using InABox.Core;
 
 namespace InABox.DatabaseProxy
 {
@@ -28,7 +28,7 @@ namespace InABox.DatabaseProxy
 
         public string AsJSON()
         {
-            return JsonConvert.SerializeObject(this);
+            return Serialization.Serialize(this, indented: true);
         }
 
         ~Request()

+ 0 - 1
inabox.wpf/Dashboard/Presenters/IDynamicDashboardDataPresenter.cs

@@ -1,5 +1,4 @@
 using InABox.Core;
-using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;