forked from laniatech/Checkout-NET-SDK
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add System.Text.Json * Drop Newtonsoft.Json * Add JsonStringEnumConverterFactory * Replace DataMember with JsonPropertyName * Use System.Test in ObjectExtensions.AsJson * Utilize JsonSerializerContext * Add PayPal*JsonSerializerContext.CustomConverters
- Loading branch information
Showing
134 changed files
with
1,613 additions
and
1,664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
using Newtonsoft.Json; | ||
using System.Text.Json; | ||
|
||
namespace PayPal.Sdk.Checkout.Samples; | ||
|
||
public static class ObjectExtensions | ||
{ | ||
public static string AsJson<TObject>(this TObject sourceObject) | ||
{ | ||
return JsonConvert.SerializeObject(sourceObject, typeof(TObject), new JsonSerializerSettings()); | ||
} | ||
public static string AsJson<TObject>( | ||
this TObject sourceObject | ||
) => JsonSerializer.Serialize( | ||
sourceObject | ||
); | ||
} |
Oops, something went wrong.