[PR #44] Add extensions that support JSON serialization/deserialization. #48

Open
opened 2026-02-26 02:30:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/junian/Standard.Licensing/pull/44
Author: @apphost
Created: 11/19/2024
Status: 🔄 Open

Base: masterHead: feature-json


📝 Commits (1)

  • 6179974 Add extensions that support JSON serialization/deserialization.

📊 Changes

4 files changed (+396 additions, -0 deletions)

View changed files

src/Standard.Licensing.Tests/JsonSerializeTests.cs (+146 -0)
src/Standard.Licensing/JsonSerializeExtension.cs (+205 -0)
src/Standard.Licensing/LicenseModel.cs (+44 -0)
📝 src/Standard.Licensing/Standard.Licensing.csproj (+1 -0)

📄 Description

When you want to serialize the License to JSON instead of XML, use .ToJson() instead of .ToString().
var jsonText = license.ToJson();

For deserialization, using ToLicense() on the JSON string will yield the License instance.
var parsedLicense = jsonText.ToLicense();


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/junian/Standard.Licensing/pull/44 **Author:** [@apphost](https://github.com/apphost) **Created:** 11/19/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feature-json` --- ### 📝 Commits (1) - [`6179974`](https://github.com/junian/Standard.Licensing/commit/6179974b0dda9642129b928ec19483ce9d6865a3) Add extensions that support JSON serialization/deserialization. ### 📊 Changes **4 files changed** (+396 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/Standard.Licensing.Tests/JsonSerializeTests.cs` (+146 -0) ➕ `src/Standard.Licensing/JsonSerializeExtension.cs` (+205 -0) ➕ `src/Standard.Licensing/LicenseModel.cs` (+44 -0) 📝 `src/Standard.Licensing/Standard.Licensing.csproj` (+1 -0) </details> ### 📄 Description When you want to serialize the License to JSON instead of XML, use .ToJson() instead of .ToString(). `var jsonText = license.ToJson();` For deserialization, using ToLicense() on the JSON string will yield the License instance. `var parsedLicense = jsonText.ToLicense();` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Standard.Licensing#48
No description provided.