aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2022-02-28 17:30:17 -0700
committerCody Robibero <cody@robibe.ro>2022-02-28 17:30:17 -0700
commitdc1b2246671749a9b4eaf64bd356877ff4e08b48 (patch)
tree1debd79919481505fa3958f80bc89bc6dfb48e51
parente26446f9c06d23d483d7c3db40888d51d37fdcdc (diff)
Add JsonConstructor
-rw-r--r--MediaBrowser.Model/Session/GeneralCommand.cs26
1 files changed, 16 insertions, 10 deletions
diff --git a/MediaBrowser.Model/Session/GeneralCommand.cs b/MediaBrowser.Model/Session/GeneralCommand.cs
index 29528c110..757b19b31 100644
--- a/MediaBrowser.Model/Session/GeneralCommand.cs
+++ b/MediaBrowser.Model/Session/GeneralCommand.cs
@@ -2,20 +2,26 @@
using System;
using System.Collections.Generic;
+using System.Text.Json.Serialization;
-namespace MediaBrowser.Model.Session
+namespace MediaBrowser.Model.Session;
+
+public class GeneralCommand
{
- public class GeneralCommand
+ public GeneralCommand()
+ : this(new Dictionary<string, string>())
+ {
+ }
+
+ [JsonConstructor]
+ public GeneralCommand(Dictionary<string, string> arguments)
{
- public GeneralCommand()
- {
- Arguments = new Dictionary<string, string>();
- }
+ Arguments = arguments;
+ }
- public GeneralCommandType Name { get; set; }
+ public GeneralCommandType Name { get; set; }
- public Guid ControllingUserId { get; set; }
+ public Guid ControllingUserId { get; set; }
- public Dictionary<string, string> Arguments { get; }
- }
+ public Dictionary<string, string> Arguments { get; }
}