mirror of
https://github.com/junian/Standard.Licensing.git
synced 2026-04-25 05:45:51 +03:00
[PR #44] Add extensions that support JSON serialization/deserialization. #48
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Standard.Licensing#48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/junian/Standard.Licensing/pull/44
Author: @apphost
Created: 11/19/2024
Status: 🔄 Open
Base:
master← Head:feature-json📝 Commits (1)
6179974Add 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.