File tree 1 file changed +3
-3
lines changed
test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/Messages
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change
1
+ using System . Text . Json ;
1
2
using JetBrains . Annotations ;
2
- using Newtonsoft . Json ;
3
3
4
4
namespace JsonApiDotNetCoreTests . IntegrationTests . Microservices . Messages
5
5
{
@@ -17,7 +17,7 @@ public T GetContentAs<T>()
17
17
string namespacePrefix = typeof ( IMessageContent ) . Namespace ;
18
18
var contentType = System . Type . GetType ( $ "{ namespacePrefix } .{ Type } ", true ) ;
19
19
20
- return ( T ) JsonConvert . DeserializeObject ( Content , contentType ) ;
20
+ return ( T ) JsonSerializer . Deserialize ( Content , contentType ) ;
21
21
}
22
22
23
23
public static OutgoingMessage CreateFromContent ( IMessageContent content )
@@ -26,7 +26,7 @@ public static OutgoingMessage CreateFromContent(IMessageContent content)
26
26
{
27
27
Type = content . GetType ( ) . Name ,
28
28
FormatVersion = content . FormatVersion ,
29
- Content = JsonConvert . SerializeObject ( content )
29
+ Content = JsonSerializer . Serialize ( content , content . GetType ( ) )
30
30
} ;
31
31
}
32
32
}
You can’t perform that action at this time.
0 commit comments