File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/Messages Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1+ using System . Text . Json ;
12using JetBrains . Annotations ;
2- using Newtonsoft . Json ;
33
44namespace JsonApiDotNetCoreTests . IntegrationTests . Microservices . Messages
55{
@@ -17,7 +17,7 @@ public T GetContentAs<T>()
1717 string namespacePrefix = typeof ( IMessageContent ) . Namespace ;
1818 var contentType = System . Type . GetType ( $ "{ namespacePrefix } .{ Type } ", true ) ;
1919
20- return ( T ) JsonConvert . DeserializeObject ( Content , contentType ) ;
20+ return ( T ) JsonSerializer . Deserialize ( Content , contentType ) ;
2121 }
2222
2323 public static OutgoingMessage CreateFromContent ( IMessageContent content )
@@ -26,7 +26,7 @@ public static OutgoingMessage CreateFromContent(IMessageContent content)
2626 {
2727 Type = content . GetType ( ) . Name ,
2828 FormatVersion = content . FormatVersion ,
29- Content = JsonConvert . SerializeObject ( content )
29+ Content = JsonSerializer . Serialize ( content , content . GetType ( ) )
3030 } ;
3131 }
3232 }
You can’t perform that action at this time.
0 commit comments