Skip to content

Commit 3ba841a

Browse files
committed
move extension methods into root-namespace of 3rd party libs
1 parent e6fa1d5 commit 3ba841a

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/Remote.Linq.Newtonsoft.Json/JsonSerializerSettingsExtensions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// Copyright (c) Christof Senn. All rights reserved. See license.txt in the project root for license information.
22

3-
namespace Remote.Linq.Newtonsoft.Json;
3+
#pragma warning disable IDE0130 // Namespace does not match folder structure
4+
namespace Newtonsoft.Json;
5+
#pragma warning restore IDE0130 // Namespace does not match folder structure
46

57
using Aqua.Newtonsoft.Json;
6-
using global::Newtonsoft.Json;
78
using global::Newtonsoft.Json.Serialization;
9+
using Remote.Linq.Newtonsoft.Json;
810
using Remote.Linq.Newtonsoft.Json.ContractResolvers;
911
using Remote.Linq.SimpleQuery;
1012
using System;

src/Remote.Linq.Text.Json/JsonSerializerOptionsExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Christof Senn. All rights reserved. See license.txt in the project root for license information.
22

3-
namespace Remote.Linq.Text.Json;
3+
#pragma warning disable IDE0130 // Namespace does not match folder structure
4+
namespace System.Text.Json;
5+
#pragma warning restore IDE0130 // Namespace does not match folder structure
46

57
using Aqua.Dynamic;
68
using Aqua.EnumerableExtensions;
@@ -15,7 +17,6 @@ namespace Remote.Linq.Text.Json;
1517
using System.Diagnostics.CodeAnalysis;
1618
using System.Linq;
1719
using System.Runtime.Serialization;
18-
using System.Text.Json;
1920
using System.Text.Json.Serialization;
2021

2122
[EditorBrowsable(EditorBrowsableState.Never)]

test/Remote.Linq.Tests/Serialization/NewtonsoftJsonSerializationHelper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Remote.Linq.Tests.Serialization;
44

55
using global::Newtonsoft.Json;
6-
using Remote.Linq.Newtonsoft.Json;
76
using System;
87

98
public static class NewtonsoftJsonSerializationHelper

test/Remote.Linq.Tests/Serialization/SystemTextJsonSerializationHelper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ namespace Remote.Linq.Tests.Serialization;
44

55
using Aqua.Text.Json;
66
using Aqua.Text.Json.Converters;
7-
using Remote.Linq.Text.Json;
87
using System;
98
using System.Numerics;
109
using System.Text.Json;

test/Remote.Linq.Tests/Test.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#nullable enable
44
namespace Remote.Linq.Tests;
55

6+
using global::Newtonsoft.Json;
67
using Remote.Linq.ExpressionExecution;
7-
using Remote.Linq.Newtonsoft.Json;
88
using System;
99
using System.Collections;
1010
using System.Collections.Generic;
@@ -106,16 +106,15 @@ public static class ExpressionHelper
106106
public static string ToJson<TExpression>(this TExpression expression)
107107
where TExpression : Remote.Linq.Expressions.Expression
108108
{
109-
var serializerSettings = new global::Newtonsoft.Json.JsonSerializerSettings().ConfigureRemoteLinq();
110-
return global::Newtonsoft.Json.JsonConvert.SerializeObject(expression, serializerSettings);
109+
var serializerSettings = new JsonSerializerSettings().ConfigureRemoteLinq();
110+
return JsonConvert.SerializeObject(expression, serializerSettings);
111111
}
112112

113113
public static TExpression? FromJson<TExpression>(this string json)
114114
where TExpression : Remote.Linq.Expressions.Expression
115115
{
116-
var serializerSettings = new global::Newtonsoft.Json.JsonSerializerSettings().ConfigureRemoteLinq();
117-
return global::Newtonsoft.Json.JsonConvert.DeserializeObject<TExpression>(json, serializerSettings);
116+
var serializerSettings = new JsonSerializerSettings().ConfigureRemoteLinq();
117+
return JsonConvert.DeserializeObject<TExpression>(json, serializerSettings);
118118
}
119119
}
120-
#pragma warning restore SA1402 // File may only contain a single type
121-
#nullable restore
120+
#pragma warning restore SA1402 // File may only contain a single type

0 commit comments

Comments
 (0)