Skip to content

Commit

Permalink
Add AdditionalData property in BaseObject to support serializing or d…
Browse files Browse the repository at this point in the history
…eserializing additional data
  • Loading branch information
mingyaulee committed May 15, 2021
1 parent 271210d commit f2e3163
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/WebExtension.Net/BaseObject.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace WebExtension.Net
Expand All @@ -13,6 +15,10 @@ public class BaseObject : IDisposable
private string referenceId;
private string accessPath;

/// <summary>Contains any additional data within this object instance.</summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalData { get; set; }

internal void Initialize(WebExtensionJSRuntime webExtensionJSRuntime, string referenceId, string accessPath)
{
if (!IsInitialized)
Expand Down

0 comments on commit f2e3163

Please sign in to comment.